From patchwork Thu Jan 3 02:40:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 49392 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 825BC1B20B; Thu, 3 Jan 2019 03:42:38 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2E4D41B101 for ; Thu, 3 Jan 2019 03:42:37 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2019 18:42:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,433,1539673200"; d="scan'208";a="288431824" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by orsmga005.jf.intel.com with ESMTP; 02 Jan 2019 18:42:35 -0800 From: Tiwei Bie To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Date: Thu, 3 Jan 2019 10:40:06 +0800 Message-Id: <20190103024007.18007-2-tiwei.bie@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190103024007.18007-1-tiwei.bie@intel.com> References: <20190103024007.18007-1-tiwei.bie@intel.com> Subject: [dpdk-dev] [PATCH 1/2] net/virtio-user: fix packed vq option parsing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Reviewed-by: Maxime Coquelin --- 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= " "server=<0|1> " "mrg_rxbuf=<0|1> " - "in_order=<0|1>"); + "in_order=<0|1> " + "packed_vq=<0|1>"); From patchwork Thu Jan 3 02:40:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiwei Bie X-Patchwork-Id: 49393 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C5C11B296; Thu, 3 Jan 2019 03:42:40 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 25E781B217 for ; Thu, 3 Jan 2019 03:42:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2019 18:42:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,433,1539673200"; d="scan'208";a="288431844" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by orsmga005.jf.intel.com with ESMTP; 02 Jan 2019 18:42:37 -0800 From: Tiwei Bie To: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Date: Thu, 3 Jan 2019 10:40:07 +0800 Message-Id: <20190103024007.18007-3-tiwei.bie@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190103024007.18007-1-tiwei.bie@intel.com> References: <20190103024007.18007-1-tiwei.bie@intel.com> Subject: [dpdk-dev] [PATCH 2/2] net/virtio-user: fix supported features list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently virtio-user doesn't support event idx. Fixes: aea29aa5d37b ("net/virtio: enable packed virtqueues by default") Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index e21e3ec3c..b9044faff 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -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,