Blame SOURCES/0012-net-virtio-user-fix-packed-vq-option-parsing.patch

2c1bf6
From ec53a1992df973607cbb10db6a0816ed2ef498dd Mon Sep 17 00:00:00 2001
2c1bf6
From: Tiwei Bie <tiwei.bie@intel.com>
2c1bf6
Date: Thu, 3 Jan 2019 10:40:06 +0800
2c1bf6
Subject: [PATCH] net/virtio-user: fix packed vq option parsing
2c1bf6
2c1bf6
[ upstream commit 9070f88b81dab42739fb169265e3ea727e47dfa2 ]
2c1bf6
2c1bf6
Add the RING_PACKED feature to dev->unsupported_features
2c1bf6
when it's disabled, and add the missing packed vq param
2c1bf6
string. And also revert the unexpected change to MAC option
2c1bf6
introduced when adding packed vq option.
2c1bf6
2c1bf6
Fixes: 34f3966c7f81 ("net/virtio-user: add option to use packed queues")
2c1bf6
2c1bf6
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
2c1bf6
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2c1bf6
(cherry picked from commit 9070f88b81dab42739fb169265e3ea727e47dfa2)
2c1bf6
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
2c1bf6
---
2c1bf6
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 11 ++++-------
2c1bf6
 drivers/net/virtio/virtio_user_ethdev.c          |  7 ++++---
2c1bf6
 2 files changed, 8 insertions(+), 10 deletions(-)
2c1bf6
2c1bf6
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
2c1bf6
index 811b95c45..426682c93 100644
2c1bf6
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
2c1bf6
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
2c1bf6
@@ -475,17 +475,14 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
2c1bf6
 					  "packed virtqueues\n");
2c1bf6
 			return -1;
2c1bf6
 		}
2c1bf6
-		dev->device_features |= (1ull << VIRTIO_F_RING_PACKED);
2c1bf6
 	} else {
2c1bf6
-		dev->device_features &= ~(1ull << VIRTIO_F_RING_PACKED);
2c1bf6
+		dev->unsupported_features |= (1ull << VIRTIO_F_RING_PACKED);
2c1bf6
 	}
2c1bf6
 
2c1bf6
-	if (dev->mac_specified) {
2c1bf6
-		dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
2c1bf6
-	} else {
2c1bf6
-		dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);
2c1bf6
+	if (dev->mac_specified)
2c1bf6
+		dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC);
2c1bf6
+	else
2c1bf6
 		dev->unsupported_features |= (1ull << VIRTIO_NET_F_MAC);
2c1bf6
-	}
2c1bf6
 
2c1bf6
 	if (cq) {
2c1bf6
 		/* device does not really need to know anything about CQ,
2c1bf6
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
2c1bf6
index daad8f452..a2911febf 100644
2c1bf6
--- a/drivers/net/virtio/virtio_user_ethdev.c
2c1bf6
+++ b/drivers/net/virtio/virtio_user_ethdev.c
2c1bf6
@@ -361,7 +361,7 @@ static const char *valid_args[] = {
2c1bf6
 	VIRTIO_USER_ARG_MRG_RXBUF,
2c1bf6
 #define VIRTIO_USER_ARG_IN_ORDER       "in_order"
2c1bf6
 	VIRTIO_USER_ARG_IN_ORDER,
2c1bf6
-#define VIRTIO_USER_ARG_PACKED_VQ "packed_vq"
2c1bf6
+#define VIRTIO_USER_ARG_PACKED_VQ      "packed_vq"
2c1bf6
 	VIRTIO_USER_ARG_PACKED_VQ,
2c1bf6
 	NULL
2c1bf6
 };
2c1bf6
@@ -466,11 +466,11 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
2c1bf6
 	uint64_t server_mode = VIRTIO_USER_DEF_SERVER_MODE;
2c1bf6
 	uint64_t mrg_rxbuf = 1;
2c1bf6
 	uint64_t in_order = 1;
2c1bf6
+	uint64_t packed_vq = 0;
2c1bf6
 	char *path = NULL;
2c1bf6
 	char *ifname = NULL;
2c1bf6
 	char *mac_addr = NULL;
2c1bf6
 	int ret = -1;
2c1bf6
-	uint64_t packed_vq = 0;
2c1bf6
 
2c1bf6
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
2c1bf6
 		const char *name = rte_vdev_device_name(dev);
2c1bf6
@@ -698,4 +698,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user,
2c1bf6
 	"iface=<string> "
2c1bf6
 	"server=<0|1> "
2c1bf6
 	"mrg_rxbuf=<0|1> "
2c1bf6
-	"in_order=<0|1>");
2c1bf6
+	"in_order=<0|1> "
2c1bf6
+	"packed_vq=<0|1>");
2c1bf6
-- 
2c1bf6
2.21.0
2c1bf6