]> www.infradead.org Git - users/dwmw2/linux.git/commit
net: lan969x: add FDMA implementation
authorDaniel Machon <daniel.machon@microchip.com>
Mon, 13 Jan 2025 19:36:09 +0000 (20:36 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 22:13:33 +0000 (14:13 -0800)
commitd84ad2c0d80c3ee1b7d758e2c07d043fcf32d568
tree85235f0984d2a15b542393e0844ea0e6e99cbcdf
parent56143c52a342d0333a9b5ba12bc16dd071a1af5b
net: lan969x: add FDMA implementation

The lan969x switch device supports manual frame injection and extraction
to and from the switch core, using a number of injection and extraction
queues.  This technique is currently supported, but delivers poor
performance compared to Frame DMA (FDMA).

This lan969x implementation of FDMA, hooks into the existing FDMA for
Sparx5, but requires its own RX and TX handling, as lan969x does not
support the same native cache coherency that Sparx5 does. Effectively,
this means that we are going to use the DMA mapping API for mapping and
unmapping TX buffers. The RX loop will utilize the page pool API for
efficient RX handling. Other than that, the implementation is largely
the same, and utilizes the FDMA library for DCB and DB handling.

Some numbers:

Manual injection/extraction (before this series):

// iperf3 -c 1.0.1.1

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.02  sec   345 MBytes   289 Mbits/sec  sender
[  5]   0.00-10.06  sec   345 MBytes   288 Mbits/sec  receiver

FDMA (after this series):

// iperf3 -c 1.0.1.1

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.03  sec  1.10 GBytes   940 Mbits/sec  sender
[  5]   0.00-10.07  sec  1.10 GBytes   936 Mbits/sec  receiver

Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20250113-sparx5-lan969x-switch-driver-5-v2-5-c468f02fd623@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/sparx5/Kconfig
drivers/net/ethernet/microchip/sparx5/Makefile
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.h
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c [new file with mode: 0644]
drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c
drivers/net/ethernet/microchip/sparx5/sparx5_main.h
drivers/net/ethernet/microchip/sparx5/sparx5_packet.c