* [Qemu-devel] [PATCH] net: increase buffer size to accommodate Jumbo frame pkts over netdev UDP socket
@ 2013-03-16 0:12 sfeldma
2013-03-18 16:08 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: sfeldma @ 2013-03-16 0:12 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori, stephanha
From: Scott Feldman <sfeldma@cumulusnetworks.com>
Socket buffer sizes were hard-coded to 4K. Bump this up to 12K to handle typical
MTU=9000 Jumbo frame pkt. 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).
Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
---
net/net.c | 2 +-
net/socket.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/net.c b/net/net.c
index f3d67f8..bab9ced 100644
--- a/net/net.c
+++ b/net/net.c
@@ -497,7 +497,7 @@ ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int size)
static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
int iovcnt)
{
- uint8_t buffer[4096];
+ uint8_t buffer[12*1024];
size_t offset;
offset = iov_to_buf(iov, iovcnt, 0, buffer, sizeof(buffer));
diff --git a/net/socket.c b/net/socket.c
index 396dc8c..74e0057 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -40,7 +40,7 @@ typedef struct NetSocketState {
unsigned int index;
unsigned int packet_len;
unsigned int send_index; /* number of bytes sent (only SOCK_STREAM) */
- uint8_t buf[4096];
+ uint8_t buf[12*1024];
struct sockaddr_in dgram_dst; /* contains inet host and port destination iff connectionless (SOCK_DGRAM) */
IOHandler *send_fn; /* differs between SOCK_STREAM/SOCK_DGRAM */
bool read_poll; /* waiting to receive data? */
@@ -146,7 +146,7 @@ static void net_socket_send(void *opaque)
NetSocketState *s = opaque;
int size, err;
unsigned l;
- uint8_t buf1[4096];
+ uint8_t buf1[12*1024];
const uint8_t *buf;
size = qemu_recv(s->fd, buf1, sizeof(buf1), 0);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] net: increase buffer size to accommodate Jumbo frame pkts over netdev UDP socket
2013-03-16 0:12 [Qemu-devel] [PATCH] net: increase buffer size to accommodate Jumbo frame pkts over netdev UDP socket sfeldma
@ 2013-03-18 16:08 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2013-03-18 16:08 UTC (permalink / raw)
To: sfeldma; +Cc: aliguori, stephanha, qemu-devel
On Fri, Mar 15, 2013 at 05:12:38PM -0700, sfeldma@cumulusnetworks.com wrote:
> From: Scott Feldman <sfeldma@cumulusnetworks.com>
>
> Socket buffer sizes were hard-coded to 4K. Bump this up to 12K to handle typical
> MTU=9000 Jumbo frame pkt. 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).
>
> Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
> ---
> net/net.c | 2 +-
> net/socket.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
grep reveals that VDE is limited in a similar way. tap-win32 may be
affected too.
I noticed that Linux tap goes straight for:
net/tap.c:#define TAP_BUFSIZE (4096 + 65536)
The 4096 is reserved for network/virtio headers.
Please move TAP_BUFSIZE to include/net/net.h and rename it to
NET_BUFSIZE. Then socket, vde, and tap-win32 can use it.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-18 16:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-16 0:12 [Qemu-devel] [PATCH] net: increase buffer size to accommodate Jumbo frame pkts over netdev UDP socket sfeldma
2013-03-18 16:08 ` Stefan Hajnoczi
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.