From: Tiwei Bie Date: Fri, 21 Sep 2018 12:52:42 +0000 (+0800) Subject: net/virtio-user: fix multiple queue for vhost-kernel X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21b90f790a5fd41875610440b888015aa9b0a460;p=dpdk.git net/virtio-user: fix multiple queue for vhost-kernel The multiple queue support in vhost-kernel is broken because the dev->vhostfd is only available for vhost-user. We should always try to enable queue pairs when it's not in server mode. Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 869e96f87e..55a82e4b0c 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -549,13 +549,11 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs) /* Server mode can't enable queue pairs if vhostfd is invalid, * always return 0 in this case. */ - if (dev->vhostfd >= 0) { + if (!dev->is_server || dev->vhostfd >= 0) { for (i = 0; i < q_pairs; ++i) ret |= dev->ops->enable_qp(dev, i, 1); for (i = q_pairs; i < dev->max_queue_pairs; ++i) ret |= dev->ops->enable_qp(dev, i, 0); - } else if (!dev->is_server) { - ret = ~0; } dev->queue_pairs = q_pairs;