]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-net: coalesce rx frags when possible during rx
authorJason Wang <jasowang@redhat.com>
Fri, 1 Nov 2013 06:07:48 +0000 (14:07 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Nov 2013 01:03:52 +0000 (20:03 -0500)
commit111388d0bc275fdfac105504456ef046001d688d
tree2b838baaa714e9d1a027fe6f199bf4b06b118044
parent42f6d988c8c84d7e575d46ebecf6b672117015d0
virtio-net: coalesce rx frags when possible during rx

Commit 8f6fb073da23bfc802ef12ba3bdaf3e28b037d69 (virtio_net: migrate mergeable
rx buffers to page frag allocators) try to increase the payload/truesize for
MTU-sized traffic. But this will introduce the extra overhead for GSO packets
received because of the frag list. This commit tries to reduce this issue by
coalesce the possible rx frags when possible during rx. Test result shows the
about 15% improvement on full size GSO packet receiving (and even better than
before commit 8f6fb073da23bfc802ef12ba3bdaf3e28b037d69).

Before this commit:
./netperf -H 192.168.100.4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.100.4
() port 0 AF_INET : demo
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00    20303.87

After this commit:
./netperf -H 192.168.100.4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.100.4
() port 0 AF_INET : demo
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00    23841.26

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Michael Dalton <mwdalton@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c