[PATCH 152/227] net/vhost: use NUMA node terminology

Chengwen Feng chengwen.feng at linux.dev
Tue Nov 3 15:51:50 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/vhost/rte_eth_vhost.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 41b77d8533..4f8f39f683 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1010,11 +1010,11 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev)
 	if (list)
 		return 0;
 
-	list = rte_zmalloc_socket(name, sizeof(*list), 0, numa_node);
+	list = rte_zmalloc_numa(name, sizeof(*list), 0, numa_node);
 	if (list == NULL)
 		return -1;
 
-	vring_state = rte_zmalloc_socket(name, sizeof(*vring_state),
+	vring_state = rte_zmalloc_numa(name, sizeof(*vring_state),
 					 0, numa_node);
 	if (vring_state == NULL)
 		goto free_list;
@@ -1251,14 +1251,14 @@ eth_dev_close(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,
+		   unsigned int numa_id,
 		   const struct rte_eth_rxconf *rx_conf __rte_unused,
 		   struct rte_mempool *mb_pool)
 {
 	struct vhost_queue *vq;
 
-	vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	vq = rte_zmalloc_numa(NULL, sizeof(struct vhost_queue),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (vq == NULL) {
 		VHOST_LOG_LINE(ERR, "Failed to allocate memory for rx queue");
 		return -ENOMEM;
@@ -1276,13 +1276,13 @@ 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,
+		   unsigned int numa_id,
 		   const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct vhost_queue *vq;
 
-	vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	vq = rte_zmalloc_numa(NULL, sizeof(struct vhost_queue),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (vq == NULL) {
 		VHOST_LOG_LINE(ERR, "Failed to allocate memory for tx queue");
 		return -ENOMEM;
@@ -1582,7 +1582,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
 		goto error;
 	data = eth_dev->data;
 
-	eth_addr = rte_zmalloc_socket(name, sizeof(*eth_addr), 0, numa_node);
+	eth_addr = rte_zmalloc_numa(name, sizeof(*eth_addr), 0, numa_node);
 	if (eth_addr == NULL)
 		goto error;
 	data->mac_addrs = eth_addr;
@@ -1595,7 +1595,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
 	 * - and point eth_dev structure to new eth_dev_data structure
 	 */
 	internal = eth_dev->data->dev_private;
-	internal->iface_name = rte_malloc_socket(name, strlen(iface_name) + 1,
+	internal->iface_name = rte_malloc_numa(name, strlen(iface_name) + 1,
 						 0, numa_node);
 	if (internal->iface_name == NULL)
 		goto error;
@@ -1689,8 +1689,8 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 		eth_dev->rx_pkt_burst = eth_vhost_rx;
 		eth_dev->tx_pkt_burst = eth_vhost_tx;
 		eth_dev->dev_ops = &ops;
-		if (dev->device.numa_node == SOCKET_ID_ANY)
-			dev->device.numa_node = rte_socket_id();
+		if (dev->device.numa_node == RTE_NUMA_ID_ANY)
+			dev->device.numa_node = rte_numa_id();
 		eth_dev->device = &dev->device;
 		rte_eth_dev_probing_finish(eth_dev);
 		return 0;
@@ -1795,8 +1795,8 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 	if (legacy_ol_flags == 0)
 		flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
 
-	if (dev->device.numa_node == SOCKET_ID_ANY)
-		dev->device.numa_node = rte_socket_id();
+	if (dev->device.numa_node == RTE_NUMA_ID_ANY)
+		dev->device.numa_node = rte_numa_id();
 
 	ret = eth_dev_vhost_create(dev, iface_name, queues,
 				   dev->device.numa_node, flags, disable_flags);
-- 
2.55.0



More information about the dev mailing list