From: Alex Williamson Date: Fri, 13 Feb 2009 08:06:29 +0000 (-0800) Subject: virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs X-Git-Tag: v2.6.28.6~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb8de065c36dafcc7e40104f6311b6b2d0d37596;p=thirdparty%2Fkernel%2Fstable.git virtio_net: Fix MAX_PACKET_LEN to support 802.1Q VLANs [ Upstream commit e918085aaff34086e265f825dd469926b1aec4a4 ] 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 Acked-by: Mark McLoughlin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0196a0df90210..ce743ecc5d612 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -24,6 +24,7 @@ #include #include #include +#include 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) struct virtnet_info {