]> git.dujemihanovic.xyz Git - linux.git/commit
net: lan966x: use the FDMA library for allocation of rx buffers
authorDaniel Machon <daniel.machon@microchip.com>
Thu, 5 Sep 2024 08:06:32 +0000 (10:06 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Sep 2024 09:04:16 +0000 (11:04 +0200)
commit01a70754327bd628610587b6b7ae5efe2a5e7d1c
tree422fcb876f3beb131c8839425e79951c28688425
parent8274d40eafa37b570ad7be8b7fe5fe507509c153
net: lan966x: use the FDMA library for allocation of rx buffers

Use the two functions: fdma_alloc_phys() and fdma_dcb_init() for rx
buffer allocation and use the new buffers throughout.

In order to replace the old buffers with the new ones, we have to do the
following refactoring:

    - use fdma_alloc_phys() and fdma_dcb_init()

    - replace the variables: rx->dma, rx->dcbs and rx->last_entry
      with the equivalents from the FDMA struct.

    - make use of fdma->db_size for rx buffer size.

    - add lan966x_fdma_rx_dataptr_cb callback for obtaining the dataptr.

    - Initialize FDMA struct values.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
drivers/net/ethernet/microchip/lan966x/lan966x_main.h