mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next 00/12] net: microchip: add FDMA library and use it for Sparx5
@ 2024-09-02 14:54 Daniel Machon
  2024-09-02 14:54 ` [PATCH net-next 01/12] net: microchip: add FDMA library Daniel Machon
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Daniel Machon @ 2024-09-02 14:54 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Lars Povlsen, Steen Hegelund, Horatiu Vultur, UNGLinuxDriver,
	rdunlap, horms
  Cc: linux-kernel, netdev, linux-arm-kernel, Jens Emil Schulz Østergaard

This patch series is the first of a 2-part series, that adds a new
common FDMA library for Microchip switch chips Sparx5 and lan966x. These
chips share the same FDMA engine, and as such will benefit from a
common library with a common implementation.  This also has the benefit
of removing a lot open-coded bookkeeping and duplicate code for the two
drivers.

Additionally, upstreaming efforts for a third chip, lan969x, will begin
in the near future. This chip will use the new library too.

In this first series, the FDMA library is introduced and used by the
Sparx5 switch driver.

 ###################
 # Example of use: #
 ###################

- Initialize the rx and tx fdma structs with values for: number of
  DCB's, number of DB's, channel ID, DB size (data buffer size), and
  total size of the requested memory. Also provide two callbacks:
  nextptr_cb() and dataptr_cb() for getting the nextptr and dataptr.

- Allocate memory using fdma_alloc_phys() or fdma_alloc_coherent().

- Initialize the DCB's with fdma_dcb_init().

- Add new DCB's with fdma_dcb_add().

- Free memory with fdma_free_phys() or fdma_free_coherent().

 #####################
 # Patch  breakdown: #
 #####################

Patch #1:  introduces library and selects it for Sparx5.

Patch #2:  includes the fdma_api.h header and removes old symbols.

Patch #3:  replaces old rx and tx variables with equivalent ones from the
           fdma struct. Only the variables that can be changed without
           breaking traffic is changed in this patch.

Patch #4:  uses the library for allocation of rx buffers. This requires
           quite a bit of refactoring in this single patch.

Patch #5:  uses the library for adding DCB's in the rx path.

Patch #6:  uses the library for freeing rx buffers.

Patch #7:  uses the library helpers in the rx path.

Patch #8:  uses the library for allocation of tx buffers. This requires
           quite a bit of refactoring in this single patch.

Patch #9:  uses the library for adding DCB's in the tx path.

Patch #10: uses the library helpers in the tx path.

Patch #11: ditches the existing linked list for storing buffer addresses,
           and instead uses offsets into contiguous memory.

Patch #12: modifies existing rx and tx functions to be direction
           independent.

To: David S. Miller <davem@davemloft.net>
To: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Lars Povlsen <lars.povlsen@microchip.com>
To: Steen Hegelund <Steen.Hegelund@microchip.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
To: UNGLinuxDriver@microchip.com
To: rdunlap@infradead.org
To: horms@kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
Daniel Machon (12):
      net: microchip: add FDMA library
      net: sparx5: use FDMA library symbols
      net: sparx5: replace a few variables with new equivalent ones
      net: sparx5: use the FDMA library for allocation of rx buffers
      net: sparx5: use FDMA library for adding DCB's in the rx path
      net: sparx5: use library helper for freeing rx buffers
      net: sparx5: use a few FDMA helpers in the rx path
      net: sparx5: use the FDMA library for allocation of tx buffers
      net: sparx5: use FDMA library for adding DCB's in the tx path
      net: sparx5: use library helper for freeing tx buffers
      net: sparx5: use contiguous memory for tx buffers
      net: sparx5: ditch sparx5_fdma_rx/tx_reload() functions

 drivers/net/ethernet/microchip/Kconfig             |   1 +
 drivers/net/ethernet/microchip/Makefile            |   1 +
 drivers/net/ethernet/microchip/fdma/Kconfig        |  18 +
 drivers/net/ethernet/microchip/fdma/Makefile       |   7 +
 drivers/net/ethernet/microchip/fdma/fdma_api.c     | 146 ++++++++
 drivers/net/ethernet/microchip/fdma/fdma_api.h     | 243 +++++++++++++
 drivers/net/ethernet/microchip/sparx5/Kconfig      |   1 +
 drivers/net/ethernet/microchip/sparx5/Makefile     |   1 +
 .../net/ethernet/microchip/sparx5/sparx5_fdma.c    | 382 +++++++--------------
 .../net/ethernet/microchip/sparx5/sparx5_main.h    |  31 +-
 10 files changed, 545 insertions(+), 286 deletions(-)
---
base-commit: 221f9cce949ac8042f65b71ed1fde13b99073256
change-id: 20240902-fdma-sparx5-5a7c0840d23f

Best regards,
-- 
Daniel Machon <daniel.machon@microchip.com>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-09-04 11:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-02 14:54 [PATCH net-next 00/12] net: microchip: add FDMA library and use it for Sparx5 Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 01/12] net: microchip: add FDMA library Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 02/12] net: sparx5: use FDMA library symbols Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 03/12] net: sparx5: replace a few variables with new equivalent ones Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 04/12] net: sparx5: use the FDMA library for allocation of rx buffers Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 05/12] net: sparx5: use FDMA library for adding DCB's in the rx path Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 06/12] net: sparx5: use library helper for freeing rx buffers Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 07/12] net: sparx5: use a few FDMA helpers in the rx path Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 08/12] net: sparx5: use the FDMA library for allocation of tx buffers Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 09/12] net: sparx5: use FDMA library for adding DCB's in the tx path Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 10/12] net: sparx5: use library helper for freeing tx buffers Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 11/12] net: sparx5: use contiguous memory for " Daniel Machon
2024-09-02 14:54 ` [PATCH net-next 12/12] net: sparx5: ditch sparx5_fdma_rx/tx_reload() functions Daniel Machon
2024-09-04 11:00 ` [PATCH net-next 00/12] net: microchip: add FDMA library and use it for Sparx5 patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®