diff options
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 450e29d7a9f3..35cd65d6b9ed 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1242,6 +1242,9 @@ static int velocity_rx_refill(struct velocity_info *vptr) | |||
1242 | static int velocity_init_rd_ring(struct velocity_info *vptr) | 1242 | static int velocity_init_rd_ring(struct velocity_info *vptr) |
1243 | { | 1243 | { |
1244 | int ret; | 1244 | int ret; |
1245 | int mtu = vptr->dev->mtu; | ||
1246 | |||
1247 | vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32; | ||
1245 | 1248 | ||
1246 | vptr->rd_info = kcalloc(vptr->options.numrx, | 1249 | vptr->rd_info = kcalloc(vptr->options.numrx, |
1247 | sizeof(struct velocity_rd_info), GFP_KERNEL); | 1250 | sizeof(struct velocity_rd_info), GFP_KERNEL); |
@@ -1898,8 +1901,6 @@ static int velocity_open(struct net_device *dev) | |||
1898 | struct velocity_info *vptr = netdev_priv(dev); | 1901 | struct velocity_info *vptr = netdev_priv(dev); |
1899 | int ret; | 1902 | int ret; |
1900 | 1903 | ||
1901 | vptr->rx_buf_sz = (dev->mtu <= 1504 ? PKT_BUF_SZ : dev->mtu + 32); | ||
1902 | |||
1903 | ret = velocity_init_rings(vptr); | 1904 | ret = velocity_init_rings(vptr); |
1904 | if (ret < 0) | 1905 | if (ret < 0) |
1905 | goto out; | 1906 | goto out; |
@@ -1978,12 +1979,6 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu) | |||
1978 | velocity_free_rd_ring(vptr); | 1979 | velocity_free_rd_ring(vptr); |
1979 | 1980 | ||
1980 | dev->mtu = new_mtu; | 1981 | dev->mtu = new_mtu; |
1981 | if (new_mtu > 8192) | ||
1982 | vptr->rx_buf_sz = 9 * 1024; | ||
1983 | else if (new_mtu > 4096) | ||
1984 | vptr->rx_buf_sz = 8192; | ||
1985 | else | ||
1986 | vptr->rx_buf_sz = 4 * 1024; | ||
1987 | 1982 | ||
1988 | ret = velocity_init_rd_ring(vptr); | 1983 | ret = velocity_init_rd_ring(vptr); |
1989 | if (ret < 0) | 1984 | if (ret < 0) |