Baby giant / jumbo frames
PATCH 1/1 Baby giant / jumbo frames
Hi,
Here's a patch against XenLinux from 2.0.7 that allows you to use baby giant frames over vif's.
I've only done minimal testing on it but it should work with MTU's of up to 3000. The 3000 limit was arbitrarily chosen due to 4k pagesize and because I'm not sufficiently knowledgeable about Xen's architecture to work out exactly how much headroom is needed. For my requirements (layer 2 tunnelling) I'm never going to need an MTU of more than 1600 so I've left this as an exercise for the reader. :-)
Note on bridging: there seems to be a misconception by some that the linux bridging code doesn't support jumbo frames. For the record this is not true, but it won't allow you to configure an MTU greater than the smallest MTU on a bridge port. (If there are no bridge ports the
maximum MTU is 1500.) The trick is to configure the jumbo MTU on
each member of the bridge first before configuring it on the bridge itself.
Regards,
Ben.
drivers/xen/netback/interface.c +9 -0
@@ -65,6 +65,14 @@return 0 ; } +static int net_change_mtu (struct net_device *dev,int new_mtu) +{ +if ((new_mtu <68 ) || (new_mtu >3000 )) +return -EINVAL ; + dev->mtu = new_mtu; +return 0 ; +} +static void __netif_disconnect_complete (void *arg) {netif_t *netif = (netif_t *)arg;
@@ -157,6 +165,7 @@ dev->hard_start_xmit = netif_be_start_xmit; dev->get_stats = netif_be_get_stats; + dev->change_mtu = net_change_mtu; dev->open = net_open; dev->stop = net_close;
drivers/xen/netback/netback.c +1 -1
@@ -510,7 +510,7 @@netif_schedule_work (netif);if (unlikely (txreq.size <ETH_HLEN ) || -unlikely (txreq.size >ETH_FRAME_LEN ) ) +unlikely (txreq.size >3018 ) ) {DPRINTK ("Bad packet size: %d\n" , txreq.size);make_tx_response (netif, txreq.id,NETIF_RSP_ERROR );
drivers/xen/netfront/netfront.c +8 -0
@@ -707,6 +707,13 @@return &np->stats; } +static int network_change_mtu (struct net_device *dev,int new_mtu) +{ +if ((new_mtu <68 ) || (new_mtu >3000 )) +return -EINVAL ; + dev->mtu = new_mtu; +return 0 ; +}static void network_connect (struct net_device *dev,netif_fe_interface_status_t *status)
@@ -969,6 +976,7 @@ dev->hard_start_xmit = network_start_xmit; dev->stop = network_close; dev->get_stats = network_get_stats; + dev->change_mtu = network_change_mtu; dev->poll = netif_poll; dev->weight =64 ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel