From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 180AAA0679 for ; Fri, 29 Mar 2019 02:58:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 052232C19; Fri, 29 Mar 2019 02:58:04 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 42C382BF4 for ; Fri, 29 Mar 2019 02:58:02 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2019 18:58:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,282,1549958400"; d="scan'208";a="146195250" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga002.jf.intel.com with ESMTP; 28 Mar 2019 18:57:58 -0700 Date: Fri, 29 Mar 2019 09:53:28 +0800 From: Ye Xiaolong To: Ferruh Yigit Cc: dev@dpdk.org, David Marchand , Andrew Rybchenko , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Luca Boccassi , Bruce Richardson , Ananyev Konstantin Message-ID: <20190329015328.GA92946@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190327090027.72170-1-xiaolong.ye@intel.com> <20190327090027.72170-6-xiaolong.ye@intel.com> <3ddb4454-9e95-6757-9ccc-8ca7b3132803@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <3ddb4454-9e95-6757-9ccc-8ca7b3132803@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v7 5/5] net/af_xdp: enable zero copy 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" Message-ID: <20190329015328.LA_uCFGbbm0wT-0ZiXwr5UiF9Cq48hQHgPDO0-S7OVU@z> On 03/28, Ferruh Yigit wrote: >On 3/27/2019 9:00 AM, Xiaolong Ye wrote: >> Try to check if external mempool (from rx_queue_setup) is fit for >> af_xdp, if it is, it will be registered to af_xdp socket directly and >> there will be no packet data copy on Rx and Tx. >> >> Signed-off-by: Xiaolong Ye >> --- >> drivers/net/af_xdp/rte_eth_af_xdp.c | 130 ++++++++++++++++++++-------- >> 1 file changed, 96 insertions(+), 34 deletions(-) >> >> diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c >> index a1fda9212..c6ade4c94 100644 >> --- a/drivers/net/af_xdp/rte_eth_af_xdp.c >> +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c >> @@ -67,6 +67,7 @@ struct xsk_umem_info { >> struct xsk_umem *umem; >> struct rte_mempool *mb_pool; >> void *buffer; >> + uint8_t zc; >> }; >> >> struct rx_stats { >> @@ -85,6 +86,7 @@ struct pkt_rx_queue { >> >> struct pkt_tx_queue *pair; >> uint16_t queue_idx; >> + uint8_t zc; >> }; >> >> struct tx_stats { > ><...> > >> @@ -630,6 +685,13 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, >> >> internals->umem = rxq->umem; >> >> + if (mb_pool == internals->umem->mb_pool) >> + rxq->zc = internals->umem->zc; >> + >> + if (rxq->zc) >> + AF_XDP_LOG(INFO, >> + "zero copy enabled on rx queue %d\n", rx_queue_id); >> + > >The "zero copy" implemented in this patch, also the variable 'zc', is from >'af_xdp' umem to mbuf data via versa copy, right? >There is also another "zero copy" support in af_xdp, device to buffers... >Do you think can these be confused with each other, should we have another log >message and variable name for this one? >Indeed I can't think of a good name, but something like, "pmd/driver zero copy" >& 'pmd_zc' ?? That's a good suggestion, will adopt it. Thanks, Xiaolong