net: stmmac: rearrange RX buffer allocation and free functions
authorOng Boon Leong <boon.leong.ong@intel.com>
Tue, 13 Apr 2021 09:36:20 +0000 (17:36 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Apr 2021 22:06:50 +0000 (15:06 -0700)
commit4298255f26fa91c698048e5cc79e371f3bfaf1da
tree07fda543aaca691fe8a2d38c858c5555c14cb3ad
parentee684c325df99fe6c07c4257cf6fb74b01169d3c
net: stmmac: rearrange RX buffer allocation and free functions

This patch restructures the per RX queue buffer allocation from page_pool
to stmmac_alloc_rx_buffers().

We also rearrange dma_free_rx_skbufs() so that it can be used in
init_dma_rx_desc_rings() during freeing of RX buffer in the event of
page_pool allocation failure to replace the more efficient method earlier.
The replacement is needed to make the RX buffer alloc and free method
scalable to XDP ZC xsk_pool alloc and free later.

Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c