Skip to content

Commit

Permalink
net: lan966x: Update rxq memory model
Browse files Browse the repository at this point in the history
By default the rxq memory model is MEM_TYPE_PAGE_SHARED but to be able
to reuse pages on the TX side, when the XDP action XDP_TX it is required
to update the memory model to PAGE_POOL.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Horatiu Vultur authored and David S. Miller committed Nov 25, 2022
1 parent 49f5eea commit 77ddda4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ static int lan966x_fdma_rx_alloc_page_pool(struct lan966x_rx *rx)
};

rx->page_pool = page_pool_create(&pp_params);

for (int i = 0; i < lan966x->num_phys_ports; ++i) {
struct lan966x_port *port;

if (!lan966x->ports[i])
continue;

port = lan966x->ports[i];
xdp_rxq_info_unreg_mem_model(&port->xdp_rxq);
xdp_rxq_info_reg_mem_model(&port->xdp_rxq, MEM_TYPE_PAGE_POOL,
rx->page_pool);
}

return PTR_ERR_OR_ZERO(rx->page_pool);
}

Expand Down

0 comments on commit 77ddda4

Please sign in to comment.