* [PATCH] virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs
@ 2009-01-20 16:48 Alex Williamson
2009-01-20 16:59 ` Mark McLoughlin
0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2009-01-20 16:48 UTC (permalink / raw)
To: netdev; +Cc: rusty, markmc, kvm
802.1Q expanded the maximum ethernet frame size by 4 bytes for the
VLAN tag. We're not taking this into account in virtio_net, which
means the buffers we provide to the backend in the virtqueue RX ring
aren't big enough to hold a full MTU VLAN packet. For QEMU/KVM,
this results in the backend exiting with a packet truncation error.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---
drivers/net/virtio_net.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 43f6523..63ef2a8 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -24,6 +24,7 @@
#include <linux/virtio.h>
#include <linux/virtio_net.h>
#include <linux/scatterlist.h>
+#include <linux/if_vlan.h>
static int napi_weight = 128;
module_param(napi_weight, int, 0444);
@@ -33,7 +34,7 @@ module_param(csum, bool, 0444);
module_param(gso, bool, 0444);
/* FIXME: MTU in config. */
-#define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN)
+#define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN)
#define GOOD_COPY_LEN 128
struct virtnet_info
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs
2009-01-20 16:48 [PATCH] virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs Alex Williamson
@ 2009-01-20 16:59 ` Mark McLoughlin
2009-01-26 2:06 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Mark McLoughlin @ 2009-01-20 16:59 UTC (permalink / raw)
To: Alex Williamson; +Cc: netdev, rusty, kvm
On Tue, 2009-01-20 at 09:48 -0700, Alex Williamson wrote:
> 802.1Q expanded the maximum ethernet frame size by 4 bytes for the
> VLAN tag. We're not taking this into account in virtio_net, which
> means the buffers we provide to the backend in the virtqueue RX ring
> aren't big enough to hold a full MTU VLAN packet. For QEMU/KVM,
> this results in the backend exiting with a packet truncation error.
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Mark McLoughlin <markmc@redhat.com>
Note 1: this only matters if the guest isn't using mergeable receive
buffers or GSO
Note 2: IMHO, this should go in 2.6.29 and stable
Cheers,
Mark.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs
2009-01-20 16:59 ` Mark McLoughlin
@ 2009-01-26 2:06 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-01-26 2:06 UTC (permalink / raw)
To: markmc; +Cc: alex.williamson, netdev, rusty, kvm
From: Mark McLoughlin <markmc@redhat.com>
Date: Tue, 20 Jan 2009 16:59:26 +0000
> On Tue, 2009-01-20 at 09:48 -0700, Alex Williamson wrote:
>
> > 802.1Q expanded the maximum ethernet frame size by 4 bytes for the
> > VLAN tag. We're not taking this into account in virtio_net, which
> > means the buffers we provide to the backend in the virtqueue RX ring
> > aren't big enough to hold a full MTU VLAN packet. For QEMU/KVM,
> > this results in the backend exiting with a packet truncation error.
> >
> > Signed-off-by: Alex Williamson <alex.williamson@hp.com>
>
> Acked-by: Mark McLoughlin <markmc@redhat.com>
>
> Note 1: this only matters if the guest isn't using mergeable receive
> buffers or GSO
>
> Note 2: IMHO, this should go in 2.6.29 and stable
Applied and queued up for -stable, thanks everyone!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-26 2:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-20 16:48 [PATCH] virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs Alex Williamson
2009-01-20 16:59 ` Mark McLoughlin
2009-01-26 2:06 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).