[PATCH 144/227] net/ring: use NUMA node terminology

Chengwen Feng chengwen.feng at linux.dev
Tue Nov 3 15:51:42 CET 2026


From: Chengwen Feng <fengchengwen at huawei.com>

Rename socket_id parameters, internal structure fields, 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>
---
 drivers/net/ring/rte_eth_ring.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index d75ae2cbed..9af86f4226 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -155,7 +155,7 @@ eth_dev_set_link_up(struct rte_eth_dev *dev)
 static int
 eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 				    uint16_t nb_rx_desc __rte_unused,
-				    unsigned int socket_id __rte_unused,
+				    unsigned int numa_id __rte_unused,
 				    const struct rte_eth_rxconf *rx_conf __rte_unused,
 				    struct rte_mempool *mb_pool __rte_unused)
 {
@@ -168,7 +168,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 static int
 eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 				    uint16_t nb_tx_desc __rte_unused,
-				    unsigned int socket_id __rte_unused,
+				    unsigned int numa_id __rte_unused,
 				    const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct pmd_internals *internals = dev->data->dev_private;
@@ -374,21 +374,21 @@ do_eth_dev_ring_create(const char *name,
 	PMD_LOG(INFO, "Creating rings-backed ethdev on numa socket %u",
 			numa_node);
 
-	rx_queues_local = rte_calloc_socket(name, nb_rx_queues,
+	rx_queues_local = rte_calloc_numa(name, nb_rx_queues,
 					    sizeof(void *), 0, numa_node);
 	if (rx_queues_local == NULL) {
 		rte_errno = ENOMEM;
 		goto error;
 	}
 
-	tx_queues_local = rte_calloc_socket(name, nb_tx_queues,
+	tx_queues_local = rte_calloc_numa(name, nb_tx_queues,
 					    sizeof(void *), 0, numa_node);
 	if (tx_queues_local == NULL) {
 		rte_errno = ENOMEM;
 		goto error;
 	}
 
-	internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
+	internals = rte_zmalloc_numa(name, sizeof(*internals), 0, numa_node);
 	if (internals == NULL) {
 		rte_errno = ENOMEM;
 		goto error;
@@ -520,7 +520,7 @@ int
 rte_eth_from_ring(struct rte_ring *r)
 {
 	return rte_eth_from_rings(r->name, &r, 1, &r, 1,
-			r->memzone ? r->memzone->socket_id : SOCKET_ID_ANY);
+			r->memzone ? r->memzone->socket_id : RTE_NUMA_ID_ANY);
 }
 
 static int
@@ -693,12 +693,12 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 	}
 
 	if (params == NULL || params[0] == '\0') {
-		ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE,
+		ret = eth_dev_ring_create(name, dev, rte_numa_id(), DEV_CREATE,
 				&eth_dev);
 		if (ret == -1) {
 			PMD_LOG(INFO,
 				"Attach to pmd_ring for %s", name);
-			ret = eth_dev_ring_create(name, dev, rte_socket_id(),
+			ret = eth_dev_ring_create(name, dev, rte_numa_id(),
 						  DEV_ATTACH, &eth_dev);
 		}
 	} else {
@@ -707,13 +707,13 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
 		if (!kvlist) {
 			PMD_LOG(INFO,
 				"Ignoring unsupported parameters when creating rings-backed ethernet device");
-			ret = eth_dev_ring_create(name, dev, rte_socket_id(),
+			ret = eth_dev_ring_create(name, dev, rte_numa_id(),
 						  DEV_CREATE, &eth_dev);
 			if (ret == -1) {
 				PMD_LOG(INFO,
 					"Attach to pmd_ring for %s",
 					name);
-				ret = eth_dev_ring_create(name, dev, rte_socket_id(),
+				ret = eth_dev_ring_create(name, dev, rte_numa_id(),
 							  DEV_ATTACH, &eth_dev);
 			}
 
-- 
2.55.0



More information about the dev mailing list