[PATCH 187/227] examples/dma: use NUMA node terminology

Chengwen Feng chengwen.feng at linux.dev
Tue Nov 3 15:52:25 CET 2026


From: Chengwen Feng <fengchengwen at huawei.com>

Rename socket_id parameters, local variables and comments to the
NUMA node terminology, and switch calls to the NUMA-named APIs.

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 examples/dma/dmafwd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c
index fea1c3e669..12298a5779 100644
--- a/examples/dma/dmafwd.c
+++ b/examples/dma/dmafwd.c
@@ -832,7 +832,7 @@ assign_rings(void)
 		/* Create ring for inter core communication */
 		cfg.ports[i].rx_to_tx_ring = rte_ring_create(
 			ring_name, ring_size,
-			rte_socket_id(), RING_F_SP_ENQ | RING_F_SC_DEQ);
+			rte_numa_id(), RING_F_SP_ENQ | RING_F_SC_DEQ);
 
 		if (cfg.ports[i].rx_to_tx_ring == NULL)
 			rte_exit(EXIT_FAILURE, "Ring create failed: %s\n",
@@ -943,7 +943,7 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 	rxq_conf.offloads = local_port_conf.rxmode.offloads;
 	for (i = 0; i < nb_queues; i++) {
 		ret = rte_eth_rx_queue_setup(portid, i, nb_rxd,
-			rte_eth_dev_socket_id(portid), &rxq_conf,
+			rte_eth_dev_numa_id(portid), &rxq_conf,
 			mbuf_pool);
 		if (ret < 0)
 			rte_exit(EXIT_FAILURE,
@@ -955,7 +955,7 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
 	txq_conf = dev_info.default_txconf;
 	txq_conf.offloads = local_port_conf.txmode.offloads;
 	ret = rte_eth_tx_queue_setup(portid, 0, nb_txd,
-			rte_eth_dev_socket_id(portid),
+			rte_eth_dev_numa_id(portid),
 			&txq_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE,
@@ -1047,7 +1047,7 @@ main(int argc, char **argv)
 	sz = max_frame_size + RTE_PKTMBUF_HEADROOM;
 	sz = RTE_MAX(sz, (size_t)RTE_MBUF_DEFAULT_BUF_SIZE);
 	dma_pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", nb_mbufs,
-		MEMPOOL_CACHE_SIZE, 0, sz, rte_socket_id());
+		MEMPOOL_CACHE_SIZE, 0, sz, rte_numa_id());
 	if (dma_pktmbuf_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Cannot init mbuf pool\n");
 	/* >8 End of allocates mempool to hold the mbufs. */
-- 
2.55.0



More information about the dev mailing list