添付ファイル | linux-2.6.16-via_velocity-jumbo-frame.patch [^] (1,153 バイト) 2009-02-22 12:36 [表示] [非表示]--- linux-2.6.16/drivers/net/via-velocity.c.old 2009-02-22 10:09:02.000000000 +0900
+++ linux-2.6.16/drivers/net/via-velocity.c 2009-02-22 10:14:02.000000000 +0900
@@ -1071,6 +1071,9 @@
int ret = -ENOMEM;
unsigned int rsize = sizeof(struct velocity_rd_info) *
vptr->options.numrx;
+ int mtu = vptr->dev->mtu;
+
+ vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
vptr->rd_info = kmalloc(rsize, GFP_KERNEL);
if(vptr->rd_info == NULL)
@@ -1727,8 +1730,6 @@
struct velocity_info *vptr = dev->priv;
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;
@@ -1792,6 +1793,11 @@
return -EINVAL;
}
+ if (!netif_running(dev)) {
+ dev->mtu = new_mtu;
+ return 0;
+ }
+
if (new_mtu != oldmtu) {
spin_lock_irqsave(&vptr->lock, flags);
@@ -1802,12 +1808,6 @@
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)
|