net/virtio: flush Rx queues on start
authorTiwei Bie <tiwei.bie@intel.com>
Fri, 20 Oct 2017 02:09:28 +0000 (10:09 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 24 Oct 2017 19:26:57 +0000 (21:26 +0200)
commitd8227497ec5c3de75fe378e09fc9673ae097fa73
tree0587348ea0bdf75e93b4eadd9cfe48e3c3a1685f
parent5cd690e4fda97bc4465195ef2f500fffde63fb64
net/virtio: flush Rx queues on start

After starting a device, the driver shouldn't deliver the
packets that already existed before the device is started
to applications. Otherwise it will lead to incorrect packet
collection for port state. This patch fixes this issue by
flushing the Rx queues when starting the device.

Fixes: a85786dc816f ("virtio: fix states handling during initialization")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtio_rxtx.c
drivers/net/virtio/virtqueue.c
drivers/net/virtio/virtqueue.h