net/virtio: fix queue flushing with vector Rx enabled
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 23 Jan 2018 15:54:40 +0000 (16:54 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 29 Jan 2018 09:04:28 +0000 (10:04 +0100)
commite67ae1e27e27b0fce9974dbf1b5bc6adff27a213
tree6fa36ce4eb8a3d35b7664bb658039d14b55300be
parent8f3d451dff2b91eb6c7636e92794c2b256267f8e
net/virtio: fix queue flushing with vector Rx enabled

When using vector Rx mode (use_simple_rx = 1), vq->vq_descx[] is not
kept up to date. To properly detach the mbufs in this case, browse
sw_ring[] instead, as it's done in virtqueue_rxvq_flush().

Since we need virtio_get_queue_type(), also move this function in
virtqueue.h as a static inline.

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtqueue.c
drivers/net/virtio/virtqueue.h