Skip to contentSkip to conversation

use NUMA node terminology across the tree

PATCH In review Chengwen Feng 7 participants 244 messages Nov 3 – Nov 6 Page 2 of 4

Subsystems (11)
lore
Share & tools
lore
#59 lore raw

PATCH 57/227 compress/nitrox: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/compress/nitrox/nitrox_comp.c        | 14 +++++++-------
 drivers/compress/nitrox/nitrox_comp_reqmgr.c | 14 +++++++-------
 drivers/compress/nitrox/nitrox_comp_reqmgr.h |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)
drivers/compress/nitrox/nitrox_comp.c +7 -7
index 56a90a35c5..d6a7ae1629 100644
@@ -153,7 +153,7 @@ static void nitrox_comp_dev_info_get(struct rte_compressdev *dev,
 
 static int nitrox_comp_queue_pair_setup(struct rte_compressdev *dev,
 					uint16_t qp_id,
-					uint32_t max_inflight_ops, int socket_id)
+					uint32_t max_inflight_ops, int numa_id)
 {
 	struct nitrox_comp_device *comp_dev = dev->data->dev_private;
 	struct nitrox_device *ndev = comp_dev->ndev;
@@ -173,9 +173,9 @@ static int nitrox_comp_queue_pair_setup(struct rte_compressdev *dev,
 			return err;
 	}
 
-	qp = rte_zmalloc_socket("nitrox PMD qp", sizeof(*qp),
+	qp = rte_zmalloc_numa("nitrox PMD qp", sizeof(*qp),
 				RTE_CACHE_LINE_SIZE,
-				socket_id);
+				numa_id);
 	if (!qp) {
 		NITROX_LOG_LINE(ERR, "Failed to allocate nitrox qp");
 		return -ENOMEM;
@@ -185,12 +185,12 @@ static int nitrox_comp_queue_pair_setup(struct rte_compressdev *dev,
 	qp->qno = qp_id;
 	err = nitrox_qp_setup(qp, ndev->bar_addr, dev->data->name,
 			      max_inflight_ops, ZIP_INSTR_SIZE,
-			      socket_id);
+			      numa_id);
 	if (unlikely(err))
 		goto qp_setup_err;
 
 	qp->sr_mp = nitrox_comp_req_pool_create(dev, qp->count, qp_id,
-						socket_id);
+						numa_id);
 	if (unlikely(!qp->sr_mp))
 		goto req_pool_err;
 
@@ -410,7 +410,7 @@ static int nitrox_comp_stream_create(struct rte_compressdev *dev,
 		nxform->window_size = NITROX_DEFAULT_DEFLATE_SEARCH_DEPTH;
 	}
 
-	nxform->history_window = rte_zmalloc_socket(NULL, nxform->window_size,
+	nxform->history_window = rte_zmalloc_numa(NULL, nxform->window_size,
 					8, comp_dev->xform_pool->numa_id);
 	if (unlikely(nxform->history_window == NULL)) {
 		err = -ENOMEM;
@@ -420,7 +420,7 @@ static int nitrox_comp_stream_create(struct rte_compressdev *dev,
 	if (xform->type == RTE_COMP_COMPRESS)
 		return 0;
 
-	nxform->context = rte_zmalloc_socket(NULL,
+	nxform->context = rte_zmalloc_numa(NULL,
 					NITROX_DECOMP_CTX_SIZE, 8,
 					comp_dev->xform_pool->numa_id);
 	if (unlikely(nxform->context == NULL)) {
drivers/compress/nitrox/nitrox_comp_reqmgr.c +7 -7
index 42358cd14f..e8689d608b 100644
@@ -523,7 +523,7 @@ static int handle_zero_length_compression(struct nitrox_softreq *sr,
 static int create_sglist_from_mbuf(struct nitrox_sgtable *sgtbl,
 				   struct rte_mbuf *mbuf, uint32_t off,
 				   uint32_t datalen, uint8_t extra_segs,
-				   int socket_id)
+				   int numa_id)
 {
 	struct rte_mbuf *m;
 	union nitrox_zip_zptr *sgl;
@@ -555,9 +555,9 @@ static int create_sglist_from_mbuf(struct nitrox_sgtable *sgtbl,
 
 		NITROX_LOG_LINE(INFO, "Mbuf has more segs %d than allocated %d",
 			   nb_segs, sgtbl->nb_sgls);
-		sgl = rte_realloc_socket(sgtbl->sgl,
+		sgl = rte_realloc_numa(sgtbl->sgl,
 					 sizeof(*sgtbl->sgl) * nb_segs,
-					 8, socket_id);
+					 8, numa_id);
 		if (unlikely(!sgl)) {
 			NITROX_LOG_LINE(ERR, "Failed to expand sglist memory");
 			return -ENOMEM;
@@ -1159,10 +1159,10 @@ static void req_pool_obj_init(struct rte_mempool *mp, void *arg, void *obj,
 	RTE_SET_USED(mp);
 	RTE_SET_USED(obj_idx);
 	sr = obj;
-	sr->src.sgl = rte_zmalloc_socket(NULL,
+	sr->src.sgl = rte_zmalloc_numa(NULL,
 				sizeof(*sr->src.sgl) * NITROX_ZIP_SGL_COUNT,
 				8, mp->numa_id);
-	sr->dst.sgl = rte_zmalloc_socket(NULL,
+	sr->dst.sgl = rte_zmalloc_numa(NULL,
 				sizeof(*sr->dst.sgl) * NITROX_ZIP_SGL_COUNT,
 				8, mp->numa_id);
 	if (sr->src.sgl == NULL || sr->dst.sgl == NULL) {
@@ -1178,7 +1178,7 @@ static void req_pool_obj_init(struct rte_mempool *mp, void *arg, void *obj,
 
 struct rte_mempool *
 nitrox_comp_req_pool_create(struct rte_compressdev *dev, uint32_t nobjs,
-			   uint16_t qp_id, int socket_id)
+			   uint16_t qp_id, int numa_id)
 {
 	char softreq_pool_name[RTE_RING_NAMESIZE];
 	struct rte_mempool *mp;
@@ -1190,7 +1190,7 @@ nitrox_comp_req_pool_create(struct rte_compressdev *dev, uint32_t nobjs,
 				RTE_ALIGN_MUL_CEIL(nobjs, 64),
 				sizeof(struct nitrox_softreq),
 				64, 0, NULL, NULL, req_pool_obj_init, &err,
-				socket_id, 0);
+				numa_id, 0);
 	if (unlikely(!mp))
 		NITROX_LOG_LINE(ERR, "Failed to create req pool, qid %d, err %d",
 			   qp_id, rte_errno);
drivers/compress/nitrox/nitrox_comp_reqmgr.h +1 -1
index f0cd1eb8fd..d544acb25f 100644
@@ -52,7 +52,7 @@ int nitrox_check_comp_req(struct nitrox_softreq *sr, struct rte_comp_op **op);
 void *nitrox_comp_instr_addr(struct nitrox_softreq *sr);
 struct rte_mempool *nitrox_comp_req_pool_create(struct rte_compressdev *cdev,
 					       uint32_t nobjs, uint16_t qp_id,
-					       int socket_id);
+					       int numa_id);
 void nitrox_comp_req_pool_free(struct rte_mempool *mp);
 
 #endif /* _NITROX_COMP_REQMGR_H_ */
Signature · 1 line
2.55.0
#60 lore raw

PATCH 58/227 compress/octeontx: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/compress/octeontx/otx_zip_pmd.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/compress/octeontx/otx_zip_pmd.c +9 -9
index 74e3e942ad..a70e9ddfa5 100644
@@ -225,7 +225,7 @@ zip_pmd_config(struct rte_compressdev *dev,
 			NULL,
 			NULL,
 			NULL,
-			SOCKET_ID_ANY,
+			RTE_NUMA_ID_ANY,
 			0);
 
 	if (zip_buf_mp == NULL) {
@@ -246,7 +246,7 @@ zip_pmd_config(struct rte_compressdev *dev,
 			NULL,
 			NULL,
 			NULL,
-			SOCKET_ID_ANY,
+			RTE_NUMA_ID_ANY,
 			MEMPOOL_F_NO_SPREAD);
 
 	if (zip_sg_mp == NULL) {
@@ -356,7 +356,7 @@ zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id)
 /** Create a ring to place process packets on */
 static struct rte_ring *
 zip_pmd_qp_create_processed_pkts_ring(struct zipvf_qp *qp,
-		unsigned int ring_size, int socket_id)
+		unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 
@@ -373,14 +373,14 @@ zip_pmd_qp_create_processed_pkts_ring(struct zipvf_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 						RING_F_EXACT_SZ);
 }
 
 /** Setup a queue pair */
 static int
 zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
-		uint32_t max_inflight_ops, int socket_id)
+		uint32_t max_inflight_ops, int numa_id)
 {
 	struct zipvf_qp *qp = NULL;
 	struct zip_vf *vf;
@@ -406,8 +406,8 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		 dev->data->dev_id, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket(name, sizeof(*qp),
-				RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa(name, sizeof(*qp),
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL) {
 		rte_free(name);
 		return (-ENOMEM);
@@ -417,7 +417,7 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 
 	/* Create completion queue up to max_inflight_ops */
 	qp->processed_pkts = zip_pmd_qp_create_processed_pkts_ring(qp,
-						max_inflight_ops, socket_id);
+						max_inflight_ops, numa_id);
 	if (qp->processed_pkts == NULL)
 		goto qp_setup_cleanup;
 
@@ -629,7 +629,7 @@ zip_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	struct rte_compressdev *compressdev;
 	struct rte_compressdev_pmd_init_params init_params = {
 		"",
-		rte_socket_id(),
+		rte_numa_id(),
 	};
 
 	ZIP_PMD_INFO("vendor_id=0x%x device_id=0x%x",
Signature · 1 line
2.55.0
#61 lore raw

PATCH 59/227 compress/uadk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/compress/uadk/uadk_compress_pmd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/compress/uadk/uadk_compress_pmd.c +7 -7
index 0d5cd21bec..2810b22b0c 100644
@@ -157,7 +157,7 @@ uadk_pmd_qp_set_unique_name(struct rte_compressdev *dev,
 
 static struct rte_ring *
 uadk_pmd_qp_create_processed_pkts_ring(struct uadk_compress_qp *qp,
-				       unsigned int ring_size, int socket_id)
+				       unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r = qp->processed_pkts;
 
@@ -173,13 +173,13 @@ uadk_pmd_qp_create_processed_pkts_ring(struct uadk_compress_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			       RING_F_EXACT_SZ);
 }
 
 static int
 uadk_compress_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
-			   uint32_t max_inflight_ops, int socket_id)
+			   uint32_t max_inflight_ops, int numa_id)
 {
 	struct uadk_compress_qp *qp = NULL;
 
@@ -188,8 +188,8 @@ uadk_compress_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		uadk_compress_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("uadk PMD Queue Pair", sizeof(*qp),
-				RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("uadk PMD Queue Pair", sizeof(*qp),
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return (-ENOMEM);
 
@@ -200,7 +200,7 @@ uadk_compress_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		goto qp_setup_cleanup;
 
 	qp->processed_pkts = uadk_pmd_qp_create_processed_pkts_ring(qp,
-						max_inflight_ops, socket_id);
+						max_inflight_ops, numa_id);
 	if (qp->processed_pkts == NULL)
 		goto qp_setup_cleanup;
 
@@ -422,7 +422,7 @@ uadk_compress_probe(struct rte_vdev_device *vdev)
 {
 	struct rte_compressdev_pmd_init_params init_params = {
 		"",
-		rte_socket_id(),
+		rte_numa_id(),
 	};
 	struct rte_compressdev *compressdev;
 	struct uacce_dev *udev;
Signature · 1 line
2.55.0
#62 lore raw

PATCH 60/227 compress/zlib: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/compress/zlib/zlib_pmd.c     |  2 +-
 drivers/compress/zlib/zlib_pmd_ops.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/compress/zlib/zlib_pmd.c +1 -1
index ed3905484c..6943367b6f 100644
@@ -535,7 +535,7 @@ zlib_probe(struct rte_vdev_device *vdev)
 {
 	struct rte_compressdev_pmd_init_params init_params = {
 		"",
-		rte_socket_id()
+		rte_numa_id()
 	};
 	const char *name;
 	const char *input_args;
drivers/compress/zlib/zlib_pmd_ops.c +6 -6
index fb9cec8488..e240db25f4 100644
@@ -155,7 +155,7 @@ zlib_pmd_qp_set_unique_name(struct rte_compressdev *dev,
 /** Create a ring to place process packets on */
 static struct rte_ring *
 zlib_pmd_qp_create_processed_pkts_ring(struct zlib_qp *qp,
-		unsigned int ring_size, int socket_id)
+		unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r = qp->processed_pkts;
 
@@ -171,14 +171,14 @@ zlib_pmd_qp_create_processed_pkts_ring(struct zlib_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 						RING_F_EXACT_SZ);
 }
 
 /** Setup a queue pair */
 static int
 zlib_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
-		uint32_t max_inflight_ops, int socket_id)
+		uint32_t max_inflight_ops, int numa_id)
 {
 	struct zlib_qp *qp = NULL;
 
@@ -187,8 +187,8 @@ zlib_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		zlib_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("ZLIB PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("ZLIB PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return (-ENOMEM);
 
@@ -199,7 +199,7 @@ zlib_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 		goto qp_setup_cleanup;
 
 	qp->processed_pkts = zlib_pmd_qp_create_processed_pkts_ring(qp,
-			max_inflight_ops, socket_id);
+			max_inflight_ops, numa_id);
 	if (qp->processed_pkts == NULL)
 		goto qp_setup_cleanup;
 
Signature · 1 line
2.55.0
#63 lore raw

PATCH 61/227 compress/zsda: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/compress/zsda/zsda_comp_pmd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/compress/zsda/zsda_comp_pmd.c +5 -5
index 6d857be2f0..057e7178e2 100644
@@ -227,7 +227,7 @@ zsda_private_xform_free(struct rte_compressdev *dev __rte_unused,
 
 static int
 zsda_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
-		uint32_t max_inflight_ops, int socket_id)
+		uint32_t max_inflight_ops, int numa_id)
 {
 	int ret = ZSDA_SUCCESS;
 	struct zsda_qp *qp_new;
@@ -247,15 +247,15 @@ zsda_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 			return ret;
 	}
 
-	qp_new = rte_zmalloc_socket("zsda PMD qp metadata", sizeof(*qp_new),
-				    RTE_CACHE_LINE_SIZE, socket_id);
+	qp_new = rte_zmalloc_numa("zsda PMD qp metadata", sizeof(*qp_new),
+				    RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp_new == NULL) {
 		ZSDA_LOG(ERR, "Failed! qp_new is NULL");
 		return -ENOMEM;
 	}
 
 	task_q_info.nb_des = nb_des;
-	task_q_info.socket_id = socket_id;
+	task_q_info.numa_id = numa_id;
 	task_q_info.qp_id = qp_id;
 	task_q_info.rx_cb = zsda_comp_callback;
 
@@ -377,7 +377,7 @@ zsda_comp_dev_create(struct zsda_pci_device *zsda_pci_dev)
 	comp_dev->capa_mz = rte_memzone_lookup(capa_memz_name);
 	if (comp_dev->capa_mz == NULL)
 		comp_dev->capa_mz = rte_memzone_reserve(
-			capa_memz_name, capa_size, rte_socket_id(), 0);
+			capa_memz_name, capa_size, rte_numa_id(), 0);
 
 	if (comp_dev->capa_mz == NULL) {
 		ZSDA_LOG(DEBUG, "Failed! comp_dev->capa_mz is NULL");
Signature · 1 line
2.55.0
#64 lore raw

PATCH 62/227 crypto/armv8: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/armv8/rte_armv8_pmd.c     |  6 +++---
 drivers/crypto/armv8/rte_armv8_pmd_ops.c | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/crypto/armv8/rte_armv8_pmd.c +3 -3
index 582dbadbdd..86378ddf4d 100644
@@ -807,7 +807,7 @@ cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev)
 	struct rte_cryptodev_pmd_init_params init_params = {
 		"",
 		sizeof(struct armv8_crypto_private),
-		rte_socket_id(),
+		rte_numa_id(),
 		RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
 	};
 	const char *name;
@@ -835,7 +835,7 @@ cryptodev_armv8_crypto_uninit(struct rte_vdev_device *vdev)
 
 	ARMV8_CRYPTO_LOG_INFO(
 		"Closing ARMv8 crypto device %s on numa socket %u",
-		name, rte_socket_id());
+		name, rte_numa_id());
 
 	cryptodev = rte_cryptodev_pmd_get_named_dev(name);
 	if (cryptodev == NULL)
@@ -857,6 +857,6 @@ RTE_LOG_REGISTER_DEFAULT(crypto_armv8_log_type, ERR);
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_ARMV8_PMD, armv8_crypto_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ARMV8_PMD,
 	"max_nb_queue_pairs=<int> "
-	"socket_id=<int>");
+	"numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(armv8_crypto_drv, armv8_crypto_pmd_drv.driver,
 		cryptodev_driver_id);
drivers/crypto/armv8/rte_armv8_pmd_ops.c +6 -6
index c4964bc112..7d78ac94b9 100644
@@ -190,7 +190,7 @@ armv8_crypto_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 /** Create a ring to place processed operations on */
 static struct rte_ring *
 armv8_crypto_pmd_qp_create_processed_ops_ring(struct armv8_crypto_qp *qp,
-		unsigned int ring_size, int socket_id)
+		unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 
@@ -209,7 +209,7 @@ armv8_crypto_pmd_qp_create_processed_ops_ring(struct armv8_crypto_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 }
 
@@ -218,7 +218,7 @@ armv8_crypto_pmd_qp_create_processed_ops_ring(struct armv8_crypto_qp *qp,
 static int
 armv8_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	struct armv8_crypto_qp *qp = NULL;
 
@@ -227,8 +227,8 @@ armv8_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		armv8_crypto_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("ARMv8 PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("ARMv8 PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return -ENOMEM;
 
@@ -239,7 +239,7 @@ armv8_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		goto qp_setup_cleanup;
 
 	qp->processed_ops = armv8_crypto_pmd_qp_create_processed_ops_ring(qp,
-			qp_conf->nb_descriptors, socket_id);
+			qp_conf->nb_descriptors, numa_id);
 	if (qp->processed_ops == NULL)
 		goto qp_setup_cleanup;
 
Signature · 1 line
2.55.0
#65 lore raw

PATCH 63/227 crypto/bcmfs: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/bcmfs/bcmfs_qp.c      | 16 ++++++++--------
 drivers/crypto/bcmfs/bcmfs_qp.h      |  2 +-
 drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/crypto/bcmfs/bcmfs_qp.c +8 -8
index 59e39a6c14..feaaa81015 100644
@@ -63,15 +63,15 @@ bcmfs_queue_delete(struct bcmfs_queue *queue,
 
 static const struct rte_memzone *
 queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
-		       int socket_id, unsigned int align)
+		       int numa_id, unsigned int align)
 {
 	const struct rte_memzone *mz;
 
 	mz = rte_memzone_lookup(queue_name);
 	if (mz != NULL) {
 		if (((size_t)queue_size <= mz->len) &&
-		    (socket_id == SOCKET_ID_ANY ||
-		     socket_id == mz->socket_id)) {
+		    (numa_id == RTE_NUMA_ID_ANY ||
+		     numa_id == mz->socket_id)) {
 			BCMFS_LOG(DEBUG, "re-use memzone already "
 					"allocated for %s", queue_name);
 			return mz;
@@ -81,14 +81,14 @@ queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size,
 				"allocated %s, size %u, socket %d. "
 				"Requested size %u, socket %u",
 				queue_name, (uint32_t)mz->len,
-				mz->socket_id, queue_size, socket_id);
+				mz->socket_id, queue_size, numa_id);
 		return NULL;
 	}
 
 	BCMFS_LOG(DEBUG, "Allocate memzone for %s, size %u on socket %u",
-		  queue_name, queue_size, socket_id);
+		  queue_name, queue_size, numa_id);
 	return rte_memzone_reserve_aligned(queue_name, queue_size,
-		socket_id, RTE_MEMZONE_IOVA_CONTIG, align);
+		numa_id, RTE_MEMZONE_IOVA_CONTIG, align);
 }
 
 static int
@@ -216,9 +216,9 @@ bcmfs_qp_setup(struct bcmfs_qp **qp_addr,
 		return -EINVAL;
 	}
 
-	qp = rte_zmalloc_socket("BCM FS PMD qp metadata",
+	qp = rte_zmalloc_numa("BCM FS PMD qp metadata",
 				sizeof(*qp), RTE_CACHE_LINE_SIZE,
-				qp_conf->socket_id);
+				qp_conf->numa_id);
 	if (qp == NULL) {
 		BCMFS_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
drivers/crypto/bcmfs/bcmfs_qp.h +1 -1
index 42adff9033..dbcb19e628 100644
@@ -44,7 +44,7 @@ struct bcmfs_qp_stats {
 
 struct bcmfs_qp_config {
 	/* Socket to allocate memory on */
-	int socket_id;
+	int numa_id;
 	/* Mapped iobase for qp */
 	void *iobase;
 	/* nb_descriptors or requests a h/w queue can accommodate */
drivers/crypto/bcmfs/bcmfs_sym_pmd.c +5 -5
index 3f2ff40cd8..bd1758fa0c 100644
@@ -149,7 +149,7 @@ req_pool_obj_init(__rte_unused struct rte_mempool *mp,
 static struct rte_mempool *
 bcmfs_sym_req_pool_create(struct rte_cryptodev *cdev __rte_unused,
 			  uint32_t nobjs, uint16_t qp_id,
-			  int socket_id)
+			  int numa_id)
 {
 	char softreq_pool_name[RTE_RING_NAMESIZE];
 	struct rte_mempool *mp;
@@ -161,7 +161,7 @@ bcmfs_sym_req_pool_create(struct rte_cryptodev *cdev __rte_unused,
 				RTE_ALIGN_MUL_CEIL(nobjs, 64),
 				sizeof(struct bcmfs_sym_request),
 				64, 0, NULL, NULL, req_pool_obj_init, NULL,
-				socket_id, 0);
+				numa_id, 0);
 	if (mp == NULL)
 		BCMFS_LOG(ERR, "Failed to create req pool, qid %d, err %d",
 				qp_id, rte_errno);
@@ -172,7 +172,7 @@ bcmfs_sym_req_pool_create(struct rte_cryptodev *cdev __rte_unused,
 static int
 bcmfs_sym_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 		   const struct rte_cryptodev_qp_conf *qp_conf,
-		   int socket_id)
+		   int numa_id)
 {
 	int ret = 0;
 	struct bcmfs_qp *qp = NULL;
@@ -197,7 +197,7 @@ bcmfs_sym_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 	}
 
 	bcmfs_qp_conf.nb_descriptors = qp_conf->nb_descriptors;
-	bcmfs_qp_conf.socket_id = socket_id;
+	bcmfs_qp_conf.numa_id = numa_id;
 	bcmfs_qp_conf.max_descs_req = BCMFS_CRYPTO_MAX_HW_DESCS_PER_REQ;
 	bcmfs_qp_conf.iobase = BCMFS_QP_IOBASE_XLATE(fsdev->mmap_addr, qp_id);
 	bcmfs_qp_conf.ops = fsdev->sym_hw_qp_ops;
@@ -209,7 +209,7 @@ bcmfs_sym_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 	qp = (struct bcmfs_qp *)*qp_addr;
 
 	qp->sr_mp = bcmfs_sym_req_pool_create(cdev, qp_conf->nb_descriptors,
-					      qp_id, socket_id);
+					      qp_id, numa_id);
 	if (qp->sr_mp == NULL)
 		return -ENOMEM;
 
Signature · 1 line
2.55.0
#66 lore raw

PATCH 64/227 crypto/caam_jr: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/caam_jr/caam_jr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/caam_jr/caam_jr.c +4 -4
index 01a9bed1ff..7d3355975b 100644
@@ -1514,7 +1514,7 @@ static int
 caam_jr_queue_pair_setup(
 		struct rte_cryptodev *dev, uint16_t qp_id,
 		__rte_unused const struct rte_cryptodev_qp_conf *qp_conf,
-		__rte_unused int socket_id)
+		__rte_unused int numa_id)
 {
 	struct sec_job_ring_t *internals;
 	struct caam_jr_qp *qp = NULL;
@@ -1962,7 +1962,7 @@ caam_jr_dev_configure(struct rte_cryptodev *dev,
 						sizeof(struct caam_jr_op_ctx),
 						CTX_POOL_CACHE_SIZE, 0,
 						NULL, NULL, NULL, NULL,
-						SOCKET_ID_ANY, 0);
+						RTE_NUMA_ID_ANY, 0);
 		if (!internals->ctx_pool) {
 			CAAM_JR_ERR("%s create failed", str);
 			return -ENOMEM;
@@ -2373,7 +2373,7 @@ cryptodev_caam_jr_probe(struct rte_vdev_device *vdev)
 	struct rte_cryptodev_pmd_init_params init_params = {
 		"",
 		sizeof(struct sec_job_ring_t),
-		rte_socket_id(),
+		rte_numa_id(),
 		RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
 	};
 	const char *name;
@@ -2455,7 +2455,7 @@ static struct cryptodev_driver caam_jr_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_CAAM_JR_PMD, cryptodev_caam_jr_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CAAM_JR_PMD,
 	"max_nb_queue_pairs=<int>"
-	"socket_id=<int>");
+	"numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(caam_jr_crypto_drv, cryptodev_caam_jr_drv.driver,
 		cryptodev_driver_id);
 
Signature · 1 line
2.55.0
#67 lore raw

PATCH 65/227 crypto/ccp: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/ccp/ccp_dev.c     | 14 +++++++-------
 drivers/crypto/ccp/ccp_pmd_ops.c | 14 +++++++-------
 drivers/crypto/ccp/rte_ccp_pmd.c |  8 ++++----
 3 files changed, 18 insertions(+), 18 deletions(-)
drivers/crypto/ccp/ccp_dev.c +7 -7
index a75816cdfc..defbb1e5a8 100644
@@ -85,15 +85,15 @@ ccp_read_hwrng(uint32_t *value)
 static const struct rte_memzone *
 ccp_queue_dma_zone_reserve(const char *queue_name,
 			   uint32_t queue_size,
-			   int socket_id)
+			   int numa_id)
 {
 	const struct rte_memzone *mz;
 
 	mz = rte_memzone_lookup(queue_name);
 	if (mz != 0) {
 		if (((size_t)queue_size <= mz->len) &&
-		    ((socket_id == SOCKET_ID_ANY) ||
-		     (socket_id == mz->socket_id))) {
+		    ((numa_id == RTE_NUMA_ID_ANY) ||
+		     (numa_id == mz->socket_id))) {
 			CCP_LOG_INFO("re-use memzone already "
 				     "allocated for %s", queue_name);
 			return mz;
@@ -102,15 +102,15 @@ ccp_queue_dma_zone_reserve(const char *queue_name,
 			    "allocated %s, size %u, socket %d. "
 			    "Requested size %u, socket %u",
 			    queue_name, (uint32_t)mz->len,
-			    mz->socket_id, queue_size, socket_id);
+			    mz->socket_id, queue_size, numa_id);
 		return NULL;
 	}
 
 	CCP_LOG_INFO("Allocate memzone for %s, size %u on socket %u",
-		     queue_name, queue_size, socket_id);
+		     queue_name, queue_size, numa_id);
 
 	return rte_memzone_reserve_aligned(queue_name, queue_size,
-			socket_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);
+			numa_id, RTE_MEMZONE_IOVA_CONTIG, queue_size);
 }
 
 /* bitmap support apis */
@@ -545,7 +545,7 @@ ccp_add_device(struct ccp_device *dev)
 			 (int)dev->id, "queue",
 			 (int)cmd_q->id, "mem");
 		q_mz = ccp_queue_dma_zone_reserve(cmd_q->memz_name,
-						  cmd_q->qsize, SOCKET_ID_ANY);
+						  cmd_q->qsize, RTE_NUMA_ID_ANY);
 		cmd_q->qbase_addr = (void *)q_mz->addr;
 		cmd_q->qbase_desc = (void *)q_mz->addr;
 		cmd_q->qbase_phys_addr =  q_mz->iova;
drivers/crypto/ccp/ccp_pmd_ops.c +7 -7
index 52f320b02b..3e22653df1 100644
@@ -660,7 +660,7 @@ ccp_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 
 static struct rte_ring *
 ccp_pmd_qp_create_batch_info_ring(struct ccp_qp *qp,
-				  unsigned int ring_size, int socket_id)
+				  unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 
@@ -678,14 +678,14 @@ ccp_pmd_qp_create_batch_info_ring(struct ccp_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 }
 
 static int
 ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		 const struct rte_cryptodev_qp_conf *qp_conf,
-		 int socket_id)
+		 int numa_id)
 {
 	struct ccp_private *internals = dev->data->dev_private;
 	struct ccp_qp *qp;
@@ -702,8 +702,8 @@ ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		ccp_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("CCP Crypto PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("CCP Crypto PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL) {
 		CCP_LOG_ERR("Failed to allocate queue pair memory");
 		return (-ENOMEM);
@@ -720,7 +720,7 @@ ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	}
 
 	qp->processed_pkts = ccp_pmd_qp_create_batch_info_ring(qp,
-			qp_conf->nb_descriptors, socket_id);
+			qp_conf->nb_descriptors, numa_id);
 	if (qp->processed_pkts == NULL) {
 		CCP_LOG_ERR("Failed to create batch info ring");
 		goto qp_setup_cleanup;
@@ -735,7 +735,7 @@ ccp_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 				sizeof(struct ccp_batch_info),
 				RTE_CACHE_LINE_SIZE,
 				0, NULL, NULL, NULL, NULL,
-				SOCKET_ID_ANY, 0);
+				RTE_NUMA_ID_ANY, 0);
 	if (qp->batch_mp == NULL)
 		goto qp_setup_cleanup;
 	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
drivers/crypto/ccp/rte_ccp_pmd.c +4 -4
index ab19f8fd9c..50e2adb6d0 100644
@@ -29,7 +29,7 @@ struct ccp_pmd_init_params {
 };
 
 #define CCP_CRYPTODEV_PARAM_NAME		("name")
-#define CCP_CRYPTODEV_PARAM_SOCKET_ID		("socket_id")
+#define CCP_CRYPTODEV_PARAM_SOCKET_ID		("numa_id")
 #define CCP_CRYPTODEV_PARAM_MAX_NB_QP		("max_nb_queue_pairs")
 #define CCP_CRYPTODEV_PARAM_AUTH_OPT		("ccp_auth_opt")
 
@@ -194,7 +194,7 @@ cryptodev_ccp_remove(struct rte_pci_device *pci_dev)
 
 	ccp_pmd_init_done = 0;
 
-	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_socket_id());
+	CCP_LOG_INFO("Closing ccp device %s on numa socket %u", name, rte_numa_id());
 
 	return rte_cryptodev_pmd_destroy(dev);
 }
@@ -271,7 +271,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		.def_p = {
 			"",
 			sizeof(struct ccp_private),
-			rte_socket_id(),
+			rte_numa_id(),
 			CCP_PMD_MAX_QUEUE_PAIRS
 		},
 		.auth_opt = CCP_PMD_AUTH_OPT_CCP,
@@ -316,7 +316,7 @@ RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_CCP_PMD, cryptodev_ccp_pmd_drv);
 RTE_PMD_REGISTER_KMOD_DEP(CRYPTODEV_NAME_CCP_PMD, "* igb_uio | uio_pci_generic | vfio-pci");
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CCP_PMD,
 	"max_nb_queue_pairs=<int> "
-	"socket_id=<int> "
+	"numa_id=<int> "
 	"ccp_auth_opt=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(ccp_crypto_drv, cryptodev_ccp_pmd_drv.driver,
 			       ccp_cryptodev_driver_id);
Signature · 1 line
2.55.0
#68 lore raw

PATCH 66/227 crypto/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 12 ++++++------
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +6 -6
index a5b8aff146..f0bb698390 100644
@@ -356,7 +356,7 @@ cnxk_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 		 dev->data->dev_id, qp_id);
 
 	pool = rte_mempool_create(mempool_name, mb_pool_sz, mlen, cache_sz, 0,
-				  NULL, NULL, NULL, NULL, rte_socket_id(), 0);
+				  NULL, NULL, NULL, NULL, rte_numa_id(), 0);
 
 	if (pool == NULL) {
 		plt_err("Could not create mempool for metabuf");
@@ -394,7 +394,7 @@ cnxk_cpt_qp_create(const struct rte_cryptodev *dev, uint16_t qp_id,
 	int ret;
 
 	/* Allocate queue pair */
-	qp = rte_zmalloc_socket("CNXK Crypto PMD Queue Pair", sizeof(*qp),
+	qp = rte_zmalloc_numa("CNXK Crypto PMD Queue Pair", sizeof(*qp),
 				ROC_ALIGN, 0);
 	if (qp == NULL) {
 		plt_err("Could not allocate queue pair");
@@ -407,7 +407,7 @@ cnxk_cpt_qp_create(const struct rte_cryptodev *dev, uint16_t qp_id,
 
 		qp_memzone_name_get(name, RTE_MEMZONE_NAMESIZE, dev->data->dev_id, qp_id);
 
-		pq_mem = rte_memzone_reserve_aligned(name, len, rte_socket_id(),
+		pq_mem = rte_memzone_reserve_aligned(name, len, rte_numa_id(),
 						     RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_256MB,
 						     RTE_CACHE_LINE_SIZE);
 		if (pq_mem == NULL) {
@@ -499,7 +499,7 @@ cnxk_cpt_queue_pair_release(struct rte_cryptodev *dev, uint16_t qp_id)
 int
 cnxk_cpt_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			  const struct rte_cryptodev_qp_conf *conf,
-			  int socket_id __rte_unused)
+			  int numa_id __rte_unused)
 {
 	struct cnxk_cpt_vf *vf = dev->data->dev_private;
 	struct roc_cpt *roc_cpt = &vf->cpt;
@@ -593,7 +593,7 @@ cnxk_cpt_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 int
 cnxk_cpt_queue_pair_reset(struct rte_cryptodev *dev, uint16_t qp_id,
-			  const struct rte_cryptodev_qp_conf *conf, int socket_id)
+			  const struct rte_cryptodev_qp_conf *conf, int numa_id)
 {
 	if (conf == NULL) {
 		struct cnxk_cpt_vf *vf = dev->data->dev_private;
@@ -618,7 +618,7 @@ cnxk_cpt_queue_pair_reset(struct rte_cryptodev *dev, uint16_t qp_id,
 		return 0;
 	}
 
-	return cnxk_cpt_queue_pair_setup(dev, qp_id, conf, socket_id);
+	return cnxk_cpt_queue_pair_setup(dev, qp_id, conf, numa_id);
 }
 
 uint32_t
drivers/crypto/cnxk/cnxk_cryptodev_ops.h +2 -2
index 6c4265f339..a605ceb613 100644
@@ -139,10 +139,10 @@ void cnxk_cpt_dev_info_get(struct rte_cryptodev *dev,
 
 int cnxk_cpt_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			      const struct rte_cryptodev_qp_conf *conf,
-			      int socket_id __rte_unused);
+			      int numa_id __rte_unused);
 
 int cnxk_cpt_queue_pair_reset(struct rte_cryptodev *dev, uint16_t qp_id,
-			      const struct rte_cryptodev_qp_conf *conf, int socket_id);
+			      const struct rte_cryptodev_qp_conf *conf, int numa_id);
 
 int cnxk_cpt_queue_pair_release(struct rte_cryptodev *dev, uint16_t qp_id);
 
Signature · 1 line
2.55.0
#69 lore raw

PATCH 67/227 crypto/dpaa2_sec: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +3 -3
index 7bcb472838..64fbf20d5a 100644
@@ -2084,7 +2084,7 @@ dpaa2_sec_queue_pair_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)
 static int
 dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		__rte_unused int socket_id)
+		__rte_unused int numa_id)
 {
 	struct dpaa2_sec_dev_private *priv = dev->data->dev_private;
 	struct dpaa2_sec_qp *qp;
@@ -2137,7 +2137,7 @@ dpaa2_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			FLE_POOL_BUF_SIZE,
 			FLE_POOL_CACHE_SIZE, 0,
 			NULL, NULL, NULL, NULL,
-			SOCKET_ID_ANY, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET);
+			RTE_NUMA_ID_ANY, MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET);
 	if (!qp->fle_pool) {
 		DPAA2_SEC_ERR("Mempool (%s) creation failed", str);
 		return -ENOMEM;
@@ -4376,7 +4376,7 @@ dpaa2_sec_uninit(const struct rte_cryptodev *dev)
 	rte_free(dev->security_ctx);
 
 	DPAA2_SEC_INFO("Closing DPAA2_SEC device %s on numa socket %u",
-		       dev->data->name, rte_socket_id());
+		       dev->data->name, rte_numa_id());
 
 	return 0;
 }
Signature · 1 line
2.55.0
#70 lore raw

PATCH 68/227 crypto/dpaa_sec: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/dpaa_sec/dpaa_sec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/dpaa_sec/dpaa_sec.c +3 -3
index 65b3573a1a..9eb7772b05 100644
@@ -2135,7 +2135,7 @@ dpaa_sec_queue_pair_release(struct rte_cryptodev *dev,
 static int
 dpaa_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		__rte_unused const struct rte_cryptodev_qp_conf *qp_conf,
-		__rte_unused int socket_id)
+		__rte_unused int numa_id)
 {
 	struct dpaa_sec_dev_private *internals;
 	struct dpaa_sec_qp *qp = NULL;
@@ -2160,7 +2160,7 @@ dpaa_sec_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 							CTX_POOL_BUF_SIZE,
 							CTX_POOL_CACHE_SIZE, 0,
 							NULL, NULL, NULL, NULL,
-							SOCKET_ID_ANY, 0);
+							RTE_NUMA_ID_ANY, 0);
 		if (!qp->ctx_pool) {
 			DPAA_SEC_ERR("%s create failed", str);
 			return -ENOMEM;
@@ -3619,7 +3619,7 @@ dpaa_sec_uninit(struct rte_cryptodev *dev)
 
 	rte_free(dev->security_ctx);
 	DPAA_SEC_INFO("Closing DPAA_SEC device %s on numa socket %u",
-		      dev->data->name, rte_socket_id());
+		      dev->data->name, rte_numa_id());
 
 	return 0;
 }
Signature · 1 line
2.55.0
#71 lore raw

PATCH 69/227 crypto/ionic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/ionic/ionic_crypto.h      |  6 ++--
 drivers/crypto/ionic/ionic_crypto_main.c | 42 ++++++++++++------------
 drivers/crypto/ionic/ionic_crypto_ops.c  |  8 ++---
 drivers/crypto/ionic/ionic_crypto_vdev.c |  2 +-
 4 files changed, 29 insertions(+), 29 deletions(-)
drivers/crypto/ionic/ionic_crypto.h +3 -3
index 5a03260486..4054f0beb1 100644
@@ -234,7 +234,7 @@ struct iocpt_dev {
 	uint32_t max_sessions;
 	uint16_t state;
 	uint8_t driver_id;
-	uint8_t socket_id;
+	uint8_t numa_id;
 
 	rte_spinlock_t adminq_lock;
 	rte_spinlock_t adminq_service_lock;
@@ -285,7 +285,7 @@ struct iocpt_admin_ctx {
 
 int iocpt_probe(void *bus_dev, struct rte_device *rte_dev,
 	struct iocpt_dev_bars *bars, const struct iocpt_dev_intf *intf,
-	uint8_t driver_id, uint8_t socket_id);
+	uint8_t driver_id, uint8_t numa_id);
 int iocpt_remove(struct rte_device *rte_dev);
 
 void iocpt_configure(struct iocpt_dev *dev);
@@ -301,7 +301,7 @@ void iocpt_dev_reset(struct iocpt_dev *dev);
 
 int iocpt_adminq_post_wait(struct iocpt_dev *dev, struct iocpt_admin_ctx *ctx);
 
-int iocpt_cryptoq_alloc(struct iocpt_dev *dev, uint32_t socket_id,
+int iocpt_cryptoq_alloc(struct iocpt_dev *dev, uint32_t numa_id,
 	uint32_t index, uint16_t ndescs);
 void iocpt_cryptoq_free(struct iocpt_crypto_q *cptq);
 
drivers/crypto/ionic/ionic_crypto_main.c +21 -21

144 lines not on this page · raw message

drivers/crypto/ionic/ionic_crypto_ops.c +4 -4
index 839bbf69d1..405c282fd7 100644
@@ -101,7 +101,7 @@ iocpt_op_queue_release(struct rte_cryptodev *cdev, uint16_t queue_id)
 static int
 iocpt_op_queue_setup(struct rte_cryptodev *cdev, uint16_t queue_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	struct iocpt_dev *dev = cdev->data->dev_private;
 	int err;
@@ -119,7 +119,7 @@ iocpt_op_queue_setup(struct rte_cryptodev *cdev, uint16_t queue_id,
 
 	IOCPT_PRINT(DEBUG, "queue_id %u", queue_id);
 
-	err = iocpt_cryptoq_alloc(dev, socket_id, queue_id,
+	err = iocpt_cryptoq_alloc(dev, numa_id, queue_id,
 				qp_conf->nb_descriptors);
 	if (err != 0)
 		return err;
@@ -428,8 +428,8 @@ iocpt_enqueue_wdog(struct iocpt_crypto_q *cptq)
 	if (avail < 1)
 		goto out_flush;
 
-	wdog_op = rte_zmalloc_socket("iocpt", sizeof(*wdog_op),
-				RTE_CACHE_LINE_SIZE, rte_socket_id());
+	wdog_op = rte_zmalloc_numa("iocpt", sizeof(*wdog_op),
+				RTE_CACHE_LINE_SIZE, rte_numa_id());
 	if (wdog_op == NULL)
 		goto out_flush;
 
drivers/crypto/ionic/ionic_crypto_vdev.c +1 -1
index d15acf660a..e4a7d56e5d 100644
@@ -107,7 +107,7 @@ iocpt_vdev_probe(struct rte_vdev_device *vdev)
 
 	return iocpt_probe((void *)vdev, &vdev->device,
 			&bars, &iocpt_vdev_intf,
-			iocpt_vdev_driver_id, rte_socket_id());
+			iocpt_vdev_driver_id, rte_numa_id());
 }
 
 static int
Signature · 1 line
2.55.0
#72 lore raw

PATCH 70/227 crypto/ipsec_mb: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c     | 22 +++++++++++-----------
 drivers/crypto/ipsec_mb/ipsec_mb_private.c |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.h |  4 ++--
 drivers/crypto/ipsec_mb/pmd_aesni_gcm.c    |  6 +++---
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c     |  2 +-
 drivers/crypto/ipsec_mb/pmd_snow3g.c       |  2 +-
 drivers/crypto/ipsec_mb/pmd_zuc.c          |  2 +-
 7 files changed, 20 insertions(+), 20 deletions(-)
drivers/crypto/ipsec_mb/ipsec_mb_ops.c +11 -11
index 50ee140ccd..7a9a518c74 100644
@@ -96,7 +96,7 @@ ipsec_mb_info_get(struct rte_cryptodev *dev,
 static int
 ipsec_mb_secondary_qp_op(int dev_id, int qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id, enum ipsec_mb_mp_req_type op_type)
+		int numa_id, enum ipsec_mb_mp_req_type op_type)
 {
 	int ret;
 	struct rte_mp_msg qp_req_msg;
@@ -114,7 +114,7 @@ ipsec_mb_secondary_qp_op(int dev_id, int qp_id,
 	req_param->type = op_type;
 	req_param->dev_id = dev_id;
 	req_param->qp_id = qp_id;
-	req_param->socket_id = socket_id;
+	req_param->numa_id = numa_id;
 	req_param->process_id = getpid();
 	if (qp_conf) {
 		req_param->nb_descriptors = qp_conf->nb_descriptors;
@@ -179,7 +179,7 @@ ipsec_mb_qp_set_unique_name(struct rte_cryptodev *dev,
 /** Create a ring to place processed operations on */
 static struct rte_ring
 *ipsec_mb_qp_create_processed_ops_ring(
-	struct ipsec_mb_qp *qp, unsigned int ring_size, int socket_id)
+	struct ipsec_mb_qp *qp, unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 	char ring_name[RTE_CRYPTODEV_NAME_MAX_LEN];
@@ -203,7 +203,7 @@ static struct rte_ring
 		return NULL;
 	}
 
-	return rte_ring_create(ring_name, ring_size, socket_id,
+	return rte_ring_create(ring_name, ring_size, numa_id,
 			       RING_F_SP_ENQ | RING_F_SC_DEQ);
 }
 
@@ -218,7 +218,7 @@ ipsec_mb_alloc_mgr_from_memzone(const struct rte_memzone **mb_mgr_mz,
 		if (*mb_mgr_mz == NULL) {
 			*mb_mgr_mz = rte_memzone_reserve(mb_mgr_mz_name,
 			imb_get_mb_mgr_size(),
-			rte_socket_id(), 0);
+			rte_numa_id(), 0);
 		}
 		if (*mb_mgr_mz == NULL) {
 			IPSEC_MB_LOG(DEBUG, "Error allocating memzone for %s",
@@ -244,7 +244,7 @@ ipsec_mb_alloc_mgr_from_memzone(const struct rte_memzone **mb_mgr_mz,
 int
 ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 				const struct rte_cryptodev_qp_conf *qp_conf,
-				int socket_id)
+				int numa_id)
 {
 	struct ipsec_mb_qp *qp = NULL;
 	struct ipsec_mb_dev_private *internals = dev->data->dev_private;
@@ -258,7 +258,7 @@ ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		if (qp == NULL) {
 			IPSEC_MB_LOG(DEBUG, "Secondary process setting up device qp.");
 			return ipsec_mb_secondary_qp_op(dev->data->dev_id, qp_id,
-						qp_conf, socket_id,	RTE_IPSEC_MB_MP_REQ_QP_SET);
+						qp_conf, numa_id,	RTE_IPSEC_MB_MP_REQ_QP_SET);
 		}
 	} else {
 		/* Free memory prior to re-allocation if needed. */
@@ -267,8 +267,8 @@ ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 
 		qp_size = sizeof(*qp) + pmd_data->qp_priv_size;
 		/* Allocate the queue pair data structure. */
-		qp = rte_zmalloc_socket("IPSEC PMD Queue Pair", qp_size,
-					RTE_CACHE_LINE_SIZE, socket_id);
+		qp = rte_zmalloc_numa("IPSEC PMD Queue Pair", qp_size,
+					RTE_CACHE_LINE_SIZE, numa_id);
 		if (qp == NULL)
 			return -ENOMEM;
 	}
@@ -297,7 +297,7 @@ ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	qp->sess_mp = qp_conf->mp_session;
 
 	qp->ingress_queue = ipsec_mb_qp_create_processed_ops_ring(qp,
-		qp_conf->nb_descriptors, socket_id);
+		qp_conf->nb_descriptors, numa_id);
 	if (qp->ingress_queue == NULL) {
 		ret = -EINVAL;
 		goto qp_setup_cleanup;
@@ -356,7 +356,7 @@ ipsec_mb_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer)
 			goto out;
 		}
 
-		ret = ipsec_mb_qp_setup(dev, qp_id,	&queue_conf, req_param->socket_id);
+		ret = ipsec_mb_qp_setup(dev, qp_id,	&queue_conf, req_param->numa_id);
 		if (!ret) {
 			qp = dev->data->queue_pairs[qp_id];
 			if (!qp) {
drivers/crypto/ipsec_mb/ipsec_mb_private.c +1 -1
index 23ec99004b..92c60daacd 100644
@@ -101,7 +101,7 @@ ipsec_mb_create(struct rte_vdev_device *vdev,
 		pmd_data->internals_priv_size;
 	init_params.max_nb_queue_pairs =
 		RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS;
-	init_params.numa_id = rte_socket_id();
+	init_params.numa_id = rte_numa_id();
 
 	name = rte_vdev_device_name(vdev);
 	if (name == NULL)
drivers/crypto/ipsec_mb/ipsec_mb_private.h +2 -2
index fc7d6f5f06..636b9d393e 100644
@@ -163,7 +163,7 @@ struct ipsec_mb_mp_param {
 	/**< The identifier of the device */
 	int qp_id;
 	/**< The index of the queue pair to be configured */
-	int socket_id;
+	int numa_id;
 	/**< Socket to allocate resources on */
 	uint16_t process_id;
 	/**< The pid who send out the requested */
@@ -411,7 +411,7 @@ ipsec_mb_qp_set_unique_name(struct rte_cryptodev *dev, struct ipsec_mb_qp *qp);
 int
 ipsec_mb_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 				 const struct rte_cryptodev_qp_conf *qp_conf,
-				 int socket_id);
+				 int numa_id);
 
 /** Returns the size of the aesni multi-buffer session structure */
 unsigned
drivers/crypto/ipsec_mb/pmd_aesni_gcm.c +3 -3
index 2a4bede7dd..57967653da 100644
@@ -740,9 +740,9 @@ aesni_gcm_process_bulk(struct rte_cryptodev *dev __rte_unused,
 static int
 aesni_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 				const struct rte_cryptodev_qp_conf *qp_conf,
-				int socket_id)
+				int numa_id)
 {
-	int ret = ipsec_mb_qp_setup(dev, qp_id, qp_conf, socket_id);
+	int ret = ipsec_mb_qp_setup(dev, qp_id, qp_conf, numa_id);
 	if (ret < 0)
 		return ret;
 
@@ -790,7 +790,7 @@ static struct cryptodev_driver aesni_gcm_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD,
 		      cryptodev_aesni_gcm_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
-			      "max_nb_queue_pairs=<int> socket_id=<int>");
+			      "max_nb_queue_pairs=<int> numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_gcm_crypto_drv,
 			       cryptodev_aesni_gcm_pmd_drv.driver,
 			       pmd_driver_id_aesni_gcm);
drivers/crypto/ipsec_mb/pmd_aesni_mb.c +1 -1
index d39539d7aa..d1a044f205 100644
@@ -2552,7 +2552,7 @@ static struct cryptodev_driver aesni_mb_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD,
 	cryptodev_aesni_mb_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
-			"max_nb_queue_pairs=<int> socket_id=<int>");
+			"max_nb_queue_pairs=<int> numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(
 	aesni_mb_crypto_drv,
 	cryptodev_aesni_mb_pmd_drv.driver,
drivers/crypto/ipsec_mb/pmd_snow3g.c +1 -1
index 28b078ea0c..54e8ba6588 100644
@@ -575,7 +575,7 @@ static struct cryptodev_driver snow3g_crypto_drv;
 
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
-			       "max_nb_queue_pairs=<int> socket_id=<int>");
+			       "max_nb_queue_pairs=<int> numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(snow3g_crypto_drv,
 				cryptodev_snow3g_pmd_drv.driver,
 				pmd_driver_id_snow3g);
drivers/crypto/ipsec_mb/pmd_zuc.c +1 -1
index 102ac520bb..784c2aa2bf 100644
@@ -378,7 +378,7 @@ static struct cryptodev_driver zuc_crypto_drv;
 
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_ZUC_PMD, cryptodev_zuc_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ZUC_PMD,
-	"max_nb_queue_pairs=<int> socket_id=<int>");
+	"max_nb_queue_pairs=<int> numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(zuc_crypto_drv, cryptodev_zuc_pmd_drv.driver,
 		pmd_driver_id_zuc);
 
Signature · 1 line
2.55.0
#73 lore raw

PATCH 71/227 crypto/mlx5: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/mlx5/mlx5_crypto.c     |  2 +-
 drivers/crypto/mlx5/mlx5_crypto_gcm.c | 16 ++++++++--------
 drivers/crypto/mlx5/mlx5_crypto_xts.c | 10 +++++-----
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/crypto/mlx5/mlx5_crypto.c +1 -1
index 821dd54b31..c668b2d04a 100644
@@ -353,7 +353,7 @@ mlx5_crypto_dev_probe(struct mlx5_common_device *cdev,
 	struct rte_cryptodev_pmd_init_params init_params = {
 		.name = "",
 		.private_data_size = sizeof(struct mlx5_crypto_priv),
-		.socket_id = cdev->dev->numa_node,
+		.numa_id = cdev->dev->numa_node,
 		.max_nb_queue_pairs =
 				RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
 	};
drivers/crypto/mlx5/mlx5_crypto_gcm.c +8 -8
index d0f01dab4a..078162e7b4 100644
@@ -264,7 +264,7 @@ mlx5_crypto_gcm_init_qp(struct mlx5_crypto_qp *qp)
 
 static inline int
 mlx5_crypto_gcm_umr_qp_setup(struct rte_cryptodev *dev, struct mlx5_crypto_qp *qp,
-			     int socket_id)
+			     int numa_id)
 {
 	struct mlx5_crypto_priv *priv = dev->data->dev_private;
 	struct mlx5_devx_qp_attr attr = {0};
@@ -284,7 +284,7 @@ mlx5_crypto_gcm_umr_qp_setup(struct rte_cryptodev *dev, struct mlx5_crypto_qp *q
 	attr.cd_master = 1;
 	ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->umr_qp_obj,
 				  attr.num_of_send_wqbbs * MLX5_SEND_WQE_BB,
-				  &attr, socket_id);
+				  &attr, numa_id);
 	if (ret) {
 		DRV_LOG(ERR, "Failed to create UMR QP.");
 		return -1;
@@ -301,7 +301,7 @@ mlx5_crypto_gcm_umr_qp_setup(struct rte_cryptodev *dev, struct mlx5_crypto_qp *q
 static int
 mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			 const struct rte_cryptodev_qp_conf *qp_conf,
-			 int socket_id)
+			 int numa_id)
 {
 	struct mlx5_crypto_priv *priv = dev->data->dev_private;
 	struct mlx5_hca_attr *attr = &priv->cdev->config.hca_attr;
@@ -332,8 +332,8 @@ mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	alloc_size = RTE_ALIGN(alloc_size, RTE_CACHE_LINE_SIZE);
 	alloc_size += (sizeof(struct rte_crypto_op *) +
 		       extra_obj_size) * entries;
-	qp = rte_zmalloc_socket(__func__, alloc_size, RTE_CACHE_LINE_SIZE,
-				socket_id);
+	qp = rte_zmalloc_numa(__func__, alloc_size, RTE_CACHE_LINE_SIZE,
+				numa_id);
 	if (qp == NULL) {
 		DRV_LOG(ERR, "Failed to allocate qp memory.");
 		rte_errno = ENOMEM;
@@ -377,7 +377,7 @@ mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	qp->cq_entries_n = rte_align32pow2(entries * (mlx5_crypto_is_ipsec_opt(priv) ? 1 : 3));
 	ret = mlx5_devx_cq_create(priv->cdev->ctx, &qp->cq_obj,
 				  rte_log2_u32(qp->cq_entries_n),
-				  &cq_attr, socket_id);
+				  &cq_attr, numa_id);
 	if (ret != 0) {
 		DRV_LOG(ERR, "Failed to create CQ.");
 		goto err;
@@ -391,7 +391,7 @@ mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	qp_attr.cd_slave_send = !mlx5_crypto_is_ipsec_opt(priv);
 	ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp_obj,
 				  qp_attr.num_of_send_wqbbs * MLX5_WQE_SIZE,
-				  &qp_attr, socket_id);
+				  &qp_attr, numa_id);
 	if (ret != 0) {
 		DRV_LOG(ERR, "Failed to create QP.");
 		goto err;
@@ -403,7 +403,7 @@ mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	qp->ops = (struct rte_crypto_op **)(qp + 1);
 	if (!mlx5_crypto_is_ipsec_opt(priv)) {
 		qp->mkey = (struct mlx5_devx_obj **)(qp->ops + entries);
-		if (mlx5_crypto_gcm_umr_qp_setup(dev, qp, socket_id)) {
+		if (mlx5_crypto_gcm_umr_qp_setup(dev, qp, numa_id)) {
 			DRV_LOG(ERR, "Failed to setup UMR QP.");
 			goto err;
 		}
drivers/crypto/mlx5/mlx5_crypto_xts.c +5 -5
index badde267a7..26b2bcbe1c 100644
@@ -460,7 +460,7 @@ mlx5_crypto_gcm_mkey_klm_update(struct mlx5_crypto_priv *priv,
 static int
 mlx5_crypto_xts_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 				 const struct rte_cryptodev_qp_conf *qp_conf,
-				 int socket_id)
+				 int numa_id)
 {
 	struct mlx5_crypto_priv *priv = dev->data->dev_private;
 	struct mlx5_devx_qp_attr attr = {0};
@@ -486,15 +486,15 @@ mlx5_crypto_xts_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	alloc_size += (sizeof(struct rte_crypto_op *) +
 		       sizeof(struct mlx5_devx_obj *)) *
 		       (size_t)RTE_BIT32(log_nb_desc);
-	qp = rte_zmalloc_socket(__func__, alloc_size, RTE_CACHE_LINE_SIZE,
-				socket_id);
+	qp = rte_zmalloc_numa(__func__, alloc_size, RTE_CACHE_LINE_SIZE,
+				numa_id);
 	if (qp == NULL) {
 		DRV_LOG(ERR, "Failed to allocate QP memory.");
 		rte_errno = ENOMEM;
 		return -rte_errno;
 	}
 	if (mlx5_devx_cq_create(priv->cdev->ctx, &qp->cq_obj, log_nb_desc,
-				&cq_attr, socket_id) != 0) {
+				&cq_attr, numa_id) != 0) {
 		DRV_LOG(ERR, "Failed to create CQ.");
 		goto error;
 	}
@@ -509,7 +509,7 @@ mlx5_crypto_xts_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		mlx5_ts_format_conv(priv->cdev->config.hca_attr.qp_ts_format);
 	ret = mlx5_devx_qp_create(priv->cdev->ctx, &qp->qp_obj,
 					attr.num_of_send_wqbbs * MLX5_WQE_SIZE,
-					&attr, socket_id);
+					&attr, numa_id);
 	if (ret) {
 		DRV_LOG(ERR, "Failed to create QP.");
 		goto error;
Signature · 1 line
2.55.0
#74 lore raw

PATCH 72/227 crypto/mvsam: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/mvsam/rte_mrvl_pmd.c     | 4 ++--
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/mvsam/rte_mrvl_pmd.c +2 -2
index c69f526c52..26069d9db3 100644
@@ -1258,7 +1258,7 @@ cryptodev_mrvl_crypto_uninit(struct rte_vdev_device *vdev)
 		return -EINVAL;
 
 	MRVL_LOG(INFO, "Closing Marvell crypto device %s on numa socket %u.",
-		 name, rte_socket_id());
+		 name, rte_numa_id());
 
 	sam_deinit();
 	rte_mvep_deinit(MVEP_MOD_T_SAM);
@@ -1285,7 +1285,7 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_MRVL_PMD, cryptodev_mrvl_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_MRVL_PMD,
 	"max_nb_queue_pairs=<int> "
 	"max_nb_sessions=<int> "
-	"socket_id=<int>");
+	"numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(mrvl_crypto_drv, cryptodev_mrvl_pmd_drv.driver,
 		cryptodev_driver_id);
 RTE_LOG_REGISTER_DEFAULT(mrvl_logtype_driver, NOTICE);
drivers/crypto/mvsam/rte_mrvl_pmd_ops.c +4 -4
index 5a0658cf83..d485c3dd52 100644
@@ -628,21 +628,21 @@ mrvl_crypto_pmd_close(struct rte_cryptodev *dev)
  * @param dev Pointer to the device structure.
  * @param qp_id ID of the Queue Pair.
  * @param qp_conf Queue pair configuration (nb of descriptors).
- * @param socket_id NUMA socket to allocate memory on.
+ * @param numa_id NUMA socket to allocate memory on.
  * @returns 0 upon success, negative value otherwise.
  */
 static int
 mrvl_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	struct mrvl_crypto_qp *qp = NULL;
 	char match[RTE_CRYPTODEV_NAME_MAX_LEN];
 	unsigned int n;
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("MRVL Crypto PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("MRVL Crypto PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return -ENOMEM;
 
Signature · 1 line
2.55.0
#75 lore raw

PATCH 73/227 crypto/nitrox: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/nitrox/nitrox_sym.c        | 10 +++++-----
 drivers/crypto/nitrox/nitrox_sym_reqmgr.c |  4 ++--
 drivers/crypto/nitrox/nitrox_sym_reqmgr.h |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/nitrox/nitrox_sym.c +5 -5
index 510d6059b1..5f7a37573c 100644
@@ -170,7 +170,7 @@ nitrox_sym_dev_stats_reset(struct rte_cryptodev *cdev)
 static int
 nitrox_sym_dev_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 			const struct rte_cryptodev_qp_conf *qp_conf,
-			int socket_id)
+			int numa_id)
 {
 	struct nitrox_sym_device *sym_dev = cdev->data->dev_private;
 	struct nitrox_device *ndev = sym_dev->ndev;
@@ -190,9 +190,9 @@ nitrox_sym_dev_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 			return err;
 	}
 
-	qp = rte_zmalloc_socket("nitrox PMD qp", sizeof(*qp),
+	qp = rte_zmalloc_numa("nitrox PMD qp", sizeof(*qp),
 				RTE_CACHE_LINE_SIZE,
-				socket_id);
+				numa_id);
 	if (!qp) {
 		NITROX_LOG_LINE(ERR, "Failed to allocate nitrox qp");
 		return -ENOMEM;
@@ -202,12 +202,12 @@ nitrox_sym_dev_qp_setup(struct rte_cryptodev *cdev, uint16_t qp_id,
 	qp->qno = qp_id;
 	err = nitrox_qp_setup(qp, ndev->bar_addr, cdev->data->name,
 			      qp_conf->nb_descriptors, NPS_PKT_IN_INSTR_SIZE,
-			      socket_id);
+			      numa_id);
 	if (unlikely(err))
 		goto qp_setup_err;
 
 	qp->sr_mp = nitrox_sym_req_pool_create(cdev, qp->count, qp_id,
-					       socket_id);
+					       numa_id);
 	if (unlikely(!qp->sr_mp))
 		goto req_pool_err;
 
drivers/crypto/nitrox/nitrox_sym_reqmgr.c +2 -2
index 7751c1a9fc..dd2809935c 100644
@@ -888,7 +888,7 @@ req_pool_obj_init(__rte_unused struct rte_mempool *mp,
 
 struct rte_mempool *
 nitrox_sym_req_pool_create(struct rte_cryptodev *cdev, uint32_t nobjs,
-			   uint16_t qp_id, int socket_id)
+			   uint16_t qp_id, int numa_id)
 {
 	char softreq_pool_name[RTE_RING_NAMESIZE];
 	struct rte_mempool *mp;
@@ -899,7 +899,7 @@ nitrox_sym_req_pool_create(struct rte_cryptodev *cdev, uint32_t nobjs,
 				RTE_ALIGN_MUL_CEIL(nobjs, 64),
 				sizeof(struct nitrox_softreq),
 				64, 0, NULL, NULL, req_pool_obj_init, NULL,
-				socket_id, 0);
+				numa_id, 0);
 	if (unlikely(!mp))
 		NITROX_LOG_LINE(ERR, "Failed to create req pool, qid %d, err %d",
 			   qp_id, rte_errno);
drivers/crypto/nitrox/nitrox_sym_reqmgr.h +1 -1
index fa2637bdb8..37e557360f 100644
@@ -17,7 +17,7 @@ int nitrox_check_se_req(struct nitrox_softreq *sr, struct rte_crypto_op **op);
 void *nitrox_sym_instr_addr(struct nitrox_softreq *sr);
 struct rte_mempool *nitrox_sym_req_pool_create(struct rte_cryptodev *cdev,
 					       uint32_t nobjs, uint16_t qp_id,
-					       int socket_id);
+					       int numa_id);
 void nitrox_sym_req_pool_free(struct rte_mempool *mp);
 
 #endif /* _NITROX_SYM_REQMGR_H_ */
Signature · 1 line
2.55.0
#76 lore raw

PATCH 74/227 crypto/null: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/null/null_crypto_pmd.c     |  4 ++--
 drivers/crypto/null/null_crypto_pmd_ops.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/null/null_crypto_pmd.c +2 -2
index 6db9deaee8..a32eca5514 100644
@@ -186,7 +186,7 @@ cryptodev_null_probe(struct rte_vdev_device *dev)
 	struct rte_cryptodev_pmd_init_params init_params = {
 		"",
 		sizeof(struct null_crypto_private),
-		rte_socket_id(),
+		rte_numa_id(),
 		RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
 	};
 	const char *name, *args;
@@ -237,7 +237,7 @@ static struct cryptodev_driver null_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
 	"max_nb_queue_pairs=<int> "
-	"socket_id=<int>");
+	"numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(null_crypto_drv, cryptodev_null_pmd_drv.driver,
 		cryptodev_driver_id);
 RTE_LOG_REGISTER_DEFAULT(null_logtype_driver, INFO);
drivers/crypto/null/null_crypto_pmd_ops.c +6 -6
index f07e9c2ea0..27bc9231b3 100644
@@ -161,7 +161,7 @@ null_crypto_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 /** Create a ring to place process packets on */
 static struct rte_ring *
 null_crypto_pmd_qp_create_processed_pkts_ring(struct null_crypto_qp *qp,
-		unsigned ring_size, int socket_id)
+		unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 
@@ -180,7 +180,7 @@ null_crypto_pmd_qp_create_processed_pkts_ring(struct null_crypto_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 }
 
@@ -188,7 +188,7 @@ null_crypto_pmd_qp_create_processed_pkts_ring(struct null_crypto_qp *qp,
 static int
 null_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	struct null_crypto_private *internals = dev->data->dev_private;
 	struct null_crypto_qp *qp;
@@ -206,8 +206,8 @@ null_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		null_crypto_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("Null Crypto PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("Null Crypto PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL) {
 		NULL_LOG(ERR, "Failed to allocate queue pair memory");
 		return (-ENOMEM);
@@ -225,7 +225,7 @@ null_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 	}
 
 	qp->processed_pkts = null_crypto_pmd_qp_create_processed_pkts_ring(qp,
-			qp_conf->nb_descriptors, socket_id);
+			qp_conf->nb_descriptors, numa_id);
 	if (qp->processed_pkts == NULL) {
 		NULL_LOG(ERR, "Failed to create unique name for null "
 				"crypto device");
Signature · 1 line
2.55.0
#77 lore raw

PATCH 75/227 crypto/octeontx: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/octeontx/otx_cryptodev.c           | 2 +-
 drivers/crypto/octeontx/otx_cryptodev_hw_access.c | 2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c       | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/crypto/octeontx/otx_cryptodev.c +1 -1
index b2f6f53ee3..8ddfa28865 100644
@@ -42,7 +42,7 @@ otx_cpt_pci_probe(struct rte_pci_driver *pci_drv,
 
 	rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
 
-	cryptodev = rte_cryptodev_pmd_allocate(name, rte_socket_id());
+	cryptodev = rte_cryptodev_pmd_allocate(name, rte_numa_id());
 	if (cryptodev == NULL)
 		return -ENOMEM;
 
drivers/crypto/octeontx/otx_cryptodev_hw_access.c +1 -1
index 27604459e4..6c91a82564 100644
@@ -458,7 +458,7 @@ otx_cpt_metabuf_mempool_create(const struct rte_cryptodev *dev,
 
 	pool = rte_mempool_create_empty(mempool_name, mb_pool_sz, max_mlen,
 					METABUF_POOL_CACHE_SIZE, 0,
-					rte_socket_id(), 0);
+					rte_numa_id(), 0);
 
 	if (pool == NULL) {
 		CPT_LOG_ERR("Could not create mempool for metabuf");
drivers/crypto/octeontx/otx_cryptodev_ops.c +3 -3
index 40f565cd78..abb94bf8d1 100644
@@ -137,7 +137,7 @@ static int
 otx_cpt_que_pair_setup(struct rte_cryptodev *dev,
 		       uint16_t que_pair_id,
 		       const struct rte_cryptodev_qp_conf *qp_conf,
-		       int socket_id __rte_unused)
+		       int numa_id __rte_unused)
 {
 	struct cpt_instance *instance = NULL;
 	struct rte_pci_device *pci_dev;
@@ -1017,9 +1017,9 @@ otx_cpt_dev_create(struct rte_cryptodev *c_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	cptvf = rte_zmalloc_socket("otx_cryptodev_private_mem",
+	cptvf = rte_zmalloc_numa("otx_cryptodev_private_mem",
 			sizeof(struct cpt_vf), RTE_CACHE_LINE_SIZE,
-			rte_socket_id());
+			rte_numa_id());
 
 	if (cptvf == NULL) {
 		CPT_LOG_ERR("Cannot allocate memory for device private data");
Signature · 1 line
2.55.0
#78 lore raw

PATCH 76/227 crypto/openssl: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/openssl/rte_openssl_pmd.c     |  4 ++--
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/openssl/rte_openssl_pmd.c +2 -2
index 1b33470c8f..c105d6a263 100644
@@ -4218,7 +4218,7 @@ cryptodev_openssl_probe(struct rte_vdev_device *vdev)
 	struct rte_cryptodev_pmd_init_params init_params = {
 		"",
 		sizeof(struct openssl_private),
-		rte_socket_id(),
+		rte_numa_id(),
 		RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
 	};
 	const char *name;
@@ -4265,7 +4265,7 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_OPENSSL_PMD,
 	cryptodev_openssl_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_OPENSSL_PMD,
 	"max_nb_queue_pairs=<int> "
-	"socket_id=<int>");
+	"numa_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(openssl_crypto_drv,
 		cryptodev_openssl_pmd_drv.driver, cryptodev_driver_id);
 RTE_LOG_REGISTER_DEFAULT(openssl_logtype_driver, INFO);
drivers/crypto/openssl/rte_openssl_pmd_ops.c +6 -6
index d3718c28e4..d6a2dfb549 100644
@@ -1080,7 +1080,7 @@ openssl_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 /** Create a ring to place processed operations on */
 static struct rte_ring *
 openssl_pmd_qp_create_processed_ops_ring(struct openssl_qp *qp,
-		unsigned int ring_size, int socket_id)
+		unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r;
 
@@ -1099,7 +1099,7 @@ openssl_pmd_qp_create_processed_ops_ring(struct openssl_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 }
 
@@ -1108,7 +1108,7 @@ openssl_pmd_qp_create_processed_ops_ring(struct openssl_qp *qp,
 static int
 openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	struct openssl_qp *qp = NULL;
 
@@ -1117,8 +1117,8 @@ openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		openssl_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("OPENSSL PMD Queue Pair", sizeof(*qp),
-					RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("OPENSSL PMD Queue Pair", sizeof(*qp),
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return -ENOMEM;
 
@@ -1129,7 +1129,7 @@ openssl_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		goto qp_setup_cleanup;
 
 	qp->processed_ops = openssl_pmd_qp_create_processed_ops_ring(qp,
-			qp_conf->nb_descriptors, socket_id);
+			qp_conf->nb_descriptors, numa_id);
 	if (qp->processed_ops == NULL)
 		goto qp_setup_cleanup;
 
Signature · 1 line
2.55.0
#79 lore raw

PATCH 77/227 crypto/scheduler: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 .../scheduler/rte_cryptodev_scheduler.c       | 16 +++++++-------
 drivers/crypto/scheduler/scheduler_failover.c |  4 ++--
 .../crypto/scheduler/scheduler_multicore.c    | 12 +++++-----
 .../scheduler/scheduler_pkt_size_distr.c      |  8 +++----
 drivers/crypto/scheduler/scheduler_pmd.c      | 22 +++++++++----------
 drivers/crypto/scheduler/scheduler_pmd_ops.c  | 10 ++++-----
 .../crypto/scheduler/scheduler_roundrobin.c   |  4 ++--
 7 files changed, 38 insertions(+), 38 deletions(-)
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +8 -8
index 1ca8443431..d69b8b237d 100644
@@ -258,9 +258,9 @@ update_scheduler_capability(struct scheduler_ctx *sched_ctx)
 			return -1;
 	}
 
-	sched_ctx->capabilities = rte_zmalloc_socket(NULL,
+	sched_ctx->capabilities = rte_zmalloc_numa(NULL,
 			sizeof(struct rte_cryptodev_capabilities) *
-			(nb_caps + 1), 0, SOCKET_ID_ANY);
+			(nb_caps + 1), 0, RTE_NUMA_ID_ANY);
 	if (!sched_ctx->capabilities)
 		return -ENOMEM;
 
@@ -277,16 +277,16 @@ update_scheduler_capability(struct scheduler_ctx *sched_ctx)
 			nb_sec_caps, rte_security_capabilities_get(sec_ctx));
 	}
 
-	sched_ctx->sec_capabilities = rte_zmalloc_socket(NULL,
+	sched_ctx->sec_capabilities = rte_zmalloc_numa(NULL,
 					sizeof(struct rte_security_capability) *
-					(nb_sec_caps + 1), 0, SOCKET_ID_ANY);
+					(nb_sec_caps + 1), 0, RTE_NUMA_ID_ANY);
 	if (!sched_ctx->sec_capabilities)
 		return -ENOMEM;
 
-	sched_ctx->sec_crypto_capabilities = rte_zmalloc_socket(NULL,
+	sched_ctx->sec_crypto_capabilities = rte_zmalloc_numa(NULL,
 				sizeof(struct rte_cryptodev_capabilities *) *
 				(nb_sec_caps + 1),
-				0, SOCKET_ID_ANY);
+				0, RTE_NUMA_ID_ANY);
 	if (!sched_ctx->sec_crypto_capabilities)
 		return -ENOMEM;
 
@@ -300,9 +300,9 @@ update_scheduler_capability(struct scheduler_ctx *sched_ctx)
 			nb_sec_crypto_caps++;
 
 		sched_ctx->sec_crypto_capabilities[i] =
-			rte_zmalloc_socket(NULL,
+			rte_zmalloc_numa(NULL,
 				sizeof(struct rte_cryptodev_capabilities) *
-				(nb_sec_crypto_caps + 1), 0, SOCKET_ID_ANY);
+				(nb_sec_crypto_caps + 1), 0, RTE_NUMA_ID_ANY);
 		if (!sched_ctx->sec_crypto_capabilities[i])
 			return -ENOMEM;
 
drivers/crypto/scheduler/scheduler_failover.c +2 -2
index 52ff2ffbb7..1a60a531ec 100644
@@ -194,8 +194,8 @@ scheduler_config_qp(struct rte_cryptodev *dev, uint16_t qp_id)
 	struct scheduler_qp_ctx *qp_ctx = dev->data->queue_pairs[qp_id];
 	struct fo_scheduler_qp_ctx *fo_qp_ctx;
 
-	fo_qp_ctx = rte_zmalloc_socket(NULL, sizeof(*fo_qp_ctx), 0,
-			rte_socket_id());
+	fo_qp_ctx = rte_zmalloc_numa(NULL, sizeof(*fo_qp_ctx), 0,
+			rte_numa_id());
 	if (!fo_qp_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory for private queue pair");
 		return -ENOMEM;
drivers/crypto/scheduler/scheduler_multicore.c +6 -6
index 70f8a25b70..4146e97335 100644
@@ -324,8 +324,8 @@ scheduler_config_qp(struct rte_cryptodev *dev, uint16_t qp_id)
 	struct scheduler_ctx *sched_ctx = dev->data->dev_private;
 	struct mc_scheduler_ctx *mc_ctx = sched_ctx->private_ctx;
 
-	mc_qp_ctx = rte_zmalloc_socket(NULL, sizeof(*mc_qp_ctx), 0,
-			rte_socket_id());
+	mc_qp_ctx = rte_zmalloc_numa(NULL, sizeof(*mc_qp_ctx), 0,
+			rte_numa_id());
 	if (!mc_qp_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory for private queue pair");
 		return -ENOMEM;
@@ -350,8 +350,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
 		sched_ctx->private_ctx = NULL;
 	}
 
-	mc_ctx = rte_zmalloc_socket(NULL, sizeof(struct mc_scheduler_ctx), 0,
-			rte_socket_id());
+	mc_ctx = rte_zmalloc_numa(NULL, sizeof(struct mc_scheduler_ctx), 0,
+			rte_numa_id());
 	if (!mc_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory");
 		return -ENOMEM;
@@ -367,7 +367,7 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
 		if (!mc_ctx->sched_enq_ring[i]) {
 			mc_ctx->sched_enq_ring[i] = rte_ring_create(r_name,
 						PER_WORKER_BUFF_SIZE,
-						rte_socket_id(),
+						rte_numa_id(),
 						RING_F_SC_DEQ | RING_F_SP_ENQ);
 			if (!mc_ctx->sched_enq_ring[i]) {
 				CR_SCHED_LOG(ERR, "Cannot create ring for worker %u",
@@ -381,7 +381,7 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
 		if (!mc_ctx->sched_deq_ring[i]) {
 			mc_ctx->sched_deq_ring[i] = rte_ring_create(r_name,
 						PER_WORKER_BUFF_SIZE,
-						rte_socket_id(),
+						rte_numa_id(),
 						RING_F_SC_DEQ | RING_F_SP_ENQ);
 			if (!mc_ctx->sched_deq_ring[i]) {
 				CR_SCHED_LOG(ERR, "Cannot create ring for worker %u",
drivers/crypto/scheduler/scheduler_pkt_size_distr.c +4 -4
index 1334a79b7b..2c455406c0 100644
@@ -325,8 +325,8 @@ scheduler_config_qp(struct rte_cryptodev *dev, uint16_t qp_id)
 	struct scheduler_qp_ctx *qp_ctx = dev->data->queue_pairs[qp_id];
 	struct psd_scheduler_qp_ctx *ps_qp_ctx;
 
-	ps_qp_ctx = rte_zmalloc_socket(NULL, sizeof(*ps_qp_ctx), 0,
-			rte_socket_id());
+	ps_qp_ctx = rte_zmalloc_numa(NULL, sizeof(*ps_qp_ctx), 0,
+			rte_numa_id());
 	if (!ps_qp_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory for private queue pair");
 		return -ENOMEM;
@@ -348,8 +348,8 @@ scheduler_create_private_ctx(struct rte_cryptodev *dev)
 		sched_ctx->private_ctx = NULL;
 	}
 
-	psd_ctx = rte_zmalloc_socket(NULL, sizeof(struct psd_scheduler_ctx), 0,
-			rte_socket_id());
+	psd_ctx = rte_zmalloc_numa(NULL, sizeof(struct psd_scheduler_ctx), 0,
+			rte_numa_id());
 	if (!psd_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory");
 		return -ENOMEM;
drivers/crypto/scheduler/scheduler_pmd.c +11 -11
index 8ca09ba3d0..d76cf96f8b 100644
@@ -38,7 +38,7 @@ struct scheduler_init_params {
 #define RTE_CRYPTODEV_VDEV_MODE_PARAM		("mode_param")
 #define RTE_CRYPTODEV_VDEV_ORDERING		("ordering")
 #define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG	("max_nb_queue_pairs")
-#define RTE_CRYPTODEV_VDEV_SOCKET_ID		("socket_id")
+#define RTE_CRYPTODEV_VDEV_SOCKET_ID		("numa_id")
 #define RTE_CRYPTODEV_VDEV_COREMASK		("coremask")
 #define RTE_CRYPTODEV_VDEV_CORELIST		("corelist")
 
@@ -217,10 +217,10 @@ cryptodev_scheduler_create(const char *name,
 
 	for (i = 0; i < init_params->nb_workers; i++) {
 		sched_ctx->init_worker_names[sched_ctx->nb_init_workers] =
-			rte_zmalloc_socket(
+			rte_zmalloc_numa(
 				NULL,
 				RTE_CRYPTODEV_SCHEDULER_NAME_MAX_LEN, 0,
-				SOCKET_ID_ANY);
+				RTE_NUMA_ID_ANY);
 
 		if (!sched_ctx->init_worker_names[
 				sched_ctx->nb_init_workers]) {
@@ -241,9 +241,9 @@ cryptodev_scheduler_create(const char *name,
 	 * Initialize capabilities structure as an empty structure,
 	 * in case device information is requested when no workers are attached
 	 */
-	sched_ctx->capabilities = rte_zmalloc_socket(NULL,
+	sched_ctx->capabilities = rte_zmalloc_numa(NULL,
 			sizeof(struct rte_cryptodev_capabilities),
-			0, SOCKET_ID_ANY);
+			0, RTE_NUMA_ID_ANY);
 
 	if (!sched_ctx->capabilities) {
 		CR_SCHED_LOG(ERR, "Not enough memory for capability information");
@@ -253,9 +253,9 @@ cryptodev_scheduler_create(const char *name,
 
 	/* Initialize security context */
 	struct rte_security_ctx *security_instance;
-	security_instance = rte_zmalloc_socket(NULL,
+	security_instance = rte_zmalloc_numa(NULL,
 					sizeof(struct rte_security_ctx),
-					RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+					RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 	if (!security_instance) {
 		CR_SCHED_LOG(ERR, "Not enough memory for security context");
 		free_mem(dev);
@@ -271,9 +271,9 @@ cryptodev_scheduler_create(const char *name,
 	 * Initialize security capabilities structure as an empty structure,
 	 * in case device information is requested when no workers are attached
 	 */
-	sched_ctx->sec_capabilities = rte_zmalloc_socket(NULL,
+	sched_ctx->sec_capabilities = rte_zmalloc_numa(NULL,
 					sizeof(struct rte_security_capability),
-					0, SOCKET_ID_ANY);
+					0, RTE_NUMA_ID_ANY);
 
 	if (!sched_ctx->sec_capabilities) {
 		CR_SCHED_LOG(ERR, "Not enough memory for security capability information");
@@ -588,7 +588,7 @@ cryptodev_scheduler_probe(struct rte_vdev_device *vdev)
 		.def_p = {
 			"",
 			sizeof(struct scheduler_ctx),
-			rte_socket_id(),
+			rte_numa_id(),
 			RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
 		},
 		.nb_workers = 0,
@@ -622,7 +622,7 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_SCHEDULER_PMD,
 	cryptodev_scheduler_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SCHEDULER_PMD,
 	"max_nb_queue_pairs=<int> "
-	"socket_id=<int> "
+	"numa_id=<int> "
 	"worker=<name>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(scheduler_crypto_drv,
 		cryptodev_scheduler_pmd_drv.driver,
drivers/crypto/scheduler/scheduler_pmd_ops.c +5 -5
index 105d9cf02a..06a0e23fc0 100644
@@ -302,7 +302,7 @@ update_order_ring(struct rte_cryptodev *dev, uint16_t qp_id)
 		}
 
 		qp_ctx->order_ring = rte_ring_create(order_ring_name,
-				buff_size, rte_socket_id(),
+				buff_size, rte_numa_id(),
 				RING_F_SP_ENQ | RING_F_SC_DEQ);
 		if (!qp_ctx->order_ring) {
 			CR_SCHED_LOG(ERR, "failed to create order ring");
@@ -576,7 +576,7 @@ scheduler_pmd_qp_release(struct rte_cryptodev *dev, uint16_t qp_id)
 /** Setup a queue pair */
 static int
 scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
-	const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
+	const struct rte_cryptodev_qp_conf *qp_conf, int numa_id)
 {
 	struct scheduler_ctx *sched_ctx = dev->data->dev_private;
 	struct scheduler_qp_ctx *qp_ctx;
@@ -604,14 +604,14 @@ scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		 * must be big enough for all the drivers used.
 		 */
 		ret = rte_cryptodev_queue_pair_setup(worker_id, qp_id,
-				qp_conf, socket_id);
+				qp_conf, numa_id);
 		if (ret < 0)
 			return ret;
 	}
 
 	/* Allocate the queue pair data structure. */
-	qp_ctx = rte_zmalloc_socket(name, sizeof(*qp_ctx), RTE_CACHE_LINE_SIZE,
-			socket_id);
+	qp_ctx = rte_zmalloc_numa(name, sizeof(*qp_ctx), RTE_CACHE_LINE_SIZE,
+			numa_id);
 	if (qp_ctx == NULL)
 		return -ENOMEM;
 
drivers/crypto/scheduler/scheduler_roundrobin.c +2 -2
index 08041887a8..cce4c4030f 100644
@@ -174,8 +174,8 @@ scheduler_config_qp(struct rte_cryptodev *dev, uint16_t qp_id)
 	struct scheduler_qp_ctx *qp_ctx = dev->data->queue_pairs[qp_id];
 	struct rr_scheduler_qp_ctx *rr_qp_ctx;
 
-	rr_qp_ctx = rte_zmalloc_socket(NULL, sizeof(*rr_qp_ctx), 0,
-			rte_socket_id());
+	rr_qp_ctx = rte_zmalloc_numa(NULL, sizeof(*rr_qp_ctx), 0,
+			rte_numa_id());
 	if (!rr_qp_ctx) {
 		CR_SCHED_LOG(ERR, "failed allocate memory for private queue pair");
 		return -ENOMEM;
Signature · 1 line
2.55.0
#80 lore raw

PATCH 78/227 crypto/uadk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/uadk/uadk_crypto_pmd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/uadk/uadk_crypto_pmd.c +6 -6
index 221ad546da..0758fb6e1b 100644
@@ -485,7 +485,7 @@ uadk_pmd_qp_set_unique_name(struct rte_cryptodev *dev,
 /* Create a ring to place process packets on */
 static struct rte_ring *
 uadk_pmd_qp_create_processed_pkts_ring(struct uadk_qp *qp,
-				       unsigned int ring_size, int socket_id)
+				       unsigned int ring_size, int numa_id)
 {
 	struct rte_ring *r = qp->processed_pkts;
 
@@ -501,14 +501,14 @@ uadk_pmd_qp_create_processed_pkts_ring(struct uadk_qp *qp,
 		return NULL;
 	}
 
-	return rte_ring_create(qp->name, ring_size, socket_id,
+	return rte_ring_create(qp->name, ring_size, numa_id,
 			       RING_F_EXACT_SZ);
 }
 
 static int
 uadk_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			 const struct rte_cryptodev_qp_conf *qp_conf,
-			 int socket_id)
+			 int numa_id)
 {
 	struct uadk_qp *qp;
 
@@ -517,8 +517,8 @@ uadk_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		uadk_crypto_pmd_qp_release(dev, qp_id);
 
 	/* Allocate the queue pair data structure. */
-	qp = rte_zmalloc_socket("uadk PMD Queue Pair", sizeof(*qp),
-				RTE_CACHE_LINE_SIZE, socket_id);
+	qp = rte_zmalloc_numa("uadk PMD Queue Pair", sizeof(*qp),
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp == NULL)
 		return (-ENOMEM);
 
@@ -529,7 +529,7 @@ uadk_crypto_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		goto qp_setup_cleanup;
 
 	qp->processed_pkts = uadk_pmd_qp_create_processed_pkts_ring(qp,
-				qp_conf->nb_descriptors, socket_id);
+				qp_conf->nb_descriptors, numa_id);
 	if (qp->processed_pkts == NULL)
 		goto qp_setup_cleanup;
 
Signature · 1 line
2.55.0
#81 lore raw

PATCH 79/227 crypto/virtio: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/virtio/virtio_cryptodev.c | 12 ++++++------
 drivers/crypto/virtio/virtio_cryptodev.h |  2 +-
 drivers/crypto/virtio/virtqueue.c        |  2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
drivers/crypto/virtio/virtio_cryptodev.c +6 -6
index d0fe21947c..9f1df7be50 100644
@@ -30,7 +30,7 @@ static void virtio_crypto_dev_stats_reset(struct rte_cryptodev *dev);
 static int virtio_crypto_qp_setup(struct rte_cryptodev *dev,
 		uint16_t queue_pair_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id);
+		int numa_id);
 static int virtio_crypto_qp_release(struct rte_cryptodev *dev,
 		uint16_t queue_pair_id);
 static void virtio_crypto_dev_free_mbufs(struct rte_cryptodev *dev);
@@ -90,7 +90,7 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev,
 		int queue_type,
 		uint16_t vtpci_queue_idx,
 		uint16_t nb_desc,
-		int socket_id,
+		int numa_id,
 		struct virtqueue **pvq)
 {
 	char vq_name[VIRTQUEUE_MAX_NAME_SZ];
@@ -144,7 +144,7 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev,
 		vq = hw->vqs[vtpci_queue_idx];
 	else
 		vq = virtcrypto_queue_alloc(hw, vtpci_queue_idx, nb_desc,
-				socket_id, vq_name);
+				numa_id, vq_name);
 	if (vq == NULL) {
 		VIRTIO_CRYPTO_INIT_LOG_ERR("Can not allocate virtqueue");
 		return -ENOMEM;
@@ -162,7 +162,7 @@ virtio_crypto_queue_setup(struct rte_cryptodev *dev,
 					nb_desc,
 					sizeof(struct virtio_crypto_op_cookie),
 					RTE_CACHE_LINE_SIZE, 0,
-					NULL, NULL, NULL, NULL, socket_id,
+					NULL, NULL, NULL, NULL, numa_id,
 					0);
 		if (!vq->mpool) {
 			VIRTIO_CRYPTO_DRV_LOG_ERR("Virtio Crypto PMD "
@@ -298,7 +298,7 @@ virtio_crypto_dev_stats_reset(struct rte_cryptodev *dev)
 static int
 virtio_crypto_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
 		const struct rte_cryptodev_qp_conf *qp_conf,
-		int socket_id)
+		int numa_id)
 {
 	int ret;
 	struct virtqueue *vq;
@@ -310,7 +310,7 @@ virtio_crypto_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
 		return 0;
 
 	ret = virtio_crypto_queue_setup(dev, VTCRYPTO_DATAQ, queue_pair_id,
-			qp_conf->nb_descriptors, socket_id, &vq);
+			qp_conf->nb_descriptors, numa_id, &vq);
 	if (ret < 0) {
 		VIRTIO_CRYPTO_INIT_LOG_ERR(
 			"virtio crypto data queue initialization failed");
drivers/crypto/virtio/virtio_cryptodev.h +1 -1
index 075b5ff444..2ca1e77492 100644
@@ -63,7 +63,7 @@ int virtio_crypto_queue_setup(struct rte_cryptodev *dev,
 		int queue_type,
 		uint16_t vtpci_queue_idx,
 		uint16_t nb_desc,
-		int socket_id,
+		int numa_id,
 		struct virtqueue **pvq);
 
 void virtio_crypto_queue_release(struct virtqueue *vq);
drivers/crypto/virtio/virtqueue.c +1 -1
index 061aa09dbe..d76e0a0cf5 100644
@@ -190,7 +190,7 @@ virtcrypto_queue_alloc(struct virtio_crypto_hw *hw, uint16_t index, uint16_t num
 	size = sizeof(*vq) + num * sizeof(struct vq_desc_extra);
 	size = RTE_ALIGN_CEIL(size, RTE_CACHE_LINE_SIZE);
 
-	vq = rte_zmalloc_socket(name, size, RTE_CACHE_LINE_SIZE, node);
+	vq = rte_zmalloc_numa(name, size, RTE_CACHE_LINE_SIZE, node);
 	if (vq == NULL) {
 		PMD_INIT_LOG(ERR, "can not allocate vq");
 		return NULL;
Signature · 1 line
2.55.0
#82 lore raw

PATCH 80/227 crypto/zsda: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/crypto/zsda/zsda_crypto_pmd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/crypto/zsda/zsda_crypto_pmd.c +5 -5
index d1cdfcce0b..d080a26891 100644
@@ -115,7 +115,7 @@ zsda_crypto_stats_reset(struct rte_cryptodev *dev)
 static int
 zsda_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 		  const struct rte_cryptodev_qp_conf *qp_conf,
-		  int socket_id)
+		  int numa_id)
 {
 	int ret = ZSDA_SUCCESS;
 	struct zsda_qp *qp_new;
@@ -134,15 +134,15 @@ zsda_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
 			return ret;
 	}
 
-	qp_new = rte_zmalloc_socket("zsda PMD qp metadata", sizeof(*qp_new),
-				    RTE_CACHE_LINE_SIZE, socket_id);
+	qp_new = rte_zmalloc_numa("zsda PMD qp metadata", sizeof(*qp_new),
+				    RTE_CACHE_LINE_SIZE, numa_id);
 	if (qp_new == NULL) {
 		ZSDA_LOG(ERR, "Failed to alloc mem for qp struct");
 		return -ENOMEM;
 	}
 
 	task_q_info.nb_des = nb_des;
-	task_q_info.socket_id = socket_id;
+	task_q_info.numa_id = numa_id;
 	task_q_info.qp_id = qp_id;
 	task_q_info.rx_cb = zsda_crypto_callback;
 
@@ -315,7 +315,7 @@ zsda_crypto_dev_create(struct zsda_pci_device *zsda_pci_dev)
 	crypto_dev_priv->capa_mz = rte_memzone_lookup(capa_memz_name);
 	if (crypto_dev_priv->capa_mz == NULL)
 		crypto_dev_priv->capa_mz = rte_memzone_reserve(
-			capa_memz_name, capa_size, rte_socket_id(), 0);
+			capa_memz_name, capa_size, rte_numa_id(), 0);
 
 	if (crypto_dev_priv->capa_mz == NULL) {
 		ZSDA_LOG(ERR, "Failed! crypto_dev_priv->capa_mz");
Signature · 1 line
2.55.0
#83 lore raw

PATCH 81/227 dma/ae4dma: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/ae4dma/ae4dma_dmadev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/ae4dma/ae4dma_dmadev.c +3 -3
index 64c19955eb..fdce20df2d 100644
@@ -26,9 +26,9 @@ RTE_LOG_REGISTER_DEFAULT(ae4dma_pmd_logtype, INFO);
 #define AE4DMA_PMD_NAME dmadev_ae4dma
 
 static const struct rte_memzone *
-ae4dma_queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size, int socket_id)
+ae4dma_queue_dma_zone_reserve(const char *queue_name, uint32_t queue_size, int numa_id)
 {
-	return rte_memzone_reserve_aligned(queue_name, queue_size, socket_id,
+	return rte_memzone_reserve_aligned(queue_name, queue_size, numa_id,
 		RTE_MEMZONE_IOVA_CONTIG, queue_size);
 }
 
@@ -507,7 +507,7 @@ ae4dma_add_queue(struct ae4dma_dmadev *dev, struct rte_pci_device *pci, uint8_t
 	snprintf(cmd_q->memz_name, sizeof(cmd_q->memz_name), "ae4dma_%s_q%u", pci_name,
 		(unsigned int)qn);
 
-	q_mz = ae4dma_queue_dma_zone_reserve(cmd_q->memz_name, cmd_q->qsize, rte_socket_id());
+	q_mz = ae4dma_queue_dma_zone_reserve(cmd_q->memz_name, cmd_q->qsize, rte_numa_id());
 	if (q_mz == NULL) {
 		AE4DMA_PMD_ERR("memzone reserve failed for %s", cmd_q->memz_name);
 		return -ENOMEM;
Signature · 1 line
2.55.0
#84 lore raw

PATCH 82/227 dma/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/cnxk/cnxk_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/cnxk/cnxk_dmadev.c +1 -1
index db177afd6f..2f0100ab2b 100644
@@ -151,7 +151,7 @@ cnxk_dmadev_chunk_pool_create(struct rte_dma_dev *dev, uint32_t nb_chunks, uint3
 
 	nb_chunks += (CNXK_DPI_POOL_MAX_CACHE_SZ * rte_lcore_count());
 	dpivf->chunk_pool = rte_mempool_create_empty(
-		pool_name, nb_chunks, chunk_sz, CNXK_DPI_POOL_MAX_CACHE_SZ, 0, rte_socket_id(), 0);
+		pool_name, nb_chunks, chunk_sz, CNXK_DPI_POOL_MAX_CACHE_SZ, 0, rte_numa_id(), 0);
 
 	if (dpivf->chunk_pool == NULL) {
 		plt_err("Unable to create chunkpool.");
Signature · 1 line
2.55.0
#85 lore raw

PATCH 83/227 dma/dpaa: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/dpaa/dpaa_qdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dpaa/dpaa_qdma.c +1 -1
index d8bece700a..eb4cddae3e 100644
@@ -1500,7 +1500,7 @@ dpaa_qdma_probe(__rte_unused struct rte_dpaa_driver *dpaa_drv,
 	}
 
 	dmadev = rte_dma_pmd_allocate(dpaa_dev->device.name,
-				      rte_socket_id(),
+				      rte_numa_id(),
 				      sizeof(struct fsl_qdma_engine));
 	if (!dmadev) {
 		DPAA_QDMA_ERR("Unable to allocate dmadevice");
Signature · 1 line
2.55.0
#86 lore raw

PATCH 84/227 dma/dpaa2: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/dpaa2/dpaa2_qdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/dpaa2/dpaa2_qdma.c +2 -2
index 8d10edfd04..2650d07695 100644
@@ -1400,7 +1400,7 @@ dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan,
 	qdma_dev->vqs[vchan].fle_pool = rte_mempool_create(pool_name,
 			DPAA2_QDMA_MAX_DESC * 2, pool_size,
 			512, 0, NULL, NULL, NULL, NULL,
-			SOCKET_ID_ANY, 0);
+			RTE_NUMA_ID_ANY, 0);
 	if (!qdma_dev->vqs[vchan].fle_pool) {
 		DPAA2_QDMA_ERR("%s create failed", pool_name);
 		return -ENOMEM;
@@ -1749,7 +1749,7 @@ dpaa2_qdma_probe(struct rte_dpaa2_driver *dpaa2_drv,
 	RTE_SET_USED(dpaa2_drv);
 
 	dmadev = rte_dma_pmd_allocate(dpaa2_dev->device.name,
-		rte_socket_id(),
+		rte_numa_id(),
 		sizeof(struct dpaa2_dpdmai_dev));
 	if (!dmadev) {
 		DPAA2_QDMA_ERR("Unable to allocate dmadevice");
Signature · 1 line
2.55.0
#87 lore raw

PATCH 85/227 dma/hisi_acc: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/hisi_acc/hisi_acc_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/hisi_acc/hisi_acc_dmadev.c +1 -1
index 196aaadc05..7754d27b40 100644
@@ -631,7 +631,7 @@ hacc_dma_create(struct rte_uacce_device *uacce_dev, uint16_t queue_id)
 			uacce_dev->qfrt_sz[RTE_UACCE_QFRT_DUS] - sizeof(uint32_t));
 	hw->cq_status = hw->sq_status - 1;
 
-	hw->status = rte_zmalloc_socket(NULL, sizeof(uint16_t) * hw->sq_depth,
+	hw->status = rte_zmalloc_numa(NULL, sizeof(uint16_t) * hw->sq_depth,
 					RTE_CACHE_LINE_SIZE, uacce_dev->numa_node);
 	if (hw->status == NULL) {
 		HACC_DMA_ERR(hw, "malloc status region fail!");
Signature · 1 line
2.55.0
#88 lore raw

PATCH 86/227 dma/idxd: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/idxd/idxd_bus.c    | 2 +-
 drivers/dma/idxd/idxd_common.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/dma/idxd/idxd_bus.c +1 -1
index 2ec526ec09..197d14f9fe 100644
@@ -286,7 +286,7 @@ dsa_scan(void)
 
 	while ((wq = readdir(dev_dir)) != NULL) {
 		struct rte_dsa_device *dev;
-		int numa_node = SOCKET_ID_ANY;
+		int numa_node = RTE_NUMA_ID_ANY;
 
 		if (strncmp(wq->d_name, "wq", 2) != 0)
 			continue;
drivers/dma/idxd/idxd_common.c +1 -1
index dc2e8cd432..e70238794b 100644
@@ -612,7 +612,7 @@ idxd_dmadev_create(const char *name, struct rte_device *dev,
 	 * The +1 is because we can never fully use
 	 * the ring, otherwise read == write means both full and empty.
 	 */
-	idxd->batch_comp_ring = rte_zmalloc_socket(NULL, (sizeof(idxd->batch_idx_ring[0]) +
+	idxd->batch_comp_ring = rte_zmalloc_numa(NULL, (sizeof(idxd->batch_idx_ring[0]) +
 			sizeof(idxd->batch_comp_ring[0]))	* (idxd->max_batches + 1),
 			sizeof(idxd->batch_comp_ring[0]), dev->numa_node);
 	if (idxd->batch_comp_ring == NULL) {
Signature · 1 line
2.55.0
#89 lore raw

PATCH 87/227 dma/imx_edma5: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/imx_edma5/imx_edma5_dmadev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/dma/imx_edma5/imx_edma5_dmadev.c +4 -4
index 778644fa82..33f751465f 100644
@@ -100,7 +100,7 @@ imx_edma5_configure(struct rte_dma_dev *dev, const struct rte_dma_conf *conf, ui
 	RTE_SET_USED(conf_sz);
 
 	if (ed->vchans == NULL) {
-		ed->vchans = rte_zmalloc_socket("imx_edma5_vchans",
+		ed->vchans = rte_zmalloc_numa("imx_edma5_vchans",
 			ed->max_vchans * sizeof(struct imx_edma5_vchan), RTE_CACHE_LINE_SIZE,
 			dev->data->numa_node);
 		if (ed->vchans == NULL) {
@@ -202,7 +202,7 @@ imx_edma5_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan,
 	vc->desc_mask = conf->nb_desc - 1;
 	vc->iova_is_va = (rte_eal_iova_mode() == RTE_IOVA_VA);
 
-	vc->jobs = rte_zmalloc_socket("imx_edma5_jobs", vc->nb_desc * sizeof(struct imx_edma5_job),
+	vc->jobs = rte_zmalloc_numa("imx_edma5_jobs", vc->nb_desc * sizeof(struct imx_edma5_job),
 		RTE_CACHE_LINE_SIZE, dev->data->numa_node);
 	if (vc->jobs == NULL) {
 		IMX_EDMA5_LOG(ERR, "Failed to alloc job ring for vchan %u", vchan);
@@ -210,7 +210,7 @@ imx_edma5_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan,
 	}
 
 	/* One IMX_EDMA5_SG_TCD_PER_JOB descriptor slice per job ring slot. */
-	vc->sg_tcd_pool = rte_zmalloc_socket("imx_edma5_sgtcd",
+	vc->sg_tcd_pool = rte_zmalloc_numa("imx_edma5_sgtcd",
 		(size_t)vc->nb_desc * IMX_EDMA5_SG_TCD_PER_JOB * sizeof(struct imx_edma5_hw_tcd64),
 		RTE_CACHE_LINE_SIZE, dev->data->numa_node);
 	if (vc->sg_tcd_pool == NULL) {
@@ -1037,7 +1037,7 @@ imx_edma5_probe(struct rte_platform_device *pdev)
 		return -EINVAL;
 	}
 
-	dev = rte_dma_pmd_allocate(name, rte_socket_id(), sizeof(struct imx_edma5_dev));
+	dev = rte_dma_pmd_allocate(name, rte_numa_id(), sizeof(struct imx_edma5_dev));
 	if (dev == NULL) {
 		IMX_EDMA5_LOG(ERR, "Failed to allocate dmadev for %s", name);
 		return -ENOMEM;
Signature · 1 line
2.55.0
#90 lore raw

PATCH 88/227 dma/odm: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/odm/odm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/odm/odm.c +2 -2
index 0633ce0b4b..cf56f89394 100644
@@ -201,7 +201,7 @@ odm_vchan_setup(struct odm_dev *odm, int vchan, const struct rte_dma_vchan_conf
 	isize = RTE_ALIGN_CEIL(conf->nb_desc * ODM_IRING_ENTRY_SIZE_MAX * 8, 1024);
 	isize = RTE_MIN(isize, ODM_IRING_MAX_SIZE);
 	snprintf(name, sizeof(name), "vq%d_iring%d", odm->vfid, vchan);
-	mz = rte_memzone_reserve_aligned(name, isize, SOCKET_ID_ANY, 0, 1024);
+	mz = rte_memzone_reserve_aligned(name, isize, RTE_NUMA_ID_ANY, 0, 1024);
 	if (mz == NULL)
 		return -ENOMEM;
 	vq->iring_mz = mz;
@@ -211,7 +211,7 @@ odm_vchan_setup(struct odm_dev *odm, int vchan, const struct rte_dma_vchan_conf
 	max_nb_desc = (isize / (ODM_IRING_ENTRY_SIZE_MIN * 8));
 	csize = RTE_ALIGN_CEIL(max_nb_desc * sizeof(union odm_cmpl_ent_s), 1024);
 	snprintf(name, sizeof(name), "vq%d_cring%d", odm->vfid, vchan);
-	mz = rte_memzone_reserve_aligned(name, csize, SOCKET_ID_ANY, 0, 1024);
+	mz = rte_memzone_reserve_aligned(name, csize, RTE_NUMA_ID_ANY, 0, 1024);
 	if (mz == NULL) {
 		rc = -ENOMEM;
 		goto iring_free;
Signature · 1 line
2.55.0
#91 lore raw

PATCH 89/227 dma/skeleton: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/dma/skeleton/skeleton_dmadev.c | 26 +++++++++++++-------------
 drivers/dma/skeleton/skeleton_dmadev.h |  2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)
drivers/dma/skeleton/skeleton_dmadev.c +13 -13
index e287802eb9..05f07fe80a 100644
@@ -235,24 +235,24 @@ vchan_setup(struct skeldma_hw *hw, int16_t dev_id, uint16_t nb_desc)
 	struct rte_ring *completed;
 	uint16_t i;
 
-	desc = rte_zmalloc_socket(NULL, nb_desc * sizeof(struct skeldma_desc),
-				  RTE_CACHE_LINE_SIZE, hw->socket_id);
+	desc = rte_zmalloc_numa(NULL, nb_desc * sizeof(struct skeldma_desc),
+				  RTE_CACHE_LINE_SIZE, hw->numa_id);
 	if (desc == NULL) {
 		SKELDMA_LOG(ERR, "Malloc dma skeleton desc fail!");
 		return -ENOMEM;
 	}
 
 	snprintf(name, RTE_RING_NAMESIZE, "dma_skel_desc_empty_%d", dev_id);
-	empty = rte_ring_create(name, nb_desc, hw->socket_id,
+	empty = rte_ring_create(name, nb_desc, hw->numa_id,
 				RING_F_SP_ENQ | RING_F_SC_DEQ);
 	snprintf(name, RTE_RING_NAMESIZE, "dma_skel_desc_pend_%d", dev_id);
-	pending = rte_ring_create(name, nb_desc, hw->socket_id,
+	pending = rte_ring_create(name, nb_desc, hw->numa_id,
 				  RING_F_SP_ENQ | RING_F_SC_DEQ);
 	snprintf(name, RTE_RING_NAMESIZE, "dma_skel_desc_run_%d", dev_id);
-	running = rte_ring_create(name, nb_desc, hw->socket_id,
+	running = rte_ring_create(name, nb_desc, hw->numa_id,
 				  RING_F_SP_ENQ | RING_F_SC_DEQ);
 	snprintf(name, RTE_RING_NAMESIZE, "dma_skel_desc_comp_%d", dev_id);
-	completed = rte_ring_create(name, nb_desc, hw->socket_id,
+	completed = rte_ring_create(name, nb_desc, hw->numa_id,
 				    RING_F_SP_ENQ | RING_F_SC_DEQ);
 	if (empty == NULL || pending == NULL || running == NULL ||
 	    completed == NULL) {
@@ -380,12 +380,12 @@ skeldma_dump(const struct rte_dma_dev *dev, FILE *f)
 
 	(void)fprintf(f,
 		"    lcore_id: %d\n"
-		"    socket_id: %d\n"
+		"    numa_id: %d\n"
 		"    desc_empty_ring_count: %u\n"
 		"    desc_pending_ring_count: %u\n"
 		"    desc_running_ring_count: %u\n"
 		"    desc_completed_ring_count: %u\n",
-		hw->lcore_id, hw->socket_id,
+		hw->lcore_id, hw->numa_id,
 		GET_RING_COUNT(hw->desc_empty),
 		GET_RING_COUNT(hw->desc_pending),
 		GET_RING_COUNT(hw->desc_running),
@@ -601,11 +601,11 @@ skeldma_create(const char *name, struct rte_vdev_device *vdev, int lcore_id)
 {
 	struct rte_dma_dev *dev;
 	struct skeldma_hw *hw;
-	int socket_id;
+	int numa_id;
 
-	socket_id = (lcore_id < 0) ? rte_socket_id() :
-				     rte_lcore_to_socket_id(lcore_id);
-	dev = rte_dma_pmd_allocate(name, socket_id, sizeof(struct skeldma_hw));
+	numa_id = (lcore_id < 0) ? rte_numa_id() :
+				     rte_lcore_to_numa_id(lcore_id);
+	dev = rte_dma_pmd_allocate(name, numa_id, sizeof(struct skeldma_hw));
 	if (dev == NULL) {
 		SKELDMA_LOG(ERR, "Unable to allocate dmadev: %s", name);
 		return -EINVAL;
@@ -624,7 +624,7 @@ skeldma_create(const char *name, struct rte_vdev_device *vdev, int lcore_id)
 
 	hw = dev->data->dev_private;
 	hw->lcore_id = lcore_id;
-	hw->socket_id = socket_id;
+	hw->numa_id = numa_id;
 
 	dev->state = RTE_DMA_DEV_READY;
 
drivers/dma/skeleton/skeleton_dmadev.h +1 -1
index 0365f64589..2fe0547acb 100644
@@ -45,7 +45,7 @@ struct skeldma_desc {
 
 struct skeldma_hw {
 	int lcore_id; /* cpuwork task affinity core */
-	int socket_id;
+	int numa_id;
 	rte_thread_t thread; /* cpuwork task thread */
 	volatile int exit_flag; /* cpuwork task exit flag */
 
Signature · 1 line
2.55.0
#92 lore raw

PATCH 90/227 event/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/cnxk/cn10k_eventdev.c         | 4 ++--
 drivers/event/cnxk/cn20k_eventdev.c         | 4 ++--
 drivers/event/cnxk/cn9k_eventdev.c          | 8 ++++----
 drivers/event/cnxk/cnxk_eventdev.c          | 2 +-
 drivers/event/cnxk/cnxk_eventdev_adptr.c    | 2 +-
 drivers/event/cnxk/cnxk_eventdev_selftest.c | 2 +-
 drivers/event/cnxk/cnxk_tim_evdev.c         | 4 ++--
 7 files changed, 13 insertions(+), 13 deletions(-)
drivers/event/cnxk/cn10k_eventdev.c +2 -2
index 47d1ec6823..4543a76ee2 100644
@@ -190,12 +190,12 @@ cn10k_sso_updt_tx_adptr_data(const struct rte_eventdev *event_dev)
 		void *ws_cookie;
 
 		ws_cookie = cnxk_sso_hws_get_cookie(ws);
-		ws_cookie = rte_realloc_socket(
+		ws_cookie = rte_realloc_numa(
 			ws_cookie,
 			sizeof(struct cnxk_sso_hws_cookie) +
 				sizeof(struct cn10k_sso_hws) +
 				dev->tx_adptr_data_sz,
-			RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+			RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 		if (ws_cookie == NULL)
 			return -ENOMEM;
 		ws = RTE_PTR_ADD(ws_cookie, sizeof(struct cnxk_sso_hws_cookie));
drivers/event/cnxk/cn20k_eventdev.c +2 -2
index 29495eb4f9..dc368051f6 100644
@@ -255,11 +255,11 @@ cn20k_sso_updt_tx_adptr_data(const struct rte_eventdev *event_dev)
 		void *ws_cookie;
 
 		ws_cookie = cnxk_sso_hws_get_cookie(ws);
-		ws_cookie = rte_realloc_socket(ws_cookie,
+		ws_cookie = rte_realloc_numa(ws_cookie,
 					       sizeof(struct cnxk_sso_hws_cookie) +
 						       sizeof(struct cn20k_sso_hws) +
 						       dev->tx_adptr_data_sz,
-					       RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+					       RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 		if (ws_cookie == NULL)
 			return -ENOMEM;
 		ws = RTE_PTR_ADD(ws_cookie, sizeof(struct cnxk_sso_hws_cookie));
drivers/event/cnxk/cn9k_eventdev.c +4 -4
index 313dcbb384..dc509b5c95 100644
@@ -269,12 +269,12 @@ cn9k_sso_updt_tx_adptr_data(const struct rte_eventdev *event_dev)
 			void *ws_cookie;
 
 			ws_cookie = cnxk_sso_hws_get_cookie(dws);
-			ws_cookie = rte_realloc_socket(
+			ws_cookie = rte_realloc_numa(
 				ws_cookie,
 				sizeof(struct cnxk_sso_hws_cookie) +
 					sizeof(struct cn9k_sso_hws_dual) +
 					dev->tx_adptr_data_sz,
-				RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+				RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 			if (ws_cookie == NULL)
 				return -ENOMEM;
 			dws = RTE_PTR_ADD(ws_cookie,
@@ -287,12 +287,12 @@ cn9k_sso_updt_tx_adptr_data(const struct rte_eventdev *event_dev)
 			void *ws_cookie;
 
 			ws_cookie = cnxk_sso_hws_get_cookie(ws);
-			ws_cookie = rte_realloc_socket(
+			ws_cookie = rte_realloc_numa(
 				ws_cookie,
 				sizeof(struct cnxk_sso_hws_cookie) +
 					sizeof(struct cn9k_sso_hws_dual) +
 					dev->tx_adptr_data_sz,
-				RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+				RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 			if (ws_cookie == NULL)
 				return -ENOMEM;
 			ws = RTE_PTR_ADD(ws_cookie,
drivers/event/cnxk/cnxk_eventdev.c +1 -1
index e3a3134264..9d842e1788 100644
@@ -639,7 +639,7 @@ cnxk_sso_init(struct rte_eventdev *event_dev)
 	int rc;
 
 	mz = rte_memzone_reserve(CNXK_SSO_MZ_NAME, sizeof(uint64_t),
-				 SOCKET_ID_ANY, 0);
+				 RTE_NUMA_ID_ANY, 0);
 	if (mz == NULL) {
 		plt_err("Failed to create eventdev memzone");
 		return -ENOMEM;
drivers/event/cnxk/cnxk_eventdev_adptr.c +1 -1
index 5678e5d264..85b5a3fc33 100644
@@ -671,7 +671,7 @@ crypto_adapter_qp_setup(struct cnxk_sso_evdev *evdev, const struct rte_cryptodev
 	cache_size = RTE_MIN(RTE_MEMPOOL_CACHE_MAX_SIZE, qp->lf.nb_desc / 1.5);
 	nb_req = qp->lf.nb_desc + (cache_size * rte_lcore_count());
 	qp->ca.req_mp = rte_mempool_create(name, nb_req, req_size, cache_size, 0, NULL, NULL, NULL,
-					   NULL, rte_socket_id(), 0);
+					   NULL, rte_numa_id(), 0);
 	if (qp->ca.req_mp == NULL)
 		return -ENOMEM;
 
drivers/event/cnxk/cnxk_eventdev_selftest.c +1 -1
index 8f3d0982e9..828a0f9ec1 100644
@@ -145,7 +145,7 @@ _eventdev_setup(int mode)
 
 	/* Create and destroy pool for each test case to make it standalone */
 	eventdev_test_mempool = rte_pktmbuf_pool_create(
-		pool_name, MAX_EVENTS, 0, 0, 512, rte_socket_id());
+		pool_name, MAX_EVENTS, 0, 0, 512, rte_numa_id());
 	if (!eventdev_test_mempool) {
 		plt_err("ERROR creating mempool");
 		return -1;
drivers/event/cnxk/cnxk_tim_evdev.c +2 -2
index 11945e0e6e..8cfb5c122f 100644
@@ -37,7 +37,7 @@ cnxk_tim_chnk_pool_populate_aligned(struct rte_mempool *mp, size_t align)
 	stride = (size_t)mp->header_size + mp->elt_size + mp->trailer_size;
 	len = stride * mp->size;
 
-	mem = rte_zmalloc_socket("cnxk_tim_chunks", len, align, mp->numa_id);
+	mem = rte_zmalloc_numa("cnxk_tim_chunks", len, align, mp->numa_id);
 	if (mem == NULL)
 		return -ENOMEM;
 
@@ -83,7 +83,7 @@ cnxk_tim_chnk_pool_create(struct cnxk_tim_ring *tim_ring,
 
 	tim_ring->chunk_pool = rte_mempool_create_empty(pool_name, tim_ring->nb_chunks,
 							tim_ring->chunk_sz, cache_sz, 0,
-							rte_socket_id(), mp_flags);
+							rte_numa_id(), mp_flags);
 	if (tim_ring->chunk_pool == NULL) {
 		plt_err("Unable to create chunkpool.");
 		return -ENOMEM;
Signature · 1 line
2.55.0
#93 lore raw

PATCH 91/227 event/dlb2: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/dlb2/dlb2.c          |  8 ++++----
 drivers/event/dlb2/dlb2_priv.h     |  4 ++--
 drivers/event/dlb2/dlb2_selftest.c |  2 +-
 drivers/event/dlb2/dlb2_xstats.c   |  8 ++++----
 drivers/event/dlb2/pf/dlb2_pf.c    | 12 ++++++------
 5 files changed, 17 insertions(+), 17 deletions(-)
drivers/event/dlb2/dlb2.c +4 -4
index 084875f1c8..b1e4963b95 100644
@@ -332,14 +332,14 @@ set_producer_coremask(const char *key __rte_unused,
 static int
 set_numa_node(const char *key __rte_unused, const char *value, void *opaque)
 {
-	int *socket_id = opaque;
+	int *numa_id = opaque;
 	int ret;
 
-	ret = dlb2_string_to_int(socket_id, value);
+	ret = dlb2_string_to_int(numa_id, value);
 	if (ret < 0)
 		return ret;
 
-	if (*socket_id > RTE_MAX_NUMA_NODES)
+	if (*numa_id > RTE_MAX_NUMA_NODES)
 		return -EINVAL;
 	return 0;
 }
@@ -5224,7 +5224,7 @@ dlb2_parse_params(const char *params,
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
 						     set_numa_node,
-						     &dlb2_args->socket_id);
+						     &dlb2_args->numa_id);
 			if (ret != 0) {
 				DLB2_LOG_ERR("%s: Error parsing numa node parameter",
 					     name);
drivers/event/dlb2/dlb2_priv.h +2 -2
index 607b4d24d0..196c629e7d 100644
@@ -196,7 +196,7 @@ struct dlb2_hw_resource_info {
 	/**> Max resources that can be provided */
 	struct dlb2_hw_rsrcs hw_rsrc_max;
 	int num_sched_domains;
-	uint32_t socket_id;
+	uint32_t numa_id;
 };
 
 enum dlb2_enqueue_type {
@@ -674,7 +674,7 @@ struct dlb2_cos_bw {
 };
 
 struct dlb2_devargs {
-	int socket_id;
+	int numa_id;
 	int max_num_events;
 	int num_dir_credits_override;
 	int dev_id;
drivers/event/dlb2/dlb2_selftest.c +1 -1
index 87d98700c9..bd608f08d1 100644
@@ -1396,7 +1396,7 @@ do_selftest(void)
 						32 /*MBUF_CACHE_SIZE*/,
 						0,
 						512, /* use very small mbufs */
-						rte_socket_id());
+						rte_numa_id());
 		if (!eventdev_func_mempool) {
 			printf("ERROR creating mempool\n");
 			goto test_fail;
drivers/event/dlb2/dlb2_xstats.c +4 -4
index c037cfe786..3398c06bd0 100644
@@ -586,9 +586,9 @@ dlb2_xstats_init(struct dlb2_eventdev *dlb2)
 		DLB2_MAX_NUM_QUEUES(dlb2->version) * RTE_DIM(qid_stats);
 	unsigned int i, port, qid, stat_id = 0;
 
-	dlb2->xstats = rte_zmalloc_socket(NULL,
+	dlb2->xstats = rte_zmalloc_numa(NULL,
 			sizeof(dlb2->xstats[0]) * count, 0,
-			dlb2->qm_instance.info.socket_id);
+			dlb2->qm_instance.info.numa_id);
 	if (dlb2->xstats == NULL)
 		return -ENOMEM;
 
@@ -1027,8 +1027,8 @@ dlb2_eventdev_dump(struct rte_eventdev *dev, FILE *f)
 	else
 		fprintf(f, "UNEXPECTED\n");
 
-	fprintf(f, "domain ID=%u, socket_id=%u, evdev=%p\n",
-		handle->domain_id, handle->info.socket_id, dlb2->event_dev);
+	fprintf(f, "domain ID=%u, numa_id=%u, evdev=%p\n",
+		handle->domain_id, handle->info.numa_id, dlb2->event_dev);
 
 	fprintf(f, "num dir ports=%u, num dir queues=%u\n",
 		dlb2->num_dir_ports, dlb2->num_dir_queues);
drivers/event/dlb2/pf/dlb2_pf.c +6 -6
index aaa55bbe00..998df9ca0c 100644
@@ -298,14 +298,14 @@ dlb2_alloc_coherent_aligned(const struct rte_memzone **mz, uintptr_t *phys,
 {
 	char mz_name[RTE_MEMZONE_NAMESIZE];
 	uint32_t core_id = rte_lcore_id();
-	unsigned int socket_id;
+	unsigned int numa_id;
 
 	snprintf(mz_name, sizeof(mz_name) - 1, "event_dlb2_pf_%lx",
 		 (unsigned long)rte_get_timer_cycles());
 	if (core_id == (unsigned int)LCORE_ID_ANY)
 		core_id = rte_get_main_lcore();
-	socket_id = rte_lcore_to_socket_id(core_id);
-	*mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
+	numa_id = rte_lcore_to_numa_id(core_id);
+	*mz = rte_memzone_reserve_aligned(mz_name, size, numa_id,
 					 RTE_MEMZONE_IOVA_CONTIG, align);
 	if (*mz == NULL) {
 		DLB2_LOG_LINE_DBG("Unable to allocate DMA memory of size %zu bytes - %s",
@@ -758,7 +758,7 @@ dlb2_eventdev_pci_init(struct rte_eventdev *eventdev)
 	int ret = 0;
 	struct rte_pci_device *pci_dev;
 	struct dlb2_devargs dlb2_args = {
-		.socket_id = rte_socket_id(),
+		.numa_id = rte_numa_id(),
 		.max_num_events = DLB2_MAX_NUM_LDB_CREDITS,
 		.producer_coremask = NULL,
 		.num_dir_credits_override = -1,
@@ -776,7 +776,7 @@ dlb2_eventdev_pci_init(struct rte_eventdev *eventdev)
 	int q;
 	const void *probe_args = NULL;
 
-	DLB2_LOG_LINE_DBG("Enter with dev_id=%d socket_id=%d",
+	DLB2_LOG_LINE_DBG("Enter with dev_id=%d numa_id=%d",
 		     eventdev->data->dev_id, eventdev->data->numa_id);
 
 	for (q = 0; q < DLB2_MAX_NUM_PORTS_ALL; q++)
@@ -787,7 +787,7 @@ dlb2_eventdev_pci_init(struct rte_eventdev *eventdev)
 	pci_dev = RTE_CLASS_TO_BUS_DEVICE(eventdev, *pci_dev);
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-		dlb2 = dlb2_pmd_priv(eventdev); /* rte_zmalloc_socket mem */
+		dlb2 = dlb2_pmd_priv(eventdev); /* rte_zmalloc_numa mem */
 		dlb2->version = DLB2_HW_DEVICE_FROM_PCI_ID(pci_dev);
 		if (dlb2->version == DLB2_HW_V2_5)
 			dlb2_args.max_num_events = DLB2_MAX_NUM_CREDITS(DLB2_HW_V2_5);
Signature · 1 line
2.55.0
#94 lore raw

PATCH 92/227 event/dpaa: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/dpaa/dpaa_eventdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/event/dpaa/dpaa_eventdev.c +1 -1
index e5d93afca2..085a2cd69c 100644
@@ -984,7 +984,7 @@ dpaa_event_dev_create(const char *name, const char *params, struct rte_vdev_devi
 
 	eventdev = rte_event_pmd_vdev_init(name,
 					   sizeof(struct dpaa_eventdev),
-					   rte_socket_id(), vdev);
+					   rte_numa_id(), vdev);
 	if (eventdev == NULL) {
 		DPAA_EVENTDEV_ERR("Failed to create eventdev vdev %s", name);
 		goto fail;
Signature · 1 line
2.55.0
#95 lore raw

PATCH 93/227 event/dpaa2: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/dpaa2/dpaa2_eventdev.c          | 2 +-
 drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
index 95d9154b11..2530d9a271 100644
@@ -1084,7 +1084,7 @@ dpaa2_eventdev_create(const char *name, struct rte_vdev_device *vdev)
 
 	eventdev = rte_event_pmd_vdev_init(name,
 					   sizeof(struct dpaa2_eventdev),
-					   rte_socket_id(), vdev);
+					   rte_numa_id(), vdev);
 	if (eventdev == NULL) {
 		DPAA2_EVENTDEV_ERR("Failed to create Event device %s", name);
 		goto fail;
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +1 -1
index b1e4bf6855..079825ed58 100644
@@ -124,7 +124,7 @@ _eventdev_setup(int mode)
 					0 /*MBUF_CACHE_SIZE*/,
 					0,
 					512, /* Use very small mbufs */
-					rte_socket_id());
+					rte_numa_id());
 	if (!eventdev_test_mempool) {
 		dpaa2_evdev_err("ERROR creating mempool");
 		return -1;
Signature · 1 line
2.55.0
#96 lore raw

PATCH 94/227 event/dsw: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/dsw/dsw_evdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/event/dsw/dsw_evdev.c +1 -1
index 55e3a2045c..84ba4a06c2 100644
@@ -448,7 +448,7 @@ dsw_probe(struct rte_vdev_device *vdev)
 	name = rte_vdev_device_name(vdev);
 
 	dev = rte_event_pmd_vdev_init(name, sizeof(struct dsw_evdev),
-				      rte_socket_id(), vdev);
+				      rte_numa_id(), vdev);
 	if (dev == NULL)
 		return -EFAULT;
 
Signature · 1 line
2.55.0
#97 lore raw

PATCH 95/227 event/octeontx: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/octeontx/ssovf_evdev.c          | 4 ++--
 drivers/event/octeontx/ssovf_evdev_selftest.c | 2 +-
 drivers/event/octeontx/ssovf_worker.c         | 2 +-
 drivers/event/octeontx/timvf_evdev.c          | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/event/octeontx/ssovf_evdev.c +2 -2
index 1e5818569b..ba9e92fd99 100644
@@ -254,7 +254,7 @@ ssovf_port_setup(struct rte_eventdev *dev, uint8_t port_id,
 	}
 
 	/* Allocate event port memory */
-	ws = rte_zmalloc_socket("eventdev ssows",
+	ws = rte_zmalloc_numa("eventdev ssows",
 			sizeof(struct ssows), RTE_CACHE_LINE_SIZE,
 			dev->data->numa_id);
 	if (ws == NULL) {
@@ -893,7 +893,7 @@ ssovf_vdev_probe(struct rte_vdev_device *vdev)
 	}
 
 	eventdev = rte_event_pmd_vdev_init(name, sizeof(struct ssovf_evdev),
-				rte_socket_id(), vdev);
+				rte_numa_id(), vdev);
 	if (eventdev == NULL) {
 		ssovf_log_err("Failed to create eventdev vdev %s", name);
 		return -ENOMEM;
drivers/event/octeontx/ssovf_evdev_selftest.c +1 -1
index df8e710b57..45ff890780 100644
@@ -159,7 +159,7 @@ _eventdev_setup(int mode)
 					0 /*MBUF_CACHE_SIZE*/,
 					0,
 					512, /* Use very small mbufs */
-					rte_socket_id());
+					rte_numa_id());
 	if (!eventdev_test_mempool) {
 		ssovf_log_dbg("ERROR creating mempool");
 		return -1;
drivers/event/octeontx/ssovf_worker.c +1 -1
index f3c6a0da5c..fe7031b6c5 100644
@@ -463,7 +463,7 @@ octeontx_fastpath_lookup_mem_get(void)
 
 	/* Request for the first time */
 	mz = rte_memzone_reserve_aligned(name, LOOKUP_ARRAY_SZ,
-					 SOCKET_ID_ANY, 0, OCCTX_ALIGN);
+					 RTE_NUMA_ID_ANY, 0, OCCTX_ALIGN);
 	if (mz != NULL) {
 		mem = mz->addr;
 		/* Form the rx ol_flags based on errcode */
drivers/event/octeontx/timvf_evdev.c +1 -1
index b404b1db61..5eaf580c7f 100644
@@ -323,7 +323,7 @@ timvf_ring_create(struct rte_event_timer_adapter *adptr)
 	snprintf(pool_name, sizeof(pool_name), "timvf_chunk_pool%d",
 			timr->tim_ring_id);
 	timr->chunk_pool = (void *)rte_mempool_create_empty(pool_name,
-			timr->nb_chunks, TIM_CHUNK_SIZE, 0, 0, rte_socket_id(),
+			timr->nb_chunks, TIM_CHUNK_SIZE, 0, 0, rte_numa_id(),
 			mp_flags);
 
 	if (!timr->chunk_pool) {
Signature · 1 line
2.55.0
#98 lore raw

PATCH 96/227 event/opdl: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/opdl/opdl_evdev.c | 16 ++++++++--------
 drivers/event/opdl/opdl_ring.c  |  6 +++---
 drivers/event/opdl/opdl_ring.h  |  2 +-
 drivers/event/opdl/opdl_test.c  |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)
drivers/event/opdl/opdl_evdev.c +8 -8
index 44a648a11a..d5396fda4f 100644
@@ -581,9 +581,9 @@ opdl_close(struct rte_eventdev *dev)
 static int
 assign_numa_node(const char *key __rte_unused, const char *value, void *opaque)
 {
-	int *socket_id = opaque;
-	*socket_id = atoi(value);
-	if (*socket_id >= RTE_MAX_NUMA_NODES)
+	int *numa_id = opaque;
+	*numa_id = atoi(value);
+	if (*numa_id >= RTE_MAX_NUMA_NODES)
 		return -1;
 	return 0;
 }
@@ -647,7 +647,7 @@ opdl_probe(struct rte_vdev_device *vdev)
 	const char *params;
 	struct rte_eventdev *dev;
 	struct opdl_evdev *opdl;
-	int socket_id = rte_socket_id();
+	int numa_id = rte_numa_id();
 	int do_validation = 0;
 	int do_test = 0;
 	int str_len;
@@ -664,7 +664,7 @@ opdl_probe(struct rte_vdev_device *vdev)
 					name);
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
-					assign_numa_node, &socket_id);
+					assign_numa_node, &numa_id);
 			if (ret != 0) {
 				PMD_DRV_LOG(ERR,
 						"%s: Error parsing numa node parameter",
@@ -698,7 +698,7 @@ opdl_probe(struct rte_vdev_device *vdev)
 		}
 	}
 	dev = rte_event_pmd_vdev_init(name,
-			sizeof(struct opdl_evdev), socket_id, vdev);
+			sizeof(struct opdl_evdev), numa_id, vdev);
 
 	if (dev == NULL) {
 		PMD_DRV_LOG(ERR, "eventdev vdev init() failed");
@@ -710,7 +710,7 @@ opdl_probe(struct rte_vdev_device *vdev)
 			  " , self_test:[%s]",
 		      dev->data->dev_id,
 		      name,
-		      socket_id,
+		      numa_id,
 		      (do_validation ? "true" : "false"),
 			  (do_test ? "true" : "false"));
 
@@ -726,7 +726,7 @@ opdl_probe(struct rte_vdev_device *vdev)
 
 	opdl = dev->data->dev_private;
 	opdl->data = dev->data;
-	opdl->socket = socket_id;
+	opdl->socket = numa_id;
 	opdl->do_validation = do_validation;
 	opdl->do_test = do_test;
 	str_len = strlen(name);
drivers/event/opdl/opdl_ring.c +3 -3
index 60991c4b03..d1e8cdb048 100644
@@ -805,13 +805,13 @@ init_stage(struct opdl_ring *t, struct opdl_stage *s, bool threadsafe,
 	s->shared.stage = s;
 
 	/* Alloc memory for deps */
-	s->dep_tracking = rte_zmalloc_socket(LIB_NAME,
+	s->dep_tracking = rte_zmalloc_numa(LIB_NAME,
 			t->max_num_stages * sizeof(enum dep_type),
 			0, t->socket);
 	if (s->dep_tracking == NULL)
 		return -ENOMEM;
 
-	s->deps = rte_zmalloc_socket(LIB_NAME,
+	s->deps = rte_zmalloc_numa(LIB_NAME,
 			t->max_num_stages * sizeof(struct shared_state *),
 			0, t->socket);
 	if (s->deps == NULL) {
@@ -923,7 +923,7 @@ opdl_ring_create(const char *name, uint32_t num_slots, uint32_t slot_size,
 	}
 
 	/* Alloc memory for stages */
-	st = rte_zmalloc_socket(LIB_NAME,
+	st = rte_zmalloc_numa(LIB_NAME,
 		max_num_stages * sizeof(struct opdl_stage),
 		RTE_CACHE_LINE_SIZE, socket);
 	if (st == NULL)
drivers/event/opdl/opdl_ring.h +1 -1
index 14ababe0bb..c055dd4f7d 100644
@@ -69,7 +69,7 @@ struct opdl_stage;
  * @param max_num_stages
  *   Maximum number of stages.
  * @param socket
- *   The NUMA socket (or SOCKET_ID_ANY) to allocate the memory used for this
+ *   The NUMA socket (or RTE_NUMA_ID_ANY) to allocate the memory used for this
  *   opdl_ring instance.
  * @param threadsafe
  *   Whether to support multiple threads inputting to the opdl_ring or not.
drivers/event/opdl/opdl_test.c +1 -1
index 9b0c4db5ce..daa07f52e2 100644
@@ -1017,7 +1017,7 @@ opdl_selftest(void)
 				32 /*MBUF_CACHE_SIZE*/,
 				0,
 				512, /* use very small mbufs */
-				rte_socket_id());
+				rte_numa_id());
 		if (!eventdev_func_mempool) {
 			PMD_DRV_LOG(ERR, "ERROR creating mempool");
 			free(t);
Signature · 1 line
2.55.0
#99 lore raw

PATCH 97/227 event/skeleton: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/skeleton/skeleton_eventdev.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/event/skeleton/skeleton_eventdev.c +7 -7
index 9eccf61cad..0893fac541 100644
@@ -220,7 +220,7 @@ skeleton_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id,
 	}
 
 	/* Allocate event port memory */
-	sp = rte_zmalloc_socket("eventdev port",
+	sp = rte_zmalloc_numa("eventdev port",
 			sizeof(struct skeleton_port), RTE_CACHE_LINE_SIZE,
 			dev->data->numa_id);
 	if (sp == NULL) {
@@ -351,7 +351,7 @@ skeleton_eventdev_init(struct rte_eventdev *eventdev)
 			pci_dev->addr.domain, pci_dev->addr.bus,
 			pci_dev->addr.devid, pci_dev->addr.function);
 
-	PMD_DRV_LOG(INFO, "dev_id=%d socket_id=%d (%x:%x)",
+	PMD_DRV_LOG(INFO, "dev_id=%d numa_id=%d (%x:%x)",
 		eventdev->data->dev_id, eventdev->data->numa_id,
 		skel->vendor_id, skel->device_id);
 
@@ -401,12 +401,12 @@ RTE_PMD_REGISTER_PCI_TABLE(event_skeleton_pci, pci_id_skeleton_map);
 /* VDEV based event device */
 
 static int
-skeleton_eventdev_create(const char *name, int socket_id, struct rte_vdev_device *vdev)
+skeleton_eventdev_create(const char *name, int numa_id, struct rte_vdev_device *vdev)
 {
 	struct rte_eventdev *eventdev;
 
 	eventdev = rte_event_pmd_vdev_init(name,
-			sizeof(struct skeleton_eventdev), socket_id, vdev);
+			sizeof(struct skeleton_eventdev), numa_id, vdev);
 	if (eventdev == NULL) {
 		PMD_DRV_ERR("Failed to create eventdev vdev %s", name);
 		goto fail;
@@ -428,8 +428,8 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev)
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d", name, rte_socket_id());
-	return skeleton_eventdev_create(name, rte_socket_id(), vdev);
+	PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d", name, rte_numa_id());
+	return skeleton_eventdev_create(name, rte_numa_id(), vdev);
 }
 
 static int
@@ -438,7 +438,7 @@ skeleton_eventdev_remove(struct rte_vdev_device *vdev)
 	const char *name;
 
 	name = rte_vdev_device_name(vdev);
-	PMD_DRV_LOG(INFO, "Closing %s on NUMA node %d", name, rte_socket_id());
+	PMD_DRV_LOG(INFO, "Closing %s on NUMA node %d", name, rte_numa_id());
 
 	return rte_event_pmd_vdev_uninit(name);
 }
Signature · 1 line
2.55.0
#100 lore raw

PATCH 98/227 event/sw: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/event/sw/event_ring.h        |  4 ++--
 drivers/event/sw/sw_evdev.c          | 26 +++++++++++++-------------
 drivers/event/sw/sw_evdev_selftest.c |  2 +-
 drivers/event/sw/sw_evdev_xstats.c   |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)
drivers/event/sw/event_ring.h +2 -2
index 35931888dd..bb12697720 100644
@@ -31,14 +31,14 @@ struct rob_ring {
 };
 
 static inline struct rob_ring *
-rob_ring_create(unsigned int size, unsigned int socket_id)
+rob_ring_create(unsigned int size, unsigned int numa_id)
 {
 	struct rob_ring *retval;
 	const uint32_t ring_size = rte_align32pow2(size + 1);
 	size_t memsize = sizeof(*retval) +
 			(ring_size * sizeof(retval->ring[0]));
 
-	retval = rte_zmalloc_socket(NULL, memsize, 0, socket_id);
+	retval = rte_zmalloc_numa(NULL, memsize, 0, numa_id);
 	if (retval == NULL)
 		goto end;
 	retval->ring_size = ring_size;
drivers/event/sw/sw_evdev.c +13 -13
index d6bc23a220..b2dc61142a 100644
@@ -237,7 +237,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
 		const struct rte_event_queue_conf *queue_conf)
 {
 	unsigned int i;
-	int socket_id = sw->data->numa_id;
+	int numa_id = sw->data->numa_id;
 	struct sw_qid *qid = &sw->qids[idx];
 
 	/* Initialize the FID structures to no pinning (-1), and zero packets */
@@ -267,9 +267,9 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
 			goto cleanup;
 		}
 
-		qid->reorder_buffer = rte_zmalloc_socket(NULL,
+		qid->reorder_buffer = rte_zmalloc_numa(NULL,
 				window_size * sizeof(qid->reorder_buffer[0]),
-				0, socket_id);
+				0, numa_id);
 		if (!qid->reorder_buffer) {
 			SW_LOG_DBG("reorder_buffer malloc failed");
 			goto cleanup;
@@ -280,7 +280,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type,
 		       window_size * sizeof(qid->reorder_buffer[0]));
 
 		qid->reorder_buffer_freelist = rob_ring_create(window_size,
-				socket_id);
+				numa_id);
 		if (!qid->reorder_buffer_freelist) {
 			SW_LOG_DBG("freelist ring create failed");
 			goto cleanup;
@@ -533,7 +533,7 @@ sw_dev_configure(const struct rte_eventdev *dev)
 	 */
 	rte_free(sw->chunks);
 
-	sw->chunks = rte_malloc_socket(NULL,
+	sw->chunks = rte_malloc_numa(NULL,
 				       sizeof(struct sw_queue_chunk) *
 				       num_chunks,
 				       0,
@@ -886,9 +886,9 @@ sw_close(struct rte_eventdev *dev)
 static int
 assign_numa_node(const char *key __rte_unused, const char *value, void *opaque)
 {
-	int *socket_id = opaque;
-	*socket_id = atoi(value);
-	if (*socket_id >= RTE_MAX_NUMA_NODES)
+	int *numa_id = opaque;
+	*numa_id = atoi(value);
+	if (*numa_id >= RTE_MAX_NUMA_NODES)
 		return -1;
 	return 0;
 }
@@ -997,7 +997,7 @@ sw_probe(struct rte_vdev_device *vdev)
 	const char *params;
 	struct rte_eventdev *dev;
 	struct sw_evdev *sw;
-	int socket_id = rte_socket_id();
+	int numa_id = rte_numa_id();
 	int sched_quanta  = SW_DEFAULT_SCHED_QUANTA;
 	int credit_quanta = SW_DEFAULT_CREDIT_QUANTA;
 	int min_burst_size = 1;
@@ -1015,7 +1015,7 @@ sw_probe(struct rte_vdev_device *vdev)
 				name);
 		} else {
 			int ret = rte_kvargs_process(kvlist, NUMA_NODE_ARG,
-					assign_numa_node, &socket_id);
+					assign_numa_node, &numa_id);
 			if (ret != 0) {
 				SW_LOG_ERR(
 					"%s: Error parsing numa node parameter",
@@ -1082,11 +1082,11 @@ sw_probe(struct rte_vdev_device *vdev)
 			"Creating eventdev sw device %s, numa_node=%d, "
 			"sched_quanta=%d, credit_quanta=%d "
 			"min_burst=%d, deq_burst=%d, refill_once=%d",
-			name, socket_id, sched_quanta, credit_quanta,
+			name, numa_id, sched_quanta, credit_quanta,
 			min_burst_size, deq_burst_size, refill_once);
 
 	dev = rte_event_pmd_vdev_init(name,
-			sizeof(struct sw_evdev), socket_id, vdev);
+			sizeof(struct sw_evdev), numa_id, vdev);
 	if (dev == NULL) {
 		SW_LOG_ERR("eventdev vdev init() failed");
 		return -EFAULT;
@@ -1116,7 +1116,7 @@ sw_probe(struct rte_vdev_device *vdev)
 	snprintf(service.name, sizeof(service.name), "%s_service", name);
 	snprintf(sw->service_name, sizeof(sw->service_name), "%s_service",
 			name);
-	service.socket_id = socket_id;
+	service.socket_id = numa_id;
 	service.callback = sw_sched_service_func;
 	service.callback_userdata = (void *)dev;
 
drivers/event/sw/sw_evdev_selftest.c +1 -1
index a2ce14051c..979ec28a72 100644
@@ -3351,7 +3351,7 @@ test_sw_eventdev(void)
 				32 /*MBUF_CACHE_SIZE*/,
 				0,
 				512, /* use very small mbufs */
-				rte_socket_id());
+				rte_numa_id());
 		if (!eventdev_func_mempool) {
 			printf("ERROR creating mempool\n");
 			goto test_fail;
drivers/event/sw/sw_evdev_xstats.c +1 -1
index 611a7ce94a..bd558d5cdf 100644
@@ -261,7 +261,7 @@ sw_xstats_init(struct sw_evdev *sw)
 				RTE_DIM(qid_port_stats);
 	unsigned int i, port, qid, iq, bkt, stat = 0;
 
-	sw->xstats = rte_zmalloc_socket(NULL, sizeof(sw->xstats[0]) * count, 0,
+	sw->xstats = rte_zmalloc_numa(NULL, sizeof(sw->xstats[0]) * count, 0,
 			sw->data->numa_id);
 	if (sw->xstats == NULL)
 		return -ENOMEM;
Signature · 1 line
2.55.0
#101 lore raw

PATCH 99/227 mempool/bucket: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/mempool/bucket/rte_mempool_bucket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/bucket/rte_mempool_bucket.c +2 -2
index d3f626e064..a94e76bc13 100644
@@ -63,7 +63,7 @@ bucket_stack_create(const struct rte_mempool *mp, unsigned int n_elts)
 {
 	struct bucket_stack *stack;
 
-	stack = rte_zmalloc_socket("bucket_stack",
+	stack = rte_zmalloc_numa("bucket_stack",
 				   sizeof(struct bucket_stack) +
 				   n_elts * sizeof(void *),
 				   RTE_CACHE_LINE_SIZE,
@@ -465,7 +465,7 @@ bucket_alloc(struct rte_mempool *mp)
 	if (rc < 0)
 		return rc;
 
-	bd = rte_zmalloc_socket("bucket_pool", sizeof(*bd),
+	bd = rte_zmalloc_numa("bucket_pool", sizeof(*bd),
 				RTE_CACHE_LINE_SIZE, mp->numa_id);
 	if (bd == NULL) {
 		rc = -ENOMEM;
Signature · 1 line
2.55.0
#102 lore raw

PATCH 100/227 mempool/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 2 +-
 drivers/mempool/cnxk/cnxk_mempool.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mempool/cnxk/cn10k_mempool_ops.c +1 -1
index 09f900a850..472144da8b 100644
@@ -47,7 +47,7 @@ batch_op_data_table_create(void)
 			sz = maxpools * sizeof(struct batch_op_data *);
 
 			mz = rte_memzone_reserve_aligned(
-				BATCH_OP_DATA_TABLE_MZ_NAME, sz, SOCKET_ID_ANY,
+				BATCH_OP_DATA_TABLE_MZ_NAME, sz, RTE_NUMA_ID_ANY,
 				0, ROC_ALIGN);
 		}
 		if (mz == NULL) {
drivers/mempool/cnxk/cnxk_mempool.c +1 -1
index 6939fccff4..8a6a1b8c4c 100644
@@ -108,7 +108,7 @@ npa_init(struct rte_pci_device *pci_dev)
 	int rc = -ENOMEM;
 
 	mz = rte_memzone_reserve_aligned(npa_dev_to_name(pci_dev, name),
-					 sizeof(*dev), SOCKET_ID_ANY, 0,
+					 sizeof(*dev), RTE_NUMA_ID_ANY, 0,
 					 RTE_CACHE_LINE_SIZE);
 	if (mz == NULL)
 		goto error;
Signature · 1 line
2.55.0
#103 lore raw

PATCH 101/227 ml/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/ml/cnxk/cnxk_ml_ops.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/ml/cnxk/cnxk_ml_ops.c +6 -6
index dc05764306..c47c58e4d0 100644
@@ -73,7 +73,7 @@ cnxk_ml_dev_queue_pair_release(struct rte_ml_dev *dev, uint16_t queue_pair_id)
 }
 
 static struct cnxk_ml_qp *
-cnxk_ml_qp_create(const struct rte_ml_dev *dev, uint16_t qp_id, uint32_t nb_desc, int socket_id)
+cnxk_ml_qp_create(const struct rte_ml_dev *dev, uint16_t qp_id, uint32_t nb_desc, int numa_id)
 {
 	const struct rte_memzone *qp_mem;
 	char name[RTE_MEMZONE_NAMESIZE];
@@ -85,8 +85,8 @@ cnxk_ml_qp_create(const struct rte_ml_dev *dev, uint16_t qp_id, uint32_t nb_desc
 	cnxk_mldev = dev->data->dev_private;
 
 	/* Allocate queue pair */
-	qp = rte_zmalloc_socket("cnxk_ml_pmd_queue_pair", sizeof(struct cnxk_ml_qp), ROC_ALIGN,
-				socket_id);
+	qp = rte_zmalloc_numa("cnxk_ml_pmd_queue_pair", sizeof(struct cnxk_ml_qp), ROC_ALIGN,
+				numa_id);
 	if (qp == NULL) {
 		plt_err("Could not allocate queue pair");
 		return NULL;
@@ -96,7 +96,7 @@ cnxk_ml_qp_create(const struct rte_ml_dev *dev, uint16_t qp_id, uint32_t nb_desc
 	len = nb_desc * sizeof(struct cnxk_ml_req);
 	qp_memzone_name_get(name, RTE_MEMZONE_NAMESIZE, dev->data->dev_id, qp_id);
 	qp_mem = rte_memzone_reserve_aligned(
-		name, len, socket_id, RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_256MB, ROC_ALIGN);
+		name, len, numa_id, RTE_MEMZONE_SIZE_HINT_ONLY | RTE_MEMZONE_256MB, ROC_ALIGN);
 	if (qp_mem == NULL) {
 		plt_err("Could not reserve memzone: %s", name);
 		goto qp_free;
@@ -837,7 +837,7 @@ cnxk_ml_dev_selftest(struct rte_ml_dev *dev)
 
 static int
 cnxk_ml_dev_queue_pair_setup(struct rte_ml_dev *dev, uint16_t queue_pair_id,
-			     const struct rte_ml_dev_qp_conf *qp_conf, int socket_id)
+			     const struct rte_ml_dev_qp_conf *qp_conf, int numa_id)
 {
 	struct rte_ml_dev_info dev_info;
 	struct cnxk_ml_qp *qp;
@@ -870,7 +870,7 @@ cnxk_ml_dev_queue_pair_setup(struct rte_ml_dev *dev, uint16_t queue_pair_id,
 	 */
 	nb_desc =
 		(qp_conf->nb_desc == dev_info.max_desc) ? dev_info.max_desc : qp_conf->nb_desc + 1;
-	qp = cnxk_ml_qp_create(dev, queue_pair_id, nb_desc, socket_id);
+	qp = cnxk_ml_qp_create(dev, queue_pair_id, nb_desc, numa_id);
 	if (qp == NULL) {
 		plt_err("Could not create queue pair %u", queue_pair_id);
 		return -ENOMEM;
Signature · 1 line
2.55.0
#104 lore raw

PATCH 102/227 net/af_packet: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/af_packet/rte_eth_af_packet.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/af_packet/rte_eth_af_packet.c +11 -11
index 44f82c0309..ad59d3dd7d 100644
@@ -599,7 +599,7 @@ eth_dev_close(struct rte_eth_dev *dev)
 		return 0;
 
 	PMD_LOG(INFO, "Closing AF_PACKET ethdev on NUMA socket %u",
-		rte_socket_id());
+		rte_numa_id());
 
 	internals = dev->data->dev_private;
 	req = &internals->req;
@@ -656,7 +656,7 @@ 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)
 {
@@ -694,7 +694,7 @@ 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)
 {
 
@@ -933,17 +933,17 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 		"%s: creating AF_PACKET-backed ethdev on numa socket %u",
 		name, numa_node);
 
-	*internals = rte_zmalloc_socket(name, sizeof(**internals),
+	*internals = rte_zmalloc_numa(name, sizeof(**internals),
 					0, numa_node);
 	if (*internals == NULL)
 		return -1;
 
 
-	(*internals)->rx_queue = rte_calloc_socket("af_packet_rx",
+	(*internals)->rx_queue = rte_calloc_numa("af_packet_rx",
 						nb_queues,
 						sizeof(struct pkt_rx_queue),
 						0, numa_node);
-	(*internals)->tx_queue = rte_calloc_socket("af_packet_tx",
+	(*internals)->tx_queue = rte_calloc_numa("af_packet_tx",
 						nb_queues,
 						sizeof(struct pkt_tx_queue),
 						0, numa_node);
@@ -979,7 +979,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 		PMD_LOG_ERRNO(ERR, "%s: ioctl failed (SIOCGIFINDEX)", name);
 		goto free_internals;
 	}
-	(*internals)->if_name = rte_malloc_socket(name, ifnamelen + 1, 0, numa_node);
+	(*internals)->if_name = rte_malloc_numa(name, ifnamelen + 1, 0, numa_node);
 	if ((*internals)->if_name == NULL)
 		goto free_internals;
 	strlcpy((*internals)->if_name, pair->value, ifnamelen + 1);
@@ -1098,7 +1098,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 		/* rdsize is same for both Tx and Rx */
 		rdsize = req->tp_frame_nr * sizeof(*(rx_queue->rd));
 
-		rx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+		rx_queue->rd = rte_zmalloc_numa(name, rdsize, 0, numa_node);
 		if (rx_queue->rd == NULL)
 			goto error;
 		for (i = 0; i < req->tp_frame_nr; ++i) {
@@ -1115,7 +1115,7 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 
 		tx_queue->map = rx_queue->map + req->tp_block_size * req->tp_block_nr;
 
-		tx_queue->rd = rte_zmalloc_socket(name, rdsize, 0, numa_node);
+		tx_queue->rd = rte_zmalloc_numa(name, rdsize, 0, numa_node);
 		if (tx_queue->rd == NULL)
 			goto error;
 		for (i = 0; i < req->tp_frame_nr; ++i) {
@@ -1406,8 +1406,8 @@ rte_pmd_af_packet_probe(struct rte_vdev_device *dev)
 			goto exit;
 	}
 
-	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 = rte_eth_from_packet(dev, &sockfd, kvlist);
 	close(sockfd); /* no longer needed */
Signature · 1 line
2.55.0
#105 lore raw

PATCH 103/227 net/af_xdp: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/af_xdp/rte_eth_af_xdp.c | 34 ++++++++++++++---------------
 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/net/af_xdp/rte_eth_af_xdp.c +17 -17
index 9c99dcec20..02ede3f648 100644
@@ -996,7 +996,7 @@ eth_dev_configure(struct rte_eth_dev *dev)
 		if (list)
 			return 0;
 
-		list = rte_zmalloc_socket(name, sizeof(*list), 0,
+		list = rte_zmalloc_numa(name, sizeof(*list), 0,
 					dev->device->numa_node);
 		if (list == NULL)
 			return -1;
@@ -1246,7 +1246,7 @@ eth_dev_close(struct rte_eth_dev *dev)
 		goto out;
 
 	AF_XDP_LOG_LINE(INFO, "Closing AF_XDP ethdev on numa socket %u",
-		rte_socket_id());
+		rte_numa_id());
 
 	for (i = 0; i < internals->queue_cnt; i++) {
 		rxq = &internals->rx_queues[i];
@@ -1423,8 +1423,8 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 						rte_pktmbuf_priv_size(mb_pool) +
 						RTE_PKTMBUF_HEADROOM;
 
-		umem = rte_zmalloc_socket("umem", sizeof(*umem), 0,
-					  rte_socket_id());
+		umem = rte_zmalloc_numa("umem", sizeof(*umem), 0,
+					  rte_numa_id());
 		if (umem == NULL) {
 			AF_XDP_LOG_LINE(ERR, "Failed to allocate umem info");
 			return NULL;
@@ -1490,7 +1490,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 	int ret;
 	uint64_t i;
 
-	umem = rte_zmalloc_socket("umem", sizeof(*umem), 0, rte_socket_id());
+	umem = rte_zmalloc_numa("umem", sizeof(*umem), 0, rte_numa_id());
 	if (umem == NULL) {
 		AF_XDP_LOG_LINE(ERR, "Failed to allocate umem info");
 		return NULL;
@@ -1500,7 +1500,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 		       internals->if_name, rxq->xsk_queue_idx);
 	umem->buf_ring = rte_ring_create(ring_name,
 					 ETH_AF_XDP_NUM_BUFFERS,
-					 rte_socket_id(),
+					 rte_numa_id(),
 					 0x0);
 	if (umem->buf_ring == NULL) {
 		AF_XDP_LOG_LINE(ERR, "Failed to create rte_ring");
@@ -1515,7 +1515,7 @@ xsk_umem_info *xdp_umem_configure(struct pmd_internals *internals,
 		       internals->if_name, rxq->xsk_queue_idx);
 	mz = rte_memzone_reserve_aligned(mz_name,
 			ETH_AF_XDP_NUM_BUFFERS * ETH_AF_XDP_FRAME_SIZE,
-			rte_socket_id(), RTE_MEMZONE_IOVA_CONTIG,
+			rte_numa_id(), RTE_MEMZONE_IOVA_CONTIG,
 			getpagesize());
 	if (mz == NULL) {
 		AF_XDP_LOG_LINE(ERR, "Failed to reserve memzone for af_xdp umem.");
@@ -2062,7 +2062,7 @@ static int
 eth_rx_queue_setup(struct rte_eth_dev *dev,
 		   uint16_t rx_queue_id,
 		   uint16_t nb_rx_desc,
-		   unsigned int socket_id __rte_unused,
+		   unsigned int numa_id __rte_unused,
 		   const struct rte_eth_rxconf *rx_conf,
 		   struct rte_mempool *mb_pool)
 {
@@ -2127,7 +2127,7 @@ 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;
@@ -2579,7 +2579,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,
 	int ret;
 	int i;
 
-	internals = rte_zmalloc_socket(name, sizeof(*internals), 0, numa_node);
+	internals = rte_zmalloc_numa(name, sizeof(*internals), 0, numa_node);
 	if (internals == NULL)
 		return NULL;
 
@@ -2619,7 +2619,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,
 		goto err_free_internals;
 	}
 
-	internals->rx_queues = rte_zmalloc_socket(NULL,
+	internals->rx_queues = rte_zmalloc_numa(NULL,
 					sizeof(struct pkt_rx_queue) * queue_cnt,
 					0, numa_node);
 	if (internals->rx_queues == NULL) {
@@ -2627,7 +2627,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,
 		goto err_free_internals;
 	}
 
-	internals->tx_queues = rte_zmalloc_socket(NULL,
+	internals->tx_queues = rte_zmalloc_numa(NULL,
 					sizeof(struct pkt_tx_queue) * queue_cnt,
 					0, numa_node);
 	if (internals->tx_queues == NULL) {
@@ -2648,7 +2648,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,
 		goto err_free_tx;
 
 	process_private = (struct pmd_process_private *)
-		rte_zmalloc_socket(name, sizeof(struct pmd_process_private),
+		rte_zmalloc_numa(name, sizeof(struct pmd_process_private),
 				   RTE_CACHE_LINE_SIZE, numa_node);
 	if (process_private == NULL) {
 		AF_XDP_LOG_LINE(ERR, "Failed to alloc memory for process private");
@@ -2859,7 +2859,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
 		eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
 		eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
 		eth_dev->process_private = (struct pmd_process_private *)
-			rte_zmalloc_socket(name,
+			rte_zmalloc_numa(name,
 					   sizeof(struct pmd_process_private),
 					   RTE_CACHE_LINE_SIZE,
 					   eth_dev->device->numa_node);
@@ -2994,14 +2994,14 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)
 	}
 
 	/* get numa node id from net sysfs */
-	if (dev->device.numa_node == SOCKET_ID_ANY) {
+	if (dev->device.numa_node == RTE_NUMA_ID_ANY) {
 		unsigned long numa = 0;
 		char numa_path[PATH_MAX];
 
 		snprintf(numa_path, sizeof(numa_path), "/sys/class/net/%s/device/numa_node",
 			 if_name);
 		if (access(numa_path, R_OK) != 0 || eal_parse_sysfs_value(numa_path, &numa) != 0)
-			dev->device.numa_node = rte_socket_id();
+			dev->device.numa_node = rte_numa_id();
 		else
 			dev->device.numa_node = numa;
 	}
@@ -3041,7 +3041,7 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev)
 	struct rte_eth_dev *eth_dev = NULL;
 
 	AF_XDP_LOG_LINE(INFO, "Removing AF_XDP ethdev on numa socket %u",
-		rte_socket_id());
+		rte_numa_id());
 
 	if (dev == NULL)
 		return -1;
Signature · 1 line
2.55.0
#106 lore raw

PATCH 104/227 net/ark: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/ark/ark_ethdev.c    |  4 ++--
 drivers/net/ark/ark_ethdev_rx.c | 14 +++++++-------
 drivers/net/ark/ark_ethdev_rx.h |  2 +-
 drivers/net/ark/ark_ethdev_tx.c | 14 +++++++-------
 drivers/net/ark/ark_ethdev_tx.h |  2 +-
 5 files changed, 18 insertions(+), 18 deletions(-)
drivers/net/ark/ark_ethdev.c +2 -2
index d6b1abf383..1df54b27b4 100644
@@ -441,10 +441,10 @@ ark_dev_init(struct rte_eth_dev *dev)
 		eth_dev->device = &pci_dev->device;
 		/* Device requires new dev_private data */
 		eth_dev->data->dev_private =
-			rte_zmalloc_socket(name,
+			rte_zmalloc_numa(name,
 					   sizeof(struct ark_adapter),
 					   RTE_CACHE_LINE_SIZE,
-					   rte_socket_id());
+					   rte_numa_id());
 		if (eth_dev->data->dev_private == NULL) {
 			ARK_PMD_LOG(ERR, "Memory allocation for dev_private failed\n");
 			goto error;
drivers/net/ark/ark_ethdev_rx.c +7 -7
index adba943fa2..4af6f5e40a 100644
@@ -114,7 +114,7 @@ int
 ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			   uint16_t queue_idx,
 			   uint16_t nb_desc,
-			   unsigned int socket_id,
+			   unsigned int numa_id,
 			   const struct rte_eth_rxconf *rx_conf,
 			   struct rte_mempool *mb_pool)
 {
@@ -154,10 +154,10 @@ ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocate queue struct */
-	queue = rte_zmalloc_socket("Ark_rxqueue",
+	queue = rte_zmalloc_numa("Ark_rxqueue",
 				   sizeof(struct ark_rx_queue),
 				   64,
-				   socket_id);
+				   numa_id);
 	if (queue == 0) {
 		ARK_PMD_LOG(ERR, "Failed to allocate memory in %s\n", __func__);
 		return -ENOMEM;
@@ -183,16 +183,16 @@ ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	queue->ext_user_data = ark->user_data[dev->data->port_id];
 
 	queue->reserve_q =
-		rte_zmalloc_socket("Ark_rx_queue mbuf",
+		rte_zmalloc_numa("Ark_rx_queue mbuf",
 				   nb_desc * sizeof(struct rte_mbuf *),
 				   512,
-				   socket_id);
+				   numa_id);
 	/* Align buffer to PCIe's boundary size to reduce upstream read request TLPs from FPGA */
 	queue->paddress_q =
-		rte_zmalloc_socket("Ark_rx_queue paddr",
+		rte_zmalloc_numa("Ark_rx_queue paddr",
 				   nb_desc * sizeof(rte_iova_t),
 				   ARK_PCIE_BOUNDARY,
-				   socket_id);
+				   numa_id);
 
 	if (queue->reserve_q == 0 || queue->paddress_q == 0) {
 		ARK_PMD_LOG(ERR,
drivers/net/ark/ark_ethdev_rx.h +1 -1
index 184733640b..0e5d0d5158 100644
@@ -14,7 +14,7 @@
 int ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       const struct rte_eth_rxconf *rx_conf,
 			       struct rte_mempool *mp);
 int ark_dev_rx_queue_count(void *rx_queue);
drivers/net/ark/ark_ethdev_tx.c +7 -7
index 0d6a94b919..5b0375ee56 100644
@@ -227,7 +227,7 @@ int
 ark_tx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct ark_adapter *ark = dev->data->dev_private;
@@ -248,10 +248,10 @@ ark_tx_queue_setup(struct rte_eth_dev *dev,
 	nb_desc = 2 * nb_desc;
 
 	/* Allocate queue struct */
-	queue =	rte_zmalloc_socket("Ark_txqueue",
+	queue =	rte_zmalloc_numa("Ark_txqueue",
 				   sizeof(struct ark_tx_queue),
 				   64,
-				   socket_id);
+				   numa_id);
 	if (queue == 0) {
 		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
@@ -269,15 +269,15 @@ ark_tx_queue_setup(struct rte_eth_dev *dev,
 	queue->ext_user_data = ark->user_data[dev->data->port_id];
 
 	queue->meta_q =
-		rte_zmalloc_socket("Ark_txqueue meta",
+		rte_zmalloc_numa("Ark_txqueue meta",
 				   nb_desc * sizeof(union ark_tx_meta),
 				   64,
-				   socket_id);
+				   numa_id);
 	queue->bufs =
-		rte_zmalloc_socket("Ark_txqueue bufs",
+		rte_zmalloc_numa("Ark_txqueue bufs",
 				   nb_desc * sizeof(struct rte_mbuf *),
 				   64,
-				   socket_id);
+				   numa_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
 		ARK_PMD_LOG(ERR, "Failed to allocate "
drivers/net/ark/ark_ethdev_tx.h +1 -1
index 2653408de6..099257012b 100644
@@ -16,7 +16,7 @@ uint16_t ark_xmit_pkts(void *vtxq,
 int ark_tx_queue_setup(struct rte_eth_dev *dev,
 			   uint16_t queue_idx,
 			   uint16_t nb_desc,
-			   unsigned int socket_id,
+			   unsigned int numa_id,
 			   const struct rte_eth_txconf *tx_conf);
 void ark_tx_queue_release(void *vtx_queue);
 int ark_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id);
Signature · 1 line
2.55.0
#107 lore raw

PATCH 105/227 net/atlantic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/atlantic/atl_ethdev.h |  4 ++--
 drivers/net/atlantic/atl_rxtx.c   | 24 ++++++++++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)
drivers/net/atlantic/atl_ethdev.h +2 -2
index d2f951c146..41bd29652f 100644
@@ -58,12 +58,12 @@ void atl_rx_queue_release(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 void atl_tx_queue_release(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 
 int atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
 int atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id,
+		uint16_t nb_tx_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 int atl_rx_queue_count(void *rx_queue);
drivers/net/atlantic/atl_rxtx.c +12 -12
index 8d02b92304..016351e69d 100644
@@ -100,7 +100,7 @@ atl_reset_rx_queue(struct atl_rx_queue *rxq)
 
 int
 atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		   uint16_t nb_rx_desc, unsigned int socket_id,
+		   uint16_t nb_rx_desc, unsigned int numa_id,
 		   const struct rte_eth_rxconf *rx_conf,
 		   struct rte_mempool *mb_pool)
 {
@@ -130,8 +130,8 @@ atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	}
 
 	/* allocate memory for the queue structure */
-	rxq = rte_zmalloc_socket("atlantic Rx queue", sizeof(*rxq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("atlantic Rx queue", sizeof(*rxq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate queue structure");
 		return -ENOMEM;
@@ -152,9 +152,9 @@ atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 		PMD_DRV_LOG(ERR, "PMD does not support KEEP_CRC offload");
 
 	/* allocate memory for the software ring */
-	rxq->sw_ring = rte_zmalloc_socket("atlantic sw rx ring",
+	rxq->sw_ring = rte_zmalloc_numa("atlantic sw rx ring",
 				nb_rx_desc * sizeof(struct atl_rx_entry),
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq->sw_ring == NULL) {
 		PMD_INIT_LOG(ERR,
 			"Port %d: Cannot allocate software ring for queue %d",
@@ -171,7 +171,7 @@ atl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	mz = rte_eth_dma_zone_reserve(dev, "rx hw_ring", rx_queue_id,
 				      HW_ATL_B0_MAX_RXD *
 					sizeof(struct hw_atl_rxd_s),
-				      128, socket_id);
+				      128, numa_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR,
 			"Port %d: Cannot allocate hardware ring for queue %d",
@@ -223,7 +223,7 @@ atl_reset_tx_queue(struct atl_tx_queue *txq)
 
 int
 atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		   uint16_t nb_tx_desc, unsigned int socket_id,
+		   uint16_t nb_tx_desc, unsigned int numa_id,
 		   const struct rte_eth_txconf *tx_conf)
 {
 	struct atl_tx_queue *txq;
@@ -252,8 +252,8 @@ atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 	}
 
 	/* allocate memory for the queue structure */
-	txq = rte_zmalloc_socket("atlantic Tx queue", sizeof(*txq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("atlantic Tx queue", sizeof(*txq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate queue structure");
 		return -ENOMEM;
@@ -267,9 +267,9 @@ atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 
 
 	/* allocate memory for the software ring */
-	txq->sw_ring = rte_zmalloc_socket("atlantic sw tx ring",
+	txq->sw_ring = rte_zmalloc_numa("atlantic sw tx ring",
 				nb_tx_desc * sizeof(struct atl_tx_entry),
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->sw_ring == NULL) {
 		PMD_INIT_LOG(ERR,
 			"Port %d: Cannot allocate software ring for queue %d",
@@ -285,7 +285,7 @@ atl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 	 */
 	mz = rte_eth_dma_zone_reserve(dev, "tx hw_ring", tx_queue_id,
 				HW_ATL_B0_MAX_TXD * sizeof(struct hw_atl_txd_s),
-				128, socket_id);
+				128, numa_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR,
 			"Port %d: Cannot allocate hardware ring for queue %d",
Signature · 1 line
2.55.0
#108 lore raw

PATCH 106/227 net/avp: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/avp/avp_ethdev.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/avp/avp_ethdev.c +8 -8
index d536f764cf..ed6eb1cce8 100644
@@ -49,14 +49,14 @@ static int avp_dev_promiscuous_disable(struct rte_eth_dev *dev);
 static int avp_dev_rx_queue_setup(struct rte_eth_dev *dev,
 				  uint16_t rx_queue_id,
 				  uint16_t nb_rx_desc,
-				  unsigned int socket_id,
+				  unsigned int numa_id,
 				  const struct rte_eth_rxconf *rx_conf,
 				  struct rte_mempool *pool);
 
 static int avp_dev_tx_queue_setup(struct rte_eth_dev *dev,
 				  uint16_t tx_queue_id,
 				  uint16_t nb_tx_desc,
-				  unsigned int socket_id,
+				  unsigned int numa_id,
 				  const struct rte_eth_txconf *tx_conf);
 
 static uint16_t avp_recv_scattered_pkts(void *rx_queue,
@@ -1093,7 +1093,7 @@ static int
 avp_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		       uint16_t rx_queue_id,
 		       uint16_t nb_rx_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_rxconf *rx_conf,
 		       struct rte_mempool *pool)
 {
@@ -1131,8 +1131,8 @@ avp_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		    avp->guest_mbuf_size);
 
 	/* allocate a queue object */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct avp_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct avp_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "Failed to allocate new Rx queue object");
 		return -ENOMEM;
@@ -1157,7 +1157,7 @@ static int
 avp_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 		       uint16_t tx_queue_id,
 		       uint16_t nb_tx_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf)
 {
 	struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
@@ -1170,8 +1170,8 @@ avp_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 	}
 
 	/* allocate a queue object */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct avp_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct avp_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "Failed to allocate new Tx queue object");
 		return -ENOMEM;
Signature · 1 line
2.55.0
#109 lore raw

PATCH 107/227 net/axgbe: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/axgbe/axgbe_rxtx.c | 16 ++++++++--------
 drivers/net/axgbe/axgbe_rxtx.h |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/axgbe/axgbe_rxtx.c +8 -8
index 51a1aeb0b9..47c09399c1 100644
@@ -36,7 +36,7 @@ void axgbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx)
 }
 
 int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_rxconf *rx_conf,
 			     struct rte_mempool *mp)
 {
@@ -55,9 +55,9 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	    rx_desc > pdata->rx_desc_count)
 		return -EINVAL;
 	/* First allocate the rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue",
+	rxq = rte_zmalloc_numa("ethdev RX queue",
 				 sizeof(struct axgbe_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq) {
 		PMD_INIT_LOG(ERR, "rte_zmalloc for rxq failed!");
 		return -ENOMEM;
@@ -90,7 +90,7 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	/* Allocate RX ring hardware descriptors */
 	size = rxq->nb_desc * sizeof(union axgbe_rx_desc);
 	dma = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size, 128,
-				       socket_id);
+				       numa_id);
 	if (!dma) {
 		PMD_DRV_LOG_LINE(ERR, "ring_dma_zone_reserve for rx_ring failed");
 		axgbe_rx_queue_release(rxq);
@@ -101,9 +101,9 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	memset((void *)rxq->desc, 0, size);
 	/* Allocate software ring */
 	size = rxq->nb_desc * sizeof(struct rte_mbuf *);
-	rxq->sw_ring = rte_zmalloc_socket("sw_ring", size,
+	rxq->sw_ring = rte_zmalloc_numa("sw_ring", size,
 					  RTE_CACHE_LINE_SIZE,
-					  socket_id);
+					  numa_id);
 	if (!rxq->sw_ring) {
 		PMD_DRV_LOG_LINE(ERR, "rte_zmalloc for sw_ring failed");
 		axgbe_rx_queue_release(rxq);
@@ -544,7 +544,7 @@ void axgbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx)
 }
 
 int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_txconf *tx_conf)
 {
 	PMD_INIT_FUNC_TRACE();
@@ -593,7 +593,7 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	/* Allocate TX ring hardware descriptors */
 	tsize = txq->nb_desc * sizeof(struct axgbe_tx_desc);
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx,
-				      tsize, AXGBE_DESC_ALIGN, socket_id);
+				      tsize, AXGBE_DESC_ALIGN, numa_id);
 	if (!tz) {
 		axgbe_tx_queue_release(txq);
 		return -ENOMEM;
drivers/net/axgbe/axgbe_rxtx.h +2 -2
index f5f74a0a39..ca6b4935d4 100644
@@ -157,7 +157,7 @@ void axgbe_set_rx_function(struct rte_eth_dev *dev);
 
 void axgbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
 int  axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-			      uint16_t nb_tx_desc, unsigned int socket_id,
+			      uint16_t nb_tx_desc, unsigned int numa_id,
 			      const struct rte_eth_txconf *tx_conf);
 void axgbe_dev_enable_tx(struct rte_eth_dev *dev);
 void axgbe_dev_disable_tx(struct rte_eth_dev *dev);
@@ -179,7 +179,7 @@ uint16_t axgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 void axgbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
 int  axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-			      uint16_t nb_rx_desc, unsigned int socket_id,
+			      uint16_t nb_rx_desc, unsigned int numa_id,
 			      const struct rte_eth_rxconf *rx_conf,
 			      struct rte_mempool *mb_pool);
 void axgbe_dev_enable_rx(struct rte_eth_dev *dev);
Signature · 1 line
2.55.0
#110 lore raw

PATCH 108/227 net/bnx2x: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/bnx2x/bnx2x.c      |  2 +-
 drivers/net/bnx2x/bnx2x_rxtx.c | 22 +++++++++++-----------
 drivers/net/bnx2x/bnx2x_rxtx.h |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -1
index 2924fed66b..fdb3290413 100644
@@ -156,7 +156,7 @@ bnx2x_dma_alloc(struct bnx2x_softc *sc, size_t size, struct bnx2x_dma *dma,
 
 	/* Caller must take care that strlen(mz_name) < RTE_MEMZONE_NAMESIZE */
 	z = rte_memzone_reserve_aligned(mz_name, (uint64_t)size,
-					SOCKET_ID_ANY,
+					RTE_NUMA_ID_ANY,
 					RTE_MEMZONE_IOVA_CONTIG, align);
 	if (z == NULL) {
 		PMD_DRV_LOG(ERR, sc, "DMA alloc failed for %s", msg);
drivers/net/bnx2x/bnx2x_rxtx.c +11 -11
index fbc0bb7698..0b8451d4ab 100644
@@ -10,10 +10,10 @@
 
 static const struct rte_memzone *
 ring_dma_zone_reserve(struct rte_eth_dev *dev, const char *ring_name,
-		      uint16_t queue_id, uint32_t ring_size, int socket_id)
+		      uint16_t queue_id, uint32_t ring_size, int numa_id)
 {
 	return rte_eth_dma_zone_reserve(dev, ring_name, queue_id,
-			ring_size, BNX2X_PAGE_SIZE, socket_id);
+			ring_size, BNX2X_PAGE_SIZE, numa_id);
 }
 
 static void
@@ -45,7 +45,7 @@ int
 bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       __rte_unused const struct rte_eth_rxconf *rx_conf,
 		       struct rte_mempool *mp)
 {
@@ -61,8 +61,8 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	rte_iova_t busaddr;
 
 	/* First allocate the rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct bnx2x_rx_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (NULL == rxq) {
 		PMD_DRV_LOG(ERR, sc, "rte_zmalloc for rxq failed!");
 		return -ENOMEM;
@@ -88,7 +88,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate RX ring hardware descriptors */
 	dma_size = rxq->nb_rx_desc * sizeof(struct eth_rx_bd);
-	dma = ring_dma_zone_reserve(dev, "hw_ring", queue_idx, dma_size, socket_id);
+	dma = ring_dma_zone_reserve(dev, "hw_ring", queue_idx, dma_size, numa_id);
 	if (NULL == dma) {
 		PMD_RX_LOG(ERR, "ring_dma_zone_reserve for rx_ring failed!");
 		bnx2x_rx_queue_release(rxq);
@@ -107,9 +107,9 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate software ring */
 	dma_size = rxq->nb_rx_desc * sizeof(struct bnx2x_rx_entry);
-	rxq->sw_ring = rte_zmalloc_socket("sw_ring", dma_size,
+	rxq->sw_ring = rte_zmalloc_numa("sw_ring", dma_size,
 					  RTE_CACHE_LINE_SIZE,
-					  socket_id);
+					  numa_id);
 	if (NULL == rxq->sw_ring) {
 		PMD_RX_LOG(ERR, "rte_zmalloc for sw_ring failed!");
 		bnx2x_rx_queue_release(rxq);
@@ -136,7 +136,7 @@ bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate CQ chain. */
 	dma_size = BNX2X_RX_CHAIN_PAGE_SZ * rxq->nb_cq_pages;
-	dma = ring_dma_zone_reserve(dev, "bnx2x_rcq", queue_idx, dma_size, socket_id);
+	dma = ring_dma_zone_reserve(dev, "bnx2x_rcq", queue_idx, dma_size, numa_id);
 	if (NULL == dma) {
 		PMD_RX_LOG(ERR, "RCQ  alloc failed");
 		return -ENOMEM;
@@ -231,7 +231,7 @@ int
 bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf)
 {
 	uint16_t i;
@@ -270,7 +270,7 @@ bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate TX ring hardware descriptors */
 	tsize = txq->nb_tx_desc * sizeof(union eth_tx_bd_types);
-	tz = ring_dma_zone_reserve(dev, "tx_hw_ring", queue_idx, tsize, socket_id);
+	tz = ring_dma_zone_reserve(dev, "tx_hw_ring", queue_idx, tsize, numa_id);
 	if (tz == NULL) {
 		bnx2x_tx_queue_release(txq);
 		return -ENOMEM;
drivers/net/bnx2x/bnx2x_rxtx.h +2 -2
index 247a72230b..c8dc12156d 100644
@@ -64,12 +64,12 @@ struct bnx2x_tx_queue {
 };
 
 int bnx2x_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-			      uint16_t nb_rx_desc, unsigned int socket_id,
+			      uint16_t nb_rx_desc, unsigned int numa_id,
 			      const struct rte_eth_rxconf *rx_conf,
 			      struct rte_mempool *mb_pool);
 
 int bnx2x_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-			      uint16_t nb_tx_desc, unsigned int socket_id,
+			      uint16_t nb_tx_desc, unsigned int numa_id,
 			      const struct rte_eth_txconf *tx_conf);
 
 void bnx2x_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
Signature · 1 line
2.55.0
#111 lore raw

PATCH 109/227 net/bnxt: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/bnxt/bnxt_ethdev.c              |  6 ++--
 drivers/net/bnxt/bnxt_mpc.c                 | 38 ++++++++++-----------
 drivers/net/bnxt/bnxt_reps.c                | 32 ++++++++---------
 drivers/net/bnxt/bnxt_reps.h                |  4 +--
 drivers/net/bnxt/bnxt_ring.c                | 12 +++----
 drivers/net/bnxt/bnxt_ring.h                |  2 +-
 drivers/net/bnxt/bnxt_rxq.c                 | 10 +++---
 drivers/net/bnxt/bnxt_rxq.h                 |  2 +-
 drivers/net/bnxt/bnxt_rxr.c                 | 22 ++++++------
 drivers/net/bnxt/bnxt_rxr.h                 |  2 +-
 drivers/net/bnxt/bnxt_txq.c                 | 14 ++++----
 drivers/net/bnxt/bnxt_txq.h                 |  2 +-
 drivers/net/bnxt/bnxt_txr.c                 | 18 +++++-----
 drivers/net/bnxt/bnxt_txr.h                 |  2 +-
 drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c |  2 +-
 15 files changed, 84 insertions(+), 84 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +3 -3
index 4ecd2effdf..2bb5cad1d9 100644
@@ -632,7 +632,7 @@ static int bnxt_alloc_ctx_mem_buf(struct bnxt *bp, char *type, size_t size,
 	if (!ctx)
 		return -EINVAL;
 
-	ctx->va = rte_zmalloc_socket(type, size, 0,
+	ctx->va = rte_zmalloc_numa(type, size, 0,
 				     bp->eth_dev->device->numa_node);
 	if (ctx->va == NULL)
 		return -ENOMEM;
@@ -5418,7 +5418,7 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 				       sizeof(struct rx_port_stats_ext) + 512);
 	if (!mz) {
 		mz = rte_memzone_reserve(mz_name, total_alloc_len,
-					 SOCKET_ID_ANY,
+					 RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_2MB |
 					 RTE_MEMZONE_SIZE_HINT_ONLY |
 					 RTE_MEMZONE_IOVA_CONTIG);
@@ -5444,7 +5444,7 @@ static int bnxt_alloc_stats_mem(struct bnxt *bp)
 	if (!mz) {
 		mz = rte_memzone_reserve(mz_name,
 					 total_alloc_len,
-					 SOCKET_ID_ANY,
+					 RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_2MB |
 					 RTE_MEMZONE_SIZE_HINT_ONLY |
 					 RTE_MEMZONE_IOVA_CONTIG);
drivers/net/bnxt/bnxt_mpc.c +19 -19
index 5560d3da00..1644e2c96e 100644
@@ -179,23 +179,23 @@ int bnxt_mpc_close(struct bnxt *bp)
 }
 
 static int bnxt_init_mpc_ring_struct(struct bnxt_mpc_txq *mpc_queue,
-				     unsigned int socket_id)
+				     unsigned int numa_id)
 {
 	struct bnxt_cp_ring_info *cpr;
 	struct bnxt_mpc_ring_info *mpr;
 	struct bnxt_ring *ring;
 	int rc = 0;
 
-	mpr = rte_zmalloc_socket("bnxt_mpc_ring",
+	mpr = rte_zmalloc_numa("bnxt_mpc_ring",
 				 sizeof(struct bnxt_mpc_ring_info),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (mpr == NULL)
 		return -ENOMEM;
 	mpc_queue->mpc_ring = mpr;
 
-	ring = rte_zmalloc_socket("bnxt_mpc_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_mpc_ring_struct",
 				  sizeof(struct bnxt_ring),
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "MPC ring struct alloc failed rc:%d", rc);
 		rc = -ENOMEM;
@@ -211,9 +211,9 @@ static int bnxt_init_mpc_ring_struct(struct bnxt_mpc_txq *mpc_queue,
 	ring->vmem = (void **)&mpr->mpc_buf_ring;
 	ring->fw_ring_id = INVALID_HW_RING_ID;
 
-	cpr = rte_zmalloc_socket("bnxt_mpc_ring",
+	cpr = rte_zmalloc_numa("bnxt_mpc_ring",
 				 sizeof(struct bnxt_cp_ring_info),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (cpr == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "MPC cp ring alloc failed rc:%d", rc);
 		rc = -ENOMEM;
@@ -221,9 +221,9 @@ static int bnxt_init_mpc_ring_struct(struct bnxt_mpc_txq *mpc_queue,
 	}
 	mpc_queue->cp_ring = cpr;
 
-	ring = rte_zmalloc_socket("bnxt_mpc_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_mpc_ring_struct",
 				  sizeof(struct bnxt_ring),
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL) {
 		PMD_DRV_LOG_LINE(ERR, "MPC cp ring struct alloc failed rc:%d", rc);
 		rc = -ENOMEM;
@@ -323,7 +323,7 @@ static int bnxt_alloc_mpc_rings(struct bnxt_mpc_txq *mpc_queue,
 	mz = rte_memzone_lookup(mz_name);
 	if (!mz) {
 		mz = rte_memzone_reserve_aligned(mz_name, total_alloc_len,
-				SOCKET_ID_ANY,
+				RTE_NUMA_ID_ANY,
 				RTE_MEMZONE_2MB |
 				RTE_MEMZONE_SIZE_HINT_ONLY |
 				RTE_MEMZONE_IOVA_CONTIG,
@@ -398,7 +398,7 @@ static uint16_t get_mpc_ring_logical_id(uint8_t mpc_cap,
 }
 
 static int bnxt_mpc_queue_setup_one(struct bnxt *bp, enum bnxt_mpc_chnl chnl_id,
-				    uint16_t nb_desc, unsigned int socket_id)
+				    uint16_t nb_desc, unsigned int numa_id)
 {
 	int rc = 0;
 	struct bnxt_mpc *mpc;
@@ -408,18 +408,18 @@ static int bnxt_mpc_queue_setup_one(struct bnxt *bp, enum bnxt_mpc_chnl chnl_id,
 		return 0;
 
 	mpc = bp->mpc;
-	mpc_queue = rte_zmalloc_socket("bnxt_mpc_queue",
+	mpc_queue = rte_zmalloc_numa("bnxt_mpc_queue",
 				       sizeof(struct bnxt_mpc_txq),
-				       RTE_CACHE_LINE_SIZE, socket_id);
+				       RTE_CACHE_LINE_SIZE, numa_id);
 	if (!mpc_queue) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_mpc_queue allocation failed!");
 		return -ENOMEM;
 	}
 
 	mpc_queue->free =
-		rte_zmalloc_socket(NULL,
+		rte_zmalloc_numa(NULL,
 				   sizeof(struct bnxt_mpc_mbuf *) * nb_desc,
-				   RTE_CACHE_LINE_SIZE, socket_id);
+				   RTE_CACHE_LINE_SIZE, numa_id);
 	if (!mpc_queue->free) {
 		PMD_DRV_LOG_LINE(ERR, "allocation of mpc mbuf free array failed!");
 		rc = -ENOMEM;
@@ -430,7 +430,7 @@ static int bnxt_mpc_queue_setup_one(struct bnxt *bp, enum bnxt_mpc_chnl chnl_id,
 	/* TBD: hardcoded to 1 for now and should be tuned later for perf */
 	mpc_queue->free_thresh = BNXT_MPC_DESC_THRESH;
 
-	rc = bnxt_init_mpc_ring_struct(mpc_queue, socket_id);
+	rc = bnxt_init_mpc_ring_struct(mpc_queue, numa_id);
 	if (rc)
 		goto bnxt_mpc_queue_setup_one_err1;
 
@@ -530,7 +530,7 @@ int bnxt_mpc_open(struct bnxt *bp)
 	int rc = 0;
 	enum bnxt_mpc_chnl i;
 	struct bnxt_mpc *mpc;
-	unsigned int socket_id;
+	unsigned int numa_id;
 
 	rc = is_bnxt_in_error(bp);
 	if (rc)
@@ -545,7 +545,7 @@ int bnxt_mpc_open(struct bnxt *bp)
 		PMD_DRV_LOG_LINE(ERR, "MPC channels enable failed rc:%d", rc);
 		return rc;
 	}
-	socket_id = rte_lcore_to_socket_id(rte_get_main_lcore());
+	numa_id = rte_lcore_to_numa_id(rte_get_main_lcore());
 	mpc = bp->mpc;
 
 	/* Limit to MPC TE_CFA and RE_CFA */
@@ -556,7 +556,7 @@ int bnxt_mpc_open(struct bnxt *bp)
 	for (i = 0; i < BNXT_MPC_CHNL_MAX; i++) {
 		if (!(mpc->mpc_chnls_cap & (1 << i)))
 			continue;
-		rc = bnxt_mpc_queue_setup_one(bp, i, BNXT_MPC_NB_DESC, socket_id);
+		rc = bnxt_mpc_queue_setup_one(bp, i, BNXT_MPC_NB_DESC, numa_id);
 		if (rc) {
 			PMD_DRV_LOG_LINE(ERR, "MPC queue %d setup failed rc:%d",
 				    i, rc);
drivers/net/bnxt/bnxt_reps.c +16 -16
index dd0f14d5c6..d3d1afd7d8 100644
@@ -684,21 +684,21 @@ int bnxt_rep_dev_configure_op(struct rte_eth_dev *eth_dev)
 }
 
 static int bnxt_init_rep_rx_ring(struct bnxt_rx_queue *rxq,
-				 unsigned int socket_id)
+				 unsigned int numa_id)
 {
 	struct bnxt_rx_ring_info *rxr;
 	struct bnxt_ring *ring;
 
-	rxr = rte_zmalloc_socket("bnxt_rep_rx_ring",
+	rxr = rte_zmalloc_numa("bnxt_rep_rx_ring",
 				 sizeof(struct bnxt_rx_ring_info),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxr == NULL)
 		return -ENOMEM;
 	rxq->rx_ring = rxr;
 
-	ring = rte_zmalloc_socket("bnxt_rep_rx_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_rep_rx_ring_struct",
 				  sizeof(struct bnxt_ring),
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL)
 		return -ENOMEM;
 	rxr->rx_ring_struct = ring;
@@ -711,7 +711,7 @@ static int bnxt_init_rep_rx_ring(struct bnxt_rx_queue *rxq,
 int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       __rte_unused const struct rte_eth_rxconf *rx_conf,
 			       __rte_unused struct rte_mempool *mp)
 {
@@ -756,9 +756,9 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			bnxt_rx_queue_release_op(eth_dev, queue_idx);
 	}
 
-	rxq = rte_zmalloc_socket("bnxt_vfr_rx_queue",
+	rxq = rte_zmalloc_numa("bnxt_vfr_rx_queue",
 				 sizeof(struct bnxt_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_vfr_rx_queue allocation failed!");
 		return -ENOMEM;
@@ -768,14 +768,14 @@ int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
 	rxq->nb_rx_desc = nb_desc;
 
-	rc = bnxt_init_rep_rx_ring(rxq, socket_id);
+	rc = bnxt_init_rep_rx_ring(rxq, numa_id);
 	if (rc)
 		goto out;
 
-	buf_ring = rte_zmalloc_socket("bnxt_rx_vfr_buf_ring",
+	buf_ring = rte_zmalloc_numa("bnxt_rx_vfr_buf_ring",
 				      sizeof(struct rte_mbuf *) *
 				      rxq->rx_ring->rx_ring_struct->ring_size,
-				      RTE_CACHE_LINE_SIZE, socket_id);
+				      RTE_CACHE_LINE_SIZE, numa_id);
 	if (!buf_ring) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_rx_vfr_buf_ring allocation failed!");
 		rc = -ENOMEM;
@@ -814,7 +814,7 @@ void bnxt_rep_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
 int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       __rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	struct bnxt_representor *rep_bp = eth_dev->data->dev_private;
@@ -856,16 +856,16 @@ int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			bnxt_rep_tx_queue_release_op(eth_dev, queue_idx);
 	}
 
-	vfr_txq = rte_zmalloc_socket("bnxt_vfr_tx_queue",
+	vfr_txq = rte_zmalloc_numa("bnxt_vfr_tx_queue",
 				     sizeof(struct bnxt_vf_rep_tx_queue),
-				     RTE_CACHE_LINE_SIZE, socket_id);
+				     RTE_CACHE_LINE_SIZE, numa_id);
 	if (!vfr_txq) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_vfr_tx_queue allocation failed!");
 		return -ENOMEM;
 	}
-	txq = rte_zmalloc_socket("bnxt_tx_queue",
+	txq = rte_zmalloc_numa("bnxt_tx_queue",
 				 sizeof(struct bnxt_tx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_tx_queue allocation failed!");
 		rte_free(vfr_txq);
drivers/net/bnxt/bnxt_reps.h +2 -2
index 1615ecf11c..0f02770ae6 100644
@@ -32,14 +32,14 @@ int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev);
 int bnxt_rep_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 				  __rte_unused uint16_t queue_idx,
 				  __rte_unused uint16_t nb_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 *mp);
 int bnxt_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 				  __rte_unused uint16_t queue_idx,
 				  __rte_unused uint16_t nb_desc,
-				  __rte_unused unsigned int socket_id,
+				  __rte_unused unsigned int numa_id,
 				  __rte_unused const struct rte_eth_txconf *
 				  tx_conf);
 void bnxt_rep_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx);
drivers/net/bnxt/bnxt_ring.c +6 -6
index d478c60a1e..a01a8462fc 100644
@@ -95,7 +95,7 @@ int bnxt_alloc_ring_grps(struct bnxt *bp)
  * tx bd ring - Only non-zero length if tx_ring_info is not NULL
  * rx bd ring - Only non-zero length if rx_ring_info is not NULL
  */
-int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx,
+int bnxt_alloc_rings(struct bnxt *bp, unsigned int numa_id, uint16_t qidx,
 			    struct bnxt_tx_queue *txq,
 			    struct bnxt_rx_queue *rxq,
 			    struct bnxt_cp_ring_info *cp_ring_info,
@@ -207,7 +207,7 @@ int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx,
 	mz = rte_memzone_lookup(mz_name);
 	if (!mz) {
 		mz = rte_memzone_reserve_aligned(mz_name, total_alloc_len,
-				socket_id,
+				numa_id,
 				RTE_MEMZONE_2MB |
 				RTE_MEMZONE_SIZE_HINT_ONLY |
 				RTE_MEMZONE_IOVA_CONTIG,
@@ -459,14 +459,14 @@ int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp)
 	if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring)
 		return 0;
 
-	nqr = rte_zmalloc_socket("nqr",
+	nqr = rte_zmalloc_numa("nqr",
 				 sizeof(struct bnxt_cp_ring_info),
 				 RTE_CACHE_LINE_SIZE,
 				 bp->eth_dev->device->numa_node);
 	if (nqr == NULL)
 		return -ENOMEM;
 
-	ring = rte_zmalloc_socket("bnxt_cp_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_cp_ring_struct",
 				  sizeof(struct bnxt_ring),
 				  RTE_CACHE_LINE_SIZE,
 				  bp->eth_dev->device->numa_node);
@@ -879,14 +879,14 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
 	if (BNXT_NUM_ASYNC_CPR(bp) == 0)
 		return 0;
 
-	cpr = rte_zmalloc_socket("cpr",
+	cpr = rte_zmalloc_numa("cpr",
 				 sizeof(struct bnxt_cp_ring_info),
 				 RTE_CACHE_LINE_SIZE,
 				 bp->eth_dev->device->numa_node);
 	if (cpr == NULL)
 		return -ENOMEM;
 
-	ring = rte_zmalloc_socket("bnxt_cp_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_cp_ring_struct",
 				  sizeof(struct bnxt_ring),
 				  RTE_CACHE_LINE_SIZE,
 				  bp->eth_dev->device->numa_node);
drivers/net/bnxt/bnxt_ring.h +1 -1
index d63ae8d8f8..7e339a270d 100644
@@ -67,7 +67,7 @@ struct bnxt_rx_ring_info;
 struct bnxt_cp_ring_info;
 void bnxt_free_ring(struct bnxt_ring *ring);
 int bnxt_alloc_ring_grps(struct bnxt *bp);
-int bnxt_alloc_rings(struct bnxt *bp, unsigned int socket_id, uint16_t qidx,
+int bnxt_alloc_rings(struct bnxt *bp, unsigned int numa_id, uint16_t qidx,
 			    struct bnxt_tx_queue *txq,
 			    struct bnxt_rx_queue *rxq,
 			    struct bnxt_cp_ring_info *cp_ring_info,
drivers/net/bnxt/bnxt_rxq.c +5 -5
index 11115db1fd..09033309b2 100644
@@ -281,7 +281,7 @@ void bnxt_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
 int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       const struct rte_eth_rxconf *rx_conf,
 			       struct rte_mempool *mp)
 {
@@ -324,8 +324,8 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	rxq = eth_dev->data->rx_queues[queue_idx];
 	if (rxq)
 		bnxt_rx_queue_release_op(eth_dev, queue_idx);
-	rxq = rte_zmalloc_socket("bnxt_rx_queue", sizeof(struct bnxt_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("bnxt_rx_queue", sizeof(struct bnxt_rx_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_rx_queue allocation failed!");
 		return -ENOMEM;
@@ -351,7 +351,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
 	eth_dev->data->rx_queues[queue_idx] = rxq;
 
-	rc = bnxt_init_rx_ring_struct(rxq, socket_id);
+	rc = bnxt_init_rx_ring_struct(rxq, numa_id);
 	if (rc) {
 		PMD_DRV_LOG_LINE(ERR,
 			    "init_rx_ring_struct failed!");
@@ -367,7 +367,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 		rxq->crc_len = 0;
 
 	/* Allocate RX ring hardware descriptors */
-	rc = bnxt_alloc_rings(bp, socket_id, queue_idx, NULL, rxq, rxq->cp_ring,
+	rc = bnxt_alloc_rings(bp, numa_id, queue_idx, NULL, rxq, rxq->cp_ring,
 			      NULL, "rxr");
 	if (rc) {
 		PMD_DRV_LOG_LINE(ERR,
drivers/net/bnxt/bnxt_rxq.h +1 -1
index 3385496e70..4ef5c4b4d0 100644
@@ -57,7 +57,7 @@ void bnxt_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx);
 int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       const struct rte_eth_rxconf *rx_conf,
 			       struct rte_mempool *mp);
 void bnxt_free_rx_mbufs(struct bnxt *bp);
drivers/net/bnxt/bnxt_rxr.c +11 -11
index 43b13790f8..2f0c619c67 100644
@@ -1528,7 +1528,7 @@ void bnxt_free_rx_rings(struct bnxt *bp)
 	}
 }
 
-int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
+int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int numa_id)
 {
 	struct bnxt_cp_ring_info *cpr;
 	struct bnxt_rx_ring_info *rxr;
@@ -1540,18 +1540,18 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
 		rxr = rxq->rx_ring;
 	} else {
 
-		rxr = rte_zmalloc_socket("bnxt_rx_ring",
+		rxr = rte_zmalloc_numa("bnxt_rx_ring",
 					 sizeof(struct bnxt_rx_ring_info),
-					 RTE_CACHE_LINE_SIZE, socket_id);
+					 RTE_CACHE_LINE_SIZE, numa_id);
 		if (rxr == NULL)
 			return -ENOMEM;
 		rxq->rx_ring = rxr;
 	}
 
 	if (rxr->rx_ring_struct == NULL) {
-		ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
+		ring = rte_zmalloc_numa("bnxt_rx_ring_struct",
 					   sizeof(struct bnxt_ring),
-					   RTE_CACHE_LINE_SIZE, socket_id);
+					   RTE_CACHE_LINE_SIZE, numa_id);
 		if (ring == NULL)
 			return -ENOMEM;
 		rxr->rx_ring_struct = ring;
@@ -1571,18 +1571,18 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
 	if (rxq->cp_ring != NULL) {
 		cpr = rxq->cp_ring;
 	} else {
-		cpr = rte_zmalloc_socket("bnxt_rx_ring",
+		cpr = rte_zmalloc_numa("bnxt_rx_ring",
 					 sizeof(struct bnxt_cp_ring_info),
-					 RTE_CACHE_LINE_SIZE, socket_id);
+					 RTE_CACHE_LINE_SIZE, numa_id);
 		if (cpr == NULL)
 			return -ENOMEM;
 		rxq->cp_ring = cpr;
 	}
 
 	if (cpr->cp_ring_struct == NULL) {
-		ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
+		ring = rte_zmalloc_numa("bnxt_rx_ring_struct",
 					   sizeof(struct bnxt_ring),
-					   RTE_CACHE_LINE_SIZE, socket_id);
+					   RTE_CACHE_LINE_SIZE, numa_id);
 		if (ring == NULL)
 			return -ENOMEM;
 		cpr->cp_ring_struct = ring;
@@ -1606,9 +1606,9 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)
 
 	rxr = rxq->rx_ring;
 	/* Allocate Aggregator rings */
-	ring = rte_zmalloc_socket("bnxt_rx_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_rx_ring_struct",
 				   sizeof(struct bnxt_ring),
-				   RTE_CACHE_LINE_SIZE, socket_id);
+				   RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL)
 		return -ENOMEM;
 	rxr->ag_ring_struct = ring;
drivers/net/bnxt/bnxt_rxr.h +1 -1
index 4e745bd7b7..a42564c165 100644
@@ -148,7 +148,7 @@ struct bnxt_rx_ring_info {
 uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 			       uint16_t nb_pkts);
 void bnxt_free_rx_rings(struct bnxt *bp);
-int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id);
+int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int numa_id);
 int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
 int bnxt_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
drivers/net/bnxt/bnxt_txq.c +7 -7
index 983be5130b..cbd9223e8e 100644
@@ -123,7 +123,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
 int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       const struct rte_eth_txconf *tx_conf)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
@@ -151,8 +151,8 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 		if (txq)
 			bnxt_tx_queue_release_op(eth_dev, queue_idx);
 	}
-	txq = rte_zmalloc_socket("bnxt_tx_queue", sizeof(struct bnxt_tx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("bnxt_tx_queue", sizeof(struct bnxt_tx_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq) {
 		PMD_DRV_LOG_LINE(ERR, "bnxt_tx_queue allocation failed!");
 		return -ENOMEM;
@@ -161,9 +161,9 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	txq->bp = bp;
 	eth_dev->data->tx_queues[queue_idx] = txq;
 
-	txq->free = rte_zmalloc_socket(NULL,
+	txq->free = rte_zmalloc_numa(NULL,
 				       sizeof(struct rte_mbuf *) * nb_desc,
-				       RTE_CACHE_LINE_SIZE, socket_id);
+				       RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq->free) {
 		PMD_DRV_LOG_LINE(ERR, "allocation of tx mbuf free array failed!");
 		rc = -ENOMEM;
@@ -187,7 +187,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 
 	txq->tx_deferred_start = tx_conf->tx_deferred_start;
 
-	rc = bnxt_init_tx_ring_struct(txq, socket_id);
+	rc = bnxt_init_tx_ring_struct(txq, numa_id);
 	if (rc)
 		goto err;
 
@@ -195,7 +195,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 	txq->port_id = eth_dev->data->port_id;
 
 	/* Allocate TX ring hardware descriptors */
-	if (bnxt_alloc_rings(bp, socket_id, queue_idx, txq, NULL, txq->cp_ring,
+	if (bnxt_alloc_rings(bp, numa_id, queue_idx, txq, NULL, txq->cp_ring,
 			     NULL, "txr")) {
 		PMD_DRV_LOG_LINE(ERR, "ring_dma_zone_reserve for tx_ring failed!");
 		rc = -ENOMEM;
drivers/net/bnxt/bnxt_txq.h +1 -1
index 01f5cf817a..52fe889c8c 100644
@@ -46,7 +46,7 @@ void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx);
 int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 			       uint16_t queue_idx,
 			       uint16_t nb_desc,
-			       unsigned int socket_id,
+			       unsigned int numa_id,
 			       const struct rte_eth_txconf *tx_conf);
 uint64_t bnxt_get_tx_port_offloads(struct bnxt *bp);
 #endif
drivers/net/bnxt/bnxt_txr.c +9 -9
index 4c01e8a275..700b2ca43f 100644
@@ -60,22 +60,22 @@ int bnxt_init_one_tx_ring(struct bnxt_tx_queue *txq)
 	return 0;
 }
 
-int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id)
+int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int numa_id)
 {
 	struct bnxt_cp_ring_info *cpr;
 	struct bnxt_tx_ring_info *txr;
 	struct bnxt_ring *ring;
 
-	txr = rte_zmalloc_socket("bnxt_tx_ring",
+	txr = rte_zmalloc_numa("bnxt_tx_ring",
 				 sizeof(struct bnxt_tx_ring_info),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txr == NULL)
 		return -ENOMEM;
 	txq->tx_ring = txr;
 
-	ring = rte_zmalloc_socket("bnxt_tx_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_tx_ring_struct",
 				  sizeof(struct bnxt_ring),
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL)
 		return -ENOMEM;
 	txr->tx_ring_struct = ring;
@@ -87,16 +87,16 @@ int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id)
 	ring->vmem = (void **)&txr->tx_buf_ring;
 	ring->fw_ring_id = INVALID_HW_RING_ID;
 
-	cpr = rte_zmalloc_socket("bnxt_tx_ring",
+	cpr = rte_zmalloc_numa("bnxt_tx_ring",
 				 sizeof(struct bnxt_cp_ring_info),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (cpr == NULL)
 		return -ENOMEM;
 	txq->cp_ring = cpr;
 
-	ring = rte_zmalloc_socket("bnxt_tx_ring_struct",
+	ring = rte_zmalloc_numa("bnxt_tx_ring_struct",
 				  sizeof(struct bnxt_ring),
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (ring == NULL)
 		return -ENOMEM;
 	cpr->cp_ring_struct = ring;
drivers/net/bnxt/bnxt_txr.h +1 -1
index fd92a242c3..a68d9f3822 100644
@@ -46,7 +46,7 @@ static inline uint32_t bnxt_tx_avail(struct bnxt_tx_queue *txq)
 
 void bnxt_free_tx_rings(struct bnxt *bp);
 int bnxt_init_one_tx_ring(struct bnxt_tx_queue *txq);
-int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int socket_id);
+int bnxt_init_tx_ring_struct(struct bnxt_tx_queue *txq, unsigned int numa_id);
 uint16_t bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 			uint16_t nb_pkts);
 uint16_t _bnxt_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c +1 -1
index a761d9bdeb..22bdc25906 100644
@@ -500,7 +500,7 @@ static int alloc_link_pbl(struct tfc_ts_mem_cfg *mem_cfg, uint32_t page_size,
 		/* Backing store does not already exist so allocate */
 		mem_cfg->ts_mz.mz = rte_memzone_reserve_aligned(mz_name,
 								total_size,
-								SOCKET_ID_ANY,
+								RTE_NUMA_ID_ANY,
 								mz_size |
 								RTE_MEMZONE_SIZE_HINT_ONLY |
 								RTE_MEMZONE_IOVA_CONTIG,
Signature · 1 line
2.55.0
#112 lore raw

PATCH 110/227 net/bonding: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/bonding/eth_bond_private.h    |  2 +-
 drivers/net/bonding/rte_eth_bond.h        |  4 +--
 drivers/net/bonding/rte_eth_bond_8023ad.c | 14 ++++-----
 drivers/net/bonding/rte_eth_bond_alb.c    |  4 +--
 drivers/net/bonding/rte_eth_bond_api.c    |  4 +--
 drivers/net/bonding/rte_eth_bond_args.c   | 14 ++++-----
 drivers/net/bonding/rte_eth_bond_flow.c   |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c    | 36 +++++++++++------------
 8 files changed, 40 insertions(+), 40 deletions(-)
drivers/net/bonding/eth_bond_private.h +1 -1
index 378bbba4e6..684f8c30cb 100644
@@ -23,7 +23,7 @@
 #define PMD_BOND_MODE_KVARG					("mode")
 #define PMD_BOND_AGG_MODE_KVARG				("agg_mode")
 #define PMD_BOND_XMIT_POLICY_KVARG			("xmit_policy")
-#define PMD_BOND_SOCKET_ID_KVARG			("socket_id")
+#define PMD_BOND_SOCKET_ID_KVARG			("numa_id")
 #define PMD_BOND_MAC_ADDR_KVARG				("mac")
 #define PMD_BOND_LSC_POLL_PERIOD_KVARG		("lsc_poll_period_ms")
 #define PMD_BOND_LINK_UP_PROP_DELAY_KVARG	("up_delay")
drivers/net/bonding/rte_eth_bond.h +2 -2
index 4f79ff9b85..37d780dd34 100644
@@ -97,13 +97,13 @@ extern "C" {
  *
  * @param name			Name of new link bonding device.
  * @param mode			Mode to initialize bonding device in.
- * @param socket_id		Socket Id on which to allocate eth_dev resources.
+ * @param numa_id		Socket Id on which to allocate eth_dev resources.
  *
  * @return
  *	Port Id of created rte_eth_dev on success, negative value otherwise
  */
 int
-rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id);
+rte_eth_bond_create(const char *name, uint8_t mode, uint8_t numa_id);
 
 /**
  * Free a bonding rte_eth_dev device
drivers/net/bonding/rte_eth_bond_8023ad.c +7 -7
index c445290079..245d535a7a 100644
@@ -1033,7 +1033,7 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
 	};
 
 	char mem_name[RTE_ETH_NAME_MAX_LEN];
-	int socket_id;
+	int numa_id;
 	unsigned element_size;
 	uint32_t total_tx_desc;
 	struct bond_tx_queue *bd_tx_q;
@@ -1073,9 +1073,9 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
 	RTE_ASSERT(port->rx_ring == NULL);
 	RTE_ASSERT(port->tx_ring == NULL);
 
-	socket_id = rte_eth_dev_socket_id(member_id);
-	if (socket_id == -1)
-		socket_id = rte_socket_id();
+	numa_id = rte_eth_dev_numa_id(member_id);
+	if (numa_id == -1)
+		numa_id = rte_numa_id();
 
 	element_size = sizeof(struct slow_protocol_frame) +
 				RTE_PKTMBUF_HEADROOM;
@@ -1094,7 +1094,7 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
 	port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc,
 		RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
 			32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
-		0, element_size, socket_id);
+		0, element_size, numa_id);
 
 	/* Any memory allocation failure in initialization is critical because
 	 * resources can't be free, so reinitialization is impossible. */
@@ -1105,7 +1105,7 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
 
 	snprintf(mem_name, RTE_DIM(mem_name), "member_%u_rx", member_id);
 	port->rx_ring = rte_ring_create(mem_name,
-			rte_align32pow2(BOND_MODE_8023AX_MEMBER_RX_PKTS), socket_id, 0);
+			rte_align32pow2(BOND_MODE_8023AX_MEMBER_RX_PKTS), numa_id, 0);
 
 	if (port->rx_ring == NULL) {
 		rte_panic("Member %u: Failed to create rx ring '%s': %s\n", member_id,
@@ -1115,7 +1115,7 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
 	/* TX ring is at least one pkt longer to make room for marker packet. */
 	snprintf(mem_name, RTE_DIM(mem_name), "member_%u_tx", member_id);
 	port->tx_ring = rte_ring_create(mem_name,
-			rte_align32pow2(BOND_MODE_8023AX_MEMBER_TX_PKTS + 1), socket_id, 0);
+			rte_align32pow2(BOND_MODE_8023AX_MEMBER_TX_PKTS + 1), numa_id, 0);
 
 	if (port->tx_ring == NULL) {
 		rte_panic("Member %u: Failed to create tx ring '%s': %s\n", member_id,
drivers/net/bonding/rte_eth_bond_alb.c +2 -2
index 253f38da4a..0720541510 100644
@@ -36,7 +36,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)
 
 	uint16_t data_size;
 	char mem_name[RTE_ETH_NAME_MAX_LEN];
-	int socket_id = bond_dev->data->numa_node;
+	int numa_id = bond_dev->data->numa_node;
 
 	/* Fill hash table with initial values */
 	memset(hash_table, 0, sizeof(struct client_data) * ALB_HASH_TABLE_SIZE);
@@ -57,7 +57,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)
 			512 * RTE_MAX_ETHPORTS,
 			RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
 				32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
-			0, data_size, socket_id);
+			0, data_size, numa_id);
 
 		if (internals->mode6.mempool == NULL) {
 			RTE_BOND_LOG(ERR, "%s: Failed to initialize ALB mempool.",
drivers/net/bonding/rte_eth_bond_api.c +2 -2
index a4b54a71dd..6835a516d9 100644
@@ -152,7 +152,7 @@ deactivate_member(struct rte_eth_dev *eth_dev, uint16_t port_id)
 
 RTE_EXPORT_SYMBOL(rte_eth_bond_create)
 int
-rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
+rte_eth_bond_create(const char *name, uint8_t mode, uint8_t numa_id)
 {
 	struct bond_dev_private *internals;
 	struct rte_eth_dev *bond_dev;
@@ -165,7 +165,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)
 	}
 
 	ret = snprintf(devargs, sizeof(devargs),
-		"driver=net_bonding,mode=%d,socket_id=%d", mode, socket_id);
+		"driver=net_bonding,mode=%d,numa_id=%d", mode, numa_id);
 	if (ret < 0 || ret >= (int)sizeof(devargs))
 		return -ENOMEM;
 
drivers/net/bonding/rte_eth_bond_args.c +7 -7
index 823ed80f07..cbf6a7fb91 100644
@@ -201,26 +201,26 @@ int
 bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused,
 		const char *value, void *extra_args)
 {
-	long socket_id;
+	long numa_id;
 	char *endptr;
 
 	if (value == NULL || extra_args == NULL)
 		return -1;
 
 	errno = 0;
-	socket_id = strtol(value, &endptr, 10);
+	numa_id = strtol(value, &endptr, 10);
 	if (*endptr != 0 || errno != 0)
 		return -1;
 
-	/* SOCKET_ID_ANY also consider a valid socket id */
-	if ((int8_t)socket_id == SOCKET_ID_ANY) {
-		*(int *)extra_args = SOCKET_ID_ANY;
+	/* RTE_NUMA_ID_ANY also consider a valid socket id */
+	if ((int8_t)numa_id == RTE_NUMA_ID_ANY) {
+		*(int *)extra_args = RTE_NUMA_ID_ANY;
 		return 0;
 	}
 
 	/* validate socket id value */
-	if (socket_id >= 0 && socket_id < RTE_MAX_NUMA_NODES) {
-		*(int *)extra_args = (int)socket_id;
+	if (numa_id >= 0 && numa_id < RTE_MAX_NUMA_NODES) {
+		*(int *)extra_args = (int)numa_id;
 		return 0;
 	}
 	return -1;
drivers/net/bonding/rte_eth_bond_flow.c +1 -1
index 5d0be5caf5..da77281499 100644
@@ -34,7 +34,7 @@ bond_flow_alloc(int numa_node, const struct rte_flow_attr *attr,
 			     strerror(rte_errno));
 		return NULL;
 	}
-	flow = rte_zmalloc_socket(NULL, offsetof(struct rte_flow, rule) + ret,
+	flow = rte_zmalloc_numa(NULL, offsetof(struct rte_flow, rule) + ret,
 				  RTE_CACHE_LINE_SIZE, numa_node);
 	if (unlikely(flow == NULL)) {
 		RTE_BOND_LOG(ERR, "Could not allocate new flow");
drivers/net/bonding/rte_eth_bond_pmd.c +18 -18
index 526f8118b3..fa538d2493 100644
@@ -1741,7 +1741,7 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev,
 			slow_rx_conf.rx_free_thresh = nb_rx_desc / 4;
 		errval = rte_eth_rx_queue_setup(member_eth_dev->data->port_id,
 				internals->mode4.dedicated_queues.rx_qid, nb_rx_desc,
-				rte_eth_dev_socket_id(member_eth_dev->data->port_id),
+				rte_eth_dev_numa_id(member_eth_dev->data->port_id),
 				&slow_rx_conf, port->slow_pool);
 		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
@@ -1757,7 +1757,7 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev,
 
 		errval = rte_eth_tx_queue_setup(member_eth_dev->data->port_id,
 				internals->mode4.dedicated_queues.tx_qid, nb_tx_desc,
-				rte_eth_dev_socket_id(member_eth_dev->data->port_id),
+				rte_eth_dev_numa_id(member_eth_dev->data->port_id),
 				NULL);
 		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
@@ -1871,7 +1871,7 @@ member_start(struct rte_eth_dev *bonding_eth_dev,
 
 		errval = rte_eth_rx_queue_setup(member_port_id, q_id,
 				bd_rx_q->nb_rx_desc,
-				rte_eth_dev_socket_id(member_port_id),
+				rte_eth_dev_numa_id(member_port_id),
 				&(bd_rx_q->rx_conf), bd_rx_q->mb_pool);
 		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
@@ -1887,7 +1887,7 @@ member_start(struct rte_eth_dev *bonding_eth_dev,
 
 		errval = rte_eth_tx_queue_setup(member_port_id, q_id,
 				bd_tx_q->nb_tx_desc,
-				rte_eth_dev_socket_id(member_port_id),
+				rte_eth_dev_numa_id(member_port_id),
 				&bd_tx_q->tx_conf);
 		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
@@ -2428,11 +2428,11 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 
 static int
 bond_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id __rte_unused,
+		uint16_t nb_rx_desc, unsigned int numa_id __rte_unused,
 		const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool)
 {
 	struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)
-			rte_zmalloc_socket(NULL, sizeof(struct bond_rx_queue),
+			rte_zmalloc_numa(NULL, sizeof(struct bond_rx_queue),
 					0, dev->data->numa_node);
 	if (bd_rx_q == NULL)
 		return -1;
@@ -2452,11 +2452,11 @@ bond_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 
 static int
 bond_ethdev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id __rte_unused,
+		uint16_t nb_tx_desc, unsigned int numa_id __rte_unused,
 		const struct rte_eth_txconf *tx_conf)
 {
 	struct bond_tx_queue *bd_tx_q  = (struct bond_tx_queue *)
-			rte_zmalloc_socket(NULL, sizeof(struct bond_tx_queue),
+			rte_zmalloc_numa(NULL, sizeof(struct bond_tx_queue),
 					0, dev->data->numa_node);
 
 	if (bd_tx_q == NULL)
@@ -3678,7 +3678,7 @@ static int
 bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 {
 	const char *name = rte_vdev_device_name(dev);
-	int socket_id = dev->device.numa_node;
+	int numa_id = dev->device.numa_node;
 	struct bond_dev_private *internals = NULL;
 	struct rte_eth_dev *eth_dev = NULL;
 	uint32_t vlan_filter_bmp_size;
@@ -3699,8 +3699,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 	eth_dev->data->nb_tx_queues = (uint16_t)1;
 
 	/* Allocate memory for storing MAC addresses */
-	eth_dev->data->mac_addrs = rte_zmalloc_socket(name, RTE_ETHER_ADDR_LEN *
-			BOND_MAX_MAC_ADDRS, 0, socket_id);
+	eth_dev->data->mac_addrs = rte_zmalloc_numa(name, RTE_ETHER_ADDR_LEN *
+			BOND_MAX_MAC_ADDRS, 0, numa_id);
 	if (eth_dev->data->mac_addrs == NULL) {
 		RTE_BOND_LOG(ERR,
 			     "Failed to allocate %u bytes needed to store MAC addresses",
@@ -3811,7 +3811,7 @@ bond_probe(struct rte_vdev_device *dev)
 	struct rte_kvargs *kvlist;
 	uint8_t bonding_mode;
 	int arg_count, port_id;
-	int socket_id;
+	int numa_id;
 	uint8_t agg_mode;
 	struct rte_eth_dev *eth_dev;
 
@@ -3869,7 +3869,7 @@ bond_probe(struct rte_vdev_device *dev)
 	arg_count = rte_kvargs_count(kvlist, PMD_BOND_SOCKET_ID_KVARG);
 	if (arg_count == 1) {
 		if (rte_kvargs_process(kvlist, PMD_BOND_SOCKET_ID_KVARG,
-				&bond_ethdev_parse_socket_id_kvarg, &socket_id)
+				&bond_ethdev_parse_socket_id_kvarg, &numa_id)
 				!= 0) {
 			RTE_BOND_LOG(ERR, "Invalid socket Id specified for "
 					"bonding device %s", name);
@@ -3880,16 +3880,16 @@ bond_probe(struct rte_vdev_device *dev)
 				"bonding device %s", name);
 		goto parse_error;
 	} else {
-		socket_id = rte_socket_id();
+		numa_id = rte_numa_id();
 	}
 
-	dev->device.numa_node = socket_id;
+	dev->device.numa_node = numa_id;
 
 	/* Create link bonding eth device */
 	port_id = bond_alloc(dev, bonding_mode);
 	if (port_id < 0) {
 		RTE_BOND_LOG(ERR, "Failed to create socket %s in mode %u on "
-				"socket %d.",	name, bonding_mode, socket_id);
+				"socket %d.",	name, bonding_mode, numa_id);
 		goto parse_error;
 	}
 	internals = rte_eth_devices[port_id].data->dev_private;
@@ -3914,7 +3914,7 @@ bond_probe(struct rte_vdev_device *dev)
 
 	rte_eth_dev_probing_finish(&rte_eth_devices[port_id]);
 	RTE_BOND_LOG(INFO, "Create bonding device %s on port %d in mode %u on "
-			"socket %u.",	name, port_id, bonding_mode, socket_id);
+			"socket %u.",	name, port_id, bonding_mode, numa_id);
 	return 0;
 
 parse_error:
@@ -4318,7 +4318,7 @@ RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
 	"mode=[0-6] "
 	"xmit_policy=[l2 | l23 | l34] "
 	"agg_mode=[count | stable | bandwidth] "
-	"socket_id=<int> "
+	"numa_id=<int> "
 	"mac=<mac addr> "
 	"lsc_poll_period_ms=<int> "
 	"up_delay=<int> "
Signature · 1 line
2.55.0
#113 lore raw

PATCH 111/227 net/cnxk: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/cnxk/cnxk_eswitch.c    | 2 +-
 drivers/net/cnxk/cnxk_ethdev_sec.c | 6 +++---
 drivers/net/cnxk/cnxk_lookup.c     | 2 +-
 drivers/net/cnxk/cnxk_rep.h        | 4 ++--
 drivers/net/cnxk/cnxk_rep_ops.c    | 8 ++++----
 5 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/cnxk/cnxk_eswitch.c +1 -1
index 57e2c490df..741621959e 100644
@@ -722,7 +722,7 @@ cnxk_eswitch_dev_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pc
 			return 0;
 
 		mz = rte_memzone_reserve_aligned(CNXK_REP_ESWITCH_DEV_MZ, sizeof(*eswitch_dev),
-						 SOCKET_ID_ANY, 0, RTE_CACHE_LINE_SIZE);
+						 RTE_NUMA_ID_ANY, 0, RTE_CACHE_LINE_SIZE);
 		if (mz == NULL) {
 			plt_err("Failed to reserve a memzone");
 			goto fail;
drivers/net/cnxk/cnxk_ethdev_sec.c +3 -3
index d208569168..4c41151bdc 100644
@@ -87,7 +87,7 @@ cnxk_nix_inl_meta_pool_cb(uint64_t *aura_handle, uintptr_t *mpool, uint32_t buf_
 	 */
 	mp = rte_mempool_create_empty(mp_name, nb_bufs, buf_sz, 0,
 				      sizeof(struct rte_pktmbuf_pool_private),
-				      SOCKET_ID_ANY, 0);
+				      RTE_NUMA_ID_ANY, 0);
 	if (!mp) {
 		plt_err("Failed to create inline meta pool");
 		return -EIO;
@@ -157,7 +157,7 @@ cnxk_nix_inl_custom_meta_pool_cb(uintptr_t pmpool, uintptr_t *mpool, const char
 	 */
 	hp = rte_mempool_create_empty(mempool_name, nb_bufs, buf_sz, 0,
 				      sizeof(struct rte_pktmbuf_pool_private),
-				      SOCKET_ID_ANY, 0);
+				      RTE_NUMA_ID_ANY, 0);
 	if (!hp) {
 		plt_err("Failed to create inline meta pool");
 		return -EIO;
@@ -865,7 +865,7 @@ cnxk_nix_inl_dev_probe(struct rte_pci_driver *pci_drv,
 		return 0;
 
 	mz = rte_memzone_reserve_aligned(nix_inl_dev_to_name(pci_dev, name),
-					 sizeof(*inl_dev), SOCKET_ID_ANY, 0,
+					 sizeof(*inl_dev), RTE_NUMA_ID_ANY, 0,
 					 RTE_CACHE_LINE_SIZE);
 	if (mz == NULL)
 		return rc;
drivers/net/cnxk/cnxk_lookup.c +1 -1
index 7af9cb111e..9504327e58 100644
@@ -316,7 +316,7 @@ cnxk_nix_fastpath_lookup_mem_get(void)
 		return mz->addr;
 
 	/* Request for the first time */
-	mz = rte_memzone_reserve_aligned(name, LOOKUP_ARRAY_SZ, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_aligned(name, LOOKUP_ARRAY_SZ, RTE_NUMA_ID_ANY,
 					 0, ROC_ALIGN);
 	if (mz != NULL) {
 		mem = mz->addr;
drivers/net/cnxk/cnxk_rep.h +2 -2
index 9ede1e6dad..b891856bb7 100644
@@ -122,10 +122,10 @@ int cnxk_rep_dev_configure(struct rte_eth_dev *eth_dev);
 int cnxk_rep_link_update(struct rte_eth_dev *eth_dev, int wait_to_compl);
 int cnxk_rep_dev_start(struct rte_eth_dev *eth_dev);
 int cnxk_rep_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc,
-			    unsigned int socket_id, const struct rte_eth_rxconf *rx_conf,
+			    unsigned int numa_id, const struct rte_eth_rxconf *rx_conf,
 			    struct rte_mempool *mp);
 int cnxk_rep_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc,
-			    unsigned int socket_id, const struct rte_eth_txconf *tx_conf);
+			    unsigned int numa_id, const struct rte_eth_txconf *tx_conf);
 void cnxk_rep_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
 void cnxk_rep_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
 int cnxk_rep_dev_stop(struct rte_eth_dev *eth_dev);
drivers/net/cnxk/cnxk_rep_ops.c +4 -4
index d4f260af20..792de73bba 100644
@@ -288,7 +288,7 @@ cnxk_rep_dev_stop(struct rte_eth_dev *ethdev)
 
 int
 cnxk_rep_rx_queue_setup(struct rte_eth_dev *ethdev, uint16_t rx_queue_id, uint16_t nb_rx_desc,
-			unsigned int socket_id, const struct rte_eth_rxconf *rx_conf,
+			unsigned int numa_id, const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mb_pool)
 {
 	struct cnxk_rep_dev *rep_dev = cnxk_rep_pmd_priv(ethdev);
@@ -296,7 +296,7 @@ cnxk_rep_rx_queue_setup(struct rte_eth_dev *ethdev, uint16_t rx_queue_id, uint16
 	uint16_t qid = 0;
 	int rc;
 
-	PLT_SET_USED(socket_id);
+	PLT_SET_USED(numa_id);
 	/* If no representee assigned, store the respective rxq parameters */
 	if (!rep_dev->is_vf_active && !rep_dev->rxq) {
 		rxq = plt_zmalloc(sizeof(*rxq), RTE_CACHE_LINE_SIZE);
@@ -384,13 +384,13 @@ cnxk_rep_rx_queue_release(struct rte_eth_dev *ethdev, uint16_t queue_id)
 
 int
 cnxk_rep_tx_queue_setup(struct rte_eth_dev *ethdev, uint16_t tx_queue_id, uint16_t nb_tx_desc,
-			unsigned int socket_id, const struct rte_eth_txconf *tx_conf)
+			unsigned int numa_id, const struct rte_eth_txconf *tx_conf)
 {
 	struct cnxk_rep_dev *rep_dev = cnxk_rep_pmd_priv(ethdev);
 	struct cnxk_rep_txq *txq = NULL;
 	int rc = 0, qid = 0;
 
-	PLT_SET_USED(socket_id);
+	PLT_SET_USED(numa_id);
 	/* If no representee assigned, store the respective rxq parameters */
 	if (!rep_dev->is_vf_active && !rep_dev->txq) {
 		txq = plt_zmalloc(sizeof(*txq), RTE_CACHE_LINE_SIZE);
Signature · 1 line
2.55.0
#114 lore raw

PATCH 112/227 net/cxgbe: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/cxgbe/base/adapter.h |  6 +++---
 drivers/net/cxgbe/cxgbe_ethdev.c | 16 ++++++++--------
 drivers/net/cxgbe/cxgbe_main.c   | 18 +++++++++---------
 drivers/net/cxgbe/cxgbe_pfvf.h   |  4 ++--
 drivers/net/cxgbe/cxgbevf_main.c |  4 ++--
 drivers/net/cxgbe/sge.c          | 28 ++++++++++++++--------------
 6 files changed, 38 insertions(+), 38 deletions(-)
drivers/net/cxgbe/base/adapter.h +3 -3
index 207f3ecb88..bdeeadbddf 100644
@@ -759,15 +759,15 @@ int t4_sge_init(struct adapter *adap);
 int t4vf_sge_init(struct adapter *adap);
 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
 			 struct rte_eth_dev *eth_dev, uint16_t queue_id,
-			 unsigned int iqid, int socket_id);
+			 unsigned int iqid, int numa_id);
 int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
 			  struct rte_eth_dev *eth_dev, uint16_t queue_id,
-			  unsigned int iqid, int socket_id);
+			  unsigned int iqid, int numa_id);
 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *rspq, bool fwevtq,
 		     struct rte_eth_dev *eth_dev, int intr_idx,
 		     struct sge_fl *fl, rspq_handler_t handler,
 		     int cong, struct rte_mempool *mp, int queue_id,
-		     int socket_id);
+		     int numa_id);
 int t4_sge_eth_txq_start(struct sge_eth_txq *txq);
 int t4_sge_eth_txq_stop(struct sge_eth_txq *txq);
 void t4_sge_eth_txq_release(struct adapter *adap, struct sge_eth_txq *txq);
drivers/net/cxgbe/cxgbe_ethdev.c +8 -8
index 93554f354c..0d427663db 100644
@@ -501,7 +501,7 @@ int cxgbe_dev_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
 
 int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 			     uint16_t queue_idx, uint16_t nb_desc,
-			     unsigned int socket_id,
+			     unsigned int numa_id,
 			     const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct port_info *pi = eth_dev->data->dev_private;
@@ -512,9 +512,9 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 	int err = 0;
 
 	txq = &s->ethtxq[pi->first_txqset + queue_idx];
-	dev_debug(adapter, "%s: eth_dev->data->nb_tx_queues = %d; queue_idx = %d; nb_desc = %d; socket_id = %d; pi->first_qset = %u\n",
+	dev_debug(adapter, "%s: eth_dev->data->nb_tx_queues = %d; queue_idx = %d; nb_desc = %d; numa_id = %d; pi->first_qset = %u\n",
 		  __func__, eth_dev->data->nb_tx_queues, queue_idx, nb_desc,
-		  socket_id, pi->first_txqset);
+		  numa_id, pi->first_txqset);
 
 	/*  Free up the existing queue  */
 	if (eth_dev->data->tx_queues[queue_idx]) {
@@ -544,7 +544,7 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 	txq->q.size = temp_nb_desc;
 
 	err = t4_sge_alloc_eth_txq(adapter, txq, eth_dev, queue_idx,
-				   s->fw_evtq.cntxt_id, socket_id);
+				   s->fw_evtq.cntxt_id, numa_id);
 
 	dev_debug(adapter, "%s: txq->q.cntxt_id= %u txq->q.abs_id= %u err = %d\n",
 		  __func__, txq->q.cntxt_id, txq->q.abs_id, err);
@@ -605,7 +605,7 @@ int cxgbe_dev_rx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id)
 
 int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 			     uint16_t queue_idx, uint16_t nb_desc,
-			     unsigned int socket_id,
+			     unsigned int numa_id,
 			     const struct rte_eth_rxconf *rx_conf __rte_unused,
 			     struct rte_mempool *mp)
 {
@@ -620,9 +620,9 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	struct sge_eth_rxq *rxq;
 
 	rxq = &s->ethrxq[pi->first_rxqset + queue_idx];
-	dev_debug(adapter, "%s: eth_dev->data->nb_rx_queues = %d; queue_idx = %d; nb_desc = %d; socket_id = %d; mp = %p\n",
+	dev_debug(adapter, "%s: eth_dev->data->nb_rx_queues = %d; queue_idx = %d; nb_desc = %d; numa_id = %d; mp = %p\n",
 		  __func__, eth_dev->data->nb_rx_queues, queue_idx, nb_desc,
-		  socket_id, mp);
+		  numa_id, mp);
 
 	err = cxgbe_dev_info_get(eth_dev, &dev_info);
 	if (err != 0) {
@@ -672,7 +672,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 			       &rxq->fl, NULL,
 			       is_pf4(adapter) ?
 			       t4_get_tp_ch_map(adapter, pi->tx_chan) : 0, mp,
-			       queue_idx, socket_id);
+			       queue_idx, numa_id);
 
 	dev_debug(adapter, "%s: err = %d; port_id = %d; cntxt_id = %u; abs_id = %u\n",
 		  __func__, err, pi->port_id, rxq->rspq.cntxt_id,
drivers/net/cxgbe/cxgbe_main.c +9 -9
index 2ed21f2d66..9adbc82d69 100644
@@ -208,7 +208,7 @@ int cxgbe_setup_sge_ctrl_txq(struct adapter *adapter)
 		err = t4_sge_alloc_ctrl_txq(adapter, q,
 					    adapter->eth_dev,  i,
 					    s->fw_evtq.cntxt_id,
-					    rte_socket_id());
+					    rte_numa_id());
 		if (err) {
 			dev_err(adapter, "Failed to alloc ctrl txq. Err: %d",
 				err);
@@ -221,7 +221,7 @@ int cxgbe_setup_sge_ctrl_txq(struct adapter *adapter)
 						     RTE_CACHE_LINE_SIZE,
 						     RTE_MBUF_PRIV_ALIGN,
 						     RTE_MBUF_DEFAULT_BUF_SIZE,
-						     SOCKET_ID_ANY);
+						     RTE_NUMA_ID_ANY);
 		if (!q->mb_pool) {
 			err = -rte_errno;
 			dev_err(adapter,
@@ -276,7 +276,7 @@ int cxgbe_setup_sge_fwevtq(struct adapter *adapter)
 
 	err = t4_sge_alloc_rxq(adapter, &s->fw_evtq, true, adapter->eth_dev,
 			       msi_idx, NULL, fwevtq_handler, -1, NULL, 0,
-			       rte_socket_id());
+			       rte_numa_id());
 	return err;
 }
 
@@ -605,15 +605,15 @@ int cxgbe_cfg_queues(struct rte_eth_dev *eth_dev)
 	u16 i;
 
 	if (!(adap->flags & CFG_QUEUES)) {
-		s->ethrxq = rte_calloc_socket(NULL, s->max_ethqsets,
+		s->ethrxq = rte_calloc_numa(NULL, s->max_ethqsets,
 					      sizeof(struct sge_eth_rxq), 0,
-					      rte_socket_id());
+					      rte_numa_id());
 		if (!s->ethrxq)
 			return -ENOMEM;
 
-		s->ethtxq = rte_calloc_socket(NULL, s->max_ethqsets,
+		s->ethtxq = rte_calloc_numa(NULL, s->max_ethqsets,
 					      sizeof(struct sge_eth_txq), 0,
-					      rte_socket_id());
+					      rte_numa_id());
 		if (!s->ethtxq) {
 			rte_free(s->ethrxq);
 			s->ethrxq = NULL;
@@ -2239,7 +2239,7 @@ int cxgbe_probe(struct adapter *adapter)
 	}
 
 	for_each_port(adapter, i) {
-		const unsigned int numa_node = rte_socket_id();
+		const unsigned int numa_node = rte_numa_id();
 		char name[RTE_ETH_NAME_MAX_LEN];
 		struct rte_eth_dev *eth_dev;
 
@@ -2263,7 +2263,7 @@ int cxgbe_probe(struct adapter *adapter)
 			goto out_free;
 
 		eth_dev->data->dev_private =
-			rte_zmalloc_socket(name, sizeof(struct port_info),
+			rte_zmalloc_numa(name, sizeof(struct port_info),
 					   RTE_CACHE_LINE_SIZE, numa_node);
 		if (!eth_dev->data->dev_private)
 			goto out_free;
drivers/net/cxgbe/cxgbe_pfvf.h +2 -2
index 11e95b5836..fd90b96784 100644
@@ -29,10 +29,10 @@ int cxgbe_dev_allmulticast_disable(struct rte_eth_dev *eth_dev);
 int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr);
 int cxgbe_dev_configure(struct rte_eth_dev *eth_dev);
 int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_txconf *tx_conf);
 int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_rxconf *rx_conf,
 			     struct rte_mempool *mp);
 int cxgbe_dev_tx_queue_start(struct rte_eth_dev *eth_dev,
drivers/net/cxgbe/cxgbevf_main.c +2 -2
index d0c93f8ac3..cc77730f6e 100644
@@ -201,7 +201,7 @@ int cxgbevf_probe(struct adapter *adapter)
 
 	pmask = adapter->params.vfres.pmask;
 	for_each_port(adapter, i) {
-		const unsigned int numa_node = rte_socket_id();
+		const unsigned int numa_node = rte_numa_id();
 		char name[RTE_ETH_NAME_MAX_LEN];
 		struct rte_eth_dev *eth_dev;
 		int port_id;
@@ -232,7 +232,7 @@ int cxgbevf_probe(struct adapter *adapter)
 			goto out_free;
 		}
 		eth_dev->data->dev_private =
-			rte_zmalloc_socket(name, sizeof(struct port_info),
+			rte_zmalloc_numa(name, sizeof(struct port_info),
 					   RTE_CACHE_LINE_SIZE, numa_node);
 		if (!eth_dev->data->dev_private)
 			goto out_free;
drivers/net/cxgbe/sge.c +14 -14
index b8dac0c46e..044fd7118f 100644
@@ -1366,7 +1366,7 @@ int t4_mgmt_tx(struct sge_ctrl_txq *q, struct rte_mbuf *mbuf)
  * @dev: the port associated with the queue
  * @z_name: memzone's name
  * @queue_id: queue index
- * @socket_id: preferred socket id for memory allocations
+ * @numa_id: preferred socket id for memory allocations
  * @nelem: the number of descriptors
  * @elem_size: the size of each descriptor
  * @stat_size: extra space in HW ring for status information
@@ -1383,7 +1383,7 @@ int t4_mgmt_tx(struct sge_ctrl_txq *q, struct rte_mbuf *mbuf)
  * of the SW ring.
  */
 static void *alloc_ring(struct rte_eth_dev *dev, const char *z_name,
-			uint16_t queue_id, int socket_id, size_t nelem,
+			uint16_t queue_id, int numa_id, size_t nelem,
 			size_t elem_size, size_t stat_size, size_t sw_size,
 			dma_addr_t *phys, void *metadata)
 {
@@ -1396,9 +1396,9 @@ static void *alloc_ring(struct rte_eth_dev *dev, const char *z_name,
 		 dev->data->port_id, queue_id, z_name);
 
 	dev_debug(adapter, "%s: nelem = %zu; elem_size = %zu; sw_size = %zu; "
-		  "stat_size = %zu; queue_id = %u; socket_id = %d; z_name = %s;"
+		  "stat_size = %zu; queue_id = %u; numa_id = %d; z_name = %s;"
 		  " z_name_sw = %s\n", __func__, nelem, elem_size, sw_size,
-		  stat_size, queue_id, socket_id, z_name, z_name_sw);
+		  stat_size, queue_id, numa_id, z_name, z_name_sw);
 
 	/*
 	 * Allocate TX/RX ring hardware descriptors. A memzone large enough to
@@ -1406,14 +1406,14 @@ static void *alloc_ring(struct rte_eth_dev *dev, const char *z_name,
 	 * resizing in later calls to the queue setup function.
 	 */
 	tz = rte_eth_dma_zone_reserve(dev, z_name, queue_id, len, 4096,
-				      socket_id);
+				      numa_id);
 	if (!tz)
 		return NULL;
 
 	memset(tz->addr, 0, len);
 	if (sw_size) {
-		s = rte_zmalloc_socket(z_name_sw, nelem * sw_size,
-				       RTE_CACHE_LINE_SIZE, socket_id);
+		s = rte_zmalloc_numa(z_name_sw, nelem * sw_size,
+				       RTE_CACHE_LINE_SIZE, numa_id);
 
 		if (!s) {
 			dev_err(adapter, "%s: failed to get sw_ring memory\n",
@@ -1756,7 +1756,7 @@ static int cxgbe_sge_fl_buf_size_index(const struct adapter *adap,
 int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 		     struct rte_eth_dev *eth_dev, int intr_idx,
 		     struct sge_fl *fl, rspq_handler_t hnd, int cong,
-		     struct rte_mempool *mp, int queue_id, int socket_id)
+		     struct rte_mempool *mp, int queue_id, int numa_id)
 {
 	struct port_info *pi = eth_dev->data->dev_private;
 	u8 pciechan, fl_buf_size_idx = 0;
@@ -1777,7 +1777,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 	iq->size = cxgbe_roundup(iq->size, 16);
 
 	iq->desc = alloc_ring(eth_dev, fwevtq ? "fwq_ring" : "rx_ring",
-			      queue_id, socket_id, iq->size, iq->iqe_len,
+			      queue_id, numa_id, iq->size, iq->iqe_len,
 			      0, 0, &iq->phys_addr, NULL);
 	if (!iq->desc)
 		return -ENOMEM;
@@ -1834,7 +1834,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
 			fl->size = s->fl_starve_thres - 1 + 2 * 8;
 		fl->size = cxgbe_roundup(fl->size, 8);
 
-		fl->desc = alloc_ring(eth_dev, "fl_ring", queue_id, socket_id,
+		fl->desc = alloc_ring(eth_dev, "fl_ring", queue_id, numa_id,
 				      fl->size, sizeof(__be64), s->stat_len,
 				      sizeof(struct rx_sw_desc),
 				      &fl->addr, &fl->sdesc);
@@ -2019,7 +2019,7 @@ int t4_sge_eth_txq_stop(struct sge_eth_txq *txq)
 
 int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
 			 struct rte_eth_dev *eth_dev, uint16_t queue_id,
-			 unsigned int iqid, int socket_id)
+			 unsigned int iqid, int numa_id)
 {
 	int ret, nentries;
 	struct fw_eq_eth_cmd c;
@@ -2030,7 +2030,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
 	/* Add status entries */
 	nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc);
 
-	txq->q.desc = alloc_ring(eth_dev, "tx_ring", queue_id, socket_id,
+	txq->q.desc = alloc_ring(eth_dev, "tx_ring", queue_id, numa_id,
 				 txq->q.size, sizeof(struct tx_desc),
 				 s->stat_len, sizeof(struct tx_sw_desc),
 				 &txq->q.phys_addr, &txq->q.sdesc);
@@ -2092,7 +2092,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
 
 int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
 			  struct rte_eth_dev *eth_dev, uint16_t queue_id,
-			  unsigned int iqid, int socket_id)
+			  unsigned int iqid, int numa_id)
 {
 	int ret, nentries;
 	struct fw_eq_ctrl_cmd c;
@@ -2103,7 +2103,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
 	nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc);
 
 	txq->q.desc = alloc_ring(eth_dev, "ctrl_tx_ring", queue_id,
-				 socket_id, txq->q.size, sizeof(struct tx_desc),
+				 numa_id, txq->q.size, sizeof(struct tx_desc),
 				 0, 0, &txq->q.phys_addr, NULL);
 	if (!txq->q.desc)
 		return -ENOMEM;
Signature · 1 line
2.55.0
#115 lore raw

PATCH 113/227 net/dpaa: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/dpaa/dpaa_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/dpaa/dpaa_ethdev.c +3 -3
index fe49c7b961..0e4679fd2b 100644
@@ -1123,7 +1123,7 @@ static inline int dpaa_eth_rx_queue_bp_check(struct rte_eth_dev *dev,
 static
 int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			    uint16_t nb_desc,
-			    unsigned int socket_id __rte_unused,
+			    unsigned int numa_id __rte_unused,
 			    const struct rte_eth_rxconf *rx_conf,
 			    struct rte_mempool *mp)
 {
@@ -1450,7 +1450,7 @@ dpaa_eth_eventq_detach(const struct rte_eth_dev *dev,
 static
 int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			    uint16_t nb_desc __rte_unused,
-		unsigned int socket_id __rte_unused,
+		unsigned int numa_id __rte_unused,
 		const struct rte_eth_txconf *tx_conf)
 {
 	struct dpaa_if *dpaa_intf = dev->data->dev_private;
@@ -2652,7 +2652,7 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv,
 			DPAA_POOL_SIZE,
 			DPAA_POOL_CACHE_SIZE, 0,
 			DPAA_MAX_SGS * sizeof(struct qm_sg_entry),
-			rte_socket_id());
+			rte_numa_id());
 		if (dpaa_tx_sg_pool == NULL) {
 			DPAA_PMD_ERR("SG pool creation failed");
 			diag = -ENOMEM;
Signature · 1 line
2.55.0
#116 lore raw

PATCH 114/227 net/dpaa2: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/dpaa2/dpaa2_ethdev.c | 6 +++---
 drivers/net/dpaa2/dpaa2_tm.c     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +3 -3
index b3a725c0ea..12ddfe90b1 100644
@@ -933,7 +933,7 @@ static int
 dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	uint16_t rx_queue_id,
 	uint16_t nb_rx_desc,
-	unsigned int socket_id __rte_unused,
+	unsigned int numa_id __rte_unused,
 	const struct rte_eth_rxconf *rx_conf,
 	struct rte_mempool *mb_pool)
 {
@@ -1142,7 +1142,7 @@ static int
 dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id,
 	uint16_t nb_tx_desc,
-	unsigned int socket_id __rte_unused,
+	unsigned int numa_id __rte_unused,
 	const struct rte_eth_txconf *tx_conf)
 {
 	struct dpaa2_dev_priv *priv = dev->data->dev_private;
@@ -3874,7 +3874,7 @@ static int dpaa2_tx_sg_pool_init(void)
 			DPAA2_POOL_SIZE,
 			DPAA2_POOL_CACHE_SIZE, 0,
 			DPAA2_MAX_SGS * sizeof(struct qbman_sge),
-			rte_socket_id());
+			rte_numa_id());
 		if (!dpaa2_tx_sg_pool) {
 			DPAA2_PMD_ERR("SG pool creation failed");
 			return -ENOMEM;
drivers/net/dpaa2/dpaa2_tm.c +3 -3
index 3057f4d031..d26b27f915 100644
@@ -322,8 +322,8 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
 					 RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID,
 					 NULL, "Profile id already exists\n");
 
-	profile = rte_zmalloc_socket(NULL, sizeof(*profile), 0,
-				     rte_socket_id());
+	profile = rte_zmalloc_numa(NULL, sizeof(*profile), 0,
+				     rte_numa_id());
 	if (!profile)
 		return -rte_tm_error_set(error, ENOMEM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -486,7 +486,7 @@ dpaa2_node_add(struct rte_eth_dev *dev, uint32_t node_id,
 					 RTE_TM_ERROR_TYPE_NODE_ID,
 					 NULL, "Node id already exists\n");
 
-	node = rte_zmalloc_socket(NULL, sizeof(*node), 0, rte_socket_id());
+	node = rte_zmalloc_numa(NULL, sizeof(*node), 0, rte_numa_id());
 	if (!node)
 		return -rte_tm_error_set(error, ENOMEM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
Signature · 1 line
2.55.0
#117 lore raw

PATCH 115/227 net/ena: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/ena/base/ena_plat_dpdk.h |  6 ++--
 drivers/net/ena/ena_ethdev.c         | 42 ++++++++++++++--------------
 drivers/net/ena/ena_ethdev.h         |  2 +-
 3 files changed, 25 insertions(+), 25 deletions(-)
drivers/net/ena/base/ena_plat_dpdk.h +3 -3
index 4a6d53d0a2..066cd11885 100644
@@ -215,7 +215,7 @@ typedef struct {
 
 const struct rte_memzone *
 ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size,
-		       int socket_id, unsigned int alignment, void **virt_addr,
+		       int numa_id, unsigned int alignment, void **virt_addr,
 		       dma_addr_t *phys_addr);
 
 #define ENA_MEM_ALLOC_COHERENT_ALIGNED(					       \
@@ -224,7 +224,7 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size,
 		void *virt_addr;					       \
 		dma_addr_t phys_addr;					       \
 		(mem_handle) = ena_mem_alloc_coherent((dmadev), (size),	       \
-			SOCKET_ID_ANY, (alignment), &virt_addr, &phys_addr);   \
+			RTE_NUMA_ID_ANY, (alignment), &virt_addr, &phys_addr);   \
 		(virt) = virt_addr;					       \
 		(phys) = phys_addr;					       \
 	} while (0)
@@ -252,7 +252,7 @@ ena_mem_alloc_coherent(struct rte_eth_dev_data *data, size_t size,
 #define ENA_MEM_ALLOC_NODE(dmadev, size, virt, node)				\
 	do {								       \
 		ENA_TOUCH(dmadev);						\
-		virt = rte_zmalloc_socket(NULL, size, 0, node);		       \
+		virt = rte_zmalloc_numa(NULL, size, 0, node);		       \
 	} while (0)
 
 #define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1)
drivers/net/ena/ena_ethdev.c +21 -21

133 lines not on this page · raw message

drivers/net/ena/ena_ethdev.h +1 -1
index b204b07767..fa0b147ff1 100644
@@ -206,7 +206,7 @@ struct __rte_cache_aligned ena_ring {
 		struct ena_stats_tx tx_stats;
 	};
 
-	unsigned int numa_socket_id;
+	unsigned int numa_id;
 
 	uint32_t missing_tx_completion_threshold;
 
Signature · 1 line
2.55.0
#118 lore raw

PATCH 116/227 net/enetc: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/enetc/enetc.h         | 4 ++--
 drivers/net/enetc/enetc4_ethdev.c | 4 ++--
 drivers/net/enetc/enetc_ethdev.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/enetc/enetc.h +2 -2
index 925ba22af6..cec38d3dea 100644
@@ -382,14 +382,14 @@ int enetc4_dev_close(struct rte_eth_dev *dev);
 int enetc4_dev_infos_get(struct rte_eth_dev *dev,
 			 struct rte_eth_dev_info *dev_info);
 int enetc4_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-			  uint16_t nb_rx_desc, unsigned int socket_id __rte_unused,
+			  uint16_t nb_rx_desc, unsigned int numa_id __rte_unused,
 			  const struct rte_eth_rxconf *rx_conf,
 			  struct rte_mempool *mb_pool);
 int enetc4_rx_queue_start(struct rte_eth_dev *dev, uint16_t qidx);
 int enetc4_rx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx);
 void enetc4_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 int enetc4_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			  uint16_t nb_desc, unsigned int socket_id __rte_unused,
+			  uint16_t nb_desc, unsigned int numa_id __rte_unused,
 			  const struct rte_eth_txconf *tx_conf);
 int enetc4_tx_queue_start(struct rte_eth_dev *dev, uint16_t qidx);
 int enetc4_tx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx);
drivers/net/enetc/enetc4_ethdev.c +2 -2
index 199cd45ee5..aeda977ab4 100644
@@ -483,7 +483,7 @@ int
 enetc4_tx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t queue_idx,
 		     uint16_t nb_desc,
-		     unsigned int socket_id __rte_unused,
+		     unsigned int numa_id __rte_unused,
 		     const struct rte_eth_txconf *tx_conf)
 {
 	int err;
@@ -704,7 +704,7 @@ int
 enetc4_rx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t rx_queue_id,
 		     uint16_t nb_rx_desc,
-		     unsigned int socket_id __rte_unused,
+		     unsigned int numa_id __rte_unused,
 		     const struct rte_eth_rxconf *rx_conf,
 		     struct rte_mempool *mb_pool)
 {
drivers/net/enetc/enetc_ethdev.c +2 -2
index 55b0e0b881..1f6528df8e 100644
@@ -302,7 +302,7 @@ static int
 enetc_tx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t queue_idx,
 		     uint16_t nb_desc,
-		     unsigned int socket_id __rte_unused,
+		     unsigned int numa_id __rte_unused,
 		     const struct rte_eth_txconf *tx_conf)
 {
 	int err = 0;
@@ -447,7 +447,7 @@ static int
 enetc_rx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t rx_queue_id,
 		     uint16_t nb_rx_desc,
-		     unsigned int socket_id __rte_unused,
+		     unsigned int numa_id __rte_unused,
 		     const struct rte_eth_rxconf *rx_conf,
 		     struct rte_mempool *mb_pool)
 {
Signature · 1 line
2.55.0
#119 lore raw

PATCH 117/227 net/enetfec: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/enetfec/enet_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/enetfec/enet_ethdev.c +2 -2
index c7ef097875..e84c4f7580 100644
@@ -343,7 +343,7 @@ static int
 enetfec_tx_queue_setup(struct rte_eth_dev *dev,
 			uint16_t queue_idx,
 			uint16_t nb_desc,
-			unsigned int socket_id __rte_unused,
+			unsigned int numa_id __rte_unused,
 			const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct enetfec_private *fep = dev->data->dev_private;
@@ -424,7 +424,7 @@ static int
 enetfec_rx_queue_setup(struct rte_eth_dev *dev,
 			uint16_t queue_idx,
 			uint16_t nb_rx_desc,
-			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)
 {
Signature · 1 line
2.55.0
#120 lore raw

PATCH 118/227 net/enic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/enic/base/vnic_cq.c        |  8 +++----
 drivers/net/enic/base/vnic_cq.h        |  4 ++--
 drivers/net/enic/base/vnic_dev.c       |  4 ++--
 drivers/net/enic/base/vnic_dev.h       |  2 +-
 drivers/net/enic/base/vnic_rq.c        |  6 ++---
 drivers/net/enic/base/vnic_rq.h        |  2 +-
 drivers/net/enic/base/vnic_wq.c        |  8 +++----
 drivers/net/enic/base/vnic_wq.h        |  2 +-
 drivers/net/enic/enic.h                |  4 ++--
 drivers/net/enic/enic_ethdev.c         |  8 +++----
 drivers/net/enic/enic_main.c           | 32 +++++++++++++-------------
 drivers/net/enic/enic_sriov.c          | 10 ++++----
 drivers/net/enic/enic_vf_representor.c |  8 +++----
 13 files changed, 49 insertions(+), 49 deletions(-)
drivers/net/enic/base/vnic_cq.c +4 -4
index e966de2f67..2c538a4b5d 100644
@@ -15,7 +15,7 @@ void vnic_cq_free(struct vnic_cq *cq)
 }
 
 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	unsigned int desc_count, unsigned int desc_size)
 {
 	int err;
@@ -34,7 +34,7 @@ int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
 
 	snprintf(res_name, sizeof(res_name), "%d-cq-%u", instance++, index);
 	err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size,
-		socket_id, res_name);
+		numa_id, res_name);
 	if (err)
 		return err;
 
@@ -42,7 +42,7 @@ int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
 }
 
 int vnic_admin_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
-	unsigned int socket_id, unsigned int desc_count, unsigned int desc_size)
+	unsigned int numa_id, unsigned int desc_count, unsigned int desc_size)
 {
 	int err;
 	char res_name[RTE_MEMZONE_NAMESIZE];
@@ -60,7 +60,7 @@ int vnic_admin_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int
 
 	snprintf(res_name, sizeof(res_name), "%d-admin-cq-%u", instance++, index);
 	err = vnic_dev_alloc_desc_ring(vdev, &cq->ring, desc_count, desc_size,
-		socket_id, res_name);
+		numa_id, res_name);
 	if (err)
 		return err;
 
drivers/net/enic/base/vnic_cq.h +2 -2
index 6469a5c12a..9b3462ba4f 100644
@@ -64,10 +64,10 @@ struct vnic_cq {
 
 void vnic_cq_free(struct vnic_cq *cq);
 int vnic_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	unsigned int desc_count, unsigned int desc_size);
 int vnic_admin_cq_alloc(struct vnic_dev *vdev, struct vnic_cq *cq, unsigned int index,
-	unsigned int socket_id, unsigned int desc_count, unsigned int desc_size);
+	unsigned int numa_id, unsigned int desc_count, unsigned int desc_size);
 void vnic_cq_init(struct vnic_cq *cq, unsigned int flow_control_enable,
 	unsigned int color_enable, unsigned int cq_head, unsigned int cq_tail,
 	unsigned int cq_tail_color, unsigned int interrupt_enable,
drivers/net/enic/base/vnic_dev.c +2 -2
index ba8ecc16f2..73596fd62b 100644
@@ -260,7 +260,7 @@ void vnic_dev_clear_desc_ring(struct vnic_dev_ring *ring)
 int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev,
 	struct vnic_dev_ring *ring,
 	unsigned int desc_count, unsigned int desc_size,
-	__rte_unused unsigned int socket_id,
+	__rte_unused unsigned int numa_id,
 	char *z_name)
 {
 	void *alloc_addr;
@@ -1199,7 +1199,7 @@ struct vnic_dev *vnic_dev_register(struct vnic_dev *vdev,
 		char name[RTE_MEMZONE_NAMESIZE];
 		snprintf((char *)name, sizeof(name), "%s-vnic",
 			  pdev->device.name);
-		vdev = (struct vnic_dev *)rte_zmalloc_socket(name,
+		vdev = (struct vnic_dev *)rte_zmalloc_numa(name,
 					sizeof(struct vnic_dev),
 					RTE_CACHE_LINE_SIZE,
 					pdev->device.numa_node);
drivers/net/enic/base/vnic_dev.h +1 -1
index 0336e07ffc..d8ab91ac15 100644
@@ -96,7 +96,7 @@ unsigned int vnic_dev_desc_ring_size(struct vnic_dev_ring *ring,
 	unsigned int desc_count, unsigned int desc_size);
 void vnic_dev_clear_desc_ring(struct vnic_dev_ring *ring);
 int vnic_dev_alloc_desc_ring(struct vnic_dev *vdev, struct vnic_dev_ring *ring,
-	unsigned int desc_count, unsigned int desc_size, unsigned int socket_id,
+	unsigned int desc_count, unsigned int desc_size, unsigned int numa_id,
 	char *z_name);
 void vnic_dev_free_desc_ring(struct vnic_dev *vdev,
 	struct vnic_dev_ring *ring);
drivers/net/enic/base/vnic_rq.c +3 -3
index 88def104ad..933a00b14e 100644
@@ -39,7 +39,7 @@ int vnic_rq_alloc(struct vnic_dev *vdev, struct vnic_rq *rq, unsigned int index,
 
 	snprintf(res_name, sizeof(res_name), "%d-rq-%u", instance++, index);
 	rc = vnic_dev_alloc_desc_ring(vdev, &rq->ring, desc_count, desc_size,
-		rq->socket_id, res_name);
+		rq->numa_id, res_name);
 	return rc;
 }
 
@@ -53,7 +53,7 @@ int vnic_admin_rq_alloc(struct vnic_dev *vdev, struct vnic_rq *rq,
 	rq->index = 0;
 	rq->vdev = vdev;
 	rq->admin_chan = true;
-	rq->socket_id = SOCKET_ID_ANY;
+	rq->numa_id = RTE_NUMA_ID_ANY;
 
 	rq->ctrl = vnic_dev_get_res(vdev, RES_TYPE_ADMIN_RQ, 0);
 	if (!rq->ctrl) {
@@ -65,7 +65,7 @@ int vnic_admin_rq_alloc(struct vnic_dev *vdev, struct vnic_rq *rq,
 
 	snprintf(res_name, sizeof(res_name), "%d-admin-rq", instance++);
 	rc = vnic_dev_alloc_desc_ring(vdev, &rq->ring, desc_count, desc_size,
-		rq->socket_id, res_name);
+		rq->numa_id, res_name);
 	return rc;
 }
 
drivers/net/enic/base/vnic_rq.h +1 -1
index 0f068d2e18..985dfae9ac 100644
@@ -60,7 +60,7 @@ struct vnic_rq {
 	unsigned int pkts_outstanding;
 	uint16_t rx_nb_hold;
 	uint16_t rx_free_thresh;
-	unsigned int socket_id;
+	unsigned int numa_id;
 	struct rte_mempool *mp;
 	uint16_t rxst_idx;
 	uint32_t tot_pkts;
drivers/net/enic/base/vnic_wq.c +4 -4
index 04eabefae7..cca99151e1 100644
@@ -26,16 +26,16 @@ int vnic_wq_alloc_ring(struct vnic_dev *vdev, struct vnic_wq *wq,
 	snprintf(res_name, sizeof(res_name), "%d-%swq-%u",
 		 instance++, wq->admin_chan ? "admin-" : "", wq->index);
 	return vnic_dev_alloc_desc_ring(vdev, &wq->ring, desc_count, desc_size,
-		wq->socket_id, res_name);
+		wq->numa_id, res_name);
 }
 
 static int vnic_wq_alloc_bufs(struct vnic_wq *wq)
 {
 	unsigned int count = wq->ring.desc_count;
        /* Allocate the mbuf ring */
-	wq->bufs = (struct rte_mbuf **)rte_zmalloc_socket(wq->admin_chan ? "admin-wq-bufs" : "wq-bufs",
+	wq->bufs = (struct rte_mbuf **)rte_zmalloc_numa(wq->admin_chan ? "admin-wq-bufs" : "wq-bufs",
 		    sizeof(struct rte_mbuf *) * count,
-		    RTE_CACHE_LINE_SIZE, wq->socket_id);
+		    RTE_CACHE_LINE_SIZE, wq->numa_id);
 	wq->head_idx = 0;
 	wq->tail_idx = 0;
 	if (wq->bufs == NULL)
@@ -94,7 +94,7 @@ int vnic_admin_wq_alloc(struct vnic_dev *vdev, struct vnic_wq *wq,
 	wq->index = 0;
 	wq->vdev = vdev;
 	wq->admin_chan = true;
-	wq->socket_id = SOCKET_ID_ANY;
+	wq->numa_id = RTE_NUMA_ID_ANY;
 
 	err = vnic_wq_get_ctrl(vdev, wq, 0, RES_TYPE_ADMIN_WQ);
 	if (err) {
drivers/net/enic/base/vnic_wq.h +1 -1
index 381f78431c..8529a8d0f9 100644
@@ -46,7 +46,7 @@ struct vnic_wq {
 	unsigned int head_idx;
 	unsigned int cq_pend;
 	unsigned int tail_idx;
-	unsigned int socket_id;
+	unsigned int numa_id;
 	const struct rte_memzone *cqmsg_rz;
 	uint16_t last_completed_index;
 	uint64_t offloads;
drivers/net/enic/enic.h +2 -2
index 0a8d4a29ca..d2806c8a89 100644
@@ -399,14 +399,14 @@ void enic_free_wq(void *txq);
 int enic_alloc_intr_resources(struct enic *enic);
 int enic_setup_finish(struct enic *enic);
 int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
-		  unsigned int socket_id, uint16_t nb_desc);
+		  unsigned int numa_id, uint16_t nb_desc);
 void enic_start_wq(struct enic *enic, uint16_t queue_idx);
 int enic_stop_wq(struct enic *enic, uint16_t queue_idx);
 void enic_start_rq(struct enic *enic, uint16_t queue_idx);
 int enic_stop_rq(struct enic *enic, uint16_t queue_idx);
 void enic_free_rq(void *rxq);
 int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
-		  unsigned int socket_id, struct rte_mempool *mp,
+		  unsigned int numa_id, struct rte_mempool *mp,
 		  uint16_t nb_desc, uint16_t free_thresh);
 int enic_set_vnic_res(struct enic *enic);
 int enic_init_rss_nic_cfg(struct enic *enic);
drivers/net/enic/enic_ethdev.c +4 -4
index 648aa67a85..ea34a05a06 100644
@@ -166,7 +166,7 @@ static int enicpmd_dev_setup_intr(struct enic *enic)
 static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 	uint16_t queue_idx,
 	uint16_t nb_desc,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	const struct rte_eth_txconf *tx_conf)
 {
 	int ret;
@@ -183,7 +183,7 @@ static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 		eth_dev->data->dev_conf.txmode.offloads;
 	eth_dev->data->tx_queues[queue_idx] = (void *)wq;
 
-	ret = enic_alloc_wq(enic, queue_idx, socket_id, nb_desc);
+	ret = enic_alloc_wq(enic, queue_idx, numa_id, nb_desc);
 	if (ret) {
 		dev_err(enic, "error in allocating wq\n");
 		return ret;
@@ -285,7 +285,7 @@ static int enicpmd_dev_rx_queue_count(void *rx_queue)
 static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	uint16_t queue_idx,
 	uint16_t nb_desc,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	const struct rte_eth_rxconf *rx_conf,
 	struct rte_mempool *mp)
 {
@@ -300,7 +300,7 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	eth_dev->data->rx_queues[queue_idx] =
 		(void *)&enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];
 
-	ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc,
+	ret = enic_alloc_rq(enic, queue_idx, numa_id, mp, nb_desc,
 			    rx_conf->rx_free_thresh);
 	if (ret) {
 		dev_err(enic, "error in allocating rq\n");
drivers/net/enic/enic_main.c +16 -16
index 0c7f085d66..414ee5e3b9 100644
@@ -333,7 +333,7 @@ enic_alloc_consistent(void *priv, size_t size,
 	struct enic_memzone_entry *mze;
 
 	rz = rte_memzone_reserve_aligned((const char *)name, size,
-			SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
+			RTE_NUMA_ID_ANY, RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
 	if (!rz) {
 		pr_err("%s : Failed to allocate memory requested for %s\n",
 			__func__, name);
@@ -787,7 +787,7 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
 }
 
 int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
-	unsigned int socket_id, struct rte_mempool *mp,
+	unsigned int numa_id, struct rte_mempool *mp,
 	uint16_t nb_desc, uint16_t free_thresh)
 {
 	struct enic_vf_representor *vf;
@@ -824,9 +824,9 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
 	rq_sop->data_queue_idx = data_queue_idx;
 	rq_data->is_sop = 0;
 	rq_data->data_queue_idx = 0;
-	rq_sop->socket_id = socket_id;
+	rq_sop->numa_id = numa_id;
 	rq_sop->mp = mp;
-	rq_data->socket_id = socket_id;
+	rq_data->numa_id = numa_id;
 	rq_data->mp = mp;
 	rq_sop->in_use = 1;
 	rq_sop->rx_free_thresh = free_thresh;
@@ -952,7 +952,7 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
 	}
 
 	rc = vnic_cq_alloc(enic->vdev, &enic->cq[cq_idx], cq_idx,
-			   socket_id, nb_sop_desc + nb_data_desc,
+			   numa_id, nb_sop_desc + nb_data_desc,
 			   enic->cq64 ?	sizeof(struct cq_enet_rq_desc_64) :
 			   sizeof(struct cq_enet_rq_desc));
 	if (rc) {
@@ -962,26 +962,26 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,
 
 	/* Allocate the mbuf rings */
 	rq_sop->mbuf_ring = (struct rte_mbuf **)
-		rte_zmalloc_socket("rq->mbuf_ring",
+		rte_zmalloc_numa("rq->mbuf_ring",
 				   sizeof(struct rte_mbuf *) * nb_sop_desc,
-				   RTE_CACHE_LINE_SIZE, rq_sop->socket_id);
+				   RTE_CACHE_LINE_SIZE, rq_sop->numa_id);
 	if (rq_sop->mbuf_ring == NULL)
 		goto err_free_cq;
 
 	if (rq_data->in_use) {
 		rq_data->mbuf_ring = (struct rte_mbuf **)
-			rte_zmalloc_socket("rq->mbuf_ring",
+			rte_zmalloc_numa("rq->mbuf_ring",
 				sizeof(struct rte_mbuf *) * nb_data_desc,
-				RTE_CACHE_LINE_SIZE, rq_sop->socket_id);
+				RTE_CACHE_LINE_SIZE, rq_sop->numa_id);
 		if (rq_data->mbuf_ring == NULL)
 			goto err_free_sop_mbuf;
 	}
 
 	rq_sop->free_mbufs = (struct rte_mbuf **)
-		rte_zmalloc_socket("rq->free_mbufs",
+		rte_zmalloc_numa("rq->free_mbufs",
 				   sizeof(struct rte_mbuf *) *
 				   ENIC_RX_BURST_MAX,
-				   RTE_CACHE_LINE_SIZE, rq_sop->socket_id);
+				   RTE_CACHE_LINE_SIZE, rq_sop->numa_id);
 	if (rq_sop->free_mbufs == NULL)
 		goto err_free_data_mbuf;
 	rq_sop->num_free_mbufs = 0;
@@ -1022,7 +1022,7 @@ void enic_free_wq(void *txq)
 }
 
 int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
-	unsigned int socket_id, uint16_t nb_desc)
+	unsigned int numa_id, uint16_t nb_desc)
 {
 	struct enic_vf_representor *vf;
 	int err;
@@ -1045,7 +1045,7 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
 		cq_index = enic_cq_wq(enic, queue_idx);
 	}
 	wq = &enic->wq[queue_idx];
-	wq->socket_id = socket_id;
+	wq->numa_id = numa_id;
 	/*
 	 * rte_eth_tx_queue_setup() checks min, max, and alignment. So just
 	 * print an info message for diagnostics.
@@ -1062,7 +1062,7 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
 	}
 
 	err = vnic_cq_alloc(enic->vdev, &enic->cq[cq_index], cq_index,
-		socket_id, nb_desc,
+		numa_id, nb_desc,
 		sizeof(struct cq_enet_wq_desc));
 	if (err) {
 		vnic_wq_free(wq);
@@ -1075,7 +1075,7 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,
 		instance++);
 
 	wq->cqmsg_rz = rte_memzone_reserve_aligned((const char *)name,
-			sizeof(uint32_t), SOCKET_ID_ANY,
+			sizeof(uint32_t), RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
 	if (!wq->cqmsg_rz)
 		return -ENOMEM;
@@ -1682,7 +1682,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
 			continue;
 
 		enic_free_rq(rq);
-		rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,
+		rc = enic_alloc_rq(enic, rq_idx, rq->numa_id, rq->mp,
 				   rq->tot_nb_desc, rq->rx_free_thresh);
 		if (rc) {
 			dev_err(enic,
drivers/net/enic/enic_sriov.c +5 -5
index 29faa31512..42b6440357 100644
@@ -79,7 +79,7 @@ static int enic_enable_admin_rq(struct enic *enic)
 		return err;
 	}
 	err = vnic_admin_cq_alloc(enic->vdev, cq, cq_idx,
-		SOCKET_ID_ANY, desc_count, sizeof(struct cq_enet_rq_desc));
+		RTE_NUMA_ID_ANY, desc_count, sizeof(struct cq_enet_rq_desc));
 	if (err) {
 		dev_err(enic, "failed to allocate CQ for admin RQ\n");
 		return err;
@@ -106,7 +106,7 @@ static int enic_enable_admin_rq(struct enic *enic)
 	 */
 	snprintf((char *)name, sizeof(name), "admin-rq-buf-%d", instance++);
 	rq->admin_msg_rz = rte_memzone_reserve_aligned((const char *)name,
-			desc_count * rqbuf_size, SOCKET_ID_ANY,
+			desc_count * rqbuf_size, RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
 	if (!rq->admin_msg_rz)
 		return -ENOMEM;
@@ -151,7 +151,7 @@ static int enic_enable_admin_wq(struct enic *enic)
 		return err;
 	}
 	err = vnic_admin_cq_alloc(enic->vdev, cq, cq_idx,
-		SOCKET_ID_ANY, desc_count, sizeof(struct cq_enet_wq_desc));
+		RTE_NUMA_ID_ANY, desc_count, sizeof(struct cq_enet_wq_desc));
 	if (err) {
 		vnic_wq_free(wq);
 		dev_err(enic, "failed to allocate CQ for admin WQ\n");
@@ -160,7 +160,7 @@ static int enic_enable_admin_wq(struct enic *enic)
 	snprintf((char *)name, sizeof(name),
 		 "vnic_cqmsg-%s-admin-wq-%d", enic->bdf_name, instance++);
 	wq->cqmsg_rz = rte_memzone_reserve_aligned((const char *)name,
-			sizeof(uint32_t), SOCKET_ID_ANY,
+			sizeof(uint32_t), RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
 	if (!wq->cqmsg_rz)
 		return -ENOMEM;
@@ -183,7 +183,7 @@ static int enic_enable_admin_wq(struct enic *enic)
 
 	snprintf((char *)name, sizeof(name), "admin-wq-buf-%d", instance++);
 	wq->admin_msg_rz = rte_memzone_reserve_aligned((const char *)name,
-			desc_count * wqbuf_size, SOCKET_ID_ANY,
+			desc_count * wqbuf_size, RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, ENIC_PAGE_SIZE);
 	if (!wq->admin_msg_rz)
 		return -ENOMEM;
drivers/net/enic/enic_vf_representor.c +4 -4
index fc836100b4..bb6adb3e6c 100644
@@ -41,7 +41,7 @@ static uint16_t enic_vf_xmit_pkts(void *tx_queue,
 static int enic_vf_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 	uint16_t queue_idx,
 	uint16_t nb_desc,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	const struct rte_eth_txconf *tx_conf)
 {
 	struct enic_vf_representor *vf;
@@ -62,7 +62,7 @@ static int enic_vf_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
 		eth_dev->data->dev_conf.txmode.offloads;
 	eth_dev->data->tx_queues[0] = (void *)wq;
 	/* Pass vf not pf because of cq index calculation. See enic_alloc_wq */
-	err = enic_alloc_wq(&vf->enic, queue_idx, socket_id, nb_desc);
+	err = enic_alloc_wq(&vf->enic, queue_idx, numa_id, nb_desc);
 	if (err) {
 		ENICPMD_LOG(ERR, "error in allocating wq");
 		return err;
@@ -83,7 +83,7 @@ static void enic_vf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 static int enic_vf_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	uint16_t queue_idx,
 	uint16_t nb_desc,
-	unsigned int socket_id,
+	unsigned int numa_id,
 	const struct rte_eth_rxconf *rx_conf,
 	struct rte_mempool *mp)
 {
@@ -101,7 +101,7 @@ static int enic_vf_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	pf = vf->pf;
 	eth_dev->data->rx_queues[queue_idx] =
 		(void *)&pf->rq[vf->pf_rq_sop_idx];
-	ret = enic_alloc_rq(&vf->enic, queue_idx, socket_id, mp, nb_desc,
+	ret = enic_alloc_rq(&vf->enic, queue_idx, numa_id, mp, nb_desc,
 			    rx_conf->rx_free_thresh);
 	if (ret) {
 		ENICPMD_LOG(ERR, "error in allocating rq");
Signature · 1 line
2.55.0
#121 lore raw

PATCH 119/227 net/failsafe: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/failsafe/failsafe.c         |  6 +++---
 drivers/net/failsafe/failsafe_ether.c   |  4 ++--
 drivers/net/failsafe/failsafe_ops.c     | 12 ++++++------
 drivers/net/failsafe/failsafe_private.h |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)
drivers/net/failsafe/failsafe.c +3 -3
index 3ba143924d..5f2555ee76 100644
@@ -168,14 +168,14 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 	struct fs_priv *priv;
 	struct sub_device *sdev;
 	const char *params;
-	unsigned int socket_id;
+	unsigned int numa_id;
 	uint8_t i;
 	int ret;
 
 	dev = NULL;
 	priv = NULL;
-	socket_id = rte_socket_id();
-	INFO("Creating fail-safe device on NUMA socket %u", socket_id);
+	numa_id = rte_numa_id();
+	INFO("Creating fail-safe device on NUMA socket %u", numa_id);
 	params = rte_vdev_device_args(vdev);
 	if (params == NULL) {
 		ERROR("This PMD requires sub-devices, none provided");
drivers/net/failsafe/failsafe_ether.c +2 -2
index 307f2abfa5..0215970492 100644
@@ -87,7 +87,7 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev,
 
 		rxq = dev->data->rx_queues[i];
 		ret = rte_eth_rx_queue_setup(PORT_ID(sdev), i,
-				rxq->info.nb_desc, rxq->socket_id,
+				rxq->info.nb_desc, rxq->numa_id,
 				&rxq->info.conf, rxq->info.mp);
 		if (ret) {
 			ERROR("rx_queue_setup failed");
@@ -100,7 +100,7 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev,
 
 		txq = dev->data->tx_queues[i];
 		ret = rte_eth_tx_queue_setup(PORT_ID(sdev), i,
-				txq->info.nb_desc, txq->socket_id,
+				txq->info.nb_desc, txq->numa_id,
 				&txq->info.conf);
 		if (ret) {
 			ERROR("tx_queue_setup failed");
drivers/net/failsafe/failsafe_ops.c +6 -6
index 5680451f21..b993b804e0 100644
@@ -431,7 +431,7 @@ static int
 fs_rx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t rx_queue_id,
 		uint16_t nb_rx_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool)
 {
@@ -467,7 +467,7 @@ fs_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	rxq->qid = rx_queue_id;
-	rxq->socket_id = socket_id;
+	rxq->numa_id = numa_id;
 	rxq->info.mp = mb_pool;
 	rxq->info.conf = *rx_conf;
 	rxq->info.nb_desc = nb_rx_desc;
@@ -487,7 +487,7 @@ fs_rx_queue_setup(struct rte_eth_dev *dev,
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
 		ret = rte_eth_rx_queue_setup(PORT_ID(sdev),
 				rx_queue_id,
-				nb_rx_desc, socket_id,
+				nb_rx_desc, numa_id,
 				rx_conf, mb_pool);
 		if ((ret = fs_err(sdev, ret))) {
 			ERROR("RX queue setup failed for sub_device %d", i);
@@ -608,7 +608,7 @@ static int
 fs_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t tx_queue_id,
 		uint16_t nb_tx_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	struct sub_device *sdev;
@@ -643,7 +643,7 @@ fs_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	txq->qid = tx_queue_id;
-	txq->socket_id = socket_id;
+	txq->numa_id = numa_id;
 	txq->info.conf = *tx_conf;
 	txq->info.nb_desc = nb_tx_desc;
 	txq->priv = PRIV(dev);
@@ -651,7 +651,7 @@ fs_tx_queue_setup(struct rte_eth_dev *dev,
 	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
 		ret = rte_eth_tx_queue_setup(PORT_ID(sdev),
 				tx_queue_id,
-				nb_tx_desc, socket_id,
+				nb_tx_desc, numa_id,
 				tx_conf);
 		if ((ret = fs_err(sdev, ret))) {
 			ERROR("TX queue setup failed for sub_device %d", i);
drivers/net/failsafe/failsafe_private.h +2 -2
index a565ee2fbc..4235764dc9 100644
@@ -71,7 +71,7 @@ struct rxq {
 	uint16_t qid;
 	/* next sub_device to poll */
 	struct sub_device *sdev;
-	unsigned int socket_id;
+	unsigned int numa_id;
 	int event_fd;
 	unsigned int enable_events:1;
 	struct rte_eth_rxq_info info;
@@ -81,7 +81,7 @@ struct rxq {
 struct txq {
 	struct fs_priv *priv;
 	uint16_t qid;
-	unsigned int socket_id;
+	unsigned int numa_id;
 	struct rte_eth_txq_info info;
 	RTE_ATOMIC(uint64_t) refcnt[];
 };
Signature · 1 line
2.55.0
#122 lore raw

PATCH 120/227 net/gve: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/gve/base/gve_osdep.h |  2 +-
 drivers/net/gve/gve_ethdev.c     | 14 +++++++-------
 drivers/net/gve/gve_ethdev.h     |  8 ++++----
 drivers/net/gve/gve_rx.c         | 16 ++++++++--------
 drivers/net/gve/gve_rx_dqo.c     | 24 ++++++++++++------------
 drivers/net/gve/gve_tx.c         | 18 +++++++++---------
 drivers/net/gve/gve_tx_dqo.c     | 16 ++++++++--------
 7 files changed, 49 insertions(+), 49 deletions(-)
drivers/net/gve/base/gve_osdep.h +1 -1
index 55629a0e1a..c9e3272881 100644
@@ -184,7 +184,7 @@ gve_alloc_dma_mem(struct gve_dma_mem *mem, u64 size)
 
 	snprintf(z_name, sizeof(z_name), "gve_dma_%" PRIu64,
 		 rte_atomic_fetch_add_explicit(&gve_dma_memzone_id, 1, rte_memory_order_relaxed));
-	mz = rte_memzone_reserve_aligned(z_name, size, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_aligned(z_name, size, RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_IOVA_CONTIG,
 					 PAGE_SIZE);
 	if (!mz)
drivers/net/gve/gve_ethdev.c +7 -7
index 8ee52fdd47..045692437e 100644
@@ -32,7 +32,7 @@ gve_alloc_using_mz(const char *name, uint32_t num_pages)
 {
 	const struct rte_memzone *mz;
 	mz = rte_memzone_reserve_aligned(name, num_pages * PAGE_SIZE,
-					 rte_socket_id(),
+					 rte_numa_id(),
 					 RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE);
 	if (mz == NULL)
 		PMD_DRV_LOG(ERR, "Failed to alloc memzone %s.", name);
@@ -45,7 +45,7 @@ gve_alloc_using_malloc(void **bufs, uint32_t num_entries)
 	uint32_t i;
 
 	for (i = 0; i < num_entries; i++) {
-		bufs[i] = rte_malloc_socket(NULL, PAGE_SIZE, PAGE_SIZE, rte_socket_id());
+		bufs[i] = rte_malloc_numa(NULL, PAGE_SIZE, PAGE_SIZE, rte_numa_id());
 		if (bufs[i] == NULL) {
 			PMD_DRV_LOG(ERR, "Failed to malloc");
 			goto free_bufs;
@@ -339,7 +339,7 @@ gve_alloc_stats_report(struct gve_priv *priv,
 			priv->pci_dev->device.name);
 	priv->stats_report_mem = rte_memzone_reserve_aligned(z_name,
 			priv->stats_report_len,
-			rte_socket_id(),
+			rte_numa_id(),
 			RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE);
 
 	if (!priv->stats_report_mem)
@@ -629,7 +629,7 @@ gve_alloc_nic_ts_report(struct gve_priv *priv)
 	snprintf(z_name, sizeof(z_name), "gve_%s_nic_ts_report",
 		 priv->pci_dev->device.name);
 	priv->nic_ts_report_mz = rte_memzone_reserve_aligned(z_name,
-			sizeof(struct gve_nic_ts_report), rte_socket_id(),
+			sizeof(struct gve_nic_ts_report), rte_numa_id(),
 			RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE);
 
 	if (!priv->nic_ts_report_mz) {
@@ -886,7 +886,7 @@ gve_verify_driver_compatibility(struct gve_priv *priv)
 
 	driver_info_mem = rte_memzone_reserve_aligned("verify_driver_compatibility",
 			sizeof(struct gve_driver_info),
-			rte_socket_id(),
+			rte_numa_id(),
 			RTE_MEMZONE_IOVA_CONTIG, PAGE_SIZE);
 
 	if (driver_info_mem == NULL) {
@@ -1575,7 +1575,7 @@ gve_setup_device_resources(struct gve_priv *priv)
 	snprintf(z_name, sizeof(z_name), "gve_%s_cnt_arr", priv->pci_dev->device.name);
 	mz = rte_memzone_reserve_aligned(z_name,
 					 priv->num_event_counters * sizeof(*priv->cnt_array),
-					 rte_socket_id(), RTE_MEMZONE_IOVA_CONTIG,
+					 rte_numa_id(), RTE_MEMZONE_IOVA_CONTIG,
 					 PAGE_SIZE);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Could not alloc memzone for count array");
@@ -1587,7 +1587,7 @@ gve_setup_device_resources(struct gve_priv *priv)
 	snprintf(z_name, sizeof(z_name), "gve_%s_irqmz", priv->pci_dev->device.name);
 	mz = rte_memzone_reserve_aligned(z_name,
 					 sizeof(*priv->irq_dbs) * (priv->num_ntfy_blks),
-					 rte_socket_id(), RTE_MEMZONE_IOVA_CONTIG,
+					 rte_numa_id(), RTE_MEMZONE_IOVA_CONTIG,
 					 PAGE_SIZE);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Could not alloc memzone for irq_dbs");
drivers/net/gve/gve_ethdev.h +4 -4
index 3a8ddfbbb6..60375598c3 100644
@@ -560,11 +560,11 @@ gve_clear_flow_subsystem_ok(struct gve_priv *priv)
 
 int
 gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
-		   unsigned int socket_id, const struct rte_eth_rxconf *conf,
+		   unsigned int numa_id, const struct rte_eth_rxconf *conf,
 		   struct rte_mempool *pool);
 int
 gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
-		   unsigned int socket_id, const struct rte_eth_txconf *conf);
+		   unsigned int numa_id, const struct rte_eth_txconf *conf);
 
 void
 gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
@@ -613,12 +613,12 @@ gve_teardown_queue_page_list(struct gve_priv *priv,
 
 int
 gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
-		       uint16_t nb_desc, unsigned int socket_id,
+		       uint16_t nb_desc, unsigned int numa_id,
 		       const struct rte_eth_rxconf *conf,
 		       struct rte_mempool *pool);
 int
 gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
-		       uint16_t nb_desc, unsigned int socket_id,
+		       uint16_t nb_desc, unsigned int numa_id,
 		       const struct rte_eth_txconf *conf);
 
 void
drivers/net/gve/gve_rx.c +8 -8
index 31c187ca83..b21cd175be 100644
@@ -324,7 +324,7 @@ gve_rx_buf_len_gqi(struct rte_mempool *pool)
 
 int
 gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
-		uint16_t nb_desc, unsigned int socket_id,
+		uint16_t nb_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *conf, struct rte_mempool *pool)
 {
 	struct gve_priv *hw = dev->data->dev_private;
@@ -361,10 +361,10 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* Allocate the RX queue data structure. */
-	rxq = rte_zmalloc_socket("gve rxq",
+	rxq = rte_zmalloc_numa("gve rxq",
 				 sizeof(struct gve_rx_queue),
 				 RTE_CACHE_LINE_SIZE,
-				 socket_id);
+				 numa_id);
 	if (!rxq) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for rx queue structure");
 		err = -ENOMEM;
@@ -393,8 +393,8 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	rxq->scatter = !!(offloads & RTE_ETH_RX_OFFLOAD_SCATTER);
 
 	/* Allocate software ring */
-	rxq->sw_ring = rte_zmalloc_socket("gve rx sw ring", sizeof(struct rte_mbuf *) * nb_desc,
-					  RTE_CACHE_LINE_SIZE, socket_id);
+	rxq->sw_ring = rte_zmalloc_numa("gve rx sw ring", sizeof(struct rte_mbuf *) * nb_desc,
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->sw_ring) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for SW RX ring");
 		err = -ENOMEM;
@@ -403,7 +403,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	mz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_id,
 				      nb_desc * sizeof(struct gve_rx_desc),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for RX");
 		err = -ENOMEM;
@@ -415,7 +415,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	mz = rte_eth_dma_zone_reserve(dev, "gve rx data ring", queue_id,
 				      sizeof(union gve_rx_data_slot) * nb_desc,
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for RX data ring");
 		err = -ENOMEM;
@@ -439,7 +439,7 @@ gve_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	mz = rte_eth_dma_zone_reserve(dev, "rxq_res", queue_id,
 				      sizeof(struct gve_queue_resources),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for RX resource");
 		err = -ENOMEM;
drivers/net/gve/gve_rx_dqo.c +12 -12
index 03c62edee6..50e26af229 100644
@@ -320,7 +320,7 @@ gve_reset_rx_ring_state_dqo(struct gve_rx_queue *rxq)
 
 int
 gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
-		       uint16_t nb_desc, unsigned int socket_id,
+		       uint16_t nb_desc, unsigned int numa_id,
 		       const struct rte_eth_rxconf *conf,
 		       struct rte_mempool *pool)
 {
@@ -338,10 +338,10 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* Allocate the RX queue data structure. */
-	rxq = rte_zmalloc_socket("gve rxq",
+	rxq = rte_zmalloc_numa("gve rxq",
 				 sizeof(struct gve_rx_queue),
 				 RTE_CACHE_LINE_SIZE,
-				 socket_id);
+				 numa_id);
 	if (rxq == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for rx queue structure");
 		return -ENOMEM;
@@ -379,9 +379,9 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 			RTE_ALIGN_FLOOR(mbuf_len, GVE_RX_BUF_ALIGN_DQO));
 
 	/* Allocate software ring */
-	rxq->sw_ring = rte_zmalloc_socket("gve rx sw ring",
+	rxq->sw_ring = rte_zmalloc_numa("gve rx sw ring",
 					  nb_desc * sizeof(struct rte_mbuf *),
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq->sw_ring == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for SW RX ring");
 		err = -ENOMEM;
@@ -389,9 +389,9 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* Allocate completed bufs list */
-	rxq->completed_buf_list = rte_zmalloc_socket("gve completed buf list",
+	rxq->completed_buf_list = rte_zmalloc_numa("gve completed buf list",
 		nb_desc * sizeof(*rxq->completed_buf_list), RTE_CACHE_LINE_SIZE,
-		socket_id);
+		numa_id);
 	if (rxq->completed_buf_list == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate completed buffer list.");
 		err = -ENOMEM;
@@ -399,9 +399,9 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* Allocate buffer for reallocating mbufs */
-	rxq->refill_bufs = rte_zmalloc_socket("gve rx refill bufs",
+	rxq->refill_bufs = rte_zmalloc_numa("gve rx refill bufs",
 		nb_desc * sizeof(*rxq->refill_bufs), RTE_CACHE_LINE_SIZE,
-		socket_id);
+		numa_id);
 	if (rxq->refill_bufs == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate rx refill bufs.");
 		err = -ENOMEM;
@@ -411,7 +411,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	/* Allocate RX buffer queue */
 	mz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_id,
 				      nb_desc * sizeof(struct gve_rx_desc_dqo),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for RX buffer queue");
 		err = -ENOMEM;
@@ -424,7 +424,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	/* Allocate RX completion queue */
 	mz = rte_eth_dma_zone_reserve(dev, "compl_ring", queue_id,
 				      nb_desc * sizeof(struct gve_rx_compl_desc_dqo),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for RX completion queue");
 		err = -ENOMEM;
@@ -438,7 +438,7 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	mz = rte_eth_dma_zone_reserve(dev, "rxq_res", queue_id,
 				      sizeof(struct gve_queue_resources),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for RX resource");
 		err = -ENOMEM;
drivers/net/gve/gve_tx.c +9 -9
index 279669165f..6cb31a0b80 100644
@@ -561,7 +561,7 @@ gve_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 
 int
 gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
-		   unsigned int socket_id, const struct rte_eth_txconf *conf)
+		   unsigned int numa_id, const struct rte_eth_txconf *conf)
 {
 	struct gve_priv *hw = dev->data->dev_private;
 	const struct rte_memzone *mz;
@@ -583,8 +583,8 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
 	}
 
 	/* Allocate the TX queue data structure. */
-	txq = rte_zmalloc_socket("gve txq", sizeof(struct gve_tx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("gve txq", sizeof(struct gve_tx_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for tx queue structure");
 		err = -ENOMEM;
@@ -609,9 +609,9 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
 	txq->ntfy_addr = &hw->db_bar[rte_be_to_cpu_32(hw->irq_dbs[txq->ntfy_id].id)];
 
 	/* Allocate software ring */
-	txq->sw_ring = rte_zmalloc_socket("gve tx sw ring",
+	txq->sw_ring = rte_zmalloc_numa("gve tx sw ring",
 					  sizeof(struct rte_mbuf *) * nb_desc,
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq->sw_ring) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for SW TX ring");
 		err = -ENOMEM;
@@ -620,7 +620,7 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
 
 	mz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_id,
 				      nb_desc * sizeof(union gve_tx_desc),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for TX");
 		err = -ENOMEM;
@@ -632,9 +632,9 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
 
 	/* QPL-specific allocations. */
 	if (txq->is_gqi_qpl) {
-		txq->iov_ring = rte_zmalloc_socket("gve tx iov ring",
+		txq->iov_ring = rte_zmalloc_numa("gve tx iov ring",
 						   sizeof(struct gve_tx_iovec) * nb_desc,
-						   RTE_CACHE_LINE_SIZE, socket_id);
+						   RTE_CACHE_LINE_SIZE, numa_id);
 		if (!txq->iov_ring) {
 			PMD_DRV_LOG(ERR, "Failed to allocate memory for SW TX ring");
 			err = -ENOMEM;
@@ -652,7 +652,7 @@ gve_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id, uint16_t nb_desc,
 	}
 
 	mz = rte_eth_dma_zone_reserve(dev, "txq_res", queue_id, sizeof(struct gve_queue_resources),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for TX resource");
 		err = -ENOMEM;
drivers/net/gve/gve_tx_dqo.c +8 -8
index 52fcdb285a..93a595188f 100644
@@ -511,7 +511,7 @@ gve_reset_tx_ring_state_dqo(struct gve_tx_queue *txq)
 
 int
 gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
-		       uint16_t nb_desc, unsigned int socket_id,
+		       uint16_t nb_desc, unsigned int numa_id,
 		       const struct rte_eth_txconf *conf)
 {
 	struct gve_priv *hw = dev->data->dev_private;
@@ -529,9 +529,9 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* Allocate the TX queue data structure. */
-	txq = rte_zmalloc_socket("gve txq",
+	txq = rte_zmalloc_numa("gve txq",
 				 sizeof(struct gve_tx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for tx queue structure");
 		return -ENOMEM;
@@ -557,9 +557,9 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	/* Allocate software ring */
 	sw_size = nb_desc;
-	txq->pkt_ring_dqo = rte_zmalloc_socket("gve tx sw ring",
+	txq->pkt_ring_dqo = rte_zmalloc_numa("gve tx sw ring",
 					  sw_size * sizeof(struct gve_tx_pkt),
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->pkt_ring_dqo == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for SW TX ring");
 		err = -ENOMEM;
@@ -570,7 +570,7 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	/* Allocate TX hardware ring descriptors. */
 	mz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_id,
 				      nb_desc * sizeof(union gve_tx_desc_dqo),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for TX");
 		err = -ENOMEM;
@@ -583,7 +583,7 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 	/* Allocate TX completion ring descriptors. */
 	mz = rte_eth_dma_zone_reserve(dev, "tx_compl_ring", queue_id,
 				       txq->nb_complq_desc * sizeof(struct gve_tx_compl_desc),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for TX completion queue");
 		err = -ENOMEM;
@@ -595,7 +595,7 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,
 
 	mz = rte_eth_dma_zone_reserve(dev, "txq_res", queue_id,
 				      sizeof(struct gve_queue_resources),
-				      PAGE_SIZE, socket_id);
+				      PAGE_SIZE, numa_id);
 	if (mz == NULL) {
 		PMD_DRV_LOG(ERR, "Failed to reserve DMA memory for TX resource");
 		err = -ENOMEM;
Signature · 1 line
2.55.0
#123 lore raw

PATCH 121/227 net/hinic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/hinic/base/hinic_compat.h      |  6 ++---
 drivers/net/hinic/base/hinic_pmd_api_cmd.c |  6 ++---
 drivers/net/hinic/base/hinic_pmd_eqs.c     |  2 +-
 drivers/net/hinic/base/hinic_pmd_hwdev.c   | 18 +++++++--------
 drivers/net/hinic/base/hinic_pmd_mbox.c    |  2 +-
 drivers/net/hinic/base/hinic_pmd_wq.c      | 10 ++++-----
 drivers/net/hinic/base/hinic_pmd_wq.h      |  2 +-
 drivers/net/hinic/hinic_pmd_ethdev.c       | 26 +++++++++++-----------
 drivers/net/hinic/hinic_pmd_rx.c           | 16 ++++++-------
 drivers/net/hinic/hinic_pmd_rx.h           |  4 ++--
 drivers/net/hinic/hinic_pmd_tx.c           |  8 +++----
 drivers/net/hinic/hinic_pmd_tx.h           |  4 ++--
 12 files changed, 52 insertions(+), 52 deletions(-)
drivers/net/hinic/base/hinic_compat.h +3 -3
index c37d970f59..a93def90a7 100644
@@ -113,13 +113,13 @@ extern int hinic_logtype;
 #define HINIC_PAGE_SIZE_DPDK	6
 
 void *dma_zalloc_coherent(void *dev, size_t size, dma_addr_t *dma_handle,
-			  unsigned int socket_id);
+			  unsigned int numa_id);
 
 void *dma_zalloc_coherent_aligned(void *hwdev, size_t size,
-		dma_addr_t *dma_handle, unsigned int socket_id);
+		dma_addr_t *dma_handle, unsigned int numa_id);
 
 void *dma_zalloc_coherent_aligned256k(void *hwdev, size_t size,
-			      dma_addr_t *dma_handle, unsigned int socket_id);
+			      dma_addr_t *dma_handle, unsigned int numa_id);
 
 void dma_free_coherent(void *dev, size_t size, void *virt, dma_addr_t phys);
 
drivers/net/hinic/base/hinic_pmd_api_cmd.c +3 -3
index b72edc0652..ef1798485f 100644
@@ -658,7 +658,7 @@ static int alloc_cmd_buf(struct hinic_api_cmd_chain *chain,
 
 	cmd_vaddr_alloc = dma_zalloc_coherent(dev, (API_CMD_BUF_SIZE +
 					      API_PAYLOAD_ALIGN_SIZE),
-					      &cmd_paddr, SOCKET_ID_ANY);
+					      &cmd_paddr, RTE_NUMA_ID_ANY);
 	if (!cmd_vaddr_alloc) {
 		PMD_DRV_LOG(ERR, "Allocate API CMD dma memory failed");
 		return -ENOMEM;
@@ -712,7 +712,7 @@ static int api_cmd_create_cell(struct hinic_api_cmd_chain *chain,
 
 	node_vaddr_alloc = dma_zalloc_coherent(dev, (chain->cell_size +
 					       API_CMD_NODE_ALIGN_SIZE),
-					       &node_paddr, SOCKET_ID_ANY);
+					       &node_paddr, RTE_NUMA_ID_ANY);
 	if (!node_vaddr_alloc) {
 		PMD_DRV_LOG(ERR, "Allocate dma API CMD cell failed");
 		return -ENOMEM;
@@ -889,7 +889,7 @@ static int api_chain_init(struct hinic_api_cmd_chain *chain,
 
 	chain->wb_status = (struct hinic_api_cmd_status *)
 			   dma_zalloc_coherent(dev, sizeof(*chain->wb_status),
-				&chain->wb_status_paddr, SOCKET_ID_ANY);
+				&chain->wb_status_paddr, RTE_NUMA_ID_ANY);
 	if (!chain->wb_status) {
 		PMD_DRV_LOG(ERR, "Allocate DMA wb status failed");
 		err = -ENOMEM;
drivers/net/hinic/base/hinic_pmd_eqs.c +1 -1
index f0e1139a98..ebd05c7585 100644
@@ -240,7 +240,7 @@ static int alloc_eq_pages(struct hinic_eq *eq)
 		eq->virt_addr[pg_num] =
 			(u8 *)dma_zalloc_coherent_aligned(eq->hwdev,
 					eq->page_size, &eq->dma_addr[pg_num],
-					SOCKET_ID_ANY);
+					RTE_NUMA_ID_ANY);
 		if (!eq->virt_addr[pg_num]) {
 			err = -ENOMEM;
 			goto dma_alloc_err;
drivers/net/hinic/base/hinic_pmd_hwdev.c +9 -9
index 3aca40d17d..ac65b8ce29 100644
@@ -114,7 +114,7 @@ void hinic_be32_to_cpu(void *data, u32 len)
 
 static void *hinic_dma_mem_zalloc(struct hinic_hwdev *hwdev, size_t size,
 			   dma_addr_t *dma_handle, unsigned int align,
-			   unsigned int socket_id)
+			   unsigned int numa_id)
 {
 	int rc;
 	uint32_t alloc_cnt;
@@ -131,7 +131,7 @@ static void *hinic_dma_mem_zalloc(struct hinic_hwdev *hwdev, size_t size,
 	snprintf(z_name, sizeof(z_name), "%s_%u",
 		 hwdev->pcidev_hdl->name, alloc_cnt);
 
-	mz = rte_memzone_reserve_aligned(z_name, size, socket_id,
+	mz = rte_memzone_reserve_aligned(z_name, size, numa_id,
 					 RTE_MEMZONE_IOVA_CONTIG, align);
 	if (!mz) {
 		PMD_DRV_LOG(ERR, "Alloc dma able memory failed, errno: %d, ma_name: %s, size: 0x%zx",
@@ -212,25 +212,25 @@ hinic_dma_mem_free(struct hinic_hwdev *hwdev, size_t size,
 }
 
 void *dma_zalloc_coherent(void *hwdev, size_t size, dma_addr_t *dma_handle,
-			  unsigned int socket_id)
+			  unsigned int numa_id)
 {
 	return hinic_dma_mem_zalloc(hwdev, size, dma_handle,
-				    RTE_CACHE_LINE_SIZE, socket_id);
+				    RTE_CACHE_LINE_SIZE, numa_id);
 }
 
 void *dma_zalloc_coherent_aligned(void *hwdev, size_t size,
-				dma_addr_t *dma_handle, unsigned int socket_id)
+				dma_addr_t *dma_handle, unsigned int numa_id)
 {
 	return hinic_dma_mem_zalloc(hwdev, size, dma_handle, HINIC_PAGE_SIZE,
-				    socket_id);
+				    numa_id);
 }
 
 void *dma_zalloc_coherent_aligned256k(void *hwdev, size_t size,
 				      dma_addr_t *dma_handle,
-				      unsigned int socket_id)
+				      unsigned int numa_id)
 {
 	return hinic_dma_mem_zalloc(hwdev, size, dma_handle,
-				    HINIC_PAGE_SIZE * 64, socket_id);
+				    HINIC_PAGE_SIZE * 64, numa_id);
 }
 
 void dma_free_coherent(void *hwdev, size_t size, void *virt, dma_addr_t phys)
@@ -314,7 +314,7 @@ void *dma_pool_alloc(struct pci_pool *pool, dma_addr_t *dma_addr)
 	void *buf;
 
 	buf = hinic_dma_mem_zalloc(pool->hwdev, pool->elem_size, dma_addr,
-				(u32)pool->align, SOCKET_ID_ANY);
+				(u32)pool->align, RTE_NUMA_ID_ANY);
 	if (buf)
 		rte_atomic_fetch_add_explicit(&pool->inuse, 1, rte_memory_order_relaxed);
 
drivers/net/hinic/base/hinic_pmd_mbox.c +1 -1
index 7418c9b602..270bed05c3 100644
@@ -443,7 +443,7 @@ static int alloc_mbox_wb_status(struct hinic_mbox_func_to_func *func_to_func)
 	u32 addr_h, addr_l;
 
 	send_mbox->wb_vaddr = dma_zalloc_coherent(hwdev, MBOX_WB_STATUS_LEN,
-					&send_mbox->wb_paddr, SOCKET_ID_ANY);
+					&send_mbox->wb_paddr, RTE_NUMA_ID_ANY);
 	if (!send_mbox->wb_vaddr) {
 		PMD_DRV_LOG(ERR, "Allocating memory for mailbox wb status failed");
 		return -ENOMEM;
drivers/net/hinic/base/hinic_pmd_wq.c +5 -5
index 345248c3ea..1197ec0082 100644
@@ -16,13 +16,13 @@ static void free_wq_pages(struct hinic_hwdev *hwdev, struct hinic_wq *wq)
 }
 
 static int alloc_wq_pages(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
-			unsigned int socket_id)
+			unsigned int numa_id)
 {
 	dma_addr_t dma_addr = 0;
 
 	wq->queue_buf_vaddr = (u64)(u64 *)
 		dma_zalloc_coherent_aligned256k(hwdev, wq->wq_buf_size,
-						&dma_addr, socket_id);
+						&dma_addr, numa_id);
 	if (!wq->queue_buf_vaddr) {
 		PMD_DRV_LOG(ERR, "Failed to allocate wq page");
 		return -ENOMEM;
@@ -41,7 +41,7 @@ static int alloc_wq_pages(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
 }
 
 int hinic_wq_allocate(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
-		      u32 wqebb_shift, u16 q_depth, unsigned int socket_id)
+		      u32 wqebb_shift, u16 q_depth, unsigned int numa_id)
 {
 	int err;
 
@@ -61,7 +61,7 @@ int hinic_wq_allocate(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
 		return -EINVAL;
 	}
 
-	err = alloc_wq_pages(hwdev, wq, socket_id);
+	err = alloc_wq_pages(hwdev, wq, numa_id);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to allocate wq pages");
 		return err;
@@ -115,7 +115,7 @@ int hinic_cmdq_alloc(struct hinic_wq *wq, struct hinic_hwdev *hwdev,
 		wq[i].wq_buf_size = wq_buf_size;
 		wq[i].q_depth = q_depth;
 
-		err = alloc_wq_pages(hwdev, &wq[i], SOCKET_ID_ANY);
+		err = alloc_wq_pages(hwdev, &wq[i], RTE_NUMA_ID_ANY);
 		if (err) {
 			PMD_DRV_LOG(ERR, "Failed to alloc CMDQ blocks");
 			goto cmdq_block_err;
drivers/net/hinic/base/hinic_pmd_wq.h +1 -1
index 354d0338de..80bcfc43ec 100644
@@ -122,7 +122,7 @@ void hinic_cmdq_free(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
 		     int cmdq_blocks);
 
 int hinic_wq_allocate(struct hinic_hwdev *hwdev, struct hinic_wq *wq,
-		      u32 wqebb_shift, u16 q_depth, unsigned int socket_id);
+		      u32 wqebb_shift, u16 q_depth, unsigned int numa_id);
 
 void hinic_wq_free(struct hinic_hwdev *hwdev, struct hinic_wq *wq);
 
drivers/net/hinic/hinic_pmd_ethdev.c +13 -13
index 016d632e64..e552c471d0 100644
@@ -361,7 +361,7 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
  *   RX queue index.
  * @param nb_desc
  *   Number of descriptors for receive queue.
- * @param socket_id
+ * @param numa_id
  *   NUMA socket on which memory must be allocated.
  * @param rx_conf
  *   Thresholds parameters (unused_).
@@ -372,7 +372,7 @@ static int hinic_dev_configure(struct rte_eth_dev *dev)
  *   0 on success, negative error value otherwise.
  */
 static int hinic_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			 uint16_t nb_desc, unsigned int socket_id,
+			 uint16_t nb_desc, unsigned int numa_id,
 			 __rte_unused const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -423,8 +423,8 @@ static int hinic_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		return -EINVAL;
 	}
 
-	rxq = rte_zmalloc_socket("hinic_rx_queue", sizeof(struct hinic_rxq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("hinic_rx_queue", sizeof(struct hinic_rxq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq) {
 		PMD_DRV_LOG(ERR, "Allocate rxq[%d] failed, dev_name: %s",
 			    queue_idx, dev->data->name);
@@ -433,7 +433,7 @@ static int hinic_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	nic_dev->rxqs[queue_idx] = rxq;
 
 	/* alloc rx sq hw wqe page */
-	rc = hinic_create_rq(hwdev, queue_idx, rq_depth, socket_id);
+	rc = hinic_create_rq(hwdev, queue_idx, rq_depth, numa_id);
 	if (rc) {
 		PMD_DRV_LOG(ERR, "Create rxq[%d] failed, dev_name: %s, rq_depth: %d",
 			    queue_idx, dev->data->name, rq_depth);
@@ -460,7 +460,7 @@ static int hinic_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->q_depth = rq_depth;
 	rxq->buf_len = (u16)buf_size;
 	rxq->rx_free_thresh = rx_free_thresh;
-	rxq->socket_id = socket_id;
+	rxq->numa_id = numa_id;
 
 	/* the last point cant do mbuf rearm in bulk */
 	rxq->rxinfo_align_end = rxq->q_depth - rxq->rx_free_thresh;
@@ -521,7 +521,7 @@ static void hinic_reset_rx_queue(struct rte_eth_dev *dev)
  *   Transmit queue index.
  * @param nb_desc
  *   Number of descriptors for transmit queue.
- * @param socket_id
+ * @param numa_id
  *   NUMA socket on which memory must be allocated.
  * @param tx_conf
  *   Tx queue configuration parameters.
@@ -530,7 +530,7 @@ static void hinic_reset_rx_queue(struct rte_eth_dev *dev)
  *   0 on success, negative error value otherwise.
  */
 static int hinic_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			 uint16_t nb_desc, unsigned int socket_id,
+			 uint16_t nb_desc, unsigned int numa_id,
 			 __rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	int rc;
@@ -578,8 +578,8 @@ static int hinic_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		return -EINVAL;
 	}
 
-	txq = rte_zmalloc_socket("hinic_tx_queue", sizeof(struct hinic_txq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("hinic_tx_queue", sizeof(struct hinic_txq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq) {
 		PMD_DRV_LOG(ERR, "Allocate txq[%d] failed, dev_name: %s",
 			    queue_idx, dev->data->name);
@@ -588,7 +588,7 @@ static int hinic_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	nic_dev->txqs[queue_idx] = txq;
 
 	/* alloc tx sq hw wqepage */
-	rc = hinic_create_sq(hwdev, queue_idx, sq_depth, socket_id);
+	rc = hinic_create_sq(hwdev, queue_idx, sq_depth, numa_id);
 	if (rc) {
 		PMD_DRV_LOG(ERR, "Create txq[%d] failed, dev_name: %s, sq_depth: %d",
 			    queue_idx, dev->data->name, sq_depth);
@@ -607,7 +607,7 @@ static int hinic_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	txq->sq_bot_sge_addr = HINIC_GET_WQ_TAIL(txq) -
 					sizeof(struct hinic_sq_bufdesc);
 	txq->cos = nic_dev->default_cos;
-	txq->socket_id = socket_id;
+	txq->numa_id = numa_id;
 
 	/* alloc software txinfo */
 	rc = hinic_setup_tx_resources(txq);
@@ -2678,7 +2678,7 @@ static int hinic_copy_mempool_init(struct hinic_nic_dev *nic_dev)
 					HINIC_COPY_MEMPOOL_DEPTH,
 					0, 0,
 					HINIC_COPY_MBUF_SIZE,
-					rte_socket_id());
+					rte_numa_id());
 		if (!nic_dev->cpy_mpool) {
 			PMD_DRV_LOG(ERR, "Create copy mempool failed, errno: %d, dev_name: %s",
 				    rte_errno, nic_dev->proc_dev_name);
drivers/net/hinic/hinic_pmd_rx.c +8 -8
index c2cd295033..5df252e789 100644
@@ -210,7 +210,7 @@ void hinic_get_func_rx_buf_size(struct hinic_nic_dev *nic_dev)
 }
 
 int hinic_create_rq(struct hinic_hwdev *hwdev, u16 q_id,
-			u16 rq_depth, unsigned int socket_id)
+			u16 rq_depth, unsigned int numa_id)
 {
 	int err;
 	struct hinic_nic_io *nic_io = hwdev->nic_io;
@@ -224,7 +224,7 @@ int hinic_create_rq(struct hinic_hwdev *hwdev, u16 q_id,
 	nic_io->rq_depth = rq_depth;
 
 	err = hinic_wq_allocate(hwdev, &nic_io->rq_wq[q_id],
-			HINIC_RQ_WQEBB_SHIFT, nic_io->rq_depth, socket_id);
+			HINIC_RQ_WQEBB_SHIFT, nic_io->rq_depth, numa_id);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to allocate WQ for RQ");
 		return err;
@@ -232,7 +232,7 @@ int hinic_create_rq(struct hinic_hwdev *hwdev, u16 q_id,
 	rq->wq = &nic_io->rq_wq[q_id];
 
 	rq->pi_virt_addr = (volatile u16 *)dma_zalloc_coherent(hwdev,
-			HINIC_PAGE_SIZE, &rq->pi_dma_addr, socket_id);
+			HINIC_PAGE_SIZE, &rq->pi_dma_addr, numa_id);
 	if (!rq->pi_virt_addr) {
 		PMD_DRV_LOG(ERR, "Failed to allocate rq pi virt addr");
 		err = -ENOMEM;
@@ -304,13 +304,13 @@ void hinic_rxq_stats_reset(struct hinic_rxq *rxq)
 	memset(rxq_stats, 0, sizeof(*rxq_stats));
 }
 
-static int hinic_rx_alloc_cqe(struct hinic_rxq *rxq, unsigned int socket_id)
+static int hinic_rx_alloc_cqe(struct hinic_rxq *rxq, unsigned int numa_id)
 {
 	size_t cqe_mem_size;
 
 	cqe_mem_size = sizeof(struct hinic_rq_cqe) * rxq->q_depth;
 	rxq->cqe_start_vaddr = dma_zalloc_coherent(rxq->nic_dev->hwdev,
-				cqe_mem_size, &rxq->cqe_start_paddr, socket_id);
+				cqe_mem_size, &rxq->cqe_start_paddr, numa_id);
 	if (!rxq->cqe_start_vaddr) {
 		PMD_DRV_LOG(ERR, "Allocate cqe dma memory failed");
 		return -ENOMEM;
@@ -366,12 +366,12 @@ int hinic_setup_rx_resources(struct hinic_rxq *rxq)
 	int err, pkts;
 
 	rx_info_sz = rxq->q_depth * sizeof(*rxq->rx_info);
-	rxq->rx_info = rte_zmalloc_socket("rx_info", rx_info_sz,
-				RTE_CACHE_LINE_SIZE, rxq->socket_id);
+	rxq->rx_info = rte_zmalloc_numa("rx_info", rx_info_sz,
+				RTE_CACHE_LINE_SIZE, rxq->numa_id);
 	if (!rxq->rx_info)
 		return -ENOMEM;
 
-	err = hinic_rx_alloc_cqe(rxq, rxq->socket_id);
+	err = hinic_rx_alloc_cqe(rxq, rxq->numa_id);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Allocate rx cqe failed");
 		goto rx_cqe_err;
drivers/net/hinic/hinic_pmd_rx.h +2 -2
index 43c236b46c..88a0c09950 100644
@@ -86,7 +86,7 @@ struct hinic_rxq {
 	u16 rx_free_thresh;
 	u16 rxinfo_align_end;
 
-	u32 socket_id;
+	u32 numa_id;
 
 	unsigned long status;
 	struct hinic_rxq_stats rxq_stats;
@@ -128,7 +128,7 @@ void hinic_rx_remove_configure(struct rte_eth_dev *dev);
 void hinic_get_func_rx_buf_size(struct hinic_nic_dev *nic_dev);
 
 int hinic_create_rq(struct hinic_hwdev *hwdev, u16 q_id,
-			u16 rq_depth, unsigned int socket_id);
+			u16 rq_depth, unsigned int numa_id);
 
 void hinic_destroy_rq(struct hinic_hwdev *hwdev, u16 q_id);
 
drivers/net/hinic/hinic_pmd_tx.c +4 -4
index 22fb0bffaf..e4987c2e14 100644
@@ -1279,8 +1279,8 @@ int hinic_setup_tx_resources(struct hinic_txq *txq)
 	u64 tx_info_sz;
 
 	tx_info_sz = txq->q_depth * sizeof(*txq->tx_info);
-	txq->tx_info = rte_zmalloc_socket("tx_info", tx_info_sz,
-			RTE_CACHE_LINE_SIZE, txq->socket_id);
+	txq->tx_info = rte_zmalloc_numa("tx_info", tx_info_sz,
+			RTE_CACHE_LINE_SIZE, txq->numa_id);
 	if (!txq->tx_info)
 		return -ENOMEM;
 
@@ -1297,7 +1297,7 @@ void hinic_free_tx_resources(struct hinic_txq *txq)
 }
 
 int hinic_create_sq(struct hinic_hwdev *hwdev, u16 q_id,
-			u16 sq_depth, unsigned int socket_id)
+			u16 sq_depth, unsigned int numa_id)
 {
 	int err;
 	struct hinic_nic_io *nic_io = hwdev->nic_io;
@@ -1312,7 +1312,7 @@ int hinic_create_sq(struct hinic_hwdev *hwdev, u16 q_id,
 	/* alloc wq */
 	err = hinic_wq_allocate(nic_io->hwdev, &nic_io->sq_wq[q_id],
 				HINIC_SQ_WQEBB_SHIFT, nic_io->sq_depth,
-				socket_id);
+				numa_id);
 	if (err) {
 		PMD_DRV_LOG(ERR, "Failed to allocate WQ for SQ");
 		return err;
drivers/net/hinic/hinic_pmd_tx.h +2 -2
index 152f7abc53..939c82730a 100644
@@ -115,7 +115,7 @@ struct hinic_txq {
 	u16 q_id;
 	u16 q_depth;
 	u32 cos;
-	u32 socket_id;
+	u32 numa_id;
 
 	/* cacheline1 */
 	struct hinic_txq_stats txq_stats;
@@ -140,7 +140,7 @@ void hinic_txq_get_stats(struct hinic_txq *txq, struct hinic_txq_stats *stats);
 void hinic_txq_stats_reset(struct hinic_txq *txq);
 
 int hinic_create_sq(struct hinic_hwdev *hwdev, u16 q_id,
-			u16 sq_depth, unsigned int socket_id);
+			u16 sq_depth, unsigned int numa_id);
 
 void hinic_destroy_sq(struct hinic_hwdev *hwdev, u16 q_id);
 
Signature · 1 line
2.55.0
#124 lore raw

PATCH 122/227 net/hinic3: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/hinic3/base/hinic3_cmdq.c  |  2 +-
 drivers/net/hinic3/base/hinic3_eqs.c   |  2 +-
 drivers/net/hinic3/base/hinic3_hwdev.c |  4 +--
 drivers/net/hinic3/base/hinic3_hwdev.h |  2 +-
 drivers/net/hinic3/base/hinic3_mbox.c  |  4 +--
 drivers/net/hinic3/base/hinic3_wq.c    |  2 +-
 drivers/net/hinic3/hinic3_ethdev.c     | 38 +++++++++++++-------------
 7 files changed, 27 insertions(+), 27 deletions(-)
drivers/net/hinic3/base/hinic3_cmdq.c +1 -1
index 9c27c6f54c..42eee08570 100644
@@ -743,7 +743,7 @@ hinic3_cmdq_init(struct hinic3_hwdev *hwdev)
 
 	cmdqs->cmd_buf_pool = rte_pktmbuf_pool_create(cmdq_pool_name,
 		HINIC3_CMDQ_DEPTH * HINIC3_MAX_CMDQ_TYPES, 0, 0,
-		HINIC3_CMDQ_BUF_SIZE, (int)rte_socket_id());
+		HINIC3_CMDQ_BUF_SIZE, (int)rte_numa_id());
 	if (!cmdqs->cmd_buf_pool) {
 		PMD_DRV_LOG(ERR, "Create cmdq buffer pool failed");
 		err = -ENOMEM;
drivers/net/hinic3/base/hinic3_eqs.c +1 -1
index 1fc78adc85..23fcf7e1cc 100644
@@ -248,7 +248,7 @@ set_eq_pages(struct hinic3_eq *eq)
 		/* Allocate memory for each page. */
 		eq->eq_mz[pg_num] = hinic3_dma_zone_reserve(eq->hwdev->eth_dev,
 			"eq_mz", eq->q_id, eq->page_size,
-			eq->page_size, SOCKET_ID_ANY);
+			eq->page_size, RTE_NUMA_ID_ANY);
 		if (!eq->eq_mz[pg_num]) {
 			err = -ENOMEM;
 			goto dma_alloc_err;
drivers/net/hinic3/base/hinic3_hwdev.c +2 -2
index 9406b6cff2..0ee1f7552b 100644
@@ -546,9 +546,9 @@ hinic3_free_hwdev(struct hinic3_hwdev *hwdev)
 
 const struct rte_memzone *
 hinic3_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,
-			uint16_t queue_id, size_t size, unsigned int align, int socket_id)
+			uint16_t queue_id, size_t size, unsigned int align, int numa_id)
 {
-	return rte_eth_dma_zone_reserve(dev, ring_name, queue_id, size, align, socket_id);
+	return rte_eth_dma_zone_reserve(dev, ring_name, queue_id, size, align, numa_id);
 }
 
 int
drivers/net/hinic3/base/hinic3_hwdev.h +1 -1
index c6661aa1a6..602b106ee1 100644
@@ -177,7 +177,7 @@ void hinic3_free_hwdev(struct hinic3_hwdev *hwdev);
 
 const struct rte_memzone *
 hinic3_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,
-			uint16_t queue_id, size_t size, unsigned int align, int socket_id);
+			uint16_t queue_id, size_t size, unsigned int align, int numa_id);
 
 int hinic3_memzone_free(const struct rte_memzone *mz);
 
drivers/net/hinic3/base/hinic3_mbox.c +2 -2
index c4ca2ed7ba..c166d7d7f2 100644
@@ -1054,7 +1054,7 @@ alloc_mbox_wb_status(struct hinic3_mbox *func_to_func)
 	/* Reserved DMA area. */
 	send_mbox->wb_mz = hinic3_dma_zone_reserve(hwdev->eth_dev,
 		"wb_mz", 0, MBOX_WB_STATUS_LEN,
-		RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
+		RTE_CACHE_LINE_SIZE, RTE_NUMA_ID_ANY);
 	if (!send_mbox->wb_mz)
 		return -ENOMEM;
 
@@ -1091,7 +1091,7 @@ alloc_mbox_tlp_buffer(struct hinic3_mbox *func_to_func)
 	struct hinic3_hwdev *hwdev = func_to_func->hwdev;
 
 	send_mbox->sbuff_mz = hinic3_dma_zone_reserve(hwdev->eth_dev, "sbuff_mz",
-			0, MBOX_MAX_BUF_SZ, MBOX_MAX_BUF_SZ, SOCKET_ID_ANY);
+			0, MBOX_MAX_BUF_SZ, MBOX_MAX_BUF_SZ, RTE_NUMA_ID_ANY);
 	if (!send_mbox->sbuff_mz)
 		return -ENOMEM;
 
drivers/net/hinic3/base/hinic3_wq.c +1 -1
index cce22e672f..d76668678d 100644
@@ -21,7 +21,7 @@ alloc_wq_pages(struct hinic3_hwdev *hwdev, struct hinic3_wq *wq, int qid)
 	const struct rte_memzone *wq_mz;
 
 	wq_mz = hinic3_dma_zone_reserve(hwdev->eth_dev, "hinic3_wq_mz",
-					qid, wq->wq_buf_size, RTE_PGSIZE_256K, SOCKET_ID_ANY);
+					qid, wq->wq_buf_size, RTE_PGSIZE_256K, RTE_NUMA_ID_ANY);
 	if (!wq_mz) {
 		PMD_DRV_LOG(ERR, "Allocate wq[%d] rq_mz failed", qid);
 		return -ENOMEM;
drivers/net/hinic3/hinic3_ethdev.c +19 -19
index eb5ddd9de6..cf28bb7292 100644
@@ -573,7 +573,7 @@ hinic3_copy_mempool_init(struct hinic3_nic_dev *nic_dev)
 	if (nic_dev->cpy_mpool == NULL) {
 		nic_dev->cpy_mpool = rte_pktmbuf_pool_create(HINCI3_CPY_MEMPOOL_NAME,
 			HINIC3_COPY_MEMPOOL_DEPTH, HINIC3_COPY_MEMPOOL_CACHE,
-			0, HINIC3_COPY_MBUF_SIZE, rte_socket_id());
+			0, HINIC3_COPY_MBUF_SIZE, rte_numa_id());
 		if (nic_dev->cpy_mpool == NULL) {
 			PMD_DRV_LOG(ERR,
 				    "Create copy mempool failed, errno: %d, dev_name: %s",
@@ -923,7 +923,7 @@ hinic3_reset_tx_queue(struct rte_eth_dev *dev)
  * Receive queue index.
  * @param[in] nb_desc
  * Number of descriptors for receive queue.
- * @param[in] socket_id
+ * @param[in] numa_id
  * Socket index on which memory must be allocated.
  * @param[in] rx_conf
  * Thresholds parameters (unused_).
@@ -935,7 +935,7 @@ hinic3_reset_tx_queue(struct rte_eth_dev *dev)
  */
 static int
 hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
-		      unsigned int socket_id, const struct rte_eth_rxconf *rx_conf,
+		      unsigned int numa_id, const struct rte_eth_rxconf *rx_conf,
 		      struct rte_mempool *mp)
 {
 	struct hinic3_nic_dev *nic_dev;
@@ -999,8 +999,8 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 		return -EINVAL;
 	}
 
-	rxq = rte_zmalloc_socket("hinic3_rq", sizeof(struct hinic3_rxq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("hinic3_rq", sizeof(struct hinic3_rxq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq) {
 		PMD_DRV_LOG(ERR, "Allocate rxq[%d] failed, dev_name: %s", qid,
 			    dev->data->name);
@@ -1048,7 +1048,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 	rxq->rx_buff_shift = rte_log2_u32(rxq->buf_len);
 
 	pi_mz = hinic3_dma_zone_reserve(dev, "hinic3_rq_pi", qid, RTE_PGSIZE_4K,
-					RTE_CACHE_LINE_SIZE, socket_id);
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (!pi_mz) {
 		PMD_DRV_LOG(ERR, "Allocate rxq[%d] pi_mz failed, dev_name: %s",
 			    qid, dev->data->name);
@@ -1068,7 +1068,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 
 	queue_buf_size = RTE_BIT32(rxq->wqebb_shift) * rq_depth;
 	rq_mz = hinic3_dma_zone_reserve(dev, "hinic3_rq_mz", qid,
-					queue_buf_size, RTE_PGSIZE_256K, socket_id);
+					queue_buf_size, RTE_PGSIZE_256K, numa_id);
 	if (!rq_mz) {
 		PMD_DRV_LOG(ERR, "Allocate rxq[%d] rq_mz failed, dev_name: %s",
 			    qid, dev->data->name);
@@ -1081,9 +1081,9 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 	rxq->queue_buf_paddr = rq_mz->iova;
 	rxq->queue_buf_vaddr = rq_mz->addr;
 
-	rxq->rx_info = rte_zmalloc_socket("rx_info",
+	rxq->rx_info = rte_zmalloc_numa("rx_info",
 					  rq_depth * sizeof(*rxq->rx_info),
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->rx_info) {
 		PMD_DRV_LOG(ERR, "Allocate rx_info failed, dev_name: %s",
 			    dev->data->name);
@@ -1094,7 +1094,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 	if (HINIC3_SUPPORT_RX_HW_COMPACT_CQE(nic_dev)) {
 		ci_mz = hinic3_dma_zone_reserve(dev, "hinic3_ci_mz", qid,
 						sizeof(*rxq->rq_ci),
-						RTE_CACHE_LINE_SIZE, (int)socket_id);
+						RTE_CACHE_LINE_SIZE, (int)numa_id);
 
 		if (!ci_mz) {
 			PMD_DRV_LOG(ERR, "Allocate ci mem zone failed, dev_name: %s",
@@ -1110,7 +1110,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 	} else {
 		cqe_mz = hinic3_dma_zone_reserve(dev, "hinic3_cqe_mz", qid,
 						 rq_depth * sizeof(*rxq->rx_cqe),
-						 RTE_CACHE_LINE_SIZE, socket_id);
+						 RTE_CACHE_LINE_SIZE, numa_id);
 		if (!cqe_mz) {
 			PMD_DRV_LOG(ERR, "Allocate cqe mem zone failed, dev_name: %s",
 			dev->data->name);
@@ -1163,7 +1163,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
  * Transmit queue index.
  * @param[in] nb_desc
  * Number of descriptors for transmit queue.
- * @param[in] socket_id
+ * @param[in] numa_id
  * Socket index on which memory must be allocated.
  * @param[in] tx_conf
  * Tx queue configuration parameters (unused_).
@@ -1173,7 +1173,7 @@ hinic3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
  */
 static int
 hinic3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
-		      unsigned int socket_id, const struct rte_eth_txconf *tx_conf)
+		      unsigned int numa_id, const struct rte_eth_txconf *tx_conf)
 {
 	struct hinic3_nic_dev *nic_dev;
 	struct hinic3_hwdev *hwdev;
@@ -1226,8 +1226,8 @@ hinic3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 		return -EINVAL;
 	}
 
-	txq = rte_zmalloc_socket("hinic3_tx_queue", sizeof(struct hinic3_txq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("hinic3_tx_queue", sizeof(struct hinic3_txq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq) {
 		PMD_DRV_LOG(ERR, "Allocate txq[%d] failed, dev_name: %s", qid,
 			    dev->data->name);
@@ -1248,7 +1248,7 @@ hinic3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 
 	ci_mz = hinic3_dma_zone_reserve(dev, "hinic3_sq_ci", qid,
 					HINIC3_CI_Q_ADDR_SIZE,
-					HINIC3_CI_Q_ADDR_SIZE, socket_id);
+					HINIC3_CI_Q_ADDR_SIZE, numa_id);
 	if (!ci_mz) {
 		PMD_DRV_LOG(ERR, "Allocate txq[%d] ci_mz failed, dev_name: %s",
 			    qid, dev->data->name);
@@ -1261,7 +1261,7 @@ hinic3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 
 	queue_buf_size = RTE_BIT32(txq->wqebb_shift) * sq_depth;
 	sq_mz = hinic3_dma_zone_reserve(dev, "hinic3_sq_mz", qid,
-					queue_buf_size, RTE_PGSIZE_256K, socket_id);
+					queue_buf_size, RTE_PGSIZE_256K, numa_id);
 	if (!sq_mz) {
 		PMD_DRV_LOG(ERR, "Allocate txq[%d] sq_mz failed, dev_name: %s",
 			    qid, dev->data->name);
@@ -1282,9 +1282,9 @@ hinic3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, uint16_t nb_desc,
 	}
 	txq->db_addr = db_addr;
 
-	txq->tx_info = rte_zmalloc_socket("tx_info",
+	txq->tx_info = rte_zmalloc_numa("tx_info",
 					  sq_depth * sizeof(*txq->tx_info),
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq->tx_info) {
 		PMD_DRV_LOG(ERR, "Allocate tx_info failed, dev_name: %s",
 			    dev->data->name);
Signature · 1 line
2.55.0
#125 lore raw

PATCH 123/227 net/hns3: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/hns3/hns3_cmd.c  |  2 +-
 drivers/net/hns3/hns3_rxtx.c | 44 ++++++++++++++++++------------------
 drivers/net/hns3/hns3_rxtx.h |  6 ++---
 3 files changed, 26 insertions(+), 26 deletions(-)
drivers/net/hns3/hns3_cmd.c +1 -1
index 34e12e7359..fdc8d827ad 100644
@@ -50,7 +50,7 @@ hns3_allocate_dma_mem(struct hns3_hw *hw, struct hns3_cmq_ring *ring,
 
 	snprintf(z_name, sizeof(z_name), "hns3_dma_%" PRIu64,
 		rte_atomic_fetch_add_explicit(&hns3_dma_memzone_id, 1, rte_memory_order_relaxed));
-	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_bounded(z_name, size, RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_IOVA_CONTIG, alignment,
 					 RTE_PGSIZE_2M);
 	if (mz == NULL)
drivers/net/hns3/hns3_rxtx.c +22 -22

147 lines not on this page · raw message

drivers/net/hns3/hns3_rxtx.h +3 -3
index c046ff21ee..2ba7ac0034 100644
@@ -596,7 +596,7 @@ struct hns3_queue_info {
 	const char *ring_name;  /* point to hardware ring name */
 	uint16_t idx;
 	uint16_t nb_desc;
-	unsigned int socket_id;
+	unsigned int numa_id;
 };
 
 #define HNS3_TX_CKSUM_OFFLOAD_MASK (RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
@@ -745,11 +745,11 @@ int hns3_rxq_iterate(struct rte_eth_dev *dev,
 		 int (*callback)(struct hns3_rx_queue *, void *), void *arg);
 void hns3_dev_release_mbufs(struct hns3_adapter *hns);
 int hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
-			unsigned int socket_id,
+			unsigned int numa_id,
 			const struct rte_eth_rxconf *conf,
 			struct rte_mempool *mp);
 int hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,
-			unsigned int socket_id,
+			unsigned int numa_id,
 			const struct rte_eth_txconf *conf);
 int hns3_rx_queue_count(void *rx_queue);
 int hns3_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
Signature · 1 line
2.55.0
#126 lore raw

PATCH 124/227 net/intel: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/intel/cpfl/cpfl_representor.c     |  4 +-
 drivers/net/intel/cpfl/cpfl_rxtx.c            | 74 +++++++++----------
 drivers/net/intel/cpfl/cpfl_rxtx.h            |  4 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |  8 +-
 drivers/net/intel/e1000/em_rxtx.c             |  8 +-
 drivers/net/intel/e1000/igb_rxtx.c            |  8 +-
 drivers/net/intel/e1000/igc_txrx.c            |  8 +-
 drivers/net/intel/e1000/igc_txrx.h            |  4 +-
 drivers/net/intel/fm10k/fm10k_ethdev.c        | 28 +++----
 drivers/net/intel/i40e/i40e_ethdev.c          |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |  2 +-
 drivers/net/intel/i40e/i40e_fdir.c            |  6 +-
 drivers/net/intel/i40e/i40e_rxtx.c            | 44 +++++------
 drivers/net/intel/i40e/i40e_rxtx.h            |  4 +-
 drivers/net/intel/i40e/i40e_vf_representor.c  |  4 +-
 drivers/net/intel/iavf/iavf_osdep.c           |  2 +-
 drivers/net/intel/iavf/iavf_rxtx.c            | 32 ++++----
 drivers/net/intel/iavf/iavf_rxtx.h            |  4 +-
 .../net/intel/ice/ice_dcf_vf_representor.c    |  4 +-
 drivers/net/intel/ice/ice_fdir_filter.c       |  6 +-
 drivers/net/intel/ice/ice_osdep.h             |  2 +-
 drivers/net/intel/ice/ice_rxtx.c              | 46 ++++++------
 drivers/net/intel/ice/ice_rxtx.h              |  4 +-
 drivers/net/intel/idpf/idpf_common_rxtx.c     |  6 +-
 drivers/net/intel/idpf/idpf_common_rxtx.h     |  2 +-
 drivers/net/intel/idpf/idpf_osdep.h           |  2 +-
 drivers/net/intel/idpf/idpf_rxtx.c            | 60 +++++++--------
 drivers/net/intel/idpf/idpf_rxtx.h            |  4 +-
 drivers/net/intel/ipn3ke/ipn3ke_ethdev.c      |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_representor.c |  4 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |  4 +-
 drivers/net/intel/ixgbe/ixgbe_rxtx.c          | 32 ++++----
 .../net/intel/ixgbe/ixgbe_vf_representor.c    |  4 +-
 33 files changed, 214 insertions(+), 214 deletions(-)
drivers/net/intel/cpfl/cpfl_representor.c +2 -2
index bb28c0b989..e7c631dbd6 100644
@@ -292,7 +292,7 @@ static int
 cpfl_repr_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 			 __rte_unused uint16_t queue_id,
 			 __rte_unused uint16_t nb_desc,
-			 __rte_unused unsigned int socket_id,
+			 __rte_unused unsigned int numa_id,
 			 __rte_unused const struct rte_eth_rxconf *conf,
 			 __rte_unused struct rte_mempool *pool)
 {
@@ -304,7 +304,7 @@ static int
 cpfl_repr_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 			 __rte_unused uint16_t queue_id,
 			 __rte_unused uint16_t nb_desc,
-			 __rte_unused unsigned int socket_id,
+			 __rte_unused unsigned int numa_id,
 			 __rte_unused const struct rte_eth_txconf *conf)
 {
 	/* Dummy */
drivers/net/intel/cpfl/cpfl_rxtx.c +37 -37

250 lines not on this page · raw message

drivers/net/intel/cpfl/cpfl_rxtx.h +2 -2
index 52cdecac88..6ae03b1a75 100644
@@ -88,10 +88,10 @@ cpfl_hw_qtail_get(uint64_t tail_start, uint16_t offset, uint64_t tail_spacing)
 }
 
 int cpfl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_txconf *tx_conf);
 int cpfl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mp);
 int cpfl_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id);
drivers/net/intel/e1000/e1000_ethdev.h +4 -4
index 0907c7c259..539fe1e028 100644
@@ -410,7 +410,7 @@ uint64_t igb_get_rx_port_offloads_capa(struct rte_eth_dev *dev);
 uint64_t igb_get_rx_queue_offloads_capa(struct rte_eth_dev *dev);
 
 int eth_igb_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
@@ -423,7 +423,7 @@ uint64_t igb_get_tx_port_offloads_capa(struct rte_eth_dev *dev);
 uint64_t igb_get_tx_queue_offloads_capa(struct rte_eth_dev *dev);
 
 int eth_igb_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id,
+		uint16_t nb_tx_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 int eth_igb_tx_done_cleanup(void *txq, uint32_t free_cnt);
@@ -484,7 +484,7 @@ uint64_t em_get_rx_port_offloads_capa(void);
 uint64_t em_get_rx_queue_offloads_capa(void);
 
 int eth_em_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
@@ -497,7 +497,7 @@ uint64_t em_get_tx_port_offloads_capa(struct rte_eth_dev *dev);
 uint64_t em_get_tx_queue_offloads_capa(struct rte_eth_dev *dev);
 
 int eth_em_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id,
+		uint16_t nb_tx_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 int eth_em_rx_init(struct rte_eth_dev *dev);
drivers/net/intel/e1000/em_rxtx.c +4 -4
index 3e18ac994a..47891e96a8 100644
@@ -1193,7 +1193,7 @@ int
 eth_em_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_txconf *tx_conf)
 {
 	const struct rte_memzone *tz;
@@ -1274,7 +1274,7 @@ eth_em_tx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	tsize = sizeof(txq->tx_ring[0]) * E1000_MAX_RING_DESC;
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, tsize,
-				      RTE_CACHE_LINE_SIZE, socket_id);
+				      RTE_CACHE_LINE_SIZE, numa_id);
 	if (tz == NULL)
 		return -ENOMEM;
 
@@ -1393,7 +1393,7 @@ int
 eth_em_rx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mp)
 {
@@ -1437,7 +1437,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev,
 	/* Allocate RX ring for max possible mumber of hardware descriptors. */
 	rsize = sizeof(rxq->rx_ring[0]) * E1000_MAX_RING_DESC;
 	rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, rsize,
-				      RTE_CACHE_LINE_SIZE, socket_id);
+				      RTE_CACHE_LINE_SIZE, numa_id);
 	if (rz == NULL)
 		return -ENOMEM;
 
drivers/net/intel/e1000/igb_rxtx.c +4 -4
index ef531f1cd4..c91c7fc6fd 100644
@@ -1498,7 +1498,7 @@ int
 eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_txconf *tx_conf)
 {
 	const struct rte_memzone *tz;
@@ -1556,7 +1556,7 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	size = sizeof(union e1000_adv_tx_desc) * E1000_MAX_RING_DESC;
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, size,
-				      E1000_ALIGN, socket_id);
+				      E1000_ALIGN, numa_id);
 	if (tz == NULL) {
 		igb_tx_queue_release(txq);
 		return -ENOMEM;
@@ -1697,7 +1697,7 @@ int
 eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -1760,7 +1760,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	size = sizeof(union e1000_adv_rx_desc) * E1000_MAX_RING_DESC;
 	rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size,
-				      E1000_ALIGN, socket_id);
+				      E1000_ALIGN, numa_id);
 	if (rz == NULL) {
 		igb_rx_queue_release(rxq);
 		return -ENOMEM;
drivers/net/intel/e1000/igc_txrx.c +4 -4
index dca66c3c2c..468327287f 100644
@@ -1260,7 +1260,7 @@ int
 eth_igc_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -1313,7 +1313,7 @@ eth_igc_rx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	size = sizeof(union e1000_adv_rx_desc) * IGC_MAX_RXD;
 	rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, size,
-				      IGC_ALIGN, socket_id);
+				      IGC_ALIGN, numa_id);
 	if (rz == NULL) {
 		igc_rx_queue_release(rxq);
 		return -ENOMEM;
@@ -2072,7 +2072,7 @@ igc_dev_clear_queues(struct rte_eth_dev *dev)
 }
 
 int eth_igc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-		uint16_t nb_desc, unsigned int socket_id,
+		uint16_t nb_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	const struct rte_memzone *tz;
@@ -2124,7 +2124,7 @@ int eth_igc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	 */
 	size = sizeof(union e1000_adv_tx_desc) * IGC_MAX_TXD;
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, size,
-				      IGC_ALIGN, socket_id);
+				      IGC_ALIGN, numa_id);
 	if (tz == NULL) {
 		igc_tx_queue_release(txq);
 		return -ENOMEM;
drivers/net/intel/e1000/igc_txrx.h +2 -2
index 29cb138312..5d0ddca3e6 100644
@@ -146,7 +146,7 @@ void eth_igc_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 void eth_igc_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 void igc_dev_clear_queues(struct rte_eth_dev *dev);
 int eth_igc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
@@ -157,7 +157,7 @@ int eth_igc_rx_descriptor_status(void *rx_queue, uint16_t offset);
 int eth_igc_tx_descriptor_status(void *tx_queue, uint16_t offset);
 
 int eth_igc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-		uint16_t nb_desc, unsigned int socket_id,
+		uint16_t nb_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 int eth_igc_tx_done_cleanup(void *txqueue, uint32_t free_cnt);
 
drivers/net/intel/fm10k/fm10k_ethdev.c +14 -14
index 5aa15a8dba..ce6fb14d91 100644
@@ -1783,7 +1783,7 @@ static uint64_t fm10k_get_rx_port_offloads_capa(struct rte_eth_dev *dev)
 
 static int
 fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
-	uint16_t nb_desc, unsigned int socket_id,
+	uint16_t nb_desc, unsigned int numa_id,
 	const struct rte_eth_rxconf *conf, struct rte_mempool *mp)
 {
 	struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1826,8 +1826,8 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* allocate memory for the queue structure */
-	q = rte_zmalloc_socket("fm10k", sizeof(*q), RTE_CACHE_LINE_SIZE,
-				socket_id);
+	q = rte_zmalloc_numa("fm10k", sizeof(*q), RTE_CACHE_LINE_SIZE,
+				numa_id);
 	if (q == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate queue structure");
 		return -ENOMEM;
@@ -1847,9 +1847,9 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 		return -EINVAL;
 	}
 	/* allocate memory for the software ring */
-	q->sw_ring = rte_zmalloc_socket("fm10k sw ring",
+	q->sw_ring = rte_zmalloc_numa("fm10k sw ring",
 			(nb_desc + q->nb_fake_desc) * sizeof(struct rte_mbuf *),
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (q->sw_ring == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate software ring");
 		rte_free(q);
@@ -1863,7 +1863,7 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	 */
 	mz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_id,
 				      FM10K_MAX_RX_RING_SZ, FM10K_ALIGN_RX_DESC,
-				      socket_id);
+				      numa_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate hardware ring");
 		rte_free(q->sw_ring);
@@ -1973,7 +1973,7 @@ static uint64_t fm10k_get_tx_port_offloads_capa(struct rte_eth_dev *dev)
 
 static int
 fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
-	uint16_t nb_desc, unsigned int socket_id,
+	uint16_t nb_desc, unsigned int numa_id,
 	const struct rte_eth_txconf *conf)
 {
 	struct fm10k_hw *hw = FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -2010,8 +2010,8 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* allocate memory for the queue structure */
-	q = rte_zmalloc_socket("fm10k", sizeof(*q), RTE_CACHE_LINE_SIZE,
-				socket_id);
+	q = rte_zmalloc_numa("fm10k", sizeof(*q), RTE_CACHE_LINE_SIZE,
+				numa_id);
 	if (q == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate queue structure");
 		return -ENOMEM;
@@ -2031,9 +2031,9 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	}
 
 	/* allocate memory for the software ring */
-	q->sw_ring = rte_zmalloc_socket("fm10k sw ring",
+	q->sw_ring = rte_zmalloc_numa("fm10k sw ring",
 					nb_desc * sizeof(struct rte_mbuf *),
-					RTE_CACHE_LINE_SIZE, socket_id);
+					RTE_CACHE_LINE_SIZE, numa_id);
 	if (q->sw_ring == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate software ring");
 		rte_free(q);
@@ -2047,7 +2047,7 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	 */
 	mz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_id,
 				      FM10K_MAX_TX_RING_SZ, FM10K_ALIGN_TX_DESC,
-				      socket_id);
+				      numa_id);
 	if (mz == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate hardware ring");
 		rte_free(q->sw_ring);
@@ -2061,10 +2061,10 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	 * allocate memory for the RS bit tracker. Enough slots to hold the
 	 * descriptor index for each RS bit needing to be set are required.
 	 */
-	q->rs_tracker.list = rte_zmalloc_socket("fm10k rs tracker",
+	q->rs_tracker.list = rte_zmalloc_numa("fm10k rs tracker",
 				((nb_desc + 1) / q->rs_thresh) *
 				sizeof(uint16_t),
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (q->rs_tracker.list == NULL) {
 		PMD_INIT_LOG(ERR, "Cannot allocate RS bit tracker");
 		rte_free(q->sw_ring);
drivers/net/intel/i40e/i40e_ethdev.c +1 -1
index 66db44aaa1..a1eeccad23 100644
@@ -4462,7 +4462,7 @@ i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw,
 
 	snprintf(z_name, sizeof(z_name), "i40e_dma_%" PRIu64,
 		rte_atomic_fetch_add_explicit(&i40e_dma_memzone_id, 1, rte_memory_order_relaxed));
-	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_bounded(z_name, size, RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_IOVA_CONTIG, alignment, RTE_PGSIZE_2M);
 	if (!mz)
 		return I40E_ERR_NO_MEMORY;
drivers/net/intel/i40e/i40e_ethdev.h +1 -1
index e5e136f554..8ba51c923e 100644
@@ -1383,7 +1383,7 @@ int i40e_fdir_setup(struct i40e_pf *pf);
 void i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi);
 const struct rte_memzone *i40e_memzone_reserve(const char *name,
 					uint32_t len,
-					int socket_id);
+					int numa_id);
 void i40e_fdir_rx_proc_sync(struct rte_eth_dev_data *dev_data);
 void i40e_fdir_teardown(struct i40e_pf *pf);
 int i40e_fdir_engine_init(struct i40e_pf *pf);
drivers/net/intel/i40e/i40e_fdir.c +3 -3
index 11e11b6713..f3323d194b 100644
@@ -228,7 +228,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
 			I40E_FDIR_MZ_NAME,
 			eth_dev->data->port_id);
 	mz = i40e_memzone_reserve(z_name, I40E_FDIR_PKT_LEN *
-			I40E_FDIR_PRG_PKT_CNT, SOCKET_ID_ANY);
+			I40E_FDIR_PRG_PKT_CNT, RTE_NUMA_ID_ANY);
 	if (!mz) {
 		PMD_DRV_LOG(ERR, "Cannot init memzone for "
 				 "flow director program packet.");
@@ -978,7 +978,7 @@ i40e_fdir_flow_store_init(struct rte_eth_dev *dev)
 		.key_len = sizeof(struct i40e_fdir_input),
 		.hash_func = rte_hash_crc,
 		.hash_func_init_val = 0,
-		.socket_id = rte_socket_id(),
+		.numa_id = rte_numa_id(),
 	};
 	char fdir_pool_name[RTE_MEMPOOL_NAMESIZE];
 	int ret;
@@ -1006,7 +1006,7 @@ i40e_fdir_flow_store_init(struct rte_eth_dev *dev)
 			RTE_MAX(i40e_flow_engine_fdir.flow_size,
 				i40e_flow_engine_fdir_ethertype.flow_size),
 			0, 0, NULL, NULL, NULL, NULL,
-			rte_socket_id(),
+			rte_numa_id(),
 			/* pack flows tightly */
 			RTE_MEMPOOL_F_NO_SPREAD | RTE_MEMPOOL_F_NO_CACHE_ALIGN |
 			RTE_MEMPOOL_F_NO_IOVA_CONTIG |
drivers/net/intel/i40e/i40e_rxtx.c +22 -22

146 lines not on this page · raw message

drivers/net/intel/i40e/i40e_rxtx.h +2 -2
index 0977342064..c4eb1b43de 100644
@@ -116,13 +116,13 @@ const uint32_t *i40e_dev_supported_ptypes_get(struct rte_eth_dev *dev,
 int i40e_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			    uint16_t queue_idx,
 			    uint16_t nb_desc,
-			    unsigned int socket_id,
+			    unsigned int numa_id,
 			    const struct rte_eth_rxconf *rx_conf,
 			    struct rte_mempool *mp);
 int i40e_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			    uint16_t queue_idx,
 			    uint16_t nb_desc,
-			    unsigned int socket_id,
+			    unsigned int numa_id,
 			    const struct rte_eth_txconf *tx_conf);
 void i40e_rx_queue_release(void *rxq);
 void i40e_tx_queue_release(void *txq);
drivers/net/intel/i40e/i40e_vf_representor.c +2 -2
index e8f0bb62a0..35f2d2abf3 100644
@@ -131,7 +131,7 @@ static int
 i40e_vf_representor_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t rx_queue_id,
 	__rte_unused 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)
 {
@@ -142,7 +142,7 @@ static int
 i40e_vf_representor_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t rx_queue_id,
 	__rte_unused uint16_t nb_rx_desc,
-	__rte_unused unsigned int socket_id,
+	__rte_unused unsigned int numa_id,
 	__rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	return 0;
drivers/net/intel/iavf/iavf_osdep.c +1 -1
index c0ff301be5..732118dadb 100644
@@ -27,7 +27,7 @@ iavf_allocate_dma_mem_d(__rte_unused struct iavf_hw *hw,
 
 	snprintf(z_name, sizeof(z_name), "iavf_dma_%" PRIu64,
 		rte_atomic_fetch_add_explicit(&iavf_dma_memzone_id, 1, rte_memory_order_relaxed));
-	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_bounded(z_name, size, RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_IOVA_CONTIG, alignment,
 					 RTE_PGSIZE_2M);
 	if (!mz)
drivers/net/intel/iavf/iavf_rxtx.c +16 -16
index 84b931e78a..6be1870099 100644
@@ -534,7 +534,7 @@ iavf_select_rxd_to_pkt_fields_handler(struct ci_rx_queue *rxq, uint32_t rxdid)
 
 int
 iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-		       uint16_t nb_desc, unsigned int socket_id,
+		       uint16_t nb_desc, unsigned int numa_id,
 		       const struct rte_eth_rxconf *rx_conf,
 		       struct rte_mempool *mp)
 {
@@ -588,10 +588,10 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	}
 
 	/* Allocate the rx queue data structure */
-	rxq = rte_zmalloc_socket("iavf rxq",
+	rxq = rte_zmalloc_numa("iavf rxq",
 				 sizeof(struct ci_rx_queue),
 				 RTE_CACHE_LINE_SIZE,
-				 socket_id);
+				 numa_id);
 	if (!rxq) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for "
 			     "rx queue data structure");
@@ -599,10 +599,10 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	}
 
 	/* Allocate stats */
-	rxq->stats = rte_zmalloc_socket("iavf rxq stats",
+	rxq->stats = rte_zmalloc_numa("iavf rxq stats",
 				 sizeof(struct iavf_rx_queue_stats),
 				 RTE_CACHE_LINE_SIZE,
-				 socket_id);
+				 numa_id);
 	if (!rxq->stats) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for "
 			     "rx queue stats");
@@ -662,10 +662,10 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	/* Allocate the software ring. */
 	len = nb_desc + IAVF_RX_MAX_BURST;
 	rxq->sw_ring =
-		rte_zmalloc_socket("iavf rx sw ring",
+		rte_zmalloc_numa("iavf rx sw ring",
 				   sizeof(struct rte_mbuf *) * len,
 				   RTE_CACHE_LINE_SIZE,
-				   socket_id);
+				   numa_id);
 	if (!rxq->sw_ring) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for SW ring");
 		rte_free(rxq->stats);
@@ -681,7 +681,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 			      IAVF_DMA_MEM_ALIGN);
 	mz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx,
 				      ring_size, IAVF_RING_BASE_ALIGN,
-				      socket_id);
+				      numa_id);
 	if (!mz) {
 		PMD_INIT_LOG(ERR, "Failed to reserve DMA memory for RX");
 		rte_free(rxq->sw_ring);
@@ -729,7 +729,7 @@ int
 iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf)
 {
 	struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -773,10 +773,10 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocate the TX queue data structure. */
-	txq = rte_zmalloc_socket("iavf txq",
+	txq = rte_zmalloc_numa("iavf txq",
 				 sizeof(struct ci_tx_queue),
 				 RTE_CACHE_LINE_SIZE,
-				 socket_id);
+				 numa_id);
 	if (!txq) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for "
 			     "tx queue structure");
@@ -822,10 +822,10 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate software ring */
 	txq->sw_ring =
-		rte_zmalloc_socket("iavf tx sw ring",
+		rte_zmalloc_numa("iavf tx sw ring",
 				   sizeof(struct ci_tx_entry) * nb_desc,
 				   RTE_CACHE_LINE_SIZE,
-				   socket_id);
+				   numa_id);
 	if (!txq->sw_ring) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for SW TX ring");
 		rte_free(txq);
@@ -834,8 +834,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate RS last_id tracking array */
 	uint16_t num_rs_buckets = nb_desc / tx_rs_thresh;
-	txq->rs_last_id = rte_zmalloc_socket(NULL, sizeof(txq->rs_last_id[0]) * num_rs_buckets,
-			RTE_CACHE_LINE_SIZE, socket_id);
+	txq->rs_last_id = rte_zmalloc_numa(NULL, sizeof(txq->rs_last_id[0]) * num_rs_buckets,
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->rs_last_id == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to allocate memory for RS last_id array");
 		rte_free(txq->sw_ring);
@@ -848,7 +848,7 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	ring_size = RTE_ALIGN(ring_size, IAVF_DMA_MEM_ALIGN);
 	mz = rte_eth_dma_zone_reserve(dev, "ci_tx_ring", queue_idx,
 				      ring_size, IAVF_RING_BASE_ALIGN,
-				      socket_id);
+				      numa_id);
 	if (!mz) {
 		PMD_INIT_LOG(ERR, "Failed to reserve DMA memory for TX");
 		rte_free(txq->sw_ring);
drivers/net/intel/iavf/iavf_rxtx.h +2 -2
index 812d7e23ee..2ebad546ae 100644
@@ -452,7 +452,7 @@ enum iavf_rx_flex_desc_ipsec_crypto_status {
 int iavf_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			   uint16_t queue_idx,
 			   uint16_t nb_desc,
-			   unsigned int socket_id,
+			   unsigned int numa_id,
 			   const struct rte_eth_rxconf *rx_conf,
 			   struct rte_mempool *mp);
 
@@ -466,7 +466,7 @@ int iavf_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
 int iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			   uint16_t queue_idx,
 			   uint16_t nb_desc,
-			   unsigned int socket_id,
+			   unsigned int numa_id,
 			   const struct rte_eth_txconf *tx_conf);
 int iavf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
drivers/net/intel/ice/ice_dcf_vf_representor.c +2 -2
index 564ff02fd8..d7dcac9f6b 100644
@@ -79,7 +79,7 @@ static int
 ice_dcf_vf_repr_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 			       __rte_unused uint16_t queue_id,
 			       __rte_unused uint16_t nb_desc,
-			       __rte_unused unsigned int socket_id,
+			       __rte_unused unsigned int numa_id,
 			       __rte_unused const struct rte_eth_rxconf *conf,
 			       __rte_unused struct rte_mempool *pool)
 {
@@ -90,7 +90,7 @@ static int
 ice_dcf_vf_repr_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 			       __rte_unused uint16_t queue_id,
 			       __rte_unused uint16_t nb_desc,
-			       __rte_unused unsigned int socket_id,
+			       __rte_unused unsigned int numa_id,
 			       __rte_unused const struct rte_eth_txconf *conf)
 {
 	return 0;
drivers/net/intel/ice/ice_fdir_filter.c +3 -3
index 3a15abe422..34ab9fe68f 100644
@@ -188,7 +188,7 @@ static int
 ice_fdir_is_tunnel_profile(enum ice_fdir_tunnel_type tunnel_type);
 
 static const struct rte_memzone *
-ice_memzone_reserve(const char *name, uint32_t len, int socket_id)
+ice_memzone_reserve(const char *name, uint32_t len, int numa_id)
 {
 	const struct rte_memzone *mz;
 
@@ -196,7 +196,7 @@ ice_memzone_reserve(const char *name, uint32_t len, int socket_id)
 	if (mz)
 		return mz;
 
-	return rte_memzone_reserve_aligned(name, len, socket_id,
+	return rte_memzone_reserve_aligned(name, len, numa_id,
 					   RTE_MEMZONE_IOVA_CONTIG,
 					   ICE_RING_BASE_ALIGN);
 }
@@ -521,7 +521,7 @@ ice_fdir_setup(struct ice_pf *pf)
 	snprintf(z_name, sizeof(z_name), "ICE_%s_%d",
 		 ICE_FDIR_MZ_NAME,
 		 eth_dev->data->port_id);
-	mz = ice_memzone_reserve(z_name, ICE_FDIR_PKT_LEN, SOCKET_ID_ANY);
+	mz = ice_memzone_reserve(z_name, ICE_FDIR_PKT_LEN, RTE_NUMA_ID_ANY);
 	if (!mz) {
 		PMD_DRV_LOG(ERR, "Cannot init memzone for "
 			    "flow director program packet.");
drivers/net/intel/ice/ice_osdep.h +1 -1
index f4ec8b8994..b07834e03b 100644
@@ -257,7 +257,7 @@ ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
 
 	snprintf(z_name, sizeof(z_name), "ice_dma_%" PRIu64,
 		rte_atomic_fetch_add_explicit(&ice_dma_memzone_id, 1, rte_memory_order_relaxed));
-	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, 0,
+	mz = rte_memzone_reserve_bounded(z_name, size, RTE_NUMA_ID_ANY, 0,
 					 0, RTE_PGSIZE_2M);
 	if (!mz)
 		return NULL;
drivers/net/intel/ice/ice_rxtx.c +23 -23

148 lines not on this page · raw message

drivers/net/intel/ice/ice_rxtx.h +2 -2
index 3332053d3d..15ebe0b7ad 100644
@@ -209,13 +209,13 @@ struct ice_32b_rx_flex_desc_comms_ovs {
 int ice_rx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_rxconf *rx_conf,
 		       struct rte_mempool *mp);
 int ice_tx_queue_setup(struct rte_eth_dev *dev,
 		       uint16_t queue_idx,
 		       uint16_t nb_desc,
-		       unsigned int socket_id,
+		       unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf);
 int ice_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int ice_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
drivers/net/intel/idpf/idpf_common_rxtx.c +3 -3
index eb29024547..2cf7be6060 100644
@@ -230,12 +230,12 @@ idpf_qc_split_tx_descq_reset(struct ci_tx_queue *txq)
 
 RTE_EXPORT_INTERNAL_SYMBOL(idpf_qc_split_tx_pending_alloc)
 int
-idpf_qc_split_tx_pending_alloc(struct ci_tx_queue *txq, unsigned int socket_id)
+idpf_qc_split_tx_pending_alloc(struct ci_tx_queue *txq, unsigned int numa_id)
 {
 	/* Scalar completion tags and vector descriptor indices both use nb_tx_desc pointers. */
-	txq->tx_pending_pkts = rte_zmalloc_socket("idpf_tx_pending",
+	txq->tx_pending_pkts = rte_zmalloc_numa("idpf_tx_pending",
 			sizeof(struct rte_mbuf *) * txq->nb_tx_desc,
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->tx_pending_pkts == NULL) {
 		DRV_LOG(ERR, "Failed to alloc idpf tx_pending shadow ring");
 		return -ENOMEM;
drivers/net/intel/idpf/idpf_common_rxtx.h +1 -1
index a4843c9f69..a74179d233 100644
@@ -216,7 +216,7 @@ void idpf_qc_single_rx_queue_reset(struct idpf_rx_queue *rxq);
 __rte_internal
 void idpf_qc_split_tx_descq_reset(struct ci_tx_queue *txq);
 __rte_internal
-int idpf_qc_split_tx_pending_alloc(struct ci_tx_queue *txq, unsigned int socket_id);
+int idpf_qc_split_tx_pending_alloc(struct ci_tx_queue *txq, unsigned int numa_id);
 __rte_internal
 void idpf_qc_split_tx_release_mbufs(struct ci_tx_queue *txq);
 __rte_internal
drivers/net/intel/idpf/idpf_osdep.h +1 -1
index 7d99a23cf8..68b8b7bc53 100644
@@ -241,7 +241,7 @@ idpf_alloc_dma_mem(__rte_unused struct idpf_hw *hw,
 		return NULL;
 
 	snprintf(z_name, sizeof(z_name), "idpf_dma_%"PRIu64, rte_rand());
-	mz = rte_memzone_reserve_aligned(z_name, size, SOCKET_ID_ANY,
+	mz = rte_memzone_reserve_aligned(z_name, size, RTE_NUMA_ID_ANY,
 					 RTE_MEMZONE_IOVA_CONTIG, RTE_PGSIZE_4K);
 	if (!mz)
 		return NULL;
drivers/net/intel/idpf/idpf_rxtx.c +30 -30

206 lines not on this page · raw message

drivers/net/intel/idpf/idpf_rxtx.h +2 -2
index b456b8705d..0a5f0dd490 100644
@@ -27,7 +27,7 @@
 #define IDPF_SUPPORT_CHAIN_NUM 5
 
 int idpf_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mp);
 int idpf_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id);
@@ -36,7 +36,7 @@ int idpf_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 void idpf_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 
 int idpf_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_txconf *tx_conf);
 int idpf_tx_queue_init(struct rte_eth_dev *dev, uint16_t tx_queue_id);
 int idpf_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
drivers/net/intel/ipn3ke/ipn3ke_ethdev.c +1 -1
index 2ee87c94c2..d6cc367dce 100644
@@ -462,7 +462,7 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device *afu_dev)
 	if (!afu_dev->shared.data) {
 		snprintf(name, sizeof(name), "net_%s_hw",
 			afu_dev->device.name);
-		hw = rte_zmalloc_socket(name,
+		hw = rte_zmalloc_numa(name,
 					sizeof(struct ipn3ke_hw),
 					RTE_CACHE_LINE_SIZE,
 					afu_dev->device.numa_node);
drivers/net/intel/ipn3ke/ipn3ke_representor.c +2 -2
index 05aad6cd15..50ab7df99d 100644
@@ -293,7 +293,7 @@ ipn3ke_rpst_tx_queue_stop(__rte_unused struct rte_eth_dev *dev,
 static int
 ipn3ke_rpst_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t queue_idx, __rte_unused uint16_t nb_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 *mp)
 {
@@ -303,7 +303,7 @@ ipn3ke_rpst_rx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 static int
 ipn3ke_rpst_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t queue_idx, __rte_unused uint16_t nb_desc,
-	__rte_unused unsigned int socket_id,
+	__rte_unused unsigned int numa_id,
 	__rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	return 0;
drivers/net/intel/ixgbe/ixgbe_ethdev.h +2 -2
index a646909b4e..2758f9338d 100644
@@ -552,12 +552,12 @@ void ixgbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 void ixgbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 
 int  ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
 int  ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id,
+		uint16_t nb_tx_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 int ixgbe_dev_rx_queue_count(void *rx_queue);
drivers/net/intel/ixgbe/ixgbe_rxtx.c +16 -16
index 4cf43fae16..440c9cee96 100644
@@ -2685,7 +2685,7 @@ int __rte_cold
 ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_txconf *tx_conf)
 {
 	const struct rte_memzone *tz;
@@ -2818,9 +2818,9 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* First allocate the tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct ci_tx_queue) +
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct ci_tx_queue) +
 					sizeof(struct ixgbe_advctx_info) * IXGBE_CTX_NUM,
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL)
 		return -ENOMEM;
 	txq->ctx_cache = RTE_PTR_ADD(txq, sizeof(struct ci_tx_queue));
@@ -2832,7 +2832,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	tz = rte_eth_dma_zone_reserve(dev, "ixgbe_tx_ring", queue_idx,
 			sizeof(union ixgbe_adv_tx_desc) * IXGBE_MAX_RING_DESC,
-			IXGBE_ALIGN, socket_id);
+			IXGBE_ALIGN, numa_id);
 	if (tz == NULL) {
 		ixgbe_tx_queue_release(txq);
 		return -ENOMEM;
@@ -2873,9 +2873,9 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->ixgbe_tx_ring = (union ixgbe_adv_tx_desc *)tz->addr;
 
 	/* Allocate software ring */
-	txq->sw_ring = rte_zmalloc_socket("txq->sw_ring",
+	txq->sw_ring = rte_zmalloc_numa("txq->sw_ring",
 				sizeof(struct ci_tx_entry) * nb_desc,
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->sw_ring == NULL) {
 		ixgbe_tx_queue_release(txq);
 		return -ENOMEM;
@@ -2885,8 +2885,8 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	/* Allocate RS last_id tracking array */
 	uint16_t num_rs_buckets = nb_desc / tx_rs_thresh;
-	txq->rs_last_id = rte_zmalloc_socket(NULL, sizeof(txq->rs_last_id[0]) * num_rs_buckets,
-			RTE_CACHE_LINE_SIZE, socket_id);
+	txq->rs_last_id = rte_zmalloc_numa(NULL, sizeof(txq->rs_last_id[0]) * num_rs_buckets,
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->rs_last_id == NULL) {
 		ixgbe_tx_queue_release(txq);
 		PMD_DRV_LOG(ERR, "Failed to allocate memory for RS last_id array");
@@ -3160,7 +3160,7 @@ int __rte_cold
 ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -3204,8 +3204,8 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* First allocate the rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct ci_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct ci_rx_queue),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL)
 		return -ENOMEM;
 	rxq->mp = mp;
@@ -3252,7 +3252,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	 * resizing in later calls to the queue setup function.
 	 */
 	rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx,
-				      RX_RING_SZ, IXGBE_ALIGN, socket_id);
+				      RX_RING_SZ, IXGBE_ALIGN, numa_id);
 	if (rz == NULL) {
 		ixgbe_rx_queue_release(rxq);
 		return -ENOMEM;
@@ -3299,9 +3299,9 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	if (adapter->rx_bulk_alloc_allowed)
 		len += IXGBE_RX_MAX_BURST;
 
-	rxq->sw_ring = rte_zmalloc_socket("rxq->sw_ring",
+	rxq->sw_ring = rte_zmalloc_numa("rxq->sw_ring",
 					  sizeof(struct ci_rx_entry) * len,
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->sw_ring) {
 		ixgbe_rx_queue_release(rxq);
 		return -ENOMEM;
@@ -3316,9 +3316,9 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	 * dev_start() flow.
 	 */
 	rxq->sw_sc_ring =
-		rte_zmalloc_socket("rxq->sw_sc_ring",
+		rte_zmalloc_numa("rxq->sw_sc_ring",
 				   sizeof(struct ci_rx_entry_sc) * len,
-				   RTE_CACHE_LINE_SIZE, socket_id);
+				   RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->sw_sc_ring) {
 		ixgbe_rx_queue_release(rxq);
 		return -ENOMEM;
drivers/net/intel/ixgbe/ixgbe_vf_representor.c +2 -2
index c11983e307..d9032c0f3d 100644
@@ -111,7 +111,7 @@ static int ixgbe_vf_representor_rx_queue_setup(
 	__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t rx_queue_id,
 	__rte_unused 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)
 {
@@ -122,7 +122,7 @@ static int ixgbe_vf_representor_tx_queue_setup(
 	__rte_unused struct rte_eth_dev *dev,
 	__rte_unused uint16_t rx_queue_id,
 	__rte_unused uint16_t nb_rx_desc,
-	__rte_unused unsigned int socket_id,
+	__rte_unused unsigned int numa_id,
 	__rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	return 0;
Signature · 1 line
2.55.0
#127 lore raw

PATCH 125/227 net/ionic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/ionic/ionic_lif.c  | 38 +++++++++++++++++-----------------
 drivers/net/ionic/ionic_lif.h  |  4 ++--
 drivers/net/ionic/ionic_main.c |  6 +++---
 drivers/net/ionic/ionic_rxtx.c | 12 +++++------
 drivers/net/ionic/ionic_rxtx.h |  4 ++--
 5 files changed, 32 insertions(+), 32 deletions(-)
drivers/net/ionic/ionic_lif.c +19 -19
index 2443c98881..d41c347dd2 100644
@@ -585,7 +585,7 @@ static int
 ionic_qcq_alloc(struct ionic_lif *lif,
 		uint8_t type,
 		size_t struct_size,
-		uint32_t socket_id,
+		uint32_t numa_id,
 		uint32_t index,
 		const char *type_name,
 		uint16_t flags,
@@ -626,8 +626,8 @@ ionic_qcq_alloc(struct ionic_lif *lif,
 		total_size += page_size;
 	}
 
-	new = rte_zmalloc_socket("ionic", struct_size,
-				RTE_CACHE_LINE_SIZE, socket_id);
+	new = rte_zmalloc_numa("ionic", struct_size,
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (!new) {
 		IONIC_PRINT(ERR, "Cannot allocate queue structure");
 		return -ENOMEM;
@@ -636,9 +636,9 @@ ionic_qcq_alloc(struct ionic_lif *lif,
 	new->lif = lif;
 
 	/* Most queue types will store 1 ptr per descriptor */
-	new->q.info = rte_calloc_socket("ionic",
+	new->q.info = rte_calloc_numa("ionic",
 				(uint64_t)num_descs * num_segs,
-				sizeof(void *), page_size, socket_id);
+				sizeof(void *), page_size, numa_id);
 	if (!new->q.info) {
 		IONIC_PRINT(ERR, "Cannot allocate queue info");
 		err = -ENOMEM;
@@ -662,7 +662,7 @@ ionic_qcq_alloc(struct ionic_lif *lif,
 
 	new->base_z = rte_eth_dma_zone_reserve(lif->eth_dev,
 		type_name, index /* queue_idx */,
-		total_size, IONIC_ALIGN, socket_id);
+		total_size, IONIC_ALIGN, numa_id);
 
 	if (!new->base_z) {
 		IONIC_PRINT(ERR, "Cannot reserve queue DMA memory");
@@ -778,7 +778,7 @@ ionic_rx_seg_rearm_data(struct ionic_lif *lif)
 }
 
 int
-ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
+ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t numa_id, uint32_t index,
 		uint16_t nrxq_descs, struct rte_mempool *mb_pool,
 		struct ionic_rx_qcq **rxq_out)
 {
@@ -829,7 +829,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
 	err = ionic_qcq_alloc(lif,
 		IONIC_QTYPE_RXQ,
 		sizeof(struct ionic_rx_qcq),
-		socket_id,
+		numa_id,
 		index,
 		"rx",
 		flags,
@@ -855,7 +855,7 @@ ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
 }
 
 int
-ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
+ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t numa_id, uint32_t index,
 		uint16_t ntxq_descs, struct ionic_tx_qcq **txq_out)
 {
 	struct ionic_tx_qcq *txq;
@@ -874,7 +874,7 @@ ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index,
 	err = ionic_qcq_alloc(lif,
 		IONIC_QTYPE_TXQ,
 		sizeof(struct ionic_tx_qcq),
-		socket_id,
+		numa_id,
 		index,
 		"tx",
 		flags,
@@ -905,7 +905,7 @@ ionic_admin_qcq_alloc(struct ionic_lif *lif)
 	err = ionic_qcq_alloc(lif,
 		IONIC_QTYPE_ADMINQ,
 		sizeof(struct ionic_admin_qcq),
-		rte_socket_id(),
+		rte_numa_id(),
 		0,
 		"admin",
 		flags,
@@ -932,7 +932,7 @@ ionic_notify_qcq_alloc(struct ionic_lif *lif)
 	err = ionic_qcq_alloc(lif,
 		IONIC_QTYPE_NOTIFYQ,
 		sizeof(struct ionic_notify_qcq),
-		rte_socket_id(),
+		rte_numa_id(),
 		0,
 		"notify",
 		flags,
@@ -1045,7 +1045,7 @@ int
 ionic_lif_alloc(struct ionic_lif *lif)
 {
 	struct ionic_adapter *adapter = lif->adapter;
-	uint32_t socket_id = rte_socket_id();
+	uint32_t numa_id = rte_numa_id();
 	int err;
 
 	/*
@@ -1087,19 +1087,19 @@ ionic_lif_alloc(struct ionic_lif *lif)
 		return -ENOMEM;
 	}
 
-	lif->txqcqs = rte_calloc_socket("ionic",
+	lif->txqcqs = rte_calloc_numa("ionic",
 				adapter->max_ntxqs_per_lif,
 				sizeof(*lif->txqcqs),
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (!lif->txqcqs) {
 		IONIC_PRINT(ERR, "Cannot allocate tx queues array");
 		return -ENOMEM;
 	}
 
-	lif->rxqcqs = rte_calloc_socket("ionic",
+	lif->rxqcqs = rte_calloc_numa("ionic",
 				adapter->max_nrxqs_per_lif,
 				sizeof(*lif->rxqcqs),
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (!lif->rxqcqs) {
 		IONIC_PRINT(ERR, "Cannot allocate rx queues array");
 		return -ENOMEM;
@@ -1127,7 +1127,7 @@ ionic_lif_alloc(struct ionic_lif *lif)
 
 	lif->info_z = rte_eth_dma_zone_reserve(lif->eth_dev,
 		"lif_info", 0 /* queue_idx*/,
-		lif->info_sz, IONIC_ALIGN, socket_id);
+		lif->info_sz, IONIC_ALIGN, numa_id);
 	if (!lif->info_z) {
 		IONIC_PRINT(ERR, "Cannot allocate lif info memory");
 		return -ENOMEM;
@@ -1239,7 +1239,7 @@ ionic_lif_rss_setup(struct ionic_lif *lif)
 		lif->rss_ind_tbl_z = rte_eth_dma_zone_reserve(lif->eth_dev,
 					"rss_ind_tbl", 0 /* queue_idx */,
 					sizeof(*lif->rss_ind_tbl) * tbl_sz,
-					IONIC_ALIGN, rte_socket_id());
+					IONIC_ALIGN, rte_numa_id());
 		if (!lif->rss_ind_tbl_z) {
 			IONIC_PRINT(ERR, "OOM");
 			return -ENOMEM;
drivers/net/ionic/ionic_lif.h +2 -2
index 2d85ebbcae..38b7b12645 100644
@@ -221,10 +221,10 @@ int ionic_dev_promiscuous_disable(struct rte_eth_dev *dev);
 int ionic_dev_allmulticast_enable(struct rte_eth_dev *dev);
 int ionic_dev_allmulticast_disable(struct rte_eth_dev *dev);
 
-int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id,
+int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t numa_id,
 	uint32_t index, uint16_t nrxq_descs, struct rte_mempool *mp,
 	struct ionic_rx_qcq **qcq_out);
-int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id,
+int ionic_tx_qcq_alloc(struct ionic_lif *lif, uint32_t numa_id,
 	uint32_t index, uint16_t ntxq_descs,
 	struct ionic_tx_qcq **qcq_out);
 void ionic_qcq_free(struct ionic_qcq *qcq);
drivers/net/ionic/ionic_main.c +3 -3
index d5545b1ecb..f11e16ac8c 100644
@@ -463,7 +463,7 @@ ionic_port_identify(struct ionic_adapter *adapter)
 }
 
 static const struct rte_memzone *
-ionic_memzone_reserve(const char *name, uint32_t len, int socket_id)
+ionic_memzone_reserve(const char *name, uint32_t len, int numa_id)
 {
 	const struct rte_memzone *mz;
 
@@ -471,7 +471,7 @@ ionic_memzone_reserve(const char *name, uint32_t len, int socket_id)
 	if (mz)
 		return mz;
 
-	mz = rte_memzone_reserve_aligned(name, len, socket_id,
+	mz = rte_memzone_reserve_aligned(name, len, numa_id,
 		RTE_MEMZONE_IOVA_CONTIG, IONIC_ALIGN);
 	return mz;
 }
@@ -497,7 +497,7 @@ ionic_port_init(struct ionic_adapter *adapter)
 		IONIC_DRV_NAME, adapter->name);
 
 	idev->port_info_z = ionic_memzone_reserve(z_name, idev->port_info_sz,
-		SOCKET_ID_ANY);
+		RTE_NUMA_ID_ANY);
 	if (!idev->port_info_z) {
 		IONIC_PRINT(ERR, "Cannot reserve port info DMA memory");
 		return -ENOMEM;
drivers/net/ionic/ionic_rxtx.c +6 -6
index 339b20f113..d028b7d066 100644
@@ -132,7 +132,7 @@ ionic_dev_tx_queue_stop_secondhalf(struct rte_eth_dev *dev,
 
 int __rte_cold
 ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
-		uint16_t nb_desc, uint32_t socket_id,
+		uint16_t nb_desc, uint32_t numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
@@ -150,7 +150,7 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
 	offloads = tx_conf->offloads | eth_dev->data->dev_conf.txmode.offloads;
 	IONIC_PRINT(DEBUG,
 		"Configuring skt %u TX queue %u with %u buffers, offloads %jx",
-		socket_id, tx_queue_id, nb_desc, offloads);
+		numa_id, tx_queue_id, nb_desc, offloads);
 
 	/* Validate number of receive descriptors */
 	if (!rte_is_power_of_2(nb_desc) || nb_desc < IONIC_MIN_RING_DESC)
@@ -172,7 +172,7 @@ ionic_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id,
 	eth_dev->data->tx_queue_state[tx_queue_id] =
 		RTE_ETH_QUEUE_STATE_STOPPED;
 
-	err = ionic_tx_qcq_alloc(lif, socket_id, tx_queue_id, nb_desc, &txq);
+	err = ionic_tx_qcq_alloc(lif, numa_id, tx_queue_id, nb_desc, &txq);
 	if (err) {
 		IONIC_PRINT(DEBUG, "Queue allocation failure");
 		return -EINVAL;
@@ -536,7 +536,7 @@ int __rte_cold
 ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 		uint16_t rx_queue_id,
 		uint16_t nb_desc,
-		uint32_t socket_id,
+		uint32_t numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mp)
 {
@@ -555,7 +555,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	offloads = rx_conf->offloads | eth_dev->data->dev_conf.rxmode.offloads;
 	IONIC_PRINT(DEBUG,
 		"Configuring skt %u RX queue %u with %u buffers, offloads %jx",
-		socket_id, rx_queue_id, nb_desc, offloads);
+		numa_id, rx_queue_id, nb_desc, offloads);
 
 	if (!rx_conf->rx_drop_en)
 		IONIC_PRINT(WARNING, "No-drop mode is not supported");
@@ -579,7 +579,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,
 	eth_dev->data->rx_queue_state[rx_queue_id] =
 		RTE_ETH_QUEUE_STATE_STOPPED;
 
-	err = ionic_rx_qcq_alloc(lif, socket_id, rx_queue_id, nb_desc, mp,
+	err = ionic_rx_qcq_alloc(lif, numa_id, rx_queue_id, nb_desc, mp,
 			&rxq);
 	if (err) {
 		IONIC_PRINT(ERR, "Queue %d allocation failure", rx_queue_id);
drivers/net/ionic/ionic_rxtx.h +2 -2
index b3e4e5e5b3..d8337a247d 100644
@@ -33,14 +33,14 @@ extern const uint32_t ionic_ptype_table[IONIC_RXQ_COMP_PKT_TYPE_MASK];
 
 /* ionic_rxtx.c */
 int ionic_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-	uint16_t nb_desc, uint32_t socket_id,
+	uint16_t nb_desc, uint32_t numa_id,
 	const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 void ionic_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 int ionic_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 int ionic_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);
 
 int ionic_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-	uint16_t nb_desc,  uint32_t socket_id,
+	uint16_t nb_desc,  uint32_t numa_id,
 	const struct rte_eth_txconf *tx_conf);
 void ionic_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 int ionic_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
Signature · 1 line
2.55.0
#128 lore raw

PATCH 126/227 net/mana: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/mana/mana.c | 54 ++++++++++++++++++++---------------------
 drivers/net/mana/mr.c   |  4 +--
 2 files changed, 29 insertions(+), 29 deletions(-)
drivers/net/mana/mana.c +27 -27
index c14b522b8a..de92e377a6 100644
@@ -68,7 +68,7 @@ mana_alloc_verbs_buf(size_t size, void *data)
 		return NULL;
 	}
 
-	ret = rte_zmalloc_socket("mana_verb_buf", size, alignment, socket);
+	ret = rte_zmalloc_numa("mana_verb_buf", size, alignment, socket);
 	if (!ret && size)
 		rte_errno = ENOMEM;
 	return ret;
@@ -565,7 +565,7 @@ mana_rss_hash_conf_get(struct rte_eth_dev *dev,
 
 static int
 mana_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_txconf *tx_conf __rte_unused)
 
 {
@@ -573,27 +573,27 @@ mana_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	struct mana_txq *txq;
 	int ret;
 
-	txq = rte_zmalloc_socket("mana_txq", sizeof(*txq), 0, socket_id);
+	txq = rte_zmalloc_numa("mana_txq", sizeof(*txq), 0, numa_id);
 	if (!txq) {
 		DRV_LOG(ERR, "failed to allocate txq");
 		return -ENOMEM;
 	}
 
-	txq->socket = socket_id;
+	txq->socket = numa_id;
 
-	txq->desc_ring = rte_malloc_socket("mana_tx_desc_ring",
+	txq->desc_ring = rte_malloc_numa("mana_tx_desc_ring",
 					   sizeof(struct mana_txq_desc) *
 						nb_desc,
-					   RTE_CACHE_LINE_SIZE, socket_id);
+					   RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq->desc_ring) {
 		DRV_LOG(ERR, "failed to allocate txq desc_ring");
 		ret = -ENOMEM;
 		goto fail;
 	}
 
-	txq->gdma_comp_buf = rte_malloc_socket("mana_txq_comp",
+	txq->gdma_comp_buf = rte_malloc_numa("mana_txq_comp",
 			sizeof(*txq->gdma_comp_buf) * nb_desc,
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (!txq->gdma_comp_buf) {
 		DRV_LOG(ERR, "failed to allocate txq comp");
 		ret = -ENOMEM;
@@ -601,14 +601,14 @@ mana_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	}
 
 	ret = mana_mr_btree_init(&txq->mr_btree,
-				 MANA_MR_BTREE_PER_QUEUE_N, socket_id);
+				 MANA_MR_BTREE_PER_QUEUE_N, numa_id);
 	if (ret) {
 		DRV_LOG(ERR, "Failed to init TXQ MR btree");
 		goto fail;
 	}
 
 	DRV_LOG(DEBUG, "idx %u nb_desc %u socket %u txq->desc_ring %p",
-		queue_idx, nb_desc, socket_id, txq->desc_ring);
+		queue_idx, nb_desc, numa_id, txq->desc_ring);
 
 	txq->desc_ring_head = 0;
 	txq->desc_ring_tail = 0;
@@ -627,7 +627,7 @@ mana_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 static int
 mana_dev_tx_queue_setup_lock(struct rte_eth_dev *dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_txconf *tx_conf)
 {
 	struct mana_priv *priv = dev->data->dev_private;
@@ -636,7 +636,7 @@ mana_dev_tx_queue_setup_lock(struct rte_eth_dev *dev, uint16_t queue_idx,
 	if (mana_reset_trylock(priv))
 		return -EBUSY;
 	ret = mana_dev_tx_queue_setup(dev, queue_idx,
-				      nb_desc, socket_id, tx_conf);
+				      nb_desc, numa_id, tx_conf);
 	pthread_mutex_unlock(&priv->reset_ops_lock);
 	return ret;
 }
@@ -655,7 +655,7 @@ mana_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 
 static int
 mana_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			uint16_t nb_desc, unsigned int socket_id,
+			uint16_t nb_desc, unsigned int numa_id,
 			const struct rte_eth_rxconf *rx_conf __rte_unused,
 			struct rte_mempool *mp)
 {
@@ -663,21 +663,21 @@ mana_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	struct mana_rxq *rxq;
 	int ret;
 
-	rxq = rte_zmalloc_socket("mana_rxq", sizeof(*rxq), 0, socket_id);
+	rxq = rte_zmalloc_numa("mana_rxq", sizeof(*rxq), 0, numa_id);
 	if (!rxq) {
 		DRV_LOG(ERR, "failed to allocate rxq");
 		return -ENOMEM;
 	}
 
 	DRV_LOG(DEBUG, "idx %u nb_desc %u socket %u",
-		queue_idx, nb_desc, socket_id);
+		queue_idx, nb_desc, numa_id);
 
-	rxq->socket = socket_id;
+	rxq->socket = numa_id;
 
-	rxq->desc_ring = rte_zmalloc_socket("mana_rx_mbuf_ring",
+	rxq->desc_ring = rte_zmalloc_numa("mana_rx_mbuf_ring",
 					    sizeof(struct mana_rxq_desc) *
 						nb_desc,
-					    RTE_CACHE_LINE_SIZE, socket_id);
+					    RTE_CACHE_LINE_SIZE, numa_id);
 
 	if (!rxq->desc_ring) {
 		DRV_LOG(ERR, "failed to allocate rxq desc_ring");
@@ -688,9 +688,9 @@ mana_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	rxq->desc_ring_head = 0;
 	rxq->desc_ring_tail = 0;
 
-	rxq->gdma_comp_buf = rte_malloc_socket("mana_rxq_comp",
+	rxq->gdma_comp_buf = rte_malloc_numa("mana_rxq_comp",
 			sizeof(*rxq->gdma_comp_buf) * nb_desc,
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->gdma_comp_buf) {
 		DRV_LOG(ERR, "failed to allocate rxq comp");
 		ret = -ENOMEM;
@@ -698,7 +698,7 @@ mana_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	}
 
 	ret = mana_mr_btree_init(&rxq->mr_btree,
-				 MANA_MR_BTREE_PER_QUEUE_N, socket_id);
+				 MANA_MR_BTREE_PER_QUEUE_N, numa_id);
 	if (ret) {
 		DRV_LOG(ERR, "Failed to init RXQ MR btree");
 		goto fail;
@@ -720,7 +720,7 @@ mana_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 
 static int
 mana_dev_rx_queue_setup_lock(struct rte_eth_dev *dev, uint16_t queue_idx,
-			     uint16_t nb_desc, unsigned int socket_id,
+			     uint16_t nb_desc, unsigned int numa_id,
 			     const struct rte_eth_rxconf *rx_conf __rte_unused,
 			     struct rte_mempool *mp)
 {
@@ -730,7 +730,7 @@ mana_dev_rx_queue_setup_lock(struct rte_eth_dev *dev, uint16_t queue_idx,
 	if (mana_reset_trylock(priv))
 		return -EBUSY;
 	ret = mana_dev_rx_queue_setup(dev, queue_idx, nb_desc,
-				      socket_id, rx_conf, mp);
+				      numa_id, rx_conf, mp);
 	pthread_mutex_unlock(&priv->reset_ops_lock);
 	return ret;
 }
@@ -1999,7 +1999,7 @@ mana_proc_priv_init(struct rte_eth_dev *dev)
 {
 	struct mana_process_priv *priv;
 
-	priv = rte_zmalloc_socket("mana_proc_priv",
+	priv = rte_zmalloc_numa("mana_proc_priv",
 				  sizeof(struct mana_process_priv),
 				  RTE_CACHE_LINE_SIZE,
 				  dev->device->numa_node);
@@ -2054,7 +2054,7 @@ mana_init_shared_data(void)
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		mana_shared_mz = rte_memzone_reserve(MZ_MANA_SHARED_DATA,
 						     sizeof(*mana_shared_data),
-						     SOCKET_ID_ANY, 0);
+						     RTE_NUMA_ID_ANY, 0);
 		if (!mana_shared_mz) {
 			DRV_LOG(ERR, "Cannot allocate mana shared data");
 			ret = -rte_errno;
@@ -2168,8 +2168,8 @@ mana_probe_port(struct ibv_device *ibdev, struct ibv_device_attr_ex *dev_attr,
 		DRV_LOG(DEBUG, "Device reset for eth_dev %p priv %p",
 			eth_dev, priv);
 	} else {
-		priv = rte_zmalloc_socket(NULL, sizeof(*priv), RTE_CACHE_LINE_SIZE,
-					  SOCKET_ID_ANY);
+		priv = rte_zmalloc_numa(NULL, sizeof(*priv), RTE_CACHE_LINE_SIZE,
+					  RTE_NUMA_ID_ANY);
 		if (!priv)
 			return -ENOMEM;
 	}
drivers/net/mana/mr.c +2 -2
index 0ce1a76ed5..3de6a901dc 100644
@@ -219,7 +219,7 @@ mana_mr_btree_expand(struct mana_mr_btree *bt, int n)
 {
 	void *mem;
 
-	mem = rte_realloc_socket(bt->table, n * sizeof(struct mana_mr_cache),
+	mem = rte_realloc_numa(bt->table, n * sizeof(struct mana_mr_cache),
 				 0, bt->socket);
 	if (!mem) {
 		DP_LOG(ERR, "Failed to expand btree size %d", n);
@@ -287,7 +287,7 @@ int
 mana_mr_btree_init(struct mana_mr_btree *bt, int n, int socket)
 {
 	memset(bt, 0, sizeof(*bt));
-	bt->table = rte_calloc_socket("MANA B-tree table",
+	bt->table = rte_calloc_numa("MANA B-tree table",
 				      n,
 				      sizeof(struct mana_mr_cache),
 				      0, socket);
Signature · 1 line
2.55.0
#129 lore raw

PATCH 127/227 net/memif: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/memif/rte_eth_memif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/memif/rte_eth_memif.c +2 -2
index 0680dc3947..7df31141c2 100644
@@ -1765,7 +1765,7 @@ static int
 memif_tx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t qid,
 		     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 *pmd = dev->data->dev_private;
@@ -1802,7 +1802,7 @@ static int
 memif_rx_queue_setup(struct rte_eth_dev *dev,
 		     uint16_t qid,
 		     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)
 {
Signature · 1 line
2.55.0
#130 lore raw

PATCH 128/227 net/mlx4: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/mlx4/mlx4.c       |  8 ++++----
 drivers/net/mlx4/mlx4_mr.c    | 12 ++++++------
 drivers/net/mlx4/mlx4_utils.c | 14 +++++++-------
 3 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/mlx4/mlx4.c +4 -4
index dbcd98d49f..eb70d96136 100644
@@ -104,7 +104,7 @@ mlx4_init_shared_data(void)
 			/* Allocate shared memory. */
 			mz = rte_memzone_reserve(MZ_MLX4_PMD_SHARED_DATA,
 						 sizeof(*mlx4_shared_data),
-						 SOCKET_ID_ANY, 0);
+						 RTE_NUMA_ID_ANY, 0);
 			if (mz == NULL) {
 				ERROR("Cannot allocate mlx4 shared data");
 				ret = -rte_errno;
@@ -151,7 +151,7 @@ mlx4_alloc_verbs_buf(size_t size, void *data)
 	struct mlx4_priv *priv = data;
 	void *ret;
 	size_t alignment = sysconf(_SC_PAGESIZE);
-	unsigned int socket = SOCKET_ID_ANY;
+	unsigned int socket = RTE_NUMA_ID_ANY;
 
 	if (priv->verbs_alloc_ctx.type == MLX4_VERBS_ALLOC_TYPE_TX_QUEUE) {
 		const struct txq *txq = priv->verbs_alloc_ctx.obj;
@@ -164,7 +164,7 @@ mlx4_alloc_verbs_buf(size_t size, void *data)
 		socket = rxq->socket;
 	}
 	MLX4_ASSERT(data != NULL);
-	ret = rte_malloc_socket(__func__, size, alignment, socket);
+	ret = rte_malloc_numa(__func__, size, alignment, socket);
 	if (!ret && size)
 		rte_errno = ENOMEM;
 	return ret;
@@ -208,7 +208,7 @@ mlx4_proc_priv_init(struct rte_eth_dev *dev)
 	 */
 	ppriv_size = sizeof(struct mlx4_proc_priv) +
 		     dev->data->nb_tx_queues * sizeof(void *);
-	ppriv = rte_zmalloc_socket("mlx4_proc_priv", ppriv_size,
+	ppriv = rte_zmalloc_numa("mlx4_proc_priv", ppriv_size,
 				   RTE_CACHE_LINE_SIZE, dev->device->numa_node);
 	if (!ppriv) {
 		rte_errno = ENOMEM;
drivers/net/mlx4/mlx4_mr.c +6 -6
index 5e2c2dbf85..5499029159 100644
@@ -71,7 +71,7 @@ mr_btree_expand(struct mlx4_mr_btree *bt, int n)
 	if (n <= bt->size)
 		return ret;
 	/*
-	 * Downside of directly using rte_realloc() is that SOCKET_ID_ANY is
+	 * Downside of directly using rte_realloc() is that RTE_NUMA_ID_ANY is
 	 * used inside if there's no room to expand. Because this is a quite
 	 * rare case and a part of very slow path, it is very acceptable.
 	 * Initially cache_bh[] will be given practically enough space and once
@@ -206,7 +206,7 @@ mlx4_mr_btree_init(struct mlx4_mr_btree *bt, int n, int socket)
 		return -rte_errno;
 	}
 	memset(bt, 0, sizeof(*bt));
-	bt->table = rte_calloc_socket("B-tree table",
+	bt->table = rte_calloc_numa("B-tree table",
 				      n, sizeof(struct mlx4_mr_cache),
 				      0, socket);
 	if (bt->table == NULL) {
@@ -658,11 +658,11 @@ mlx4_mr_create_primary(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 	      data.start, data.end, msl->page_sz, ms_n);
 	/* Size of memory for bitmap. */
 	bmp_size = rte_bitmap_get_memory_footprint(ms_n);
-	mr = rte_zmalloc_socket(NULL,
+	mr = rte_zmalloc_numa(NULL,
 				RTE_ALIGN_CEIL(sizeof(*mr),
 					       RTE_CACHE_LINE_SIZE) +
 				bmp_size,
-				RTE_CACHE_LINE_SIZE, msl->socket_id);
+				RTE_CACHE_LINE_SIZE, msl->numa_id);
 	if (mr == NULL) {
 		WARN("port %u unable to allocate memory for a new MR of"
 		     " address (%p).",
@@ -773,7 +773,7 @@ mlx4_mr_create_primary(struct rte_eth_dev *dev, struct mlx4_mr_cache *entry,
 	/*
 	 * Finally create a verbs MR for the memory chunk. ibv_reg_mr() can be
 	 * called with holding the memory lock because it doesn't use
-	 * mlx4_alloc_buf_extern() which eventually calls rte_malloc_socket()
+	 * mlx4_alloc_buf_extern() which eventually calls rte_malloc_numa()
 	 * through mlx4_alloc_verbs_buf().
 	 */
 	mr->ibv_mr = mlx4_glue->reg_mr(priv->pd, (void *)data.start, len,
@@ -1223,7 +1223,7 @@ mlx4_mr_update_ext_mp_cb(struct rte_mempool *mp, void *opaque,
 	rte_rwlock_read_unlock(&priv->mr.rwlock);
 	if (lkey != UINT32_MAX)
 		return;
-	mr = rte_zmalloc_socket(NULL,
+	mr = rte_zmalloc_numa(NULL,
 				RTE_ALIGN_CEIL(sizeof(*mr),
 					       RTE_CACHE_LINE_SIZE),
 				RTE_CACHE_LINE_SIZE, mp->numa_id);
drivers/net/mlx4/mlx4_utils.c +7 -7
index 614dc197d9..3615bfa5b9 100644
@@ -81,9 +81,9 @@ mlx4_mallocv_inline(const char *type, const struct mlx4_malloc_vec *vec,
 	if (fill)
 		return size;
 	if (!zero)
-		data = rte_malloc_socket(type, size, least, socket);
+		data = rte_malloc_numa(type, size, least, socket);
 	else
-		data = rte_zmalloc_socket(type, size, least, socket);
+		data = rte_zmalloc_numa(type, size, least, socket);
 	if (data) {
 		fill = 1;
 		goto fill;
@@ -138,7 +138,7 @@ size_t
 mlx4_mallocv(const char *type, const struct mlx4_malloc_vec *vec,
 	     unsigned int cnt)
 {
-	return mlx4_mallocv_inline(type, vec, cnt, 0, SOCKET_ID_ANY);
+	return mlx4_mallocv_inline(type, vec, cnt, 0, RTE_NUMA_ID_ANY);
 }
 
 /**
@@ -151,7 +151,7 @@ size_t
 mlx4_zmallocv(const char *type, const struct mlx4_malloc_vec *vec,
 	      unsigned int cnt)
 {
-	return mlx4_mallocv_inline(type, vec, cnt, 1, SOCKET_ID_ANY);
+	return mlx4_mallocv_inline(type, vec, cnt, 1, RTE_NUMA_ID_ANY);
 }
 
 /**
@@ -160,11 +160,11 @@ mlx4_zmallocv(const char *type, const struct mlx4_malloc_vec *vec,
  * This function takes one additional parameter.
  *
  * @param socket
- *   NUMA socket to allocate memory on. If SOCKET_ID_ANY is used, this
+ *   NUMA socket to allocate memory on. If RTE_NUMA_ID_ANY is used, this
  *   function will behave the same as mlx4_mallocv().
  *
  * @see mlx4_mallocv()
- * @see rte_malloc_socket()
+ * @see rte_malloc_numa()
  */
 size_t
 mlx4_mallocv_socket(const char *type, const struct mlx4_malloc_vec *vec,
@@ -178,7 +178,7 @@ mlx4_mallocv_socket(const char *type, const struct mlx4_malloc_vec *vec,
  * mlx4_zmalloc_socket().
  *
  * @see mlx4_mallocv_socket()
- * @see rte_zmalloc_socket()
+ * @see rte_zmalloc_numa()
  */
 size_t
 mlx4_zmallocv_socket(const char *type, const struct mlx4_malloc_vec *vec,
Signature · 1 line
2.55.0
#131 lore raw

PATCH 129/227 net/mvneta: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/mvneta/mvneta_ethdev.c | 2 +-
 drivers/net/mvneta/mvneta_rxtx.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/mvneta/mvneta_ethdev.c +1 -1
index 975d3da81e..a58a5df6d9 100644
@@ -814,7 +814,7 @@ mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name)
 	if (!eth_dev)
 		return -ENOMEM;
 
-	priv = rte_zmalloc_socket(name, sizeof(*priv), 0, rte_socket_id());
+	priv = rte_zmalloc_numa(name, sizeof(*priv), 0, rte_numa_id());
 	if (!priv) {
 		ret = -ENOMEM;
 		goto out_free;
drivers/net/mvneta/mvneta_rxtx.c +2 -2
index 952e982275..e46050bd76 100644
@@ -731,7 +731,7 @@ mvneta_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		dev->data->rx_queues[idx] = NULL;
 	}
 
-	rxq = rte_zmalloc_socket("rxq", sizeof(*rxq), 0, socket);
+	rxq = rte_zmalloc_numa("rxq", sizeof(*rxq), 0, socket);
 	if (!rxq)
 		return -ENOMEM;
 
@@ -780,7 +780,7 @@ mvneta_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		dev->data->tx_queues[idx] = NULL;
 	}
 
-	txq = rte_zmalloc_socket("txq", sizeof(*txq), 0, socket);
+	txq = rte_zmalloc_numa("txq", sizeof(*txq), 0, socket);
 	if (!txq)
 		return -ENOMEM;
 
Signature · 1 line
2.55.0
#132 lore raw

PATCH 130/227 net/mvpp2: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
 drivers/net/mvpp2/mrvl_flow.c   | 8 ++++----
 drivers/net/mvpp2/mrvl_mtr.c    | 4 ++--
 drivers/net/mvpp2/mrvl_qos.c    | 4 ++--
 drivers/net/mvpp2/mrvl_tm.c     | 6 +++---
 5 files changed, 14 insertions(+), 14 deletions(-)
drivers/net/mvpp2/mrvl_ethdev.c +3 -3
index 9be3e5a92d..695031ca6c 100644
@@ -2021,7 +2021,7 @@ mrvl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		dev->data->rx_queues[idx] = NULL;
 	}
 
-	rxq = rte_zmalloc_socket("rxq", sizeof(*rxq), 0, socket);
+	rxq = rte_zmalloc_numa("rxq", sizeof(*rxq), 0, socket);
 	if (!rxq)
 		return -ENOMEM;
 
@@ -2124,7 +2124,7 @@ mrvl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,
 		dev->data->tx_queues[idx] = NULL;
 	}
 
-	txq = rte_zmalloc_socket("txq", sizeof(*txq), 0, socket);
+	txq = rte_zmalloc_numa("txq", sizeof(*txq), 0, socket);
 	if (!txq)
 		return -ENOMEM;
 
@@ -3060,7 +3060,7 @@ mrvl_priv_create(const char *dev_name)
 	uint16_t max_frame_size;
 	int ret, bpool_bit;
 
-	priv = rte_zmalloc_socket(dev_name, sizeof(*priv), 0, rte_socket_id());
+	priv = rte_zmalloc_numa(dev_name, sizeof(*priv), 0, rte_numa_id());
 	if (!priv)
 		return NULL;
 
drivers/net/mvpp2/mrvl_flow.c +4 -4
index 9932e28edc..14b691eaf4 100644
@@ -35,13 +35,13 @@
 static int
 mrvl_alloc_key_mask(struct pp2_cls_rule_key_field *field)
 {
-	unsigned int id = rte_socket_id();
+	unsigned int id = rte_numa_id();
 
-	field->key = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
+	field->key = rte_zmalloc_numa(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
 	if (!field->key)
 		goto out;
 
-	field->mask = rte_zmalloc_socket(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
+	field->mask = rte_zmalloc_numa(NULL, MRVL_CLS_STR_SIZE_MAX, 0, id);
 	if (!field->mask)
 		goto out_mask;
 
@@ -1721,7 +1721,7 @@ mrvl_flow_create(struct rte_eth_dev *dev,
 		return NULL;
 	}
 
-	flow = rte_zmalloc_socket(NULL, sizeof(*flow), 0, rte_socket_id());
+	flow = rte_zmalloc_numa(NULL, sizeof(*flow), 0, rte_numa_id());
 	if (!flow)
 		return NULL;
 
drivers/net/mvpp2/mrvl_mtr.c +2 -2
index c07ac95ddc..f8ca04118b 100644
@@ -100,7 +100,7 @@ mrvl_meter_profile_add(struct rte_eth_dev *dev, uint32_t meter_profile_id,
 					  RTE_MTR_ERROR_TYPE_METER_PROFILE_ID,
 					  NULL, "Profile id already exists\n");
 
-	prof = rte_zmalloc_socket(NULL, sizeof(*prof), 0, rte_socket_id());
+	prof = rte_zmalloc_numa(NULL, sizeof(*prof), 0, rte_numa_id());
 	if (!prof)
 		return -rte_mtr_error_set(error, ENOMEM,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED,
@@ -347,7 +347,7 @@ mrvl_create(struct rte_eth_dev *dev, uint32_t mtr_id,
 					  RTE_MTR_ERROR_TYPE_MTR_ID, NULL,
 					  "Meter id already exists\n");
 
-	mtr = rte_zmalloc_socket(NULL, sizeof(*mtr), 0, rte_socket_id());
+	mtr = rte_zmalloc_numa(NULL, sizeof(*mtr), 0, rte_numa_id());
 	if (!mtr)
 		return -rte_mtr_error_set(error, ENOMEM,
 					  RTE_MTR_ERROR_TYPE_UNSPECIFIED,
drivers/net/mvpp2/mrvl_qos.c +2 -2
index e298da2724..d53a5c8d65 100644
@@ -936,9 +936,9 @@ setup_tc(struct pp2_ppio_tc_params *param, uint8_t inqs,
 	param->pools[0][1] = dummy_pool[bpool->pp2_id];
 	param->default_color = color;
 
-	inq_params = rte_zmalloc_socket("inq_params",
+	inq_params = rte_zmalloc_numa("inq_params",
 		inqs * sizeof(*inq_params),
-		0, rte_socket_id());
+		0, rte_numa_id());
 	if (!inq_params)
 		return -ENOMEM;
 
drivers/net/mvpp2/mrvl_tm.c +3 -3
index c5046490ae..09d349a794 100644
@@ -429,8 +429,8 @@ mrvl_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,
 					 RTE_TM_ERROR_TYPE_SHAPER_PROFILE_ID,
 					 NULL, "Profile id already exists\n");
 
-	profile = rte_zmalloc_socket(NULL, sizeof(*profile), 0,
-				     rte_socket_id());
+	profile = rte_zmalloc_numa(NULL, sizeof(*profile), 0,
+				     rte_numa_id());
 	if (!profile)
 		return -rte_tm_error_set(error, ENOMEM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
@@ -657,7 +657,7 @@ mrvl_node_add(struct rte_eth_dev *dev, uint32_t node_id,
 					 RTE_TM_ERROR_TYPE_NODE_ID,
 					 NULL, "Node id already exists\n");
 
-	node = rte_zmalloc_socket(NULL, sizeof(*node), 0, rte_socket_id());
+	node = rte_zmalloc_numa(NULL, sizeof(*node), 0, rte_numa_id());
 	if (!node)
 		return -rte_tm_error_set(error, ENOMEM,
 					 RTE_TM_ERROR_TYPE_UNSPECIFIED,
Signature · 1 line
2.55.0
#133 lore raw

PATCH 131/227 net/nbl: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/nbl/nbl_common/nbl_common.c   |  2 +-
 drivers/net/nbl/nbl_dev/nbl_dev.c         |  8 ++++----
 drivers/net/nbl/nbl_dev/nbl_dev.h         |  4 ++--
 drivers/net/nbl/nbl_hw/nbl_txrx.c         | 14 +++++++-------
 drivers/net/nbl/nbl_include/nbl_include.h |  4 ++--
 5 files changed, 16 insertions(+), 16 deletions(-)
drivers/net/nbl/nbl_common/nbl_common.c +1 -1
index bded42c358..0d63a04b74 100644
@@ -21,7 +21,7 @@ void *nbl_alloc_dma_mem(struct nbl_dma_mem *mem, uint32_t size)
 		return NULL;
 
 	snprintf(z_name, sizeof(z_name), "nbl_dma_%u", nbl_dma_memzone_id++);
-	mz = rte_memzone_reserve_bounded(z_name, size, SOCKET_ID_ANY, 0,
+	mz = rte_memzone_reserve_bounded(z_name, size, RTE_NUMA_ID_ANY, 0,
 					 0, RTE_PGSIZE_2M);
 	if (!mz)
 		return NULL;
drivers/net/nbl/nbl_dev/nbl_dev.c +4 -4
index d28eea082f..81d90a14e7 100644
@@ -355,7 +355,7 @@ int nbl_dev_port_close(struct rte_eth_dev *eth_dev)
 }
 
 int nbl_tx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
-		       u16 nb_desc, unsigned int socket_id, const struct rte_eth_txconf *conf)
+		       u16 nb_desc, unsigned int numa_id, const struct rte_eth_txconf *conf)
 {
 	struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
 	struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter);
@@ -367,7 +367,7 @@ int nbl_tx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
 
 	param.queue_idx = queue_idx;
 	param.nb_desc = nb_desc;
-	param.socket_id = socket_id;
+	param.numa_id = numa_id;
 	param.conf = conf;
 	param.product = adapter->caps.product_type;
 	param.bond_broadcast_check = NULL;
@@ -383,7 +383,7 @@ int nbl_tx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
 }
 
 int nbl_rx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
-		       u16 nb_desc, unsigned int socket_id,
+		       u16 nb_desc, unsigned int numa_id,
 		       const struct rte_eth_rxconf *conf, struct rte_mempool *mempool)
 {
 	struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
@@ -396,7 +396,7 @@ int nbl_rx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
 
 	param.queue_idx = queue_idx;
 	param.nb_desc = nb_desc;
-	param.socket_id = socket_id;
+	param.numa_id = numa_id;
 	param.conf = conf;
 	param.mempool = mempool;
 	param.product = adapter->caps.product_type;
drivers/net/nbl/nbl_dev/nbl_dev.h +2 -2
index bfe2b06deb..bdf2129b04 100644
@@ -78,9 +78,9 @@ int nbl_dev_port_start(struct rte_eth_dev *eth_dev);
 int nbl_dev_port_stop(struct rte_eth_dev *eth_dev);
 int nbl_dev_port_close(struct rte_eth_dev *eth_dev);
 int nbl_tx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
-		       u16 nb_desc, unsigned int socket_id, const struct rte_eth_txconf *conf);
+		       u16 nb_desc, unsigned int numa_id, const struct rte_eth_txconf *conf);
 int nbl_rx_queue_setup(struct rte_eth_dev *eth_dev, u16 queue_idx,
-		       u16 nb_desc, unsigned int socket_id,
+		       u16 nb_desc, unsigned int numa_id,
 		       const struct rte_eth_rxconf *conf, struct rte_mempool *mempool);
 void nbl_tx_queues_release(struct rte_eth_dev *eth_dev, uint16_t queue_id);
 void nbl_rx_queues_release(struct rte_eth_dev *eth_dev, uint16_t queue_id);
drivers/net/nbl/nbl_hw/nbl_txrx.c +7 -7
index 7beae85177..9587045832 100644
@@ -165,7 +165,7 @@ static int nbl_res_txrx_start_tx_ring(void *priv,
 	size = RTE_ALIGN_CEIL(sizeof(tx_ring->desc[0]) * param->nb_desc, 4096);
 	memzone = rte_eth_dma_zone_reserve(eth_dev, "tx_ring", param->queue_idx,
 					   size, RTE_CACHE_LINE_SIZE,
-					   param->socket_id);
+					   param->numa_id);
 	if (memzone == NULL) {
 		NBL_LOG(ERR, "reserve dma zone for tx ring failed");
 		goto alloc_dma_zone_failed;
@@ -176,7 +176,7 @@ static int nbl_res_txrx_start_tx_ring(void *priv,
 	snprintf(vq_hdr_name, sizeof(vq_hdr_name), "port%d_vq%d_hdr",
 			eth_dev->data->port_id, param->queue_idx);
 	net_hdr_mz = rte_memzone_reserve_aligned(vq_hdr_name, size,
-						 param->socket_id,
+						 param->numa_id,
 						 RTE_MEMZONE_IOVA_CONTIG,
 						 RTE_CACHE_LINE_SIZE);
 	if (net_hdr_mz == NULL) {
@@ -312,17 +312,17 @@ static int nbl_res_txrx_start_rx_ring(void *priv,
 		eth_dev->data->rx_queues[param->queue_idx] = NULL;
 	}
 
-	rx_ring = rte_zmalloc_socket("nbl_rxring", sizeof(*rx_ring),
-				 RTE_CACHE_LINE_SIZE, param->socket_id);
+	rx_ring = rte_zmalloc_numa("nbl_rxring", sizeof(*rx_ring),
+				 RTE_CACHE_LINE_SIZE, param->numa_id);
 	if (rx_ring == NULL) {
 		NBL_LOG(ERR, "allocate rx queue data structure failed");
 		return -ENOMEM;
 	}
 
 	size = sizeof(rx_ring->rx_entry[0]) * (param->nb_desc + NBL_DESC_PER_LOOP_VEC_MAX);
-	rx_ring->rx_entry = rte_zmalloc_socket("rxq rx_entry", size,
+	rx_ring->rx_entry = rte_zmalloc_numa("rxq rx_entry", size,
 					       RTE_CACHE_LINE_SIZE,
-					       param->socket_id);
+					       param->numa_id);
 	if (rx_ring->rx_entry == NULL) {
 		NBL_LOG(ERR, "allocate rx queue %d software ring failed", param->queue_idx);
 		goto alloc_rx_entry_failed;
@@ -331,7 +331,7 @@ static int nbl_res_txrx_start_rx_ring(void *priv,
 	size = sizeof(rx_ring->desc[0]) * (param->nb_desc + NBL_DESC_PER_LOOP_VEC_MAX);
 	memzone = rte_eth_dma_zone_reserve(eth_dev, "rx_ring", param->queue_idx,
 					   size, RTE_CACHE_LINE_SIZE,
-					   param->socket_id);
+					   param->numa_id);
 	if (memzone == NULL) {
 		NBL_LOG(ERR, "reserve dma zone for rx ring failed");
 		goto alloc_dma_zone_failed;
drivers/net/nbl/nbl_include/nbl_include.h +2 -2
index ba99b9f8e7..07549cf2f9 100644
@@ -82,7 +82,7 @@ struct nbl_func_caps {
 struct nbl_start_rx_ring_param {
 	u16 queue_idx;
 	u16 nb_desc;
-	u32 socket_id;
+	u32 numa_id;
 	enum nbl_product_type product;
 	const struct rte_eth_rxconf *conf;
 	struct rte_mempool *mempool;
@@ -91,7 +91,7 @@ struct nbl_start_rx_ring_param {
 struct nbl_start_tx_ring_param {
 	u16 queue_idx;
 	u16 nb_desc;
-	u32 socket_id;
+	u32 numa_id;
 	enum nbl_product_type product;
 	const struct rte_eth_txconf *conf;
 	bool (*bond_broadcast_check)(struct rte_mbuf *mbuf);
Signature · 1 line
2.55.0
#134 lore raw

PATCH 132/227 net/netvsc: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/netvsc/hn_ethdev.c |  6 +++---
 drivers/net/netvsc/hn_rxtx.c   | 30 +++++++++++++++---------------
 drivers/net/netvsc/hn_var.h    | 10 +++++-----
 drivers/net/netvsc/hn_vf.c     |  8 ++++----
 4 files changed, 27 insertions(+), 27 deletions(-)
drivers/net/netvsc/hn_ethdev.c +3 -3
index 5dc91f9503..ae21ade424 100644
@@ -163,7 +163,7 @@ eth_dev_vmbus_allocate(struct rte_vmbus_device *dev, size_t private_data_size)
 
 		if (private_data_size) {
 			eth_dev->data->dev_private =
-				rte_zmalloc_socket(name, private_data_size,
+				rte_zmalloc_numa(name, private_data_size,
 						     RTE_CACHE_LINE_SIZE, dev->device.numa_node);
 			if (!eth_dev->data->dev_private) {
 				PMD_DRV_LOG(NOTICE, "can not allocate driver data");
@@ -1987,7 +1987,7 @@ static int netvsc_init_once(void)
 	switch (rte_eal_process_type()) {
 	case RTE_PROC_PRIMARY:
 		netvsc_shared_mz = rte_memzone_reserve(MZ_NETVSC_SHARED_DATA,
-				sizeof(*netvsc_shared_data), SOCKET_ID_ANY, 0);
+				sizeof(*netvsc_shared_data), RTE_NUMA_ID_ANY, 0);
 		if (!netvsc_shared_mz) {
 			PMD_DRV_LOG(ERR, "Cannot allocate netvsc shared data");
 			return -rte_errno;
@@ -2091,7 +2091,7 @@ static int eth_hn_probe(struct rte_vmbus_driver *drv __rte_unused,
 		goto vmbus_alloc_failed;
 	}
 
-	process_priv = rte_zmalloc_socket("netvsc_proc_priv",
+	process_priv = rte_zmalloc_numa("netvsc_proc_priv",
 					  sizeof(struct hn_nvs_process_priv),
 					  RTE_CACHE_LINE_SIZE,
 					  dev->device.numa_node);
drivers/net/netvsc/hn_rxtx.c +15 -15
index 7987b70ce5..e18fb64f2e 100644
@@ -236,7 +236,7 @@ hn_rx_queue_free_common(struct hn_rx_queue *rxq)
 int
 hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		      uint16_t queue_idx, uint16_t nb_desc,
-		      unsigned int socket_id,
+		      unsigned int numa_id,
 		      const struct rte_eth_txconf *tx_conf)
 
 {
@@ -263,8 +263,8 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	txq = rte_zmalloc_socket("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE,
-				 socket_id);
+	txq = rte_zmalloc_numa("HN_TXQ", sizeof(*txq), RTE_CACHE_LINE_SIZE,
+				 numa_id);
 	if (!txq)
 		return -ENOMEM;
 
@@ -281,7 +281,7 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 		     name, nb_desc, sizeof(struct hn_txdesc));
 
 	txq->tx_rndis_mz = rte_memzone_reserve_aligned(name,
-			nb_desc * HN_RNDIS_PKT_ALIGNED, rte_socket_id(),
+			nb_desc * HN_RNDIS_PKT_ALIGNED, rte_numa_id(),
 			RTE_MEMZONE_IOVA_CONTIG, HN_RNDIS_PKT_ALIGNED);
 	if (!txq->tx_rndis_mz) {
 		err = -rte_errno;
@@ -307,7 +307,7 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	 * received
 	 */
 	if (queue_idx >= dev->data->nb_rx_queues) {
-		rxq = hn_rx_queue_alloc(hv, queue_idx, socket_id);
+		rxq = hn_rx_queue_alloc(hv, queue_idx, numa_id);
 
 		if (!rxq) {
 			err = -ENOMEM;
@@ -329,7 +329,7 @@ hn_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	hn_reset_txagg(txq);
 
 	err = hn_vf_tx_queue_setup(dev, queue_idx, nb_desc,
-				     socket_id, tx_conf);
+				     numa_id, tx_conf);
 	if (err == 0) {
 		dev->data->tx_queues[queue_idx] = txq;
 		if (rxq != NULL)
@@ -906,12 +906,12 @@ static void hn_nvs_handle_notify(struct rte_eth_dev *dev,
 
 struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
 				      uint16_t queue_id,
-				      unsigned int socket_id)
+				      unsigned int numa_id)
 {
 	struct hn_rx_queue *rxq;
 
-	rxq = rte_zmalloc_socket("HN_RXQ", sizeof(*rxq),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("HN_RXQ", sizeof(*rxq),
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq)
 		return NULL;
 
@@ -921,8 +921,8 @@ struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
 	rxq->port_id = hv->port_id;
 	rxq->queue_id = queue_id;
 	rxq->event_sz = HN_RXQ_EVENT_DEFAULT;
-	rxq->event_buf = rte_malloc_socket("HN_EVENTS", HN_RXQ_EVENT_DEFAULT,
-					   RTE_CACHE_LINE_SIZE, socket_id);
+	rxq->event_buf = rte_malloc_numa("HN_EVENTS", HN_RXQ_EVENT_DEFAULT,
+					   RTE_CACHE_LINE_SIZE, numa_id);
 	if (!rxq->event_buf) {
 		rte_free(rxq);
 		return NULL;
@@ -962,7 +962,7 @@ hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
 int
 hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		      uint16_t queue_idx, uint16_t nb_desc,
-		      unsigned int socket_id,
+		      unsigned int numa_id,
 		      const struct rte_eth_rxconf *rx_conf,
 		      struct rte_mempool *mp)
 {
@@ -982,7 +982,7 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		 * number of Rx queues, we may already have allocated an rxq.
 		 */
 		if (!dev->data->rx_queues[queue_idx])
-			rxq = hn_rx_queue_alloc(hv, queue_idx, socket_id);
+			rxq = hn_rx_queue_alloc(hv, queue_idx, numa_id);
 		else
 			rxq = dev->data->rx_queues[queue_idx];
 
@@ -1004,12 +1004,12 @@ hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 		 "hn_rx_%u_%u", dev->data->port_id, queue_idx);
 	rxq->rx_ring = rte_ring_create(ring_name,
 				       rte_align32pow2(nb_desc),
-				       socket_id, 0);
+				       numa_id, 0);
 	if (!rxq->rx_ring)
 		goto fail;
 
 	error = hn_vf_rx_queue_setup(dev, queue_idx, nb_desc,
-				     socket_id, rx_conf, mp);
+				     numa_id, rx_conf, mp);
 	if (error)
 		goto fail;
 
drivers/net/netvsc/hn_var.h +5 -5
index 7d9a950816..ad6180ef09 100644
@@ -205,7 +205,7 @@ int	hn_chim_init(struct rte_eth_dev *dev);
 void	hn_chim_uninit(struct rte_eth_dev *dev);
 int	hn_dev_link_update(struct rte_eth_dev *dev, int wait);
 int	hn_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-			      uint16_t nb_desc, unsigned int socket_id,
+			      uint16_t nb_desc, unsigned int numa_id,
 			      const struct rte_eth_txconf *tx_conf);
 void	hn_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 void	hn_dev_tx_queue_info(struct rte_eth_dev *dev, uint16_t queue_idx,
@@ -215,10 +215,10 @@ int	hn_dev_tx_descriptor_status(void *arg, uint16_t offset);
 
 struct hn_rx_queue *hn_rx_queue_alloc(struct hn_data *hv,
 				      uint16_t queue_id,
-				      unsigned int socket_id);
+				      unsigned int numa_id);
 int	hn_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			      uint16_t queue_idx, uint16_t nb_desc,
-			      unsigned int socket_id,
+			      unsigned int numa_id,
 			      const struct rte_eth_rxconf *rx_conf,
 			      struct rte_mempool *mp);
 void	hn_dev_rx_queue_info(struct rte_eth_dev *dev, uint16_t queue_id,
@@ -263,14 +263,14 @@ int	hn_vf_mc_addr_list(struct rte_eth_dev *dev,
 
 int	hn_vf_tx_queue_setup(struct rte_eth_dev *dev,
 			     uint16_t queue_idx, uint16_t nb_desc,
-			     unsigned int socket_id,
+			     unsigned int numa_id,
 			     const struct rte_eth_txconf *tx_conf);
 void	hn_vf_tx_queue_release(struct hn_data *hv, uint16_t queue_id);
 int	hn_vf_tx_queue_status(struct hn_data *hv, uint16_t queue_id, uint16_t offset);
 
 int	hn_vf_rx_queue_setup(struct rte_eth_dev *dev,
 			     uint16_t queue_idx, uint16_t nb_desc,
-			     unsigned int socket_id,
+			     unsigned int numa_id,
 			     const struct rte_eth_rxconf *rx_conf,
 			     struct rte_mempool *mp);
 void	hn_vf_rx_queue_release(struct hn_data *hv, uint16_t queue_id);
drivers/net/netvsc/hn_vf.c +4 -4
index 96e811278a..f226acfedb 100644
@@ -848,7 +848,7 @@ int hn_vf_mc_addr_list(struct rte_eth_dev *dev,
 
 int hn_vf_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx, uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_txconf *tx_conf)
 {
 	struct hn_data *hv = dev->data->dev_private;
@@ -860,7 +860,7 @@ int hn_vf_tx_queue_setup(struct rte_eth_dev *dev,
 	if (vf_dev)
 		ret = rte_eth_tx_queue_setup(vf_dev->data->port_id,
 					     queue_idx, nb_desc,
-					     socket_id, tx_conf);
+					     numa_id, tx_conf);
 	rte_rwlock_read_unlock(&hv->vf_lock);
 	return ret;
 }
@@ -881,7 +881,7 @@ void hn_vf_tx_queue_release(struct hn_data *hv, uint16_t queue_id)
 
 int hn_vf_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx, uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -894,7 +894,7 @@ int hn_vf_rx_queue_setup(struct rte_eth_dev *dev,
 	if (vf_dev)
 		ret = rte_eth_rx_queue_setup(vf_dev->data->port_id,
 					     queue_idx, nb_desc,
-					     socket_id, rx_conf, mp);
+					     numa_id, rx_conf, mp);
 	rte_rwlock_read_unlock(&hv->vf_lock);
 	return ret;
 }
Signature · 1 line
2.55.0
#135 lore raw

PATCH 133/227 net/nfb: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/nfb/nfb_ethdev.c | 2 +-
 drivers/net/nfb/nfb_rx.c     | 8 ++++----
 drivers/net/nfb/nfb_rx.h     | 2 +-
 drivers/net/nfb/nfb_tx.c     | 8 ++++----
 drivers/net/nfb/nfb_tx.h     | 2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/nfb/nfb_ethdev.c +1 -1
index ba7c849a4b..795abcd9ac 100644
@@ -763,7 +763,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev, void *init_data)
 	struct rte_ether_addr eth_addr_init;
 	uint16_t max_rx_queues, max_tx_queues;
 
-	internals = rte_zmalloc_socket("nfb_internals",
+	internals = rte_zmalloc_numa("nfb_internals",
 			sizeof(struct pmd_internals), RTE_CACHE_LINE_SIZE,
 			dev->device->numa_node);
 	if (internals == NULL) {
drivers/net/nfb/nfb_rx.c +4 -4
index 5b8579e280..0d8a515a1f 100644
@@ -56,7 +56,7 @@ int
 nfb_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)
 {
@@ -70,11 +70,11 @@ nfb_eth_rx_queue_setup(struct rte_eth_dev *dev,
 	if (rx_queue_id >= priv->max_rx_queues)
 		return -EINVAL;
 
-	rxq = rte_zmalloc_socket("ndp rx queue", sizeof(struct ndp_rx_queue),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ndp rx queue", sizeof(struct ndp_rx_queue),
+			RTE_CACHE_LINE_SIZE, numa_id);
 
 	if (rxq == NULL) {
-		NFB_LOG(ERR, "rte_zmalloc_socket() failed for rx queue id %" PRIu16,
+		NFB_LOG(ERR, "rte_zmalloc_numa() failed for rx queue id %u",
 			rx_queue_id);
 		return -ENOMEM;
 	}
drivers/net/nfb/nfb_rx.h +1 -1
index 831945c577..453245f6fe 100644
@@ -87,7 +87,7 @@ int
 nfb_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);
 
drivers/net/nfb/nfb_tx.c +4 -4
index 1a7dcc3d30..fb9791eab9 100644
@@ -50,7 +50,7 @@ int
 nfb_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 pmd_internals *internals = dev->process_private;
@@ -63,11 +63,11 @@ nfb_eth_tx_queue_setup(struct rte_eth_dev *dev,
 	if (tx_queue_id >= priv->max_tx_queues)
 		return -EINVAL;
 
-	txq = rte_zmalloc_socket("ndp tx queue", sizeof(struct ndp_tx_queue),
-		RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("ndp tx queue", sizeof(struct ndp_tx_queue),
+		RTE_CACHE_LINE_SIZE, numa_id);
 
 	if (txq == NULL) {
-		NFB_LOG(ERR, "rte_zmalloc_socket() failed for tx queue id %" PRIu16,
+		NFB_LOG(ERR, "rte_zmalloc_numa() failed for tx queue id %u",
 			tx_queue_id);
 		return -ENOMEM;
 	}
drivers/net/nfb/nfb_tx.h +1 -1
index c253af1a86..0b6aad50e6 100644
@@ -45,7 +45,7 @@ int
 nfb_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);
 
 /**
Signature · 1 line
2.55.0
#136 lore raw

PATCH 134/227 net/nfp: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/nfp/flower/nfp_flower.c           | 16 +++++++--------
 .../net/nfp/flower/nfp_flower_representor.c   | 20 +++++++++----------
 drivers/net/nfp/nfd3/nfp_nfd3.h               |  2 +-
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c            | 12 +++++------
 drivers/net/nfp/nfdk/nfp_nfdk.h               |  2 +-
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c            | 12 +++++------
 drivers/net/nfp/nfp_net_common.c              |  2 +-
 drivers/net/nfp/nfp_rxtx.c                    | 18 ++++++++---------
 drivers/net/nfp/nfp_rxtx.h                    |  4 ++--
 drivers/net/nfp/nfpcore/nfp_sync.c            |  2 +-
 10 files changed, 45 insertions(+), 45 deletions(-)
drivers/net/nfp/flower/nfp_flower.c +8 -8
index 14a8992376..b8c061c657 100644
@@ -380,7 +380,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_app_fw_flower *app_fw_flower,
 	pci_name = strchr(pf_dev->pci_dev->name, ':') + 1;
 
 	/* Create a mbuf pool for the ctrl vNIC */
-	numa_node = rte_socket_id();
+	numa_node = rte_numa_id();
 	snprintf(ctrl_pktmbuf_pool_name, sizeof(ctrl_pktmbuf_pool_name),
 			"%s_ctrlmp", pci_name);
 	app_fw_flower->ctrl_pktmbuf_pool =
@@ -424,7 +424,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_app_fw_flower *app_fw_flower,
 	snprintf(ctrl_rxring_name, sizeof(ctrl_rxring_name), "%s_ctrx_ring", pci_name);
 	/* Set up the Rx queues */
 	for (i = 0; i < n_rxq; i++) {
-		rxq = rte_zmalloc_socket("ethdev RX queue",
+		rxq = rte_zmalloc_numa("ethdev RX queue",
 				sizeof(struct nfp_net_rxq), RTE_CACHE_LINE_SIZE,
 				numa_node);
 		if (rxq == NULL) {
@@ -473,7 +473,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_app_fw_flower *app_fw_flower,
 		rxq->rxds = tz->addr;
 
 		/* Mbuf pointers array for referencing mbufs linked to RX descriptors */
-		rxq->rxbufs = rte_zmalloc_socket("rxq->rxbufs",
+		rxq->rxbufs = rte_zmalloc_numa("rxq->rxbufs",
 				sizeof(*rxq->rxbufs) * CTRL_VNIC_NB_DESC,
 				RTE_CACHE_LINE_SIZE, numa_node);
 		if (rxq->rxbufs == NULL) {
@@ -499,7 +499,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_app_fw_flower *app_fw_flower,
 	snprintf(ctrl_txring_name, sizeof(ctrl_txring_name), "%s_cttx_ring", pci_name);
 	/* Set up the Tx queues */
 	for (i = 0; i < n_txq; i++) {
-		txq = rte_zmalloc_socket("ethdev TX queue",
+		txq = rte_zmalloc_numa("ethdev TX queue",
 				sizeof(struct nfp_net_txq), RTE_CACHE_LINE_SIZE,
 				numa_node);
 		if (txq == NULL) {
@@ -539,7 +539,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_app_fw_flower *app_fw_flower,
 		txq->txds = tz->addr;
 
 		/* Mbuf pointers array for referencing mbufs linked to TX descriptors */
-		txq->txbufs = rte_zmalloc_socket("txq->txbufs",
+		txq->txbufs = rte_zmalloc_numa("txq->txbufs",
 				sizeof(*txq->txbufs) * CTRL_VNIC_NB_DESC,
 				RTE_CACHE_LINE_SIZE, numa_node);
 		if (txq->txbufs == NULL) {
@@ -744,11 +744,11 @@ nfp_init_app_fw_flower(struct nfp_net_hw_priv *hw_priv)
 	struct nfp_app_fw_flower *app_fw_flower;
 	struct nfp_pf_dev *pf_dev = hw_priv->pf_dev;
 
-	numa_node = rte_socket_id();
+	numa_node = rte_numa_id();
 	id = nfp_function_id_get(pf_dev, 0);
 
 	/* Allocate memory for the Flower app */
-	app_fw_flower = rte_zmalloc_socket("nfp_app_fw_flower", sizeof(*app_fw_flower),
+	app_fw_flower = rte_zmalloc_numa("nfp_app_fw_flower", sizeof(*app_fw_flower),
 			RTE_CACHE_LINE_SIZE, numa_node);
 	if (app_fw_flower == NULL) {
 		PMD_INIT_LOG(ERR, "Could not malloc app fw flower.");
@@ -770,7 +770,7 @@ nfp_init_app_fw_flower(struct nfp_net_hw_priv *hw_priv)
 	}
 
 	/* Allocate memory for the PF AND ctrl vNIC here (hence the * 2) */
-	pf_hw = rte_zmalloc_socket("nfp_pf_vnic", 2 * sizeof(struct nfp_net_hw),
+	pf_hw = rte_zmalloc_numa("nfp_pf_vnic", 2 * sizeof(struct nfp_net_hw),
 			RTE_CACHE_LINE_SIZE, numa_node);
 	if (pf_hw == NULL) {
 		PMD_INIT_LOG(ERR, "Could not malloc nfp pf vnic.");
drivers/net/nfp/flower/nfp_flower_representor.c +10 -10
index 231a76980d..d75dbcbd4b 100644
@@ -249,7 +249,7 @@ static int
 nfp_flower_repr_rx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t rx_queue_id,
 		uint16_t nb_rx_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		__rte_unused const struct rte_eth_rxconf *rx_conf,
 		__rte_unused struct rte_mempool *mb_pool)
 {
@@ -262,14 +262,14 @@ nfp_flower_repr_rx_queue_setup(struct rte_eth_dev *dev,
 	pf_hw = repr->app_fw_flower->pf_hw;
 
 	/* Allocating rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct nfp_net_rxq),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct nfp_net_rxq),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL)
 		return -ENOMEM;
 
 	snprintf(ring_name, sizeof(ring_name), "%s-%s-%u", repr->name, "Rx", rx_queue_id);
 	repr->ring[rx_queue_id] = rte_ring_create(ring_name, nb_rx_desc,
-			rte_socket_id(), 0);
+			rte_numa_id(), 0);
 	if (repr->ring[rx_queue_id] == NULL) {
 		PMD_DRV_LOG(ERR, "The rte_ring_create failed for rx queue %u.", rx_queue_id);
 		rte_free(rxq);
@@ -288,7 +288,7 @@ static int
 nfp_flower_repr_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t tx_queue_id,
 		__rte_unused uint16_t nb_tx_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		__rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	struct nfp_net_txq *txq;
@@ -299,8 +299,8 @@ nfp_flower_repr_tx_queue_setup(struct rte_eth_dev *dev,
 	pf_hw = repr->app_fw_flower->pf_hw;
 
 	/* Allocating tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct nfp_net_txq),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct nfp_net_txq),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL)
 		return -ENOMEM;
 
@@ -886,8 +886,8 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
 	 * representor PMD will try to read from the ring.
 	 */
 	snprintf(ring_name, sizeof(ring_name), "%s_%s", init_repr_data->name, "ring");
-	numa_node = rte_socket_id();
-	repr->ring = rte_zmalloc_socket(ring_name,
+	numa_node = rte_numa_id();
+	repr->ring = rte_zmalloc_numa(ring_name,
 			sizeof(struct rte_ring *) * app_fw_flower->pf_hw->max_rx_queues,
 			RTE_CACHE_LINE_SIZE, numa_node);
 	if (repr->ring == NULL) {
@@ -897,7 +897,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
 
 	repr->repr_nb_qstats = RTE_MAX(app_fw_flower->pf_hw->max_rx_queues,
 			app_fw_flower->pf_hw->max_tx_queues);
-	repr->repr_qstats = rte_zmalloc_socket("nfp_repr_qstats",
+	repr->repr_qstats = rte_zmalloc_numa("nfp_repr_qstats",
 			sizeof(struct eth_queue_stats) * repr->repr_nb_qstats,
 			RTE_CACHE_LINE_SIZE, numa_node);
 	if (repr->repr_qstats == NULL) {
drivers/net/nfp/nfd3/nfp_nfd3.h +1 -1
index dc24f4fa1d..b8a42dcf15 100644
@@ -81,7 +81,7 @@ uint16_t nfp_net_nfd3_xmit_pkts(void *tx_queue,
 int nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 #endif /* __NFP_NFD3_H__ */
drivers/net/nfp/nfd3/nfp_nfd3_dp.c +6 -6
index 6466a5a4fb..1503934667 100644
@@ -374,7 +374,7 @@ int
 nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	size_t size;
@@ -421,8 +421,8 @@ nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocating tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct nfp_net_txq),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct nfp_net_txq),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL) {
 		PMD_DRV_LOG(ERR, "Error allocating tx dma.");
 		return -ENOMEM;
@@ -437,7 +437,7 @@ nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	size = sizeof(struct nfp_net_nfd3_tx_desc) * NFD3_TX_DESC_PER_PKT * max_tx_desc;
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, size,
-			NFP_MEMZONE_ALIGN, socket_id);
+			NFP_MEMZONE_ALIGN, numa_id);
 	if (tz == NULL) {
 		PMD_DRV_LOG(ERR, "Error allocating tx dma.");
 		nfp_net_tx_queue_release(dev, queue_idx);
@@ -459,9 +459,9 @@ nfp_net_nfd3_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->txds = tz->addr;
 
 	/* Mbuf pointers array for referencing mbufs linked to TX descriptors */
-	txq->txbufs = rte_zmalloc_socket("txq->txbufs",
+	txq->txbufs = rte_zmalloc_numa("txq->txbufs",
 			sizeof(*txq->txbufs) * txq->tx_count,
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->txbufs == NULL) {
 		nfp_net_tx_queue_release(dev, queue_idx);
 		dev->data->tx_queues[queue_idx] = NULL;
drivers/net/nfp/nfdk/nfp_nfdk.h +1 -1
index d843162be0..b0f5224acf 100644
@@ -216,7 +216,7 @@ uint16_t nfp_net_nfdk_xmit_pkts(void *tx_queue,
 int nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 int nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq,
 		struct rte_mbuf *pkt);
drivers/net/nfp/nfdk/nfp_nfdk_dp.c +6 -6
index 777550b6df..a039de9135 100644
@@ -408,7 +408,7 @@ int
 nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	size_t size;
@@ -457,8 +457,8 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocating tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct nfp_net_txq),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct nfp_net_txq),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL) {
 		PMD_DRV_LOG(ERR, "Error allocating tx dma.");
 		return -ENOMEM;
@@ -472,7 +472,7 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 	size = sizeof(struct nfp_net_nfdk_tx_desc) * max_tx_desc *
 			NFDK_TX_DESC_PER_SIMPLE_PKT;
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx, size,
-			NFP_MEMZONE_ALIGN, socket_id);
+			NFP_MEMZONE_ALIGN, numa_id);
 	if (tz == NULL) {
 		PMD_DRV_LOG(ERR, "Error allocating tx dma.");
 		nfp_net_tx_queue_release(dev, queue_idx);
@@ -493,9 +493,9 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->ktxds = tz->addr;
 
 	/* Mbuf pointers array for referencing mbufs linked to TX descriptors */
-	txq->txbufs = rte_zmalloc_socket("txq->txbufs",
+	txq->txbufs = rte_zmalloc_numa("txq->txbufs",
 			sizeof(*txq->txbufs) * txq->tx_count,
-			RTE_CACHE_LINE_SIZE, socket_id);
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->txbufs == NULL) {
 		nfp_net_tx_queue_release(dev, queue_idx);
 		return -ENOMEM;
drivers/net/nfp/nfp_net_common.c +1 -1
index 97841c00b5..ab0aa14ff4 100644
@@ -2269,7 +2269,7 @@ nfp_net_txrwb_alloc(struct rte_eth_dev *eth_dev)
 	snprintf(mz_name, sizeof(mz_name), "%s_TXRWB", eth_dev->data->name);
 	net_hw->txrwb_mz = rte_memzone_reserve_aligned(mz_name,
 			net_hw->max_tx_queues * sizeof(uint64_t),
-			rte_socket_id(),
+			rte_numa_id(),
 			RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
 	if (net_hw->txrwb_mz == NULL) {
 		PMD_INIT_LOG(ERR, "Failed to alloc %s for TX ring write back.",
drivers/net/nfp/nfp_rxtx.c +9 -9
index 19c8324549..b76c6ea7ed 100644
@@ -620,7 +620,7 @@ int
 nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mp)
 {
@@ -655,8 +655,8 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* Allocating rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct nfp_net_rxq),
-			RTE_CACHE_LINE_SIZE, socket_id);
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct nfp_net_rxq),
+			RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL)
 		return -ENOMEM;
 
@@ -687,7 +687,7 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
 	 */
 	tz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx,
 			sizeof(struct nfp_net_rx_desc) * max_rx_desc,
-			NFP_MEMZONE_ALIGN, socket_id);
+			NFP_MEMZONE_ALIGN, numa_id);
 	if (tz == NULL) {
 		PMD_DRV_LOG(ERR, "Error allocating rx dma.");
 		nfp_net_rx_queue_release(dev, queue_idx);
@@ -700,9 +700,9 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
 	rxq->rxds = tz->addr;
 
 	/* Mbuf pointers array for referencing mbufs linked to RX descriptors */
-	rxq->rxbufs = rte_zmalloc_socket("rxq->rxbufs",
+	rxq->rxbufs = rte_zmalloc_numa("rxq->rxbufs",
 			sizeof(*rxq->rxbufs) * nb_desc, RTE_CACHE_LINE_SIZE,
-			socket_id);
+			numa_id);
 	if (rxq->rxbufs == NULL) {
 		nfp_net_rx_queue_release(dev, queue_idx);
 		dev->data->rx_queues[queue_idx] = NULL;
@@ -838,7 +838,7 @@ int
 nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf)
 {
 	struct nfp_net_hw_priv *hw_priv;
@@ -847,10 +847,10 @@ nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 
 	if (hw_priv->pf_dev->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3)
 		return nfp_net_nfd3_tx_queue_setup(dev, queue_idx,
-				nb_desc, socket_id, tx_conf);
+				nb_desc, numa_id, tx_conf);
 	else
 		return nfp_net_nfdk_tx_queue_setup(dev, queue_idx,
-				nb_desc, socket_id, tx_conf);
+				nb_desc, numa_id, tx_conf);
 }
 
 void
drivers/net/nfp/nfp_rxtx.h +2 -2
index 95c7a85053..a4cde4d4dd 100644
@@ -226,7 +226,7 @@ uint16_t nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 void nfp_net_rx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
 void nfp_net_reset_rx_queue(struct nfp_net_rxq *rxq);
 int nfp_net_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
-		uint16_t nb_desc, unsigned int socket_id,
+		uint16_t nb_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mp);
 void nfp_net_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
@@ -235,7 +235,7 @@ void nfp_net_reset_tx_queue(struct nfp_net_txq *txq);
 int nfp_net_tx_queue_setup(struct rte_eth_dev *dev,
 		uint16_t queue_idx,
 		uint16_t nb_desc,
-		unsigned int socket_id,
+		unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 uint32_t nfp_net_tx_free_bufs(struct nfp_net_txq *txq);
 void nfp_net_rx_queue_info_get(struct rte_eth_dev *dev,
drivers/net/nfp/nfpcore/nfp_sync.c +1 -1
index 1b594257c6..a7a9465f65 100644
@@ -56,7 +56,7 @@ nfp_sync_alloc(void)
 		return sync;
 	}
 
-	mz = rte_memzone_reserve("nfp_sync",  sizeof(*sync), SOCKET_ID_ANY,
+	mz = rte_memzone_reserve("nfp_sync",  sizeof(*sync), RTE_NUMA_ID_ANY,
 			RTE_MEMZONE_SIZE_HINT_ONLY);
 	if (mz == NULL)
 		return NULL;
Signature · 1 line
2.55.0
#137 lore raw

PATCH 135/227 net/ngbe: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/ngbe/ngbe_ethdev.c |  2 +-
 drivers/net/ngbe/ngbe_ethdev.h |  4 ++--
 drivers/net/ngbe/ngbe_rxtx.c   | 28 ++++++++++++++--------------
 3 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/ngbe/ngbe_ethdev.c +1 -1
index dc8e65ecc2..2ad76e7a3c 100644
@@ -388,7 +388,7 @@ eth_ngbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)
 
 	/* Reserve memory for interrupt status block */
 	mz = rte_eth_dma_zone_reserve(eth_dev, "ngbe_driver", -1,
-		NGBE_ISB_SIZE, NGBE_ALIGN, SOCKET_ID_ANY);
+		NGBE_ISB_SIZE, NGBE_ALIGN, RTE_NUMA_ID_ANY);
 	if (mz == NULL)
 		return -ENOMEM;
 
drivers/net/ngbe/ngbe_ethdev.h +2 -2
index 12ee884ce1..6e6bee6391 100644
@@ -186,12 +186,12 @@ void ngbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 void ngbe_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);
 
 int  ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
-		uint16_t nb_rx_desc, unsigned int socket_id,
+		uint16_t nb_rx_desc, unsigned int numa_id,
 		const struct rte_eth_rxconf *rx_conf,
 		struct rte_mempool *mb_pool);
 
 int  ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
-		uint16_t nb_tx_desc, unsigned int socket_id,
+		uint16_t nb_tx_desc, unsigned int numa_id,
 		const struct rte_eth_txconf *tx_conf);
 
 int ngbe_dev_rx_queue_count(void *rx_queue);
drivers/net/ngbe/ngbe_rxtx.c +14 -14
index a1389de9c0..e4be3edc95 100644
@@ -2007,7 +2007,7 @@ int
 ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_txconf *tx_conf)
 {
 	const struct rte_memzone *tz;
@@ -2055,16 +2055,16 @@ ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* First allocate the Tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev Tx queue",
+	txq = rte_zmalloc_numa("ethdev Tx queue",
 				 sizeof(struct ngbe_tx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq == NULL)
 		return -ENOMEM;
 
 	/* Allocate Tx ring hardware descriptors. */
 	tz = rte_eth_dma_zone_reserve(dev, "tx_ring", queue_idx,
 			sizeof(struct ngbe_tx_desc) * nb_desc,
-			NGBE_ALIGN, socket_id);
+			NGBE_ALIGN, numa_id);
 	if (tz == NULL) {
 		ngbe_tx_queue_release(txq);
 		return -ENOMEM;
@@ -2091,9 +2091,9 @@ ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	txq->tx_ring = (struct ngbe_tx_desc *)TMZ_VADDR(tz);
 
 	/* Allocate software ring */
-	txq->sw_ring = rte_zmalloc_socket("txq->sw_ring",
+	txq->sw_ring = rte_zmalloc_numa("txq->sw_ring",
 				sizeof(struct ngbe_tx_entry) * nb_desc,
-				RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, numa_id);
 	if (txq->sw_ring == NULL) {
 		ngbe_tx_queue_release(txq);
 		return -ENOMEM;
@@ -2313,7 +2313,7 @@ int
 ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			 uint16_t queue_idx,
 			 uint16_t nb_desc,
-			 unsigned int socket_id,
+			 unsigned int numa_id,
 			 const struct rte_eth_rxconf *rx_conf,
 			 struct rte_mempool *mp)
 {
@@ -2337,9 +2337,9 @@ ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	}
 
 	/* First allocate the Rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue",
+	rxq = rte_zmalloc_numa("ethdev RX queue",
 				 sizeof(struct ngbe_rx_queue),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq == NULL)
 		return -ENOMEM;
 	rxq->mb_pool = mp;
@@ -2360,7 +2360,7 @@ ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	/* Allocate Rx ring hardware descriptors. */
 	size = (nb_desc + RTE_PMD_NGBE_RX_MAX_BURST) * sizeof(struct ngbe_rx_desc);
 	rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx,
-				      size, NGBE_ALIGN, socket_id);
+				      size, NGBE_ALIGN, numa_id);
 	if (rz == NULL) {
 		ngbe_rx_queue_release(rxq);
 		return -ENOMEM;
@@ -2399,9 +2399,9 @@ ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	if (adapter->rx_bulk_alloc_allowed)
 		len += RTE_PMD_NGBE_RX_MAX_BURST;
 
-	rxq->sw_ring = rte_zmalloc_socket("rxq->sw_ring",
+	rxq->sw_ring = rte_zmalloc_numa("rxq->sw_ring",
 					  sizeof(struct ngbe_rx_entry) * len,
-					  RTE_CACHE_LINE_SIZE, socket_id);
+					  RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq->sw_ring == NULL) {
 		ngbe_rx_queue_release(rxq);
 		return -ENOMEM;
@@ -2416,9 +2416,9 @@ ngbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	 * dev_start() flow.
 	 */
 	rxq->sw_sc_ring =
-		rte_zmalloc_socket("rxq->sw_sc_ring",
+		rte_zmalloc_numa("rxq->sw_sc_ring",
 				  sizeof(struct ngbe_scattered_rx_entry) * len,
-				  RTE_CACHE_LINE_SIZE, socket_id);
+				  RTE_CACHE_LINE_SIZE, numa_id);
 	if (rxq->sw_sc_ring == NULL) {
 		ngbe_rx_queue_release(rxq);
 		return -ENOMEM;
Signature · 1 line
2.55.0
#138 lore raw

PATCH 136/227 net/ntnic: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c |  4 ++--
 .../link_mgmt/link_100g/nt4ga_link_100g.c     |  2 +-
 .../link_agx_100g/nt4ga_agx_link_100g.c       |  2 +-
 .../flow_api/profile_inline/flm_age_queue.c   |  2 +-
 .../flow_api/profile_inline/flm_evt_queue.c   |  2 +-
 .../flow_api/profile_inline/flm_lrn_queue.c   |  2 +-
 drivers/net/ntnic/ntnic_ethdev.c              | 24 +++++++++----------
 drivers/net/ntnic/ntutil/nt_util.c            |  4 ++--
 8 files changed, 21 insertions(+), 21 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +2 -2
index ef8ad29aa1..d009f0e6a0 100644
@@ -180,7 +180,7 @@ static int dbs_numa_node(const nthw_dbs_t *p_nthw_dbs)
 /* Allocate a zeroed queue object and bind it to its DBS module */
 static struct nthw_virt_queue *dbs_alloc_virt_queue(nthw_dbs_t *p_nthw_dbs)
 {
-	struct nthw_virt_queue *vq = rte_zmalloc_socket("ntnic_vq",
+	struct nthw_virt_queue *vq = rte_zmalloc_numa("ntnic_vq",
 			sizeof(struct nthw_virt_queue), RTE_CACHE_LINE_SIZE,
 			dbs_numa_node(p_nthw_dbs));
 
@@ -202,7 +202,7 @@ static int dbs_copy_packet_buffers(struct nthw_virt_queue *vq,
 	if (n == 0)
 		return -1;	/* don't allocate memory with size of 0 bytes */
 
-	vq->p_virtual_addr = rte_zmalloc_socket("ntnic_vq_bufs", size, RTE_CACHE_LINE_SIZE,
+	vq->p_virtual_addr = rte_zmalloc_numa("ntnic_vq_bufs", size, RTE_CACHE_LINE_SIZE,
 			dbs_numa_node(vq->mp_nthw_dbs));
 
 	if (vq->p_virtual_addr == NULL)
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +1 -1
index 0f36c30e5f..b9b3738454 100644
@@ -721,7 +721,7 @@ static int nt4ga_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nth
 		struct rte_service_spec adapter_monitor_service = {
 			.name = "ntnic-adapter-monitor",
 			.callback = nt4ga_link_100g_mon,
-			.socket_id = SOCKET_ID_ANY,
+			.socket_id = RTE_NUMA_ID_ANY,
 			.capabilities = RTE_SERVICE_CAP_MT_SAFE,
 			.callback_userdata = p_adapter_info,
 		};
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
index f0c07c80ad..c4e12b1c25 100644
@@ -1023,7 +1023,7 @@ int nt4ga_agx_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nthw_f
 		struct rte_service_spec adapter_monitor_service = {
 						.name = "ntnic-adapter_agx-monitor",
 						.callback = nt4ga_agx_link_100g_mon,
-						.socket_id = SOCKET_ID_ANY,
+						.socket_id = RTE_NUMA_ID_ANY,
 						.capabilities = RTE_SERVICE_CAP_MT_SAFE,
 						.callback_userdata = p_adapter_info,
 		};
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_age_queue.c +1 -1
index b9c93a293c..ac1f8b0005 100644
@@ -95,7 +95,7 @@ struct rte_ring *nthw_flm_age_queue_create(uint8_t port, uint16_t caller_id, uns
 	q = rte_ring_create_elem(name,
 			FLM_AGE_ELEM_SIZE,
 			count,
-			SOCKET_ID_ANY,
+			RTE_NUMA_ID_ANY,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 
 	if (q == NULL) {
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_evt_queue.c +1 -1
index e2f3b31ad0..869680173e 100644
@@ -179,7 +179,7 @@ static struct rte_ring *flm_evt_queue_create(uint8_t port, uint8_t caller)
 	q = rte_ring_create_elem(name,
 			elem_size,
 			queue_size,
-			SOCKET_ID_ANY,
+			RTE_NUMA_ID_ANY,
 			RING_F_SP_ENQ | RING_F_SC_DEQ);
 
 	if (q == NULL) {
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.c +1 -1
index cb4504a6e0..98c7825fb1 100644
@@ -21,7 +21,7 @@ void *nthw_flm_lrn_queue_create(void)
 	struct rte_ring *q = rte_ring_create_elem("RFQ",
 		ELEM_SIZE,
 		QUEUE_SIZE,
-		SOCKET_ID_ANY,
+		RTE_NUMA_ID_ANY,
 		RING_F_MP_HTS_ENQ | RING_F_SC_DEQ);
 	RTE_ASSERT(q != NULL);
 	return q;
drivers/net/ntnic/ntnic_ethdev.c +12 -12
index e0d84705f5..02c3be52e8 100644
@@ -789,7 +789,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st
 	uint64_t tot_alloc_size = 0x100000 + (uint64_t)buf_size * (uint64_t)num_descr;
 
 	void *virt =
-		rte_malloc_socket("VirtQDescr", tot_alloc_size,
+		rte_malloc_numa("VirtQDescr", tot_alloc_size,
 			nthw_util_align_size(tot_alloc_size),
 			eth_dev->data->numa_node);
 
@@ -820,7 +820,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st
 
 		/* Just allocate 1MB to hold all combined descr rings */
 		size = 0x100000;
-		void *virt = rte_malloc_socket("VirtQDescr", size, 4096, eth_dev->data->numa_node);
+		void *virt = rte_malloc_numa("VirtQDescr", size, 4096, eth_dev->data->numa_node);
 
 		if (!virt)
 			return -1;
@@ -843,7 +843,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st
 
 		size = num_descr * sizeof(struct nthw_memory_descriptor);
 		hwq->pkt_buffers =
-			rte_zmalloc_socket("rx_pkt_buffers", size, 64, eth_dev->data->numa_node);
+			rte_zmalloc_numa("rx_pkt_buffers", size, 64, eth_dev->data->numa_node);
 
 		if (!hwq->pkt_buffers) {
 			NT_LOG(ERR, NTNIC,
@@ -856,7 +856,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st
 
 		size = buf_size * num_descr;
 		void *virt_addr =
-			rte_malloc_socket("pkt_buffer_pkts", size, 4096, eth_dev->data->numa_node);
+			rte_malloc_numa("pkt_buffer_pkts", size, 4096, eth_dev->data->numa_node);
 
 		if (!virt_addr) {
 			NT_LOG(ERR, NTNIC,
@@ -916,7 +916,7 @@ static int allocate_hw_virtio_queues(struct rte_eth_dev *eth_dev, int vf_num, st
 
 	size = num_descr * sizeof(struct nthw_memory_descriptor);
 	hwq->pkt_buffers =
-		rte_zmalloc_socket("rx_pkt_buffers", size, 64, eth_dev->data->numa_node);
+		rte_zmalloc_numa("rx_pkt_buffers", size, 64, eth_dev->data->numa_node);
 
 	if (!hwq->pkt_buffers) {
 		NT_LOG(ERR, NTNIC,
@@ -1028,7 +1028,7 @@ static int allocate_queue(int num)
 static int eth_rx_scg_queue_setup(struct rte_eth_dev *eth_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,
 	struct rte_mempool *mb_pool)
 {
@@ -1107,7 +1107,7 @@ static int eth_rx_scg_queue_setup(struct rte_eth_dev *eth_dev,
 static int eth_tx_scg_queue_setup(struct rte_eth_dev *eth_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)
 {
 	const struct port_ops *port_ops = nthw_get_port_ops();
@@ -2323,7 +2323,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 
 
 	/* alloc */
-	p_drv = rte_zmalloc_socket(pci_dev->name, sizeof(struct drv_s), RTE_CACHE_LINE_SIZE,
+	p_drv = rte_zmalloc_numa(pci_dev->name, sizeof(struct drv_s), RTE_CACHE_LINE_SIZE,
 			pci_dev->device.numa_node);
 
 	if (!p_drv) {
@@ -2443,7 +2443,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		struct rte_service_spec flm_update_spec = {
 			.name = "ntnic-flm_update_service",
 			.callback = adapter_flm_update_service,
-			.socket_id = SOCKET_ID_ANY,
+			.socket_id = RTE_NUMA_ID_ANY,
 			.capabilities = RTE_SERVICE_CAP_MT_SAFE,
 			.callback_userdata = p_drv
 		};
@@ -2460,7 +2460,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 	struct rte_service_spec stat_spec = {
 		.name = "ntnic-stat_collect_service",
 		.callback = adapter_stat_service,
-		.socket_id = SOCKET_ID_ANY,
+		.socket_id = RTE_NUMA_ID_ANY,
 		.capabilities = RTE_SERVICE_CAP_MT_SAFE,
 		.callback_userdata = p_drv
 	};
@@ -2494,7 +2494,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		NT_LOG_DBGX(DBG, NTNIC, "%s: interface #%d: %s: '%s'", p_port_id_str,
 			n_intf_no, (pci_dev->name[0] ? pci_dev->name : "NA"), name);
 
-		internals = rte_zmalloc_socket(name, sizeof(struct pmd_internals),
+		internals = rte_zmalloc_numa(name, sizeof(struct pmd_internals),
 				RTE_CACHE_LINE_SIZE, pci_dev->device.numa_node);
 
 		if (!internals) {
@@ -2634,7 +2634,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		if (fpga_info->profile == FPGA_INFO_PROFILE_INLINE) {
 			struct rte_service_spec port_event_spec = {
 				.callback = port_event_service,
-				.socket_id = SOCKET_ID_ANY,
+				.socket_id = RTE_NUMA_ID_ANY,
 				.capabilities = RTE_SERVICE_CAP_MT_SAFE,
 				.callback_userdata = internals
 			};
drivers/net/ntnic/ntutil/nt_util.c +2 -2
index 8014b218b5..450c35c00c 100644
@@ -56,11 +56,11 @@ struct nt_dma_s *nthw_dma_alloc(uint64_t size, uint64_t align, int numa)
 		return NULL;
 	}
 
-	void *addr = rte_malloc_socket(NULL, size, align, numa);
+	void *addr = rte_malloc_numa(NULL, size, align, numa);
 
 	if (!addr) {
 		rte_free(vfio_addr);
-		NT_LOG(ERR, GENERAL, "VFIO rte_malloc_socket failed");
+		NT_LOG(ERR, GENERAL, "VFIO rte_malloc_numa failed");
 		return NULL;
 	}
 
Signature · 1 line
2.55.0
#139 lore raw

PATCH 137/227 net/null: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/null/rte_eth_null.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/null/rte_eth_null.c +7 -7
index a2f70fee79..dd90d51e9b 100644
@@ -223,7 +223,7 @@ eth_dev_stop(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)
 {
@@ -244,7 +244,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
 	internals->rx_null_queues[rx_queue_id].mb_pool = mb_pool;
 	dev->data->rx_queues[rx_queue_id] =
 		&internals->rx_null_queues[rx_queue_id];
-	dummy_packet = rte_zmalloc_socket(NULL,
+	dummy_packet = rte_zmalloc_numa(NULL,
 			packet_size, 0, dev->data->numa_node);
 	if (dummy_packet == NULL)
 		return -ENOMEM;
@@ -258,7 +258,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 rte_mbuf *dummy_packet;
@@ -277,7 +277,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,
 
 	dev->data->tx_queues[tx_queue_id] =
 		&internals->tx_null_queues[tx_queue_id];
-	dummy_packet = rte_zmalloc_socket(NULL,
+	dummy_packet = rte_zmalloc_numa(NULL,
 			packet_size, 0, dev->data->numa_node);
 	if (dummy_packet == NULL)
 		return -ENOMEM;
@@ -500,7 +500,7 @@ static int
 eth_dev_close(struct rte_eth_dev *dev)
 {
 	PMD_LOG(INFO, "Closing null ethdev on NUMA socket %u",
-			rte_socket_id());
+			rte_numa_id());
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
@@ -548,8 +548,8 @@ eth_dev_null_create(struct rte_vdev_device *dev, struct pmd_options *args)
 		0xBE, 0xAC, 0x01, 0xFA
 	};
 
-	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();
 
 	PMD_LOG(INFO, "Creating null ethdev on numa socket %u",
 		dev->device.numa_node);
Signature · 1 line
2.55.0
#140 lore raw

PATCH 138/227 net/octeon_ep: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/octeon_ep/otx_ep_common.h |  4 ++--
 drivers/net/octeon_ep/otx_ep_ethdev.c | 12 +++++-----
 drivers/net/octeon_ep/otx_ep_rxtx.c   | 32 +++++++++++++--------------
 3 files changed, 24 insertions(+), 24 deletions(-)
drivers/net/octeon_ep/otx_ep_common.h +2 -2
index 406155078b..d9bca31770 100644
@@ -584,12 +584,12 @@ struct otx_ep_device {
 };
 
 int otx_ep_setup_iqs(struct otx_ep_device *otx_ep, uint32_t iq_no,
-		     int num_descs, unsigned int socket_id);
+		     int num_descs, unsigned int numa_id);
 int otx_ep_delete_iqs(struct otx_ep_device *otx_ep, uint32_t iq_no);
 
 int otx_ep_setup_oqs(struct otx_ep_device *otx_ep, int oq_no, int num_descs,
 		     int desc_size, struct rte_mempool *mpool,
-		     unsigned int socket_id);
+		     unsigned int numa_id);
 int otx_ep_delete_oqs(struct otx_ep_device *otx_ep, uint32_t oq_no);
 
 #define OTX_EP_MAX_PKT_SZ 65498U
drivers/net/octeon_ep/otx_ep_ethdev.c +6 -6
index ddd3d092c3..10d2adfa87 100644
@@ -475,7 +475,7 @@ otx_ep_dev_configure(struct rte_eth_dev *eth_dev)
  *    Queue number
  * @param num_rx_descs
  *    Number of entries in the queue
- * @param socket_id
+ * @param numa_id
  *    Where to allocate memory
  * @param rx_conf
  *    Pointer to the struction rte_eth_rxconf
@@ -488,7 +488,7 @@ otx_ep_dev_configure(struct rte_eth_dev *eth_dev)
  */
 static int
 otx_ep_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
-		       uint16_t num_rx_descs, unsigned int socket_id,
+		       uint16_t num_rx_descs, unsigned int numa_id,
 		       const struct rte_eth_rxconf *rx_conf __rte_unused,
 		       struct rte_mempool *mp)
 {
@@ -518,7 +518,7 @@ otx_ep_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
 	buf_size = mbp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM;
 
 	if (otx_ep_setup_oqs(otx_epvf, q_no, num_rx_descs, buf_size, mp,
-			     socket_id)) {
+			     numa_id)) {
 		otx_ep_err("droq allocation failed");
 		return -1;
 	}
@@ -563,7 +563,7 @@ otx_ep_rx_queue_release(struct rte_eth_dev *dev, uint16_t q_no)
  * @param num_tx_descs
  *   Number of ringbuffer descriptors
  *
- * @param socket_id
+ * @param numa_id
  *   NUMA socket id, used for memory allocations
  *
  * @param tx_conf
@@ -575,7 +575,7 @@ otx_ep_rx_queue_release(struct rte_eth_dev *dev, uint16_t q_no)
  */
 static int
 otx_ep_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
-		       uint16_t num_tx_descs, unsigned int socket_id,
+		       uint16_t num_tx_descs, unsigned int numa_id,
 		       const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev);
@@ -596,7 +596,7 @@ otx_ep_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
 		return -EINVAL;
 	}
 
-	retval = otx_ep_setup_iqs(otx_epvf, q_no, num_tx_descs, socket_id);
+	retval = otx_ep_setup_iqs(otx_epvf, q_no, num_tx_descs, numa_id);
 
 	if (retval) {
 		otx_ep_err("IQ(TxQ) creation failed.");
drivers/net/octeon_ep/otx_ep_rxtx.c +16 -16
index a21764868d..ded787268d 100644
@@ -77,7 +77,7 @@ otx_ep_delete_iqs(struct otx_ep_device *otx_ep, uint32_t iq_no)
 /* IQ initialization */
 static int
 otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
-		     unsigned int socket_id)
+		     unsigned int numa_id)
 {
 	const struct otx_ep_config *conf;
 	struct otx_ep_instr_queue *iq;
@@ -93,7 +93,7 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
 	iq->iq_mz = rte_eth_dma_zone_reserve(otx_ep->eth_dev,
 					     "instr_queue", iq_no, q_size,
 					     OTX_EP_PCI_RING_ALIGN,
-					     socket_id);
+					     numa_id);
 	if (iq->iq_mz == NULL) {
 		otx_ep_err("IQ[%d] memzone alloc failed", iq_no);
 		goto iq_init_fail;
@@ -113,18 +113,18 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
 	 * posted to OCTEON 9. This list will be used for freeing the IQ
 	 * data buffer(s) later once the OCTEON 9 fetched the requests.
 	 */
-	iq->req_list = rte_zmalloc_socket("request_list",
+	iq->req_list = rte_zmalloc_numa("request_list",
 			(iq->nb_desc * OTX_EP_IQREQ_LIST_SIZE),
 			RTE_CACHE_LINE_SIZE,
-			rte_socket_id());
+			rte_numa_id());
 	if (iq->req_list == NULL) {
 		otx_ep_err("IQ[%d] req_list alloc failed", iq_no);
 		goto iq_init_fail;
 	}
 
 	for (i = 0; i < iq->nb_desc; i++) {
-		sg = rte_zmalloc_socket("sg_entry", (OTX_EP_MAX_SG_LISTS * OTX_EP_SG_ENTRY_SIZE),
-			OTX_EP_SG_ALIGN, rte_socket_id());
+		sg = rte_zmalloc_numa("sg_entry", (OTX_EP_MAX_SG_LISTS * OTX_EP_SG_ENTRY_SIZE),
+			OTX_EP_SG_ALIGN, rte_numa_id());
 		if (sg == NULL) {
 			otx_ep_err("IQ[%d] sg_entries alloc failed", iq_no);
 			goto iq_init_fail;
@@ -138,8 +138,8 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
 		     iq_no, iq->base_addr, (unsigned long)iq->base_addr_dma,
 		     iq->nb_desc);
 
-	iq->mbuf_list = rte_zmalloc_socket("mbuf_list",	(iq->nb_desc * sizeof(struct rte_mbuf *)),
-					   RTE_CACHE_LINE_SIZE, rte_socket_id());
+	iq->mbuf_list = rte_zmalloc_numa("mbuf_list",	(iq->nb_desc * sizeof(struct rte_mbuf *)),
+					   RTE_CACHE_LINE_SIZE, rte_numa_id());
 	if (!iq->mbuf_list) {
 		otx_ep_err("IQ[%d] mbuf_list alloc failed", iq_no);
 		goto iq_init_fail;
@@ -175,7 +175,7 @@ otx_ep_init_instr_queue(struct otx_ep_device *otx_ep, int iq_no, int num_descs,
 
 int
 otx_ep_setup_iqs(struct otx_ep_device *otx_ep, uint32_t iq_no, int num_descs,
-		 unsigned int socket_id)
+		 unsigned int numa_id)
 {
 	struct otx_ep_instr_queue *iq;
 
@@ -186,7 +186,7 @@ otx_ep_setup_iqs(struct otx_ep_device *otx_ep, uint32_t iq_no, int num_descs,
 
 	otx_ep->instr_queue[iq_no] = iq;
 
-	if (otx_ep_init_instr_queue(otx_ep, iq_no, num_descs, socket_id)) {
+	if (otx_ep_init_instr_queue(otx_ep, iq_no, num_descs, numa_id)) {
 		otx_ep_err("IQ init is failed");
 		goto delete_IQ;
 	}
@@ -316,7 +316,7 @@ otx_ep_set_rearm_data(struct otx_ep_device *otx_ep)
 static int
 otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
 	      uint32_t num_descs, uint32_t desc_size,
-	      struct rte_mempool *mpool, unsigned int socket_id)
+	      struct rte_mempool *mpool, unsigned int numa_id)
 {
 	const struct otx_ep_config *conf = otx_ep->conf;
 	uint32_t c_refill_threshold;
@@ -341,7 +341,7 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
 	droq->desc_ring_mz = rte_eth_dma_zone_reserve(otx_ep->eth_dev, "droq",
 						      q_no, desc_ring_size,
 						      OTX_EP_PCI_RING_ALIGN,
-						      socket_id);
+						      numa_id);
 
 	if (droq->desc_ring_mz == NULL) {
 		otx_ep_err("OQ:%d desc_ring allocation failed", q_no);
@@ -356,9 +356,9 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
 	otx_ep_dbg("OQ[%d]: num_desc: %d", q_no, droq->nb_desc);
 
 	/* OQ buf_list set up */
-	droq->recv_buf_list = rte_zmalloc_socket("recv_buf_list",
+	droq->recv_buf_list = rte_zmalloc_numa("recv_buf_list",
 				(droq->nb_desc * sizeof(struct rte_mbuf *)),
-				 RTE_CACHE_LINE_SIZE, socket_id);
+				 RTE_CACHE_LINE_SIZE, numa_id);
 	if (droq->recv_buf_list == NULL) {
 		otx_ep_err("OQ recv_buf_list alloc failed");
 		goto init_droq_fail;
@@ -391,7 +391,7 @@ otx_ep_init_droq(struct otx_ep_device *otx_ep, uint32_t q_no,
 int
 otx_ep_setup_oqs(struct otx_ep_device *otx_ep, int oq_no, int num_descs,
 		 int desc_size, struct rte_mempool *mpool,
-		 unsigned int socket_id)
+		 unsigned int numa_id)
 {
 	struct otx_ep_droq *droq;
 
@@ -405,7 +405,7 @@ otx_ep_setup_oqs(struct otx_ep_device *otx_ep, int oq_no, int num_descs,
 	otx_ep->droq[oq_no] = droq;
 
 	if (otx_ep_init_droq(otx_ep, oq_no, num_descs, desc_size, mpool,
-			     socket_id)) {
+			     numa_id)) {
 		otx_ep_err("Droq[%d] Initialization failed", oq_no);
 		goto delete_OQ;
 	}
Signature · 1 line
2.55.0
#141 lore raw

PATCH 139/227 net/octeontx: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/octeontx/octeontx_ethdev.c | 40 +++++++++++++-------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/net/octeontx/octeontx_ethdev.c +20 -20
index bde4c2c615..4e83b81de9 100644
@@ -1223,7 +1223,7 @@ octeontx_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
 
 static int
 octeontx_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
-			    uint16_t nb_desc, unsigned int socket_id,
+			    uint16_t nb_desc, unsigned int numa_id,
 			    const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct octeontx_nic *nic = octeontx_pmd_priv(dev);
@@ -1232,15 +1232,15 @@ octeontx_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
 	int res = 0;
 
 	RTE_SET_USED(nb_desc);
-	RTE_SET_USED(socket_id);
+	RTE_SET_USED(numa_id);
 
 	dq_num = (nic->pko_vfid * PKO_VF_NUM_DQ) + qidx;
 
 	/* Socket id check */
-	if (socket_id != (unsigned int)SOCKET_ID_ANY &&
-			socket_id != (unsigned int)nic->node)
-		PMD_TX_LOG(INFO, "socket_id expected %d, configured %d",
-						socket_id, nic->node);
+	if (numa_id != (unsigned int)RTE_NUMA_ID_ANY &&
+			numa_id != (unsigned int)nic->node)
+		PMD_TX_LOG(INFO, "numa_id expected %d, configured %d",
+						numa_id, nic->node);
 
 	/* Free memory prior to re-allocation if needed. */
 	if (dev->data->tx_queues[qidx] != NULL) {
@@ -1251,7 +1251,7 @@ octeontx_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
 	}
 
 	/* Allocating tx queue data structure */
-	txq = rte_zmalloc_socket("ethdev TX queue", sizeof(struct octeontx_txq),
+	txq = rte_zmalloc_numa("ethdev TX queue", sizeof(struct octeontx_txq),
 				 RTE_CACHE_LINE_SIZE, nic->node);
 	if (txq == NULL) {
 		octeontx_log_err("failed to allocate txq=%d", qidx);
@@ -1289,7 +1289,7 @@ octeontx_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
 
 static int
 octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
-				uint16_t nb_desc, unsigned int socket_id,
+				uint16_t nb_desc, unsigned int numa_id,
 				const struct rte_eth_rxconf *rx_conf,
 				struct rte_mempool *mb_pool)
 {
@@ -1340,13 +1340,13 @@ octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx,
 	}
 
 	/* Socket id check */
-	if (socket_id != (unsigned int)SOCKET_ID_ANY &&
-			socket_id != (unsigned int)nic->node)
-		PMD_RX_LOG(INFO, "socket_id expected %d, configured %d",
-						socket_id, nic->node);
+	if (numa_id != (unsigned int)RTE_NUMA_ID_ANY &&
+			numa_id != (unsigned int)nic->node)
+		PMD_RX_LOG(INFO, "numa_id expected %d, configured %d",
+						numa_id, nic->node);
 
 	/* Allocating rx queue data structure */
-	rxq = rte_zmalloc_socket("ethdev RX queue", sizeof(struct octeontx_rxq),
+	rxq = rte_zmalloc_numa("ethdev RX queue", sizeof(struct octeontx_rxq),
 				 RTE_CACHE_LINE_SIZE, nic->node);
 	if (rxq == NULL) {
 		octeontx_log_err("failed to allocate rxq=%d", qidx);
@@ -1531,7 +1531,7 @@ static const struct eth_dev_ops octeontx_dev_ops = {
 /* Create Ethdev interface per BGX LMAC ports */
 static int
 octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
-			int socket_id)
+			int numa_id)
 {
 	int res;
 	size_t pko_vfid;
@@ -1567,7 +1567,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 	}
 	data = eth_dev->data;
 
-	nic = rte_zmalloc_socket(octtx_name, sizeof(*nic), 0, socket_id);
+	nic = rte_zmalloc_numa(octtx_name, sizeof(*nic), 0, numa_id);
 	if (nic == NULL) {
 		octeontx_log_err("failed to allocate nic structure");
 		res = -ENOMEM;
@@ -1624,9 +1624,9 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev,
 		goto err;
 	}
 
-	data->mac_addrs = rte_zmalloc_socket(octtx_name, max_entries *
+	data->mac_addrs = rte_zmalloc_numa(octtx_name, max_entries *
 					     RTE_ETHER_ADDR_LEN, 0,
-							socket_id);
+							numa_id);
 	if (data->mac_addrs == NULL) {
 		octeontx_log_err("failed to allocate memory for mac_addrs");
 		res = -ENOMEM;
@@ -1733,7 +1733,7 @@ octeontx_probe(struct rte_vdev_device *dev)
 {
 	const char *dev_name;
 	static int probe_once;
-	uint8_t socket_id, qlist;
+	uint8_t numa_id, qlist;
 	int tx_vfcnt, port_id, evdev, qnum, pnum, res, i;
 	struct rte_event_dev_config dev_conf;
 	const char *eventdev_name = "event_octeontx";
@@ -1772,7 +1772,7 @@ octeontx_probe(struct rte_vdev_device *dev)
 
 	PMD_INIT_LOG(DEBUG, "initializing %s pmd", dev_name);
 
-	socket_id = rte_socket_id();
+	numa_id = rte_numa_id();
 
 	tx_vfcnt = octeontx_pko_vf_count();
 
@@ -1856,7 +1856,7 @@ octeontx_probe(struct rte_vdev_device *dev)
 
 	/* Create ethdev interface */
 	for (i = 0; i < init_params.nr_port; i++) {
-		port_id = octeontx_create(dev, i, evdev, socket_id);
+		port_id = octeontx_create(dev, i, evdev, numa_id);
 		if (port_id < 0) {
 			octeontx_log_err("failed to create device %s",
 					dev_name);
Signature · 1 line
2.55.0
#142 lore raw

PATCH 140/227 net/pcap: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/pcap/pcap_ethdev.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/pcap/pcap_ethdev.c +7 -7
index 1e114e0008..5307979da2 100644
@@ -1150,7 +1150,7 @@ eth_dev_close(struct rte_eth_dev *dev)
 	struct pmd_internals *internals = dev->data->dev_private;
 
 	PMD_LOG(INFO, "Closing pcap ethdev on NUMA socket %d",
-			rte_socket_id());
+			rte_numa_id());
 
 	eth_dev_stop(dev);
 
@@ -1212,7 +1212,7 @@ 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)
 {
@@ -1335,7 +1335,7 @@ 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 pmd_internals *internals = dev->data->dev_private;
@@ -1343,8 +1343,8 @@ eth_tx_queue_setup(struct rte_eth_dev *dev,
 
 	pcap_q->port_id = dev->data->port_id;
 	pcap_q->queue_id = tx_queue_id;
-	pcap_q->bounce_buf = rte_malloc_socket(NULL, internals->snapshot_len,
-					       RTE_CACHE_LINE_SIZE, socket_id);
+	pcap_q->bounce_buf = rte_malloc_numa(NULL, internals->snapshot_len,
+					       RTE_CACHE_LINE_SIZE, numa_id);
 	if (pcap_q->bounce_buf == NULL)
 		return -ENOMEM;
 
@@ -1641,7 +1641,7 @@ pmd_init_internals(struct rte_vdev_device *vdev,
 	PMD_LOG(INFO, "Creating pcap-backed ethdev on numa socket %u",
 		numa_node);
 
-	pp = rte_zmalloc_socket("pcap_private", sizeof(struct pmd_process_private),
+	pp = rte_zmalloc_numa("pcap_private", sizeof(struct pmd_process_private),
 		RTE_CACHE_LINE_SIZE, numa_node);
 	if (pp == NULL) {
 		PMD_LOG(ERR,
@@ -1709,7 +1709,7 @@ eth_pcap_update_mac(const char *if_name, struct rte_eth_dev *eth_dev,
 	if (osdep_iface_mac_get(if_name, &mac) < 0)
 		return -1;
 
-	mac_addrs = rte_zmalloc_socket("pcap_mac", RTE_ETHER_ADDR_LEN, 0, numa_node);
+	mac_addrs = rte_zmalloc_numa("pcap_mac", RTE_ETHER_ADDR_LEN, 0, numa_node);
 	if (mac_addrs == NULL)
 		return -1;
 
Signature · 1 line
2.55.0
#143 lore raw

PATCH 141/227 net/pfe: use NUMA node terminology

In reply to Chengwen Feng

From: Chengwen Feng <[email protected]>

Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.

---
 drivers/net/pfe/pfe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/pfe/pfe_ethdev.c +2 -2
index 1b183ab1f3..dec48ff42b 100644
@@ -450,7 +450,7 @@ pfe_eth_info(struct rte_eth_dev *dev,
 static int
 pfe_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 		__rte_unused 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,
 		struct rte_mempool *mb_pool)
 {
@@ -493,7 +493,7 @@ static int
 pfe_tx_queue_setup(struct rte_eth_dev *dev,
 		   uint16_t queue_idx,
 		   __rte_unused uint16_t nb_desc,
-		   __rte_unused unsigned int socket_id,
+		   __rte_unused unsigned int numa_id,
 		   __rte_unused const struct rte_eth_txconf *tx_conf)
 {
 	struct pfe_eth_priv_s *priv = dev->data->dev_private;
Signature · 1 line
2.55.0