Skip to contentSkip to conversation

Some fixes for virtio-user/packed-ring

PATCH Applied Tiwei Bie 2 participants 6 messages Jan 3, 2019 – Jan 4, 2019 Network drivers

lore
Share & tools
lore

Tiwei Bie

author
#0 lore raw

cover Some fixes for virtio-user/packed-ring

Tiwei Bie (2):
net/virtio-user: fix packed vq option parsing
net/virtio-user: fix supported features list

 drivers/net/virtio/virtio_user/virtio_user_dev.c | 14 +++++---------
 drivers/net/virtio/virtio_user_ethdev.c          |  7 ++++---
 2 files changed, 9 insertions(+), 12 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/2 net/virtio-user: fix packed vq option parsing

Add the RING_PACKED feature to dev->unsupported_features when it's disabled, and add the missing packed vq param string. And also revert the unexpected change to MAC option introduced when adding packed vq option.

Fixes 34f3966c7f81 ("net/virtio-user: add option to use packed queues")
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 11 ++++-------
 drivers/net/virtio/virtio_user_ethdev.c          |  7 ++++---
 2 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +4 -7
index 5560bd9a3..e21e3ec3c 100644
@@ -474,17 +474,14 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 					  "packed virtqueues\n");
 			return -1;
 		}
-		dev->device_features |= (1ull << VIRTIO_F_RING_PACKED);
 	} else {
-		dev->device_features &= ~(1ull << VIRTIO_F_RING_PACKED);
+		dev->unsupported_features |= (1ull << VIRTIO_F_RING_PACKED);
 	}
 
-	if (dev->mac_specified) {
-		dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
-	} else {
-		dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);
+	if (dev->mac_specified)
+		dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC);
+	else
 		dev->unsupported_features |= (1ull << VIRTIO_NET_F_MAC);
-	}
 
 	if (cq) {
 		/* device does not really need to know anything about CQ,
drivers/net/virtio/virtio_user_ethdev.c +4 -3
index af2800605..2df6eb695 100644
@@ -361,7 +361,7 @@ static const char *valid_args[] = {
 	VIRTIO_USER_ARG_MRG_RXBUF,
 #define VIRTIO_USER_ARG_IN_ORDER       "in_order"
 	VIRTIO_USER_ARG_IN_ORDER,
-#define VIRTIO_USER_ARG_PACKED_VQ "packed_vq"
+#define VIRTIO_USER_ARG_PACKED_VQ      "packed_vq"
 	VIRTIO_USER_ARG_PACKED_VQ,
 	NULL
 };
@@ -466,11 +466,11 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
 	uint64_t server_mode = VIRTIO_USER_DEF_SERVER_MODE;
 	uint64_t mrg_rxbuf = 1;
 	uint64_t in_order = 1;
+	uint64_t packed_vq = 0;
 	char *path = NULL;
 	char *ifname = NULL;
 	char *mac_addr = NULL;
 	int ret = -1;
-	uint64_t packed_vq = 0;
 
 	kvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_args);
 	if (!kvlist) {
@@ -689,4 +689,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user,
 	"iface=<string> "
 	"server=<0|1> "
 	"mrg_rxbuf=<0|1> "
-	"in_order=<0|1>");
+	"in_order=<0|1> "
+	"packed_vq=<0|1>");
Signature · 1 line
2.17.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] net/virtio-user: fix packed vq option parsing

Quoted 5 lines · Tiwei Bie

Add the RING_PACKED feature to dev->unsupported_features when it's disabled, and add the missing packed vq param string. And also revert the unexpected change to MAC option introduced when adding packed vq option.

Quoted 8 lines
Fixes 34f3966c7f81 ("net/virtio-user: add option to use packed queues")
---
  drivers/net/virtio/virtio_user/virtio_user_dev.c | 11 ++++-------
  drivers/net/virtio/virtio_user_ethdev.c          |  7 ++++---
  2 files changed, 8 insertions(+), 10 deletions(-)

Thanks,
Maxime

author
#3 lore raw

PATCH 2/2 net/virtio-user: fix supported features list

In reply to Tiwei Bie

Currently virtio-user doesn't support event idx.

Fixes aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/virtio/virtio_user/virtio_user_dev.c +1 -2
index e21e3ec3c..b9044faff 100644
@@ -410,8 +410,7 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
 	 1ULL << VIRTIO_NET_F_GUEST_TSO6	|	\
 	 1ULL << VIRTIO_F_IN_ORDER		|	\
 	 1ULL << VIRTIO_F_VERSION_1		|	\
-	 1ULL << VIRTIO_F_RING_PACKED		|	\
-	 1ULL << VIRTIO_RING_F_EVENT_IDX)
+	 1ULL << VIRTIO_F_RING_PACKED)
 
 int
 virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] net/virtio-user: fix supported features list

Quoted 8 lines · Tiwei Bie

Currently virtio-user doesn't support event idx.

Fixes aea29aa5d37b ("net/virtio: enable packed virtqueues by default")
---
  drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

Thanks,
Maxime

#5 lore raw
In reply to Tiwei Bie
Quoted 8 lines · Tiwei Bie

Tiwei Bie (2):
net/virtio-user: fix packed vq option parsing
net/virtio-user: fix supported features list

  drivers/net/virtio/virtio_user/virtio_user_dev.c | 14 +++++---------
  drivers/net/virtio/virtio_user_ethdev.c          |  7 ++++---
  2 files changed, 9 insertions(+), 12 deletions(-)

Applied to dpdk-next-virtio

Thanks,
Maxime