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:48:32 +0000 (13:48 -0800)
commit6d278b22a99c8bcfbc7106c40e9c95da6d608880
tree2124104dda2553b6636d9a386d8a53c487b83da7
parentb39c209833d4f3c40e89c43cd83a86c6c669acbc
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