Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103463
b: refs/heads/master
c: 9088d9a
h: refs/heads/master
i:
  103461: 81fb6ef
  103459: 2313033
  103455: 1e1b1a0
v: v3
  • Loading branch information
Francois Romieu authored and Jeff Garzik committed Jul 11, 2008
1 parent 4cfa9fb commit 33f65d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28133176082d9bcafb5958b8fac80943e51d5eda
refs/heads/master: 9088d9a4267ff098d5edc3dad8359c92741b7a6a
12 changes: 9 additions & 3 deletions trunk/drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,11 @@ static int velocity_rx_refill(struct velocity_info *vptr)
return done;
}

static void velocity_set_rxbufsize(struct velocity_info *vptr, int mtu)
{
vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
}

/**
* velocity_init_rd_ring - set up receive ring
* @vptr: velocity to configure
Expand All @@ -1217,11 +1222,8 @@ static int velocity_rx_refill(struct velocity_info *vptr)

static int velocity_init_rd_ring(struct velocity_info *vptr)
{
int mtu = vptr->dev->mtu;
int ret = -ENOMEM;

vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;

vptr->rd_info = kcalloc(vptr->options.numrx,
sizeof(struct velocity_rd_info), GFP_KERNEL);
if (!vptr->rd_info)
Expand Down Expand Up @@ -1860,6 +1862,8 @@ static int velocity_open(struct net_device *dev)
struct velocity_info *vptr = netdev_priv(dev);
int ret;

velocity_set_rxbufsize(vptr, dev->mtu);

ret = velocity_init_rings(vptr);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -1941,6 +1945,8 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)

dev->mtu = new_mtu;

velocity_set_rxbufsize(vptr, new_mtu);

ret = velocity_init_rd_ring(vptr);
if (ret < 0)
goto out_unlock;
Expand Down

0 comments on commit 33f65d9

Please sign in to comment.