]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_net: fix truesize for mergeable buffers
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 31 Jul 2017 18:49:49 +0000 (21:49 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Aug 2017 01:02:46 +0000 (18:02 -0700)
commit71d26bddbd7f993df740d96cd418a966ac3c5430
treefa2dbfb28b89a3f520c402f146b731e69f737e86
parent2856d4808243d580d352b69ab53809eb6264eeae
virtio_net: fix truesize for mergeable buffers

Seth Forshee noticed a performance degradation with some workloads.
This turns out to be due to packet drops.  Euan Kemp noticed that this
is because we drop all packets where length exceeds the truesize, but
for some packets we add in extra memory without updating the truesize.
This in turn was kept around unchanged from 65855d28a9391 ("virtio-net:
auto-tune mergeable rx buffer size for improved performance").  That
commit had an internal reason not to account for the extra space: not
enough bits to do it.  No longer true so let's account for the allocated
length exactly.

Many thanks to Seth Forshee for the report and bisecting and Euan Kemp
for debugging the issue.

Fixes: f371e4d3960d ("virtio_net: rework mergeable buffer handling")
Reported-by: Euan Kemp <euan.kemp@coreos.com>
Tested-by: Euan Kemp <euan.kemp@coreos.com>
Reported-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c