Context memory (and the FW crash dump buffer which reuses the same helpers) is used by the device, once set up the host only touches it on the slow path (diagnostics, FW trace). Pass the device's node to bnxt_alloc_ring() rather than NUMA_NO_NODE to make it clear that this memory is not meant to follow any queue. Ring page tables are only read by the device, annotate their allocation so that they stay put once the ring pages start following the queue. Reviewed-by: Björn Töpel Reviewed-by: Joe Damato Signed-off-by: Jakub Kicinski --- v2: no change v1: https://lore.kernel.org/20261118023905.3050661-5-kuba@kernel.org --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 7acf74822e64..265ee15b6b35 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -3784,6 +3784,7 @@ static int bnxt_alloc_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem, if (rmem->flags & BNXT_RMEM_USE_FULL_PAGE_FLAG) pg_tbl_size = rmem->page_size; + /* Only read by the device, keep it on the device's node */ rmem->pg_tbl = dma_alloc_coherent(&pdev->dev, pg_tbl_size, &rmem->pg_tbl_map, GFP_KERNEL); @@ -9259,7 +9260,8 @@ static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp, rmem->flags = BNXT_RMEM_VALID_PTE_FLAG; if (rmem->depth >= 1) rmem->flags |= BNXT_RMEM_USE_FULL_PAGE_FLAG; - return bnxt_alloc_ring(bp, rmem, NUMA_NO_NODE); + /* Host only uses it on the slow path, keep it on the device's node */ + return bnxt_alloc_ring(bp, rmem, dev_to_node(&bp->pdev->dev)); } static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, -- 2.56.1