On Tue, 10 Jun 2014 09:08:03 +0800
Andy Green [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+static int ogma_netdev_change_mtu(struct net_device *net_device, int new_mtu)
+{
+ struct ogma_ndev *ndev = netdev_priv(net_device);
+
+ if (!ndev->priv->param.use_jumbo_pkt_flag)
+ return eth_change_mtu(net_device, new_mtu);
+
+ if ((new_mtu < 68) || (new_mtu > 9000))
+ return -EINVAL;
+
+ net_device->mtu = new_mtu;
+
+ return 0;
+}
+
I don't think this works. rx_pkt_buf_len is only set at probe time.
Don't you need to:
1. Stop device if running
2. Free existing receive buffers
3. change rx_pkt_buf_len
4. Refill restart receiver.
Most devices setup receive ring in open (not probe)
to handle this. It also avoid grabbing memory if device is unused.