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

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


From: Chengwen Feng <fengchengwen at huawei.com>

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

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 drivers/net/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(-)

diff --git a/drivers/net/octeon_ep/otx_ep_common.h b/drivers/net/octeon_ep/otx_ep_common.h
index 406155078b..d9bca31770 100644
--- a/drivers/net/octeon_ep/otx_ep_common.h
+++ b/drivers/net/octeon_ep/otx_ep_common.h
@@ -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
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index ddd3d092c3..10d2adfa87 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -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.");
diff --git a/drivers/net/octeon_ep/otx_ep_rxtx.c b/drivers/net/octeon_ep/otx_ep_rxtx.c
index a21764868d..ded787268d 100644
--- a/drivers/net/octeon_ep/otx_ep_rxtx.c
+++ b/drivers/net/octeon_ep/otx_ep_rxtx.c
@@ -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;
 	}
-- 
2.55.0



More information about the dev mailing list