mbox series

[net-next,00/12] net: lan966x: use the newly introduced FDMA library

Message ID 20240905-fdma-lan966x-v1-0-e083f8620165@microchip.com (mailing list archive)
Headers show
Series net: lan966x: use the newly introduced FDMA library | expand

Message

Daniel Machon Sept. 5, 2024, 8:06 a.m. UTC
This patch series is the second of a 2-part series [1], 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 of open-coded bookkeeping and duplicate code for the two
drivers.

In this second series, the FDMA library will be taken into use by the
lan966x 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:  select FDMA library for lan966x.

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 for allocation of tx buffers. This requires
           quite a bit of refactoring in this single patch.

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

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

Patch #10: ditch last_in_use variable and use library instead.

Patch #11: uses library helpers throughout.

Patch #12: refactor lan966x_fdma_reload() function.

[1] https://lore.kernel.org/netdev/20240902-fdma-sparx5-v1-0-1e7d5e5a9f34@microchip.com/

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
Daniel Machon (12):
      net: lan966x: select FDMA library
      net: lan966x: use FDMA library symbols
      net: lan966x: replace a few variables with new equivalent ones
      net: lan966x: use the FDMA library for allocation of rx buffers
      net: lan966x: use FDMA library for adding DCB's in the rx path
      net: lan966x: use library helper for freeing rx buffers
      net: lan966x: use the FDMA library for allocation of tx buffers
      net: lan966x: use FDMA library for adding DCB's in the tx path
      net: lan966x: use library helper for freeing tx buffers
      net: lan966x: ditch tx->last_in_use variable
      net: lan966x: use a few FDMA helpers throughout
      net: lan966x: refactor buffer reload function

 drivers/net/ethernet/microchip/lan966x/Kconfig     |   1 +
 drivers/net/ethernet/microchip/lan966x/Makefile    |   1 +
 .../net/ethernet/microchip/lan966x/lan966x_fdma.c  | 409 ++++++++-------------
 .../net/ethernet/microchip/lan966x/lan966x_main.h  |  58 +--
 4 files changed, 164 insertions(+), 305 deletions(-)
---
base-commit: ff09bc366fc45861b35dfeac97baadee16f65aec
change-id: 20240904-fdma-lan966x-04281c53952b

Best regards,

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 10, 2024, 9:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Thu, 5 Sep 2024 10:06:28 +0200 you wrote:
> This patch series is the second of a 2-part series [1], 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 of open-coded bookkeeping and duplicate code for the two
> drivers.
> 
> [...]

Here is the summary with links:
  - [net-next,01/12] net: lan966x: select FDMA library
    https://git.kernel.org/netdev/net-next/c/63acda75801f
  - [net-next,02/12] net: lan966x: use FDMA library symbols
    https://git.kernel.org/netdev/net-next/c/1dfe4ca8cb4a
  - [net-next,03/12] net: lan966x: replace a few variables with new equivalent ones
    https://git.kernel.org/netdev/net-next/c/8274d40eafa3
  - [net-next,04/12] net: lan966x: use the FDMA library for allocation of rx buffers
    https://git.kernel.org/netdev/net-next/c/01a70754327b
  - [net-next,05/12] net: lan966x: use FDMA library for adding DCB's in the rx path
    https://git.kernel.org/netdev/net-next/c/2b5a09e67b72
  - [net-next,06/12] net: lan966x: use library helper for freeing rx buffers
    https://git.kernel.org/netdev/net-next/c/f51293b3ea89
  - [net-next,07/12] net: lan966x: use the FDMA library for allocation of tx buffers
    https://git.kernel.org/netdev/net-next/c/df2ddc1458c3
  - [net-next,08/12] net: lan966x: use FDMA library for adding DCB's in the tx path
    https://git.kernel.org/netdev/net-next/c/29cc3a66a81d
  - [net-next,09/12] net: lan966x: use library helper for freeing tx buffers
    https://git.kernel.org/netdev/net-next/c/8cdd0bd02283
  - [net-next,10/12] net: lan966x: ditch tx->last_in_use variable
    https://git.kernel.org/netdev/net-next/c/c06fef96c7d5
  - [net-next,11/12] net: lan966x: use a few FDMA helpers throughout
    https://git.kernel.org/netdev/net-next/c/9fbc5719f6aa
  - [net-next,12/12] net: lan966x: refactor buffer reload function
    https://git.kernel.org/netdev/net-next/c/89ba464fcf54

You are awesome, thank you!