net/virtio: fix vector Rx flushing
authorTiwei Bie <tiwei.bie@intel.com>
Mon, 11 Dec 2017 05:13:29 +0000 (13:13 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
commitbcf55c93026ff1db8ff2838766bbaaa38741579e
treed7a24575aed077ab52f5e3eff6fd2383a3169343
parent43ec842ca45d1b090998aff20c64eb92cc8bdf0b
net/virtio: fix vector Rx flushing

The vector Rx will be broken if backend has consumed all
the descs in the avail ring before the device is started.
Because in current implementation, vector Rx will return
immediately without refilling the avail ring if the used
ring is empty. So we have to refill the avail ring after
flushing the elements in the used ring for vector Rx.

Besides, vector Rx has a different ring layout assumption
and mbuf management. So we need to handle it differently.

Fixes: d8227497ec5c ("net/virtio: flush Rx queues on start")
Cc: stable@dpdk.org
Reported-by: Antonio Fischetti <antonio.fischetti@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Antonio Fischetti <antonio.fischetti@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtqueue.c
drivers/net/virtio/virtqueue.h