mbox series

[net-next,v3,00/12] net: dpaa2-eth: AF_XDP zero-copy support

Message ID 20221018141901.147965-1-ioana.ciornei@nxp.com (mailing list archive)
Headers show
Series net: dpaa2-eth: AF_XDP zero-copy support | expand

Message

Ioana Ciornei Oct. 18, 2022, 2:18 p.m. UTC
This patch set adds support for AF_XDP zero-copy in the dpaa2-eth
driver. The support is available on the LX2160A SoC and its variants and
only on interfaces (DPNIs) with a maximum of 8 queues (HW limitations
are the root cause).

We are first implementing the .get_channels() callback since this a
dependency for further work.

Patches 2-3 are working on making the necessary changes for multiple
buffer pools on a single interface. By default, without an AF_XDP socket
attached, only a single buffer pool will be used and shared between all
the queues. The changes in the functions are made in this patch, but the
actual allocation and setup of a new BP is done in patch#10.

Patches 4-5 are improving the information exposed in debugfs. We are
exposing a new file to show which buffer pool is used by what channels
and how many buffers it currently has.

The 6th patch updates the dpni_set_pools() firmware API so that we are
capable of setting up a different buffer per queue in later patches.

In the 7th patch the generic dev_open/close APIs are used instead of the
dpaa2-eth internal ones.

Patches 8-9 are rearranging the existing code in dpaa2-eth.c in order to
create new functions which will be used in the XSK implementation in
dpaa2-xsk.c

Finally, the last 3 patches are adding the actual support for both the
Rx and Tx path of AF_XDP zero-copy and some associated tracepoints.
Details on the implementation can be found in the actual patch.

Changes in v2:
 - 3/12:  Export dpaa2_eth_allocate_dpbp/dpaa2_eth_free_dpbp in this
   patch to avoid a build warning. The functions will be used in next
   patches.
 - 6/12:  Use __le16 instead of u16 for the dpbp_id field.
 - 12/12: Use xdp_buff->data_hard_start when tracing the BP seeding.

Changes in v3:
 - 3/12: fix leaking of bp on error path

Ioana Ciornei (4):
  net: dpaa2-eth: rearrange variable in dpaa2_eth_get_ethtool_stats
  net: dpaa2-eth: export the CH#<index> in the 'ch_stats' debug file
  net: dpaa2-eth: export buffer pool info into a new debugfs file
  net: dpaa2-eth: use dev_close/open instead of the internal functions

Robert-Ionut Alexa (8):
  net: dpaa2-eth: add support to query the number of queues through
    ethtool
  net: dpaa2-eth: add support for multiple buffer pools per DPNI
  net: dpaa2-eth: update the dpni_set_pools() API to support per QDBIN
    pools
  net: dpaa2-eth: create and export the dpaa2_eth_alloc_skb function
  net: dpaa2-eth: create and export the dpaa2_eth_receive_skb() function
  net: dpaa2-eth: AF_XDP RX zero copy support
  net: dpaa2-eth: AF_XDP TX zero copy support
  net: dpaa2-eth: add trace points on XSK events

 MAINTAINERS                                   |   1 +
 drivers/net/ethernet/freescale/dpaa2/Makefile |   2 +-
 .../freescale/dpaa2/dpaa2-eth-debugfs.c       |  57 +-
 .../freescale/dpaa2/dpaa2-eth-trace.h         | 142 +++--
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 487 ++++++++++++------
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.h  | 101 +++-
 .../ethernet/freescale/dpaa2/dpaa2-ethtool.c  |  58 ++-
 .../net/ethernet/freescale/dpaa2/dpaa2-xsk.c  | 454 ++++++++++++++++
 .../net/ethernet/freescale/dpaa2/dpni-cmd.h   |  19 +-
 drivers/net/ethernet/freescale/dpaa2/dpni.c   |   6 +-
 drivers/net/ethernet/freescale/dpaa2/dpni.h   |   9 +
 11 files changed, 1094 insertions(+), 242 deletions(-)
 create mode 100644 drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c

Comments

Jakub Kicinski Oct. 19, 2022, 10:54 p.m. UTC | #1
On Tue, 18 Oct 2022 17:18:49 +0300 Ioana Ciornei wrote:
> This patch set adds support for AF_XDP zero-copy in the dpaa2-eth
> driver. The support is available on the LX2160A SoC and its variants and
> only on interfaces (DPNIs) with a maximum of 8 queues (HW limitations
> are the root cause).

AF_XDP folks, could you take a look?
Björn Töpel Oct. 20, 2022, 1:02 p.m. UTC | #2
Jakub Kicinski <kuba@kernel.org> writes:

> On Tue, 18 Oct 2022 17:18:49 +0300 Ioana Ciornei wrote:
>> This patch set adds support for AF_XDP zero-copy in the dpaa2-eth
>> driver. The support is available on the LX2160A SoC and its variants and
>> only on interfaces (DPNIs) with a maximum of 8 queues (HW limitations
>> are the root cause).
>
> AF_XDP folks, could you take a look? 

Sorry for the delay, Ioana and Jakub! We'll make sure it's reviewed, but
it might take a few more days!


