[dpdk-stable] patch 'net/virtio-user: fix start with kernel vhost' has been queued to LTS release 16.11.5

Luca Boccassi bluca at debian.org
Thu Feb 15 13:03:07 CET 2018


Hi,

FYI, your patch has been queued to LTS release 16.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/17/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 46c71a6e94c76ac2d9e3dfb07694940d28db5369 Mon Sep 17 00:00:00 2001
From: Jianfeng Tan <jianfeng.tan at intel.com>
Date: Mon, 12 Feb 2018 03:20:27 +0000
Subject: [PATCH] net/virtio-user: fix start with kernel vhost

[ upstream commit bce7e9050f9b5e92cead60e8ac7768812ce898f2 ]

After reset owner in below patch, we failed to set owner before
sending further vhost messages. It is OK with vhost user implemented
DPDK/VPP/Contrail, but it sees "Operation not permitted" error when
used with vhost kernel.

We fix this by setting owner every time the device is started.

Fixes: 0d6a8752ac9d ("net/virtio-user: fix crash as features change")

Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 91f6a59a9..8bb155d8c 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -142,6 +142,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)
 	uint64_t features;
 	int ret;
 
+	/* Do not check return as already done in init, or reset in stop */
+	vhost_user_sock(dev->vhostfd, VHOST_USER_SET_OWNER, NULL);
+
 	/* Step 0: tell vhost to create queues */
 	if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)
 		goto error;
@@ -240,6 +243,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 		PMD_INIT_LOG(ERR, "backend set up fails");
 		return -1;
 	}
+
 	if (vhost_user_sock(dev->vhostfd, VHOST_USER_SET_OWNER, NULL) < 0) {
 		PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno));
 		return -1;
-- 
2.14.2



More information about the stable mailing list