RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-07 Thread Ioana Ciocoi Radulescu
> -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; da...@davemloft.net; Ioana Ciornei
> ; dsah...@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 per 
> > packet
> > is a hard requirement for XDP. Could you point me to more info on this?
> >
> 
> 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 decent
> 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 mvneta
> 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.

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 it's
a dumb question, but I haven't found details on this and I'd really like
to understand it.

Thanks
Ioana


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-07 Thread Ilias Apalodimas
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 per packet
> is a hard requirement for XDP. Could you point me to more info on this?
> 

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 decent 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 mvneta
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.

/Ilias


RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-07 Thread Ioana Ciocoi Radulescu



> -Original Message-
> From: Ilias Apalodimas 
> Sent: Friday, December 7, 2018 7:20 PM
> To: Ioana Ciocoi Radulescu 
> Cc: Jesper Dangaard Brouer ;
> netdev@vger.kernel.org; da...@davemloft.net; Ioana Ciornei
> ; dsah...@gmail.com; Camelia Alexandra Groza
> 
> Subject: Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support
> 
> Hi Ioana,
> > >
> > > > Add support for XDP programs. Only XDP_PASS, XDP_DROP and
> XDP_TX
> > > > actions are supported for now. Frame header changes are also
> > > > allowed.
> 
> 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 per packet
is a hard requirement for XDP. Could you point me to more info on this?

Thanks,
Ioana

> 
> > >
> > > Do you have any XDP performance benchmarks on this hardware?
> >
> > We have some preliminary perf data that doesn't look great,
> > but we hope to improve it :)
> 
> As Jesper said we are doing similar work on a cortex a-53 and plan to work on
> a-72 as well. We might be able to help out.
> 
> /Ilias


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-07 Thread Ilias Apalodimas
Hi Ioana,
> > 
> > > Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
> > > actions are supported for now. Frame header changes are also
> > > allowed.

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? 

> > 
> > Do you have any XDP performance benchmarks on this hardware?
> 
> We have some preliminary perf data that doesn't look great,
> but we hope to improve it :)

As Jesper said we are doing similar work on a cortex a-53 and plan to work on
a-72 as well. We might be able to help out.

/Ilias


RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-07 Thread Ioana Ciocoi Radulescu
> -Original Message-
> From: Jesper Dangaard Brouer 
> Sent: Wednesday, December 5, 2018 5:45 PM
> To: Ioana Ciocoi Radulescu 
> Cc: bro...@redhat.com; netdev@vger.kernel.org; da...@davemloft.net;
> Ioana Ciornei ; dsah...@gmail.com; Camelia
> Alexandra Groza ; Ilias Apalodimas
> 
> Subject: Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support
> 
> On Mon, 26 Nov 2018 16:27:28 +
> Ioana Ciocoi Radulescu  wrote:
> 
> > Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
> > actions are supported for now. Frame header changes are also
> > allowed.
> 
> Do you have any XDP performance benchmarks on this hardware?

We have some preliminary perf data that doesn't look great,
but we hope to improve it :)

On a LS2088A with A72 cores @2GHz (numbers in Mpps):
1core   8cores
-
XDP_DROP (no touching data) 5.6829.6 (linerate)
XDP_DROP (xdp1 sample)  3.4625.18
XDP_TX(xdp2 sample) 1.7113.26

For comparison, plain IP forwarding through the stack
is currently around 0.5Mpps (1c) / 3.8Mpps (8c).

