From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 6C4DD68E8 for ; Fri, 23 Sep 2016 06:13:06 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP; 22 Sep 2016 21:13:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,380,1470726000"; d="scan'208";a="12384606" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga005.fm.intel.com with ESMTP; 22 Sep 2016 21:13:04 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Yuanhan Liu Date: Fri, 23 Sep 2016 12:13:27 +0800 Message-Id: <1474604007-5221-8-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1474604007-5221-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1471939839-29778-1-git-send-email-yuanhan.liu@linux.intel.com> <1474604007-5221-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v2 7/7] net/vhost: add an option to enable dequeue zero copy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Sep 2016 04:13:06 -0000 Add an option, dequeue-zero-copy, to enable this feature in vhost-pmd. Signed-off-by: Yuanhan Liu --- drivers/net/vhost/rte_eth_vhost.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 7539cd4..61b3dfc 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -51,6 +51,7 @@ #define ETH_VHOST_IFACE_ARG "iface" #define ETH_VHOST_QUEUES_ARG "queues" #define ETH_VHOST_CLIENT_ARG "client" +#define ETH_VHOST_DEQUEUE_ZERO_COPY "dequeue-zero-copy" static const char *drivername = "VHOST PMD"; @@ -58,6 +59,7 @@ static const char *valid_arguments[] = { ETH_VHOST_IFACE_ARG, ETH_VHOST_QUEUES_ARG, ETH_VHOST_CLIENT_ARG, + ETH_VHOST_DEQUEUE_ZERO_COPY, NULL }; @@ -831,6 +833,7 @@ rte_pmd_vhost_devinit(const char *name, const char *params) uint16_t queues; uint64_t flags = 0; int client_mode = 0; + int dequeue_zero_copy = 0; RTE_LOG(INFO, PMD, "Initializing pmd_vhost for %s\n", name); @@ -867,6 +870,16 @@ rte_pmd_vhost_devinit(const char *name, const char *params) flags |= RTE_VHOST_USER_CLIENT; } + if (rte_kvargs_count(kvlist, ETH_VHOST_DEQUEUE_ZERO_COPY) == 1) { + ret = rte_kvargs_process(kvlist, ETH_VHOST_DEQUEUE_ZERO_COPY, + &open_int, &dequeue_zero_copy); + if (ret < 0) + goto out_free; + + if (dequeue_zero_copy) + flags |= RTE_VHOST_USER_DEQUEUE_ZERO_COPY; + } + eth_dev_vhost_create(name, iface_name, queues, rte_socket_id(), flags); out_free: -- 1.9.0