DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tiwei Bie <tiwei.bie@intel.com>
To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] net/virtio-user: fix packed vq option parsing
Date: Thu,  3 Jan 2019 10:40:06 +0800	[thread overview]
Message-ID: <20190103024007.18007-2-tiwei.bie@intel.com> (raw)
In-Reply-To: <20190103024007.18007-1-tiwei.bie@intel.com>

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")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 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(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 5560bd9a3..e21e3ec3c 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -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,
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index af2800605..2df6eb695 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -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>");
-- 
2.17.1

  reply	other threads:[~2019-01-03  2:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  2:40 [dpdk-dev] [PATCH 0/2] Some fixes for virtio-user/packed-ring Tiwei Bie
2019-01-03  2:40 ` Tiwei Bie [this message]
2019-01-03  9:52   ` [dpdk-dev] [PATCH 1/2] net/virtio-user: fix packed vq option parsing Maxime Coquelin
2019-01-03  2:40 ` [dpdk-dev] [PATCH 2/2] net/virtio-user: fix supported features list Tiwei Bie
2019-01-03  9:53   ` Maxime Coquelin
2019-01-04 18:00 ` [dpdk-dev] [PATCH 0/2] Some fixes for virtio-user/packed-ring Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190103024007.18007-2-tiwei.bie@intel.com \
    --to=tiwei.bie@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).