From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ioana Ciocoi Radulescu Subject: RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support Date: Thu, 13 Dec 2018 17:43:16 +0000 Message-ID: References: <1543249591-14563-1-git-send-email-ruxandra.radulescu@nxp.com> <20181205164502.5b11ff7e@redhat.com> <20181207172016.GA21965@apalos> <20181207175135.GA22649@apalos> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Jesper Dangaard Brouer , "netdev@vger.kernel.org" , "davem@davemloft.net" , Ioana Ciornei , "dsahern@gmail.com" , Camelia Alexandra Groza To: Ilias Apalodimas Return-path: Received: from mail-eopbgr20058.outbound.protection.outlook.com ([40.107.2.58]:63935 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728859AbeLMRoD (ORCPT ); Thu, 13 Dec 2018 12:44:03 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: > -----Original Message----- > From: Ioana Ciocoi Radulescu > Sent: Friday, December 7, 2018 8:08 PM > To: 'Ilias Apalodimas' > Cc: Jesper Dangaard Brouer ; > netdev@vger.kernel.org; davem@davemloft.net; Ioana Ciornei > ; dsahern@gmail.com; Camelia Alexandra Groza > > Subject: RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support >=20 > > -----Original Message----- > > From: Ilias Apalodimas > > Sent: Friday, December 7, 2018 7:52 PM > > To: Ioana Ciocoi Radulescu > > Cc: Jesper Dangaard Brouer ; > > netdev@vger.kernel.org; davem@davemloft.net; Ioana Ciornei > > ; dsahern@gmail.com; Camelia Alexandra Groza > > > > Subject: Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support > > > > Hi Ioana, > > > > > > > > > > I only did a quick grep around the driver so i might be missing > something, > > > > but i can only see allocations via napi_alloc_frag(). XDP requires = pages > > > > (either a single page per packet or a driver that does the page > > management > > > > of > > > > its own and fits 2 frames in a single page, assuming 4kb pages). > > > > Am i missing something on the driver? > > > > > > No, I guess I'm the one missing stuff, I didn't realise single page p= er > packet > > > is a hard requirement for XDP. Could you point me to more info on thi= s? > > > > > > > Well if you don't have to use 64kb pages you can use the page_pool API > (only > > used from mlx5 atm) and get the xdp recycling for free. The memory > 'waste' > > for > > 4kb pages isn't too much if the platforms the driver sits on have decen= t > > amounts > > of memory (and the number of descriptors used is not too high). > > We still have work in progress with Jesper (just posted an RFC)with > > improvements > > on the API. > > Using it is fairly straightforward. This is a patchset on marvell's mvn= eta > > driver with the API changes needed: > > https://www.spinics.net/lists/netdev/msg538285.html > > > > If you need 64kb pages you would have to introduce page recycling and > > sharing > > like intel/mlx drivers on your driver. >=20 > Thanks a lot for the info, will look into this. Do you have any pointers > as to why the full page restriction exists in the first place? Sorry if i= t's > a dumb question, but I haven't found details on this and I'd really like > to understand it. After a quick glance, not sure we can use page_pool API. The problem is our driver is not ring-based: we have a single buffer pool used by all Rx queues, so using page_pool allocations would imply adding a layer of synchronization in our driver. I'm still trying to figure out how deep is the trouble we're in for not using single page per packet in our driver, considering we don't support XDP_REDIRECT yet. Guess I'll wait for Jasper's answer for this. Thanks, Ioana