>
> Also what boards (and arch's) are using this dpaa2-eth driver?

Currently supported LS2088A, LS1088A, soon LX2160A (all with
ARM64 cores).

> Any devel board I can buy?

I should have an answer for this early next week and will
get back to you.

Thanks,
Ioana

> 
> 
> p.s. Ilias and I are coding up page_pool and XDP support for Marvell
> mvneta driver, which is avail on a number of avail boards, see here[1]
> 
> [1]
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit
> hub.com%2Fxdp-project%2Fxdp-
> project%2Fblob%2Fmaster%2Fareas%2Farm64%2Farm01_selecting_hardwar
> e.orgdata=02%7C01%7Cruxandra.radulescu%40nxp.com%7C546868ba
> aa074902ded608d65ac8a594%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7
> C0%7C636796215148994553sdata=za6xUoIrv2jo%2BbvuKjXfpOXeQ3tw
> 96bZZzRB2Vny1iw%3Dreserved=0
> --
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn:
> https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fww
> w.linkedin.com%2Fin%2Fbrouerdata=02%7C01%7Cruxandra.radulescu
> %40nxp.com%7C546868baaa074902ded608d65ac8a594%7C686ea1d3bc2b4c6f
> a92cd99c5c301635%7C0%7C0%7C636796215148994553sdata=vTe2jd3V
> FXUpEVPLkbGN6i2OyyPfhQ9HacCaPZbm%2Bk8%3Dreserved=0


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-12-05 Thread Jesper Dangaard Brouer
On Mon, 26 Nov 2018 16:27:28 +
Ioana Ciocoi Radulescu  wrote:

> Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
> actions are supported for now. Frame header changes are also
> allowed.

Do you have any XDP performance benchmarks on this hardware?

Also what boards (and arch's) are using this dpaa2-eth driver?
Any devel board I can buy?


p.s. Ilias and I are coding up page_pool and XDP support for Marvell
mvneta driver, which is avail on a number of avail boards, see here[1]

[1] 
https://github.com/xdp-project/xdp-project/blob/master/areas/arm64/arm01_selecting_hardware.org
-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-11-28 Thread David Miller
From: Ioana Ciocoi Radulescu 
Date: Wed, 28 Nov 2018 09:18:28 +

> They apply cleanly for me.

I figured out what happend.

The patches were mis-ordered (specifically patches #3 and #4) when I added
them to the patchwork bundle, and that is what causes them to fail.

Series applied, thanks!


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-11-28 Thread David Ahern
On 11/28/18 2:18 AM, Ioana Ciocoi Radulescu wrote:
>> -Original Message-
>> From: David Miller 
>> Sent: Wednesday, November 28, 2018 2:25 AM
>> To: Ioana Ciocoi Radulescu 
>> Cc: netdev@vger.kernel.org; Ioana Ciornei ;
>> dsah...@gmail.com; Camelia Alexandra Groza 
>> Subject: Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support
>>
>> From: Ioana Ciocoi Radulescu 
>> Date: Mon, 26 Nov 2018 16:27:28 +
>>
>>> Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
>>> actions are supported for now. Frame header changes are also
>>> allowed.
>>>
>>> v2: - count the XDP packets in the rx/tx inteface stats
>>> - add message with the maximum supported MTU value for XDP
>>
>> This doesn't apply cleanly to net-next.
>>
>> Could you please do a quick respin so I can apply this?
> 
> They apply cleanly for me. To doublecheck, I've downloaded the mbox
> patches from patchwork and applied them on net-next.git, master branch
> (commit 86d1d8b72c).
> I'm obviously doing something wrong, but I don't know what.

same here. All patches applied cleanly to net-next.


RE: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-11-28 Thread Ioana Ciocoi Radulescu
> -Original Message-
> From: David Miller 
> Sent: Wednesday, November 28, 2018 2:25 AM
> To: Ioana Ciocoi Radulescu 
> Cc: netdev@vger.kernel.org; Ioana Ciornei ;
> dsah...@gmail.com; Camelia Alexandra Groza 
> Subject: Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support
> 
> From: Ioana Ciocoi Radulescu 
> Date: Mon, 26 Nov 2018 16:27:28 +
> 
> > Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
> > actions are supported for now. Frame header changes are also
> > allowed.
> >
> > v2: - count the XDP packets in the rx/tx inteface stats
> > - add message with the maximum supported MTU value for XDP
> 
> This doesn't apply cleanly to net-next.
> 
> Could you please do a quick respin so I can apply this?

They apply cleanly for me. To doublecheck, I've downloaded the mbox
patches from patchwork and applied them on net-next.git, master branch
(commit 86d1d8b72c).
I'm obviously doing something wrong, but I don't know what.

Thanks,
Ioana


Re: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-11-27 Thread David Miller
From: Ioana Ciocoi Radulescu 
Date: Mon, 26 Nov 2018 16:27:28 +

> Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
> actions are supported for now. Frame header changes are also
> allowed.
> 
> v2: - count the XDP packets in the rx/tx inteface stats
> - add message with the maximum supported MTU value for XDP

This doesn't apply cleanly to net-next.

Could you please do a quick respin so I can apply this?

Thanks!


[PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support

2018-11-26 Thread Ioana Ciocoi Radulescu
Add support for XDP programs. Only XDP_PASS, XDP_DROP and XDP_TX
actions are supported for now. Frame header changes are also
allowed.

v2: - count the XDP packets in the rx/tx inteface stats
- add message with the maximum supported MTU value for XDP

Ioana Radulescu (8):
  dpaa2-eth: Add basic XDP support
  dpaa2-eth: Allow XDP header adjustments
  dpaa2-eth: Move function
  dpaa2-eth: Release buffers back to pool on XDP_DROP
  dpaa2-eth: Map Rx buffers as bidirectional
  dpaa2-eth: Add support for XDP_TX
  dpaa2-eth: Cleanup channel stats
  dpaa2-eth: Add xdp counters

 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c   | 349 +++--
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h   |  20 +-
 .../net/ethernet/freescale/dpaa2/dpaa2-ethtool.c   |  19 +-
 3 files changed, 350 insertions(+), 38 deletions(-)

-- 
2.7.4