From 6e1e59045715113815ea6a377e6e58945f291e0d Mon Sep 17 00:00:00 2001 From: Jiayu Hu Date: Fri, 11 May 2018 15:26:07 +0800 Subject: [PATCH] net/virtio-user: fix feature setting with vhost-net backend When the backend is vhost-net, virtio-user must work in client mode and needs to request features from the backend in virtio_user_dev_init(). But currently, virtio-user is assigned to default features in this case. This patch is to fix this inappropriate feature setting. Fixes: bd8f50a45d0f ("net/virtio-user: support server mode") Signed-off-by: Jiayu Hu Tested-by: Lei Yao Reviewed-by: Tiwei Bie Reviewed-by: Zhiyong Yang --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 992a68757c..566c3251ac 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -396,7 +396,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, return -1; } - if (dev->vhostfd >= 0) { + if (!dev->is_server) { if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL) < 0) { PMD_INIT_LOG(ERR, "set_owner fails: %s", -- 2.20.1