[dpdk-stable] patch 'net/virtio-user: fix device features for server mode' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Fri Nov 23 11:26:38 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.1

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

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From 3f2cf62ac5e52c86a672fc0e76a40f2fcfce0003 Mon Sep 17 00:00:00 2001
From: Tiwei Bie <tiwei.bie at intel.com>
Date: Mon, 29 Oct 2018 13:28:06 +0800
Subject: [PATCH] net/virtio-user: fix device features for server mode

[ upstream commit bb97d2dd96c0425b0cd9a58749de252ddf675b47 ]

We need to save the supported frontend features (which won't be
announced by vhost backend), otherwise we will lost them when the
connection to vhost-user backend is established in server mode.

Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode")

Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 8 +++++---
 drivers/net/virtio/virtio_user/virtio_user_dev.h | 1 +
 drivers/net/virtio/virtio_user_ethdev.c          | 2 ++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 85c35246b..5c10bf8e0 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -416,4 +416,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	dev->queue_size = queue_size;
 	dev->mac_specified = 0;
+	dev->frontend_features = 0;
 	dev->unsupported_features = 0;
 	parse_mac(dev, mac);
@@ -463,5 +464,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 
 	if (dev->mac_specified) {
-		dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
+		dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC);
 	} else {
 		dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);
@@ -473,5 +474,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 		 * so if necessary, we just claim to support CQ
 		 */
-		dev->device_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
+		dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
 	} else {
 		dev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_VQ);
@@ -494,6 +495,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 	/* The backend will not report this feature, we add it explicitly */
 	if (is_vhost_user_by_type(dev->path))
-		dev->device_features |= (1ull << VIRTIO_NET_F_STATUS);
+		dev->frontend_features |= (1ull << VIRTIO_NET_F_STATUS);
 
+	dev->device_features |= dev->frontend_features;
 	dev->device_features &= VIRTIO_USER_SUPPORTED_FEATURES;
 	dev->unsupported_features |= ~VIRTIO_USER_SUPPORTED_FEATURES;
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h
index d6e0e137b..c42ce5d4b 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h
@@ -34,4 +34,5 @@ struct virtio_user_dev {
 				   */
 	uint64_t	device_features; /* supported features by device */
+	uint64_t	frontend_features; /* enabled frontend features */
 	uint64_t	unsupported_features; /* unsupported features mask */
 	uint8_t		status;
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index ba8e59e58..b9860a23e 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -44,4 +44,6 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)
 	}
 
+	dev->device_features |= dev->frontend_features;
+
 	/* umask vhost-user unsupported features */
 	dev->device_features &= ~(dev->unsupported_features);
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-23 10:22:55.143409903 +0000
+++ 0034-net-virtio-user-fix-device-features-for-server-mode.patch	2018-11-23 10:22:54.000000000 +0000
@@ -1,14 +1,15 @@
-From bb97d2dd96c0425b0cd9a58749de252ddf675b47 Mon Sep 17 00:00:00 2001
+From 3f2cf62ac5e52c86a672fc0e76a40f2fcfce0003 Mon Sep 17 00:00:00 2001
 From: Tiwei Bie <tiwei.bie at intel.com>
 Date: Mon, 29 Oct 2018 13:28:06 +0800
 Subject: [PATCH] net/virtio-user: fix device features for server mode
 
+[ upstream commit bb97d2dd96c0425b0cd9a58749de252ddf675b47 ]
+
 We need to save the supported frontend features (which won't be
 announced by vhost backend), otherwise we will lost them when the
 connection to vhost-user backend is established in server mode.
 
 Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode")
-Cc: stable at dpdk.org
 
 Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
 Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
@@ -19,30 +20,30 @@
  3 files changed, 8 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
-index 0eb0f244b..ff1c2034f 100644
+index 85c35246b..5c10bf8e0 100644
 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
 +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
-@@ -422,4 +422,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
+@@ -416,4 +416,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
  	dev->queue_size = queue_size;
  	dev->mac_specified = 0;
 +	dev->frontend_features = 0;
  	dev->unsupported_features = 0;
  	parse_mac(dev, mac);
-@@ -469,5 +470,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
+@@ -463,5 +464,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
  
  	if (dev->mac_specified) {
 -		dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
 +		dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC);
  	} else {
  		dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);
-@@ -479,5 +480,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
+@@ -473,5 +474,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
  		 * so if necessary, we just claim to support CQ
  		 */
 -		dev->device_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
 +		dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ);
  	} else {
  		dev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_VQ);
-@@ -500,6 +501,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
+@@ -494,6 +495,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
  	/* The backend will not report this feature, we add it explicitly */
  	if (is_vhost_user_by_type(dev->path))
 -		dev->device_features |= (1ull << VIRTIO_NET_F_STATUS);
@@ -62,7 +63,7 @@
  	uint64_t	unsupported_features; /* unsupported features mask */
  	uint8_t		status;
 diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
-index a31b9b44a..61b7c0a38 100644
+index ba8e59e58..b9860a23e 100644
 --- a/drivers/net/virtio/virtio_user_ethdev.c
 +++ b/drivers/net/virtio/virtio_user_ethdev.c
 @@ -44,4 +44,6 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)


More information about the stable mailing list