Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74490
b: refs/heads/master
c: 48f6b05
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Dec 1, 2007
1 parent 6d96e39 commit 83eb539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 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: dda93b486a25009456fca6b9c925ab4d7c6b6d6a
refs/heads/master: 48f6b053613b62fed7a2fe3255e5568260a8d615
11 changes: 3 additions & 8 deletions trunk/drivers/net/via-velocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,9 @@ static int velocity_rx_refill(struct velocity_info *vptr)
static int velocity_init_rd_ring(struct velocity_info *vptr)
{
int ret;
int mtu = vptr->dev->mtu;

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);
Expand Down Expand Up @@ -1898,8 +1901,6 @@ static int velocity_open(struct net_device *dev)
struct velocity_info *vptr = netdev_priv(dev);
int ret;

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

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

dev->mtu = new_mtu;
if (new_mtu > 8192)
vptr->rx_buf_sz = 9 * 1024;
else if (new_mtu > 4096)
vptr->rx_buf_sz = 8192;
else
vptr->rx_buf_sz = 4 * 1024;

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

0 comments on commit 83eb539

Please sign in to comment.