From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BDA2D6C94 for ; Sun, 9 Oct 2016 09:27:15 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 09 Oct 2016 00:27:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,465,1473145200"; d="scan'208";a="1042270039" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 09 Oct 2016 00:27:13 -0700 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Yuanhan Liu Date: Sun, 9 Oct 2016 15:28:00 +0800 Message-Id: <1475998080-4644-8-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1475998080-4644-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1474604007-5221-1-git-send-email-yuanhan.liu@linux.intel.com> <1475998080-4644-1-git-send-email-yuanhan.liu@linux.intel.com> Subject: [dpdk-dev] [PATCH v3 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: Sun, 09 Oct 2016 07:27:16 -0000 Add an option, dequeue-zero-copy, to enable this feature in vhost-pmd. Signed-off-by: Yuanhan Liu Reviewed-by: Maxime Coquelin --- 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 c1d09a0..86c7a4d 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 }; @@ -1132,6 +1134,7 @@ rte_pmd_vhost_probe(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); @@ -1168,6 +1171,16 @@ rte_pmd_vhost_probe(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