[PATCH 163/227] raw/ntb: use NUMA node terminology

Chengwen Feng chengwen.feng at linux.dev
Tue Nov 3 15:52:01 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/raw/ntb/ntb.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index 9f29d409e4..6167f69402 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -187,7 +187,7 @@ ntb_rxq_setup(struct rte_rawdev *dev,
 		return -EINVAL;
 
 	/* Allocate the rx queue data structure */
-	rxq = rte_zmalloc_socket("ntb rx queue",
+	rxq = rte_zmalloc_numa("ntb rx queue",
 				 sizeof(struct ntb_rx_queue),
 				 RTE_CACHE_LINE_SIZE,
 				 dev->numa_id);
@@ -209,7 +209,7 @@ ntb_rxq_setup(struct rte_rawdev *dev,
 
 	/* Allocate the software ring. */
 	rxq->sw_ring =
-		rte_zmalloc_socket("ntb rx sw ring",
+		rte_zmalloc_numa("ntb rx sw ring",
 				   sizeof(struct ntb_rx_entry) *
 				   rxq->nb_rx_desc,
 				   RTE_CACHE_LINE_SIZE,
@@ -273,7 +273,7 @@ ntb_txq_setup(struct rte_rawdev *dev,
 		return -EINVAL;
 
 	/* Allocate the TX queue data structure. */
-	txq = rte_zmalloc_socket("ntb tx queue",
+	txq = rte_zmalloc_numa("ntb tx queue",
 				  sizeof(struct ntb_tx_queue),
 				  RTE_CACHE_LINE_SIZE,
 				  dev->numa_id);
@@ -290,7 +290,7 @@ ntb_txq_setup(struct rte_rawdev *dev,
 
 	/* Allocate software ring */
 	txq->sw_ring =
-		rte_zmalloc_socket("ntb tx sw ring",
+		rte_zmalloc_numa("ntb tx sw ring",
 				   sizeof(struct ntb_tx_entry) *
 				   txq->nb_tx_desc,
 				   RTE_CACHE_LINE_SIZE,
@@ -1319,7 +1319,7 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
 }
 
 static int
-ntb_create(struct rte_pci_device *pci_dev, int socket_id)
+ntb_create(struct rte_pci_device *pci_dev, int numa_id)
 {
 	char name[RTE_RAWDEV_NAME_MAX_LEN];
 	struct rte_rawdev *rawdev = NULL;
@@ -1335,11 +1335,11 @@ ntb_create(struct rte_pci_device *pci_dev, int socket_id)
 		 pci_dev->addr.bus, pci_dev->addr.devid,
 		 pci_dev->addr.function);
 
-	NTB_LOG(INFO, "Init %s on NUMA node %d", name, socket_id);
+	NTB_LOG(INFO, "Init %s on NUMA node %d", name, numa_id);
 
 	/* Allocate device structure. */
 	rawdev = rte_rawdev_pmd_allocate(name, sizeof(struct ntb_hw),
-					 socket_id);
+					 numa_id);
 	if (rawdev == NULL) {
 		NTB_LOG(ERR, "Unable to allocate rawdev.");
 		return -EINVAL;
@@ -1382,7 +1382,7 @@ ntb_destroy(struct rte_pci_device *pci_dev)
 		 pci_dev->addr.bus, pci_dev->addr.devid,
 		 pci_dev->addr.function);
 
-	NTB_LOG(INFO, "Closing %s on NUMA node %d", name, rte_socket_id());
+	NTB_LOG(INFO, "Closing %s on NUMA node %d", name, rte_numa_id());
 
 	rawdev = rte_rawdev_pmd_get_named_dev(name);
 	if (rawdev == NULL) {
@@ -1402,7 +1402,7 @@ static int
 ntb_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	struct rte_pci_device *pci_dev)
 {
-	return ntb_create(pci_dev, rte_socket_id());
+	return ntb_create(pci_dev, rte_numa_id());
 }
 
 static int
-- 
2.55.0



More information about the dev mailing list