net/virtio-user: fix packed ring server mode
authorXuan Ding <xuan.ding@intel.com>
Wed, 15 Jan 2020 06:13:58 +0000 (06:13 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:26 +0000 (19:46 +0100)
commit6ebbf4109f3529a1af880ce195869cee84647178
tree6ee2a3b8fd466a85d4f7e2ffe16fd7c56ec495e0
parent5efb18e85f7fdb436d3e56591656051c16802066
net/virtio-user: fix packed ring server mode

This patch fixes the situation where data path does not work properly
when vhost reconnects to virtio in server mode with packed ring.

Currently, virtio and vhost share memory of vring. For split ring, vhost
can read the status of descriptors directly from the available ring and
the used ring during reconnection. Therefore, the data path can
continue.

But for packed ring, when reconnecting to virtio, vhost cannot get the
status of descriptors via the descriptor ring. By resetting Tx
and Rx queues, the data path can restart from the beginning.

Fixes: 4c3f5822eb21 ("net/virtio: add packed virtqueue defines")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtio_user_ethdev.c
drivers/net/virtio/virtqueue.c
drivers/net/virtio/virtqueue.h