[PATCH 042/227] baseband/null: use NUMA node terminology

Chengwen Feng chengwen.feng at linux.dev
Tue Nov 3 15:50:00 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/baseband/null/bbdev_null.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c
index 10d02da856..9f0e2adf1b 100644
--- a/drivers/baseband/null/bbdev_null.c
+++ b/drivers/baseband/null/bbdev_null.c
@@ -29,13 +29,13 @@ RTE_LOG_REGISTER_DEFAULT(bbdev_null_logtype, NOTICE);
 
 /*  Initialisation params structure that can be used by null BBDEV driver */
 struct bbdev_null_params {
-	int socket_id;
+	int numa_id;
 	uint16_t queues_num;
 };
 
 /* Acceptable params for null BBDEV devices */
 #define BBDEV_NULL_MAX_NB_QUEUES_ARG  "max_nb_queues"
-#define BBDEV_NULL_SOCKET_ID_ARG      "socket_id"
+#define BBDEV_NULL_SOCKET_ID_ARG      "numa_id"
 
 static const char * const bbdev_null_valid_params[] = {
 	BBDEV_NULL_MAX_NB_QUEUES_ARG,
@@ -117,15 +117,15 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id,
 				dev->data->dev_id, q_id);
 
 	/* Allocate the queue data structure. */
-	q = rte_zmalloc_socket(RTE_STR(DRIVER_NAME), sizeof(*q),
-			RTE_CACHE_LINE_SIZE, queue_conf->socket);
+	q = rte_zmalloc_numa(RTE_STR(DRIVER_NAME), sizeof(*q),
+			RTE_CACHE_LINE_SIZE, queue_conf->numa_id);
 	if (q == NULL) {
 		rte_bbdev_log(ERR, "Failed to allocate queue memory");
 		return -ENOMEM;
 	}
 
 	q->processed_pkts = rte_ring_create(ring_name, queue_conf->queue_size,
-			queue_conf->socket, RING_F_SP_ENQ | RING_F_SC_DEQ);
+			queue_conf->numa_id, RING_F_SP_ENQ | RING_F_SC_DEQ);
 	if (q->processed_pkts == NULL) {
 		rte_bbdev_log(ERR, "Failed to create ring");
 		goto free_q;
@@ -242,11 +242,11 @@ parse_bbdev_null_params(struct bbdev_null_params *params,
 			goto exit;
 
 		ret = rte_kvargs_process(kvlist, bbdev_null_valid_params[1],
-					&parse_u16_arg, &params->socket_id);
+					&parse_u16_arg, &params->numa_id);
 		if (ret < 0)
 			goto exit;
 
-		if (params->socket_id >= RTE_MAX_NUMA_NODES) {
+		if (params->numa_id >= RTE_MAX_NUMA_NODES) {
 			rte_bbdev_log(ERR, "Invalid socket, must be < %u",
 					RTE_MAX_NUMA_NODES);
 			goto exit;
@@ -270,9 +270,9 @@ null_bbdev_create(struct rte_vdev_device *vdev,
 	if (bbdev == NULL)
 		return -ENODEV;
 
-	bbdev->data->dev_private = rte_zmalloc_socket(name,
+	bbdev->data->dev_private = rte_zmalloc_numa(name,
 			sizeof(struct bbdev_private), RTE_CACHE_LINE_SIZE,
-			init_params->socket_id);
+			init_params->numa_id);
 	if (bbdev->data->dev_private == NULL) {
 		rte_bbdev_release(bbdev);
 		return -ENOMEM;
@@ -280,7 +280,7 @@ null_bbdev_create(struct rte_vdev_device *vdev,
 
 	bbdev->dev_ops = &pmd_ops;
 	bbdev->device = &vdev->device;
-	bbdev->data->numa_id = init_params->socket_id;
+	bbdev->data->numa_id = init_params->numa_id;
 	bbdev->intr_handle = NULL;
 
 	/* register rx/tx burst functions for data path */
@@ -299,7 +299,7 @@ static int
 null_bbdev_probe(struct rte_vdev_device *vdev)
 {
 	struct bbdev_null_params init_params = {
-		rte_socket_id(),
+		rte_numa_id(),
 		RTE_BBDEV_DEFAULT_MAX_NB_QUEUES
 	};
 	const char *name;
@@ -316,7 +316,7 @@ null_bbdev_probe(struct rte_vdev_device *vdev)
 	parse_bbdev_null_params(&init_params, input_args);
 
 	rte_bbdev_log_debug("Init %s on NUMA node %d with max queues: %d",
-			name, init_params.socket_id, init_params.queues_num);
+			name, init_params.numa_id, init_params.queues_num);
 
 	return null_bbdev_create(vdev, &init_params);
 }
-- 
2.55.0



More information about the dev mailing list