]> Pileus Git - ~andy/linux/commit
virtio-net: correct capacity math on ring full
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 16 Oct 2012 13:26:14 +0000 (23:56 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 18 Dec 2012 04:50:32 +0000 (15:20 +1030)
commit6ee57bcc1e61d39c0579438055bc84087210f9b6
tree2cae790fe378aa4be4419e40ae13f2a4e4b4d8c5
parent06ca287dbac9cc19d04ac2901b8c4882c03795ff
virtio-net: correct capacity math on ring full

Capacity math on ring full is wrong: we are
looking at num_sg but that might be optimistic
because of indirect buffer use.

The implementation also penalizes fast path
with extra memory accesses for the benefit of
ring full condition handling which is slow path.

It's easy to query ring capacity so let's do just that.

This change also makes it easier to move vnet header
for tx around as follow-up patch does.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
drivers/net/virtio_net.c