Björn
Björn Töpel Oct. 23, 2022, 6:52 p.m. UTC | #3
Ioana Ciornei <ioana.ciornei@nxp.com> writes:

> This patch set adds support for AF_XDP zero-copy in the dpaa2-eth
> driver. The support is available on the LX2160A SoC and its variants and
> only on interfaces (DPNIs) with a maximum of 8 queues (HW limitations
> are the root cause).
>
> We are first implementing the .get_channels() callback since this a
> dependency for further work.
>
> Patches 2-3 are working on making the necessary changes for multiple
> buffer pools on a single interface. By default, without an AF_XDP socket
> attached, only a single buffer pool will be used and shared between all
> the queues. The changes in the functions are made in this patch, but the
> actual allocation and setup of a new BP is done in patch#10.
>
> Patches 4-5 are improving the information exposed in debugfs. We are
> exposing a new file to show which buffer pool is used by what channels
> and how many buffers it currently has.
>
> The 6th patch updates the dpni_set_pools() firmware API so that we are
> capable of setting up a different buffer per queue in later patches.
>
> In the 7th patch the generic dev_open/close APIs are used instead of the
> dpaa2-eth internal ones.
>
> Patches 8-9 are rearranging the existing code in dpaa2-eth.c in order to
> create new functions which will be used in the XSK implementation in
> dpaa2-xsk.c
>
> Finally, the last 3 patches are adding the actual support for both the
> Rx and Tx path of AF_XDP zero-copy and some associated tracepoints.
> Details on the implementation can be found in the actual patch.
>
> Changes in v2:
>  - 3/12:  Export dpaa2_eth_allocate_dpbp/dpaa2_eth_free_dpbp in this
>    patch to avoid a build warning. The functions will be used in next
>    patches.
>  - 6/12:  Use __le16 instead of u16 for the dpbp_id field.
>  - 12/12: Use xdp_buff->data_hard_start when tracing the BP seeding.
>
> Changes in v3:
>  - 3/12: fix leaking of bp on error path
>

Again, sorry about the feedback delay.

I don't have access to the hardware, so I mostly glossed over the
patches that didn't touch AF_XDP directly.

The series looks clean, and is easy to follow. The XSK pool usage looks
correct. Awesome to see yet another AF_XDP capable driver!

Feel free to add:
Acked-by: Björn Töpel <bjorn@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 24, 2022, 8:30 a.m. UTC | #4
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 18 Oct 2022 17:18:49 +0300 you wrote:
> This patch set adds support for AF_XDP zero-copy in the dpaa2-eth
> driver. The support is available on the LX2160A SoC and its variants and
> only on interfaces (DPNIs) with a maximum of 8 queues (HW limitations
> are the root cause).
> 
> We are first implementing the .get_channels() callback since this a
> dependency for further work.
> 
> [...]

Here is the summary with links:
  - [net-next,v3,01/12] net: dpaa2-eth: add support to query the number of queues through ethtool
    https://git.kernel.org/netdev/net-next/c/14e493ddc341
  - [net-next,v3,02/12] net: dpaa2-eth: rearrange variable in dpaa2_eth_get_ethtool_stats
    https://git.kernel.org/netdev/net-next/c/331320682767
  - [net-next,v3,03/12] net: dpaa2-eth: add support for multiple buffer pools per DPNI
    https://git.kernel.org/netdev/net-next/c/095174dafc74
  - [net-next,v3,04/12] net: dpaa2-eth: export the CH#<index> in the 'ch_stats' debug file
    https://git.kernel.org/netdev/net-next/c/96b44697e53a
  - [net-next,v3,05/12] net: dpaa2-eth: export buffer pool info into a new debugfs file
    https://git.kernel.org/netdev/net-next/c/b1dd9bf6ead8
  - [net-next,v3,06/12] net: dpaa2-eth: update the dpni_set_pools() API to support per QDBIN pools
    https://git.kernel.org/netdev/net-next/c/801c76dd067c
  - [net-next,v3,07/12] net: dpaa2-eth: use dev_close/open instead of the internal functions
    https://git.kernel.org/netdev/net-next/c/e3caeb2ddbf2
  - [net-next,v3,08/12] net: dpaa2-eth: create and export the dpaa2_eth_alloc_skb function
    https://git.kernel.org/netdev/net-next/c/129902a351bf
  - [net-next,v3,09/12] net: dpaa2-eth: create and export the dpaa2_eth_receive_skb() function
    https://git.kernel.org/netdev/net-next/c/ee2a3bdef94b
  - [net-next,v3,10/12] net: dpaa2-eth: AF_XDP RX zero copy support
    https://git.kernel.org/netdev/net-next/c/48276c08cf5d
  - [net-next,v3,11/12] net: dpaa2-eth: AF_XDP TX zero copy support
    https://git.kernel.org/netdev/net-next/c/4a7f6c5ac9e5
  - [net-next,v3,12/12] net: dpaa2-eth: add trace points on XSK events
    https://git.kernel.org/netdev/net-next/c/3817b2ac71de

You are awesome, thank you!