[PATCH 209/227] examples/packet_ordering: use NUMA node terminology
Chengwen Feng
chengwen.feng at linux.dev
Tue Nov 3 15:52:47 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/packet_ordering/main.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 0279faf081..b931ab86ae 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -254,9 +254,9 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[])
continue;
/* Initialize TX buffers */
- tx_buffer[port_id] = rte_zmalloc_socket("tx_buffer",
+ tx_buffer[port_id] = rte_zmalloc_numa("tx_buffer",
RTE_ETH_TX_BUFFER_SIZE(MAX_PKTS_BURST), 0,
- rte_eth_dev_socket_id(port_id));
+ rte_eth_dev_numa_id(port_id));
if (tx_buffer[port_id] == NULL)
rte_exit(EXIT_FAILURE, "Cannot allocate buffer for tx on port %u\n",
port_id);
@@ -309,7 +309,7 @@ configure_eth_port(uint16_t port_id)
for (q = 0; q < rxRings; q++) {
ret = rte_eth_rx_queue_setup(port_id, q, nb_rxd,
- rte_eth_dev_socket_id(port_id), NULL,
+ rte_eth_dev_numa_id(port_id), NULL,
mbuf_pool);
if (ret < 0)
return ret;
@@ -319,7 +319,7 @@ configure_eth_port(uint16_t port_id)
txconf.offloads = port_conf.txmode.offloads;
for (q = 0; q < txRings; q++) {
ret = rte_eth_tx_queue_setup(port_id, q, nb_txd,
- rte_eth_dev_socket_id(port_id), &txconf);
+ rte_eth_dev_numa_id(port_id), &txconf);
if (ret < 0)
return ret;
}
@@ -719,7 +719,7 @@ main(int argc, char **argv)
mbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", MBUF_PER_POOL,
MBUF_POOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
- rte_socket_id());
+ rte_numa_id());
if (mbuf_pool == NULL)
rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
@@ -747,18 +747,18 @@ main(int argc, char **argv)
}
/* Create rings for inter core communication */
- rx_to_workers = rte_ring_create("rx_to_workers", RING_SIZE, rte_socket_id(),
+ rx_to_workers = rte_ring_create("rx_to_workers", RING_SIZE, rte_numa_id(),
RING_F_SP_ENQ);
if (rx_to_workers == NULL)
rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
- workers_to_tx = rte_ring_create("workers_to_tx", RING_SIZE, rte_socket_id(),
+ workers_to_tx = rte_ring_create("workers_to_tx", RING_SIZE, rte_numa_id(),
RING_F_SC_DEQ);
if (workers_to_tx == NULL)
rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
if (!disable_reorder) {
- send_args.buffer = rte_reorder_create("PKT_RO", rte_socket_id(),
+ send_args.buffer = rte_reorder_create("PKT_RO", rte_numa_id(),
REORDER_BUFFER_SIZE);
if (send_args.buffer == NULL)
rte_exit(EXIT_FAILURE, "%s\n", rte_strerror(rte_errno));
--
2.55.0
More information about the dev
mailing list