netdev-dpdk: vhost-user: Fix sending packets to queues not enabled by guest.
authorIlya Maximets <i.maximets@samsung.com>
Wed, 24 Feb 2016 14:14:43 +0000 (17:14 +0300)
committerDaniele Di Proietto <diproiettod@vmware.com>
Wed, 24 Feb 2016 21:34:10 +0000 (13:34 -0800)
commit585a5beaa2a45dd43f41543b7c9800d13083bc1a
treeb512791c9e5f450c0f94e0599f278031831dd5b0
parent6c6eedc5d6730835a0d9724e2e8cfe9cdf03b07d
netdev-dpdk: vhost-user: Fix sending packets to queues not enabled by guest.

Currently virtio driver in guest operating system have to be configured
to use exactly same number of queues. If number of queues will be less,
some packets will get stuck in queues unused by guest and will not be
received.

Fix that by using new 'vring_state_changed' callback, which is
available for vhost-user since DPDK 2.2.
Implementation uses additional mapping from configured tx queues to
enabled by virtio driver. This requires mandatory locking of TX queues
in __netdev_dpdk_vhost_send(), but this locking was almost always anyway
because of calling set_multiq with n_txq = 'ovs_numa_get_n_cores() + 1'.

OVS_VHOST_MAX_QUEUE_NUM = 1024 chosen based on the fact that this is
the maximum number of queues supported by QEMU.

Fixes: 4573fbd38fa1 ("netdev-dpdk: Add vhost-user multiqueue support")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
lib/netdev-dpdk.c