From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v7 5/5] net/af_xdp: enable zero copy Date: Thu, 28 Mar 2019 18:44:40 +0000 Message-ID: <3ddb4454-9e95-6757-9ccc-8ca7b3132803@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190327090027.72170-1-xiaolong.ye@intel.com> <20190327090027.72170-6-xiaolong.ye@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Luca Boccassi , Bruce Richardson , Ananyev Konstantin To: Xiaolong Ye , dev@dpdk.org, David Marchand , Andrew Rybchenko Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5CD8B4C8D for ; Thu, 28 Mar 2019 19:44:45 +0100 (CET) In-Reply-To: <20190327090027.72170-6-xiaolong.ye@intel.com> Content-Language: en-US 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 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' ??