From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ye Xiaolong Subject: Re: [PATCH v7 5/5] net/af_xdp: enable zero copy Date: Fri, 29 Mar 2019 09:53:28 +0800 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=us-ascii Cc: dev@dpdk.org, David Marchand , Andrew Rybchenko , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Luca Boccassi , Bruce Richardson , Ananyev Konstantin To: Ferruh Yigit Return-path: 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) Content-Disposition: inline In-Reply-To: <3ddb4454-9e95-6757-9ccc-8ca7b3132803@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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