Re: [PATCH net-next] net: bcmasp: Switch to page pool for RX path

From: Nicolai Buchwitz

Date: Tue Apr 07 2026 - 17:05:32 EST


On 7.4.2026 18:26, Florian Fainelli wrote:
This shows an improvement of 1.9% in reducing the CPU cycles and data
cache misses.

Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
---

[...]


-static int bcmasp_alloc_buffers(struct bcmasp_intf *intf)
+static struct page_pool *
+bcmasp_rx_page_pool_create(struct bcmasp_intf *intf)
+{
+ struct page_pool_params pp_params = {
+ .order = 0,
+ /* Pages are CPU-side copy targets; no DMA mapping needed. */
+ .flags = 0,
+ .pool_size = NUM_4K_BUFFERS,
+ .nid = NUMA_NO_NODE,
+ .dev = &intf->parent->pdev->dev,
+ .dma_dir = DMA_FROM_DEVICE,

Nit: .dma_dir has AFAIK no effect without PP_FLAG_DMA_MAP, so
it's a bit misleading next to the "no DMA mapping needed" comment.

+ .offset = 0,
+ .max_len = PAGE_SIZE,
+ };

Other Broadcom page pool drivers set .napi and .netdev. Adding those
here would enable direct recycling and expose pool stats in ethtool -S.

[...]

Thanks
Nicolai