summaryrefslogtreecommitdiff
path: root/net/tap.c
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@cumulusnetworks.com>2013-03-18 11:43:44 -0700
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-25 11:14:07 +0100
commitd32fcad366e5f45d33dab2ee4de0e5729439680b (patch)
tree6881ca1e804644a6361a76813318bcf1a36c7d99 /net/tap.c
parent786fd2b0f87baded8c9e55307b99719eea3e016e (diff)
downloadqemu-d32fcad366e5f45d33dab2ee4de0e5729439680b.tar.gz
qemu-d32fcad366e5f45d33dab2ee4de0e5729439680b.tar.bz2
qemu-d32fcad366e5f45d33dab2ee4de0e5729439680b.zip
net: increase buffer size to accommodate Jumbo frame pkts
Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs. Bump this up to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plenty of room for the ethernet and virtio_net headers. Originally, ran into this limitation when using -netdev UDP sockets to connect VM-to-VM, where VM interface is configure with MTU=9000. (Using virtio_net NIC model). Test is simple: ping -M do -s 8500 <target>. This test will attempt to ping with unfragmented packet of given size. Without patch, size is limited to < 4K (minus protocol hdrs). With patch, ping test works with pkt size up to 9000 (again, minus protocol hdrs). v2: per Stefan, increase buf size to (4096+65536) as done in tap and apply to vde and socket netdevs. v1: increase buf size to 12K just for -netdev UDP sockets Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r--net/tap.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/net/tap.c b/net/tap.c
index ce796997a3..e7c84811ac 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -44,17 +44,12 @@
#include "hw/vhost_net.h"
-/* Maximum GSO packet size (64k) plus plenty of room for
- * the ethernet and virtio_net headers
- */
-#define TAP_BUFSIZE (4096 + 65536)
-
typedef struct TAPState {
NetClientState nc;
int fd;
char down_script[1024];
char down_script_arg[128];
- uint8_t buf[TAP_BUFSIZE];
+ uint8_t buf[NET_BUFSIZE];
bool read_poll;
bool write_poll;
bool using_vnet_hdr;