Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Jakub Kicinski
Wed, 18 Nov 2026 02:39
[PATCH net-next 5/6] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node
Author: Jakub Kicinski
Date: Wed, 18 Nov 2026 02:39
Date: Wed, 18 Nov 2026 02:39
95 lines
11021 bytes
11021 bytes
Descriptor rings, completion rings, NQs and the TX push buffer are
accessed by the host in the fast path, and so is the SW state around
them, which we already allocate on the node of the CPU expected to
service the queue. The DMA memory itself comes from the device's node,
though, as that's what dma_alloc_coherent() always uses.
Use dma_alloc_coherent_node() for the ring pages and the TX push buffer.
Pass the queue's node for completion rings and NQs as well, they used
NUMA_NO_NODE so far since @nid only affected the SW rings.
Ring page tables are only read by the device, keep them on the device's
node.
Note that queue restart only reallocates the Rx descriptor rings.
Completion rings, NQs and Tx rings will follow IRQ affinity changes
only on the next full reconfiguration.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 24 +++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f98507944350..134b24842c4f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -3790,10 +3790,10 @@ static int bnxt_alloc_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem,
for (i = 0; i < rmem->nr_pages; i++) {
u64 extra_bits = valid_bit;
- rmem->pg_arr[i] = dma_alloc_coherent(&pdev->dev,
- rmem->page_size,
- &rmem->dma_arr[i],
- GFP_KERNEL);
+ rmem->pg_arr[i] = dma_alloc_coherent_node(&pdev->dev,
+ rmem->page_size,
+ &rmem->dma_arr[i],
+ GFP_KERNEL, nid);
if (!rmem->pg_arr[i])
return -ENOMEM;
@@ -3812,7 +3812,6 @@ static int bnxt_alloc_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem,
}
}
- /* Only the SW ring follows @nid, DMA memory is on the device's node */
if (rmem->vmem_size) {
*rmem->vmem = vzalloc_node(rmem->vmem_size, nid);
if (!(*rmem->vmem))
@@ -4208,10 +4207,11 @@ static int bnxt_alloc_tx_rings(struct bnxt *bp)
/* One pre-allocated DMA buffer to backup
* TX push operation
*/
- txr->tx_push = dma_alloc_coherent(&pdev->dev,
- bp->tx_push_size,
- &txr->tx_push_mapping,
- GFP_KERNEL);
+ txr->tx_push =
+ dma_alloc_coherent_node(&pdev->dev,
+ bp->tx_push_size,
+ &txr->tx_push_mapping,
+ GFP_KERNEL, nid);
if (!txr->tx_push)
return -ENOMEM;
@@ -4353,7 +4353,7 @@ static int bnxt_alloc_cp_sub_ring(struct bnxt *bp,
rmem->pg_arr = (void **)cpr->cp_desc_ring;
rmem->dma_arr = cpr->cp_desc_mapping;
rmem->flags = BNXT_RMEM_RING_PTE_FLAG;
- rc = bnxt_alloc_ring(bp, rmem, NUMA_NO_NODE);
+ rc = bnxt_alloc_ring(bp, rmem, nid);
if (rc) {
bnxt_free_ring(bp, rmem);
bnxt_free_cp_arrays(cpr);
@@ -4384,7 +4384,8 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
cpr->bnapi = bnapi;
ring = &cpr->cp_ring_struct;
- rc = bnxt_alloc_ring(bp, &ring->ring_mem, NUMA_NO_NODE);
+ nid = bnxt_cp_num_to_node(bp, i);
+ rc = bnxt_alloc_ring(bp, &ring->ring_mem, nid);
if (rc)
return rc;
@@ -4406,7 +4407,6 @@ static int bnxt_alloc_cp_rings(struct bnxt *bp)
tx = 1;
}
- nid = bnxt_cp_num_to_node(bp, i);
cpr->cp_ring_arr = kcalloc_node(cp_count, sizeof(*cpr),
GFP_KERNEL, nid);
if (!cpr->cp_ring_arr)
--
2.56.1
Re: [PATCH net-next 5/6] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node
Author: Björn Töpel
Date: Wed, 18 Nov 2026 12:39
Date: Wed, 18 Nov 2026 12:39
23 lines
8712 bytes
8712 bytes
Jakub Kicinski <kuba@kernel.org> writes: > Descriptor rings, completion rings, NQs and the TX push buffer are > accessed by the host in the fast path, and so is the SW state around > them, which we already allocate on the node of the CPU expected to > service the queue. The DMA memory itself comes from the device's node, > though, as that's what dma_alloc_coherent() always uses. > > Use dma_alloc_coherent_node() for the ring pages and the TX push buffer. > Pass the queue's node for completion rings and NQs as well, they used > NUMA_NO_NODE so far since @nid only affected the SW rings. > > Ring page tables are only read by the device, keep them on the device's > node. > > Note that queue restart only reallocates the Rx descriptor rings. > Completion rings, NQs and Tx rings will follow IRQ affinity changes > only on the next full reconfiguration. > > Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Björn Töpel <bjorn@kernel.org>
Re: [PATCH net-next 5/6] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node
Author: Joe Damato
Date: Wed, 18 Nov 2026 14:51
Date: Wed, 18 Nov 2026 14:51
25 lines
12424 bytes
12424 bytes
On Tue, Nov 17, 2026 at 06:39:04PM -0800, Jakub Kicinski wrote: > Descriptor rings, completion rings, NQs and the TX push buffer are > accessed by the host in the fast path, and so is the SW state around > them, which we already allocate on the node of the CPU expected to > service the queue. The DMA memory itself comes from the device's node, > though, as that's what dma_alloc_coherent() always uses. > > Use dma_alloc_coherent_node() for the ring pages and the TX push buffer. > Pass the queue's node for completion rings and NQs as well, they used > NUMA_NO_NODE so far since @nid only affected the SW rings. > > Ring page tables are only read by the device, keep them on the device's > node. > > Note that queue restart only reallocates the Rx descriptor rings. > Completion rings, NQs and Tx rings will follow IRQ affinity changes > only on the next full reconfiguration. > > Signed-off-by: Jakub Kicinski <kuba@kernel.org> > --- > drivers/net/ethernet/broadcom/bnxt/bnxt.c | 24 +++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) Reviewed-by: Joe Damato <joe@dama.to>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads