From: Jianfeng Tan Date: Tue, 27 Sep 2016 19:11:04 +0000 (+0000) Subject: net/virtio_user: fix first queue pair without multiqueue X-Git-Tag: spdx-start~5919 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=33a290899dd2b6e2e26e8e5c33d08979f8315d18;p=dpdk.git net/virtio_user: fix first queue pair without multiqueue When virtio_user is used with OVS-DPDK (with mq disabled), it cannot receive any packets. This is because no queue is enabled at all when mq is disabled. To fix it, we should consistently make sure the 1st queue is enabled, which is also the behaviour QEMU takes. Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer") Reported-by: Ning Li Signed-off-by: Jianfeng Tan Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 376c9cf563..bf1155ca54 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -131,6 +131,9 @@ virtio_user_start_device(struct virtio_user_dev *dev) } } + /* we enable the 1st queue pair by default. */ + vhost_user_enable_queue_pair(dev->vhostfd, 0, 1); + /* After setup all virtqueues, we need to set_features so that these * features can be set into each virtqueue in vhost side. And before * that, make sure VHOST_USER_F_PROTOCOL_FEATURES is added if mq is