From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniele Palumbo Subject: [PATCH] netback vlan support [WAS: Re: [Xen-users] Ethernet MTU] Date: Thu, 14 Sep 2006 20:12:02 +0200 Message-ID: <200609142012.02860.daniele@retaggio.net> References: <00c801c6c11c$a2c62ee0$2f00a8c0@ELTON> <20060816205306.GA15396@nnx.com> <200609131655.20244.daniele@retaggio.net> Reply-To: daniele@retaggio.net Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_ytZCFI8e2b2K3uO" Return-path: In-Reply-To: <200609131655.20244.daniele@retaggio.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-users@lists.xensource.com Cc: xen-devel List-Id: xen-devel@lists.xenproject.org --Boundary-00=_ytZCFI8e2b2K3uO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 13 September 2006 16:55, Daniele Palumbo wrote: I made a working patch (tested by me, icmp and tcp). This work *WITH* netfront_vlan.patch. simply, the patch will use VLAN_ETH_FRAME_LEN (1518 bytes) instead of ETH_FRAME_LEN (1514 bytes). this patch will involve (for clear code) common.h (including vlans headers) and netback.c (using #define in vlans headers ;), both in driver netback directory. this is something like "quick and dirthy", what do you think about it? HTH bye d. > netfront_vlan.patch: > --- > # Node ID a5ee1cb525bbe8954dc3332ceec951e09a378b68 > # parent: c097485037f7417b77db34da198b62a9c9481dc5 > Make MTU rx check in netfront more permissive to allow for 8021q vlan > tagging. > > Signed-off-by: Keir Fraser > > --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Mar 15 > 12:41:58 2006 +0100 > +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Mar 15 > 12:52:33 2006 +0100 > @@ -845,11 +845,11 @@ static int netif_poll(struct net_device > } > > while ((skb = __skb_dequeue(&rxq)) != NULL) { > - if (skb->len > (dev->mtu + ETH_HLEN)) { > + if (skb->len > (dev->mtu + ETH_HLEN + 4)) { > if (net_ratelimit()) > printk(KERN_INFO "Received packet too big > for " > "MTU (%d > %d)\n", > - skb->len - ETH_HLEN, dev->mtu); > + skb->len - ETH_HLEN - 4, dev->mtu); > skb->len = 0; > skb->tail = skb->data; > init_skb_shinfo(skb); > --- -- PGP Key-ID: 0xF482D454 -- to boldly go where no man has gone before. --Boundary-00=_ytZCFI8e2b2K3uO Content-Type: text/x-diff; charset="iso-8859-1"; name="netback_vlan.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="netback_vlan.patch" This will prevent dropping packets from domU to vif in dom0. Idea from: Dominique Rousseau Patch by: Daniele Palumbo diff -Nur drivers/xen/netback.orig/common.h drivers/xen/netback/common.h --- drivers/xen/netback.orig/common.h 2006-09-14 15:52:10.000000000 +0200 +++ drivers/xen/netback/common.h 2006-09-14 15:52:18.000000000 +0200 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff -Nur drivers/xen/netback.orig/netback.c drivers/xen/netback/netback.c --- drivers/xen/netback.orig/netback.c 2006-09-14 10:09:10.000000000 +0200 +++ drivers/xen/netback/netback.c 2006-09-14 15:49:30.000000000 +0200 @@ -548,8 +548,12 @@ netif_schedule_work(netif); + /* Accept packet for vlan. + * linux-src/include/linux/if_vlan.h:#define VLAN_ETH_FRAME_LEN 1518 + * linux-src/include/linux/if_ether.h:#define ETH_FRAME_LEN 1514 + */ if (unlikely(txreq.size < ETH_HLEN) || - unlikely(txreq.size > ETH_FRAME_LEN)) { + unlikely(txreq.size > VLAN_ETH_FRAME_LEN)) { DPRINTK("Bad packet size: %d\n", txreq.size); make_tx_response(netif, txreq.id, NETIF_RSP_ERROR); netif_put(netif); --Boundary-00=_ytZCFI8e2b2K3uO Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_ytZCFI8e2b2K3uO--