From: Daniele Palumbo <daniele@retaggio.net>
To: xen-users@lists.xensource.com
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] netback vlan support [WAS: Re: [Xen-users] Ethernet MTU]
Date: Thu, 14 Sep 2006 20:12:02 +0200 [thread overview]
Message-ID: <200609142012.02860.daniele@retaggio.net> (raw)
In-Reply-To: <200609131655.20244.daniele@retaggio.net>
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
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 <keir@xensource.com>
>
> --- 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.
[-- Attachment #2: netback_vlan.patch --]
[-- Type: text/x-diff, Size: 1326 bytes --]
This will prevent dropping packets from domU to vif in dom0.
Idea from: Dominique Rousseau <d.rousseau@nnx.com>
Patch by: Daniele Palumbo <daniele@retaggio.net>
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 <linux/in.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/if_vlan.h>
#include <xen/evtchn.h>
#include <xen/interface/io/netif.h>
#include <asm/io.h>
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);
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
prev parent reply other threads:[~2006-09-14 18:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 10:13 Ethernet MTU Sylvain Coutant
2006-08-16 10:18 ` [Xen-devel] " Molle Bestefich
2006-08-16 10:24 ` James Harper
2006-08-16 10:36 ` [Xen-devel] " Molle Bestefich
2006-08-16 11:05 ` Sylvain Coutant
2006-08-16 11:36 ` Molle Bestefich
2006-08-16 11:20 ` [Xen-devel] " James Harper
2006-08-16 11:58 ` Molle Bestefich
2006-08-16 10:19 ` James Harper
2006-08-16 10:28 ` [Xen-devel] " Molle Bestefich
2006-08-16 12:12 ` Adrian Chadd
2006-08-16 12:30 ` Sylvain Coutant
2006-08-16 14:14 ` Herbert Xu
2006-08-16 14:16 ` Sylvain Coutant
2006-08-17 0:15 ` Herbert Xu
[not found] ` <20060816120908.GC8597@nnx.com>
[not found] ` <20060816205306.GA15396@nnx.com>
2006-09-13 14:55 ` [Xen-users] " Daniele Palumbo
2006-09-14 18:12 ` Daniele Palumbo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200609142012.02860.daniele@retaggio.net \
--to=daniele@retaggio.net \
--cc=xen-devel@lists.xensource.com \
--cc=xen-users@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.