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.

Signed-off-by: Chengwen Feng <[email protected]>
---
 drivers/net/qede/base/bcm_osal.c | 12 +++----
 drivers/net/qede/qede_filter.c   |  2 +-
 drivers/net/qede/qede_rxtx.c     | 54 ++++++++++++++++----------------
 drivers/net/qede/qede_rxtx.h     |  4 +--
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index abd11860b7..024c4b1f76 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -153,7 +153,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
        const struct rte_memzone *mz;
        char mz_name[RTE_MEMZONE_NAMESIZE];
        uint32_t core_id = rte_lcore_id();
-       unsigned int socket_id;
+       unsigned int numa_id;
 
        if (ecore_mz_count >= rte_memzone_max_get()) {
                DP_ERR(p_dev, "Memzone allocation count exceeds %zu\n",
@@ -167,8 +167,8 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
                                        (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, RTE_CACHE_LINE_SIZE);
        if (!mz) {
                DP_ERR(p_dev, "Unable to allocate DMA memory "
@@ -192,7 +192,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev 
*p_dev,
        const struct rte_memzone *mz;
        char mz_name[RTE_MEMZONE_NAMESIZE];
        uint32_t core_id = rte_lcore_id();
-       unsigned int socket_id;
+       unsigned int numa_id;
 
        if (ecore_mz_count >= rte_memzone_max_get()) {
                DP_ERR(p_dev, "Memzone allocation count exceeds %zu\n",
@@ -206,8 +206,8 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev 
*p_dev,
                                        (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) {
                DP_ERR(p_dev, "Unable to allocate DMA memory "
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index cecb58c997..82563085e3 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -199,7 +199,7 @@ qede_config_arfs_filter(struct rte_eth_dev *eth_dev,
        snprintf(mz_name, sizeof(mz_name), "%lx",
                 (unsigned long)rte_get_timer_cycles());
        mz = rte_memzone_reserve_aligned(mz_name, QEDE_MAX_FDIR_PKT_LEN,
-                                        SOCKET_ID_ANY, 0, RTE_CACHE_LINE_SIZE);
+                                        RTE_NUMA_ID_ANY, 0, 
RTE_CACHE_LINE_SIZE);
        if (!mz) {
                DP_ERR(edev, "Failed to allocate memzone for fdir, err = %s\n",
                       rte_strerror(rte_errno));
diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index 25e28fd9f6..5ecca0c0b6 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -123,7 +123,7 @@ static struct qede_rx_queue *
 qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
                        uint16_t queue_idx,
                        uint16_t nb_desc,
-                       unsigned int socket_id,
+                       unsigned int numa_id,
                        struct rte_mempool *mp,
                        uint16_t bufsz)
 {
@@ -134,12 +134,12 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
        int rc;
 
        /* First allocate the rx queue data structure */
-       rxq = rte_zmalloc_socket("qede_rx_queue", sizeof(struct qede_rx_queue),
-                                RTE_CACHE_LINE_SIZE, socket_id);
+       rxq = rte_zmalloc_numa("qede_rx_queue", sizeof(struct qede_rx_queue),
+                                RTE_CACHE_LINE_SIZE, numa_id);
 
        if (!rxq) {
                DP_ERR(edev, "Unable to allocate memory for rxq on socket %u",
-                         socket_id);
+                         numa_id);
                return NULL;
        }
 
@@ -157,11 +157,11 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
 
        /* Allocate the parallel driver ring for Rx buffers */
        size = sizeof(*rxq->sw_rx_ring) * rxq->nb_rx_desc;
-       rxq->sw_rx_ring = rte_zmalloc_socket("sw_rx_ring", size,
-                                            RTE_CACHE_LINE_SIZE, socket_id);
+       rxq->sw_rx_ring = rte_zmalloc_numa("sw_rx_ring", size,
+                                            RTE_CACHE_LINE_SIZE, numa_id);
        if (!rxq->sw_rx_ring) {
                DP_ERR(edev, "Memory allocation fails for sw_rx_ring on"
-                      " socket %u\n", socket_id);
+                      " socket %u\n", numa_id);
                rte_free(rxq);
                return NULL;
        }
@@ -178,7 +178,7 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
 
        if (rc != ECORE_SUCCESS) {
                DP_ERR(edev, "Memory allocation fails for RX BD ring"
-                      " on socket %u\n", socket_id);
+                      " on socket %u\n", numa_id);
                rte_free(rxq->sw_rx_ring);
                rte_free(rxq);
                return NULL;
@@ -196,7 +196,7 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
 
        if (rc != ECORE_SUCCESS) {
                DP_ERR(edev, "Memory allocation fails for RX CQE ring"
-                      " on socket %u\n", socket_id);
+                      " on socket %u\n", numa_id);
                qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring);
                rte_free(rxq->sw_rx_ring);
                rte_free(rxq);
@@ -208,7 +208,7 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
 
 int
 qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid,
-                   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)
 {
@@ -257,13 +257,13 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid,
 
        if (ECORE_IS_CMT(edev)) {
                rxq = qede_alloc_rx_queue_mem(dev, qid * 2, nb_desc,
-                                             socket_id, mp, bufsz);
+                                             numa_id, mp, bufsz);
                if (!rxq)
                        return -ENOMEM;
 
                qdev->fp_array[qid * 2].rxq = rxq;
                rxq = qede_alloc_rx_queue_mem(dev, qid * 2 + 1, nb_desc,
-                                             socket_id, mp, bufsz);
+                                             numa_id, mp, bufsz);
                if (!rxq)
                        return -ENOMEM;
 
@@ -272,7 +272,7 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid,
                dev->data->rx_queues[qid] = &qdev->fp_array_cmt[qid];
        } else {
                rxq = qede_alloc_rx_queue_mem(dev, qid, nb_desc,
-                                             socket_id, mp, bufsz);
+                                             numa_id, mp, bufsz);
                if (!rxq)
                        return -ENOMEM;
 
@@ -281,7 +281,7 @@ qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid,
        }
 
        DP_INFO(edev, "rxq %d num_desc %u rx_buf_size=%u socket %u\n",
-                 qid, nb_desc, rxq->rx_buf_size, socket_id);
+                 qid, nb_desc, rxq->rx_buf_size, numa_id);
 
        return 0;
 }
@@ -381,7 +381,7 @@ static struct qede_tx_queue *
 qede_alloc_tx_queue_mem(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 qede_dev *qdev = dev->data->dev_private;
@@ -390,13 +390,13 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
        int rc;
        size_t sw_tx_ring_size;
 
-       txq = rte_zmalloc_socket("qede_tx_queue", sizeof(struct qede_tx_queue),
-                                RTE_CACHE_LINE_SIZE, socket_id);
+       txq = rte_zmalloc_numa("qede_tx_queue", sizeof(struct qede_tx_queue),
+                                RTE_CACHE_LINE_SIZE, numa_id);
 
        if (txq == NULL) {
                DP_ERR(edev,
                       "Unable to allocate memory for txq on socket %u",
-                      socket_id);
+                      numa_id);
                return NULL;
        }
 
@@ -415,21 +415,21 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
        if (rc != ECORE_SUCCESS) {
                DP_ERR(edev,
                       "Unable to allocate memory for txbd ring on socket %u",
-                      socket_id);
+                      numa_id);
                qede_tx_queue_release(txq);
                return NULL;
        }
 
        /* Allocate software ring */
        sw_tx_ring_size = sizeof(txq->sw_tx_ring) * txq->nb_tx_desc;
-       txq->sw_tx_ring = rte_zmalloc_socket("txq->sw_tx_ring",
+       txq->sw_tx_ring = rte_zmalloc_numa("txq->sw_tx_ring",
                                             sw_tx_ring_size,
-                                            RTE_CACHE_LINE_SIZE, socket_id);
+                                            RTE_CACHE_LINE_SIZE, numa_id);
 
        if (!txq->sw_tx_ring) {
                DP_ERR(edev,
                       "Unable to allocate memory for txbd ring on socket %u",
-                      socket_id);
+                      numa_id);
                qdev->ops->common->chain_free(edev, &txq->tx_pbl);
                qede_tx_queue_release(txq);
                return NULL;
@@ -445,7 +445,7 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
 
        DP_INFO(edev,
                  "txq %u num_desc %u tx_free_thresh %u socket %u\n",
-                 queue_idx, nb_desc, txq->tx_free_thresh, socket_id);
+                 queue_idx, nb_desc, txq->tx_free_thresh, numa_id);
        return txq;
 }
 
@@ -453,7 +453,7 @@ int
 qede_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 qede_dev *qdev = dev->data->dev_private;
@@ -476,13 +476,13 @@ qede_tx_queue_setup(struct rte_eth_dev *dev,
 
        if (ECORE_IS_CMT(edev)) {
                txq = qede_alloc_tx_queue_mem(dev, queue_idx * 2, nb_desc,
-                                             socket_id, tx_conf);
+                                             numa_id, tx_conf);
                if (!txq)
                        return -ENOMEM;
 
                qdev->fp_array[queue_idx * 2].txq = txq;
                txq = qede_alloc_tx_queue_mem(dev, (queue_idx * 2) + 1, nb_desc,
-                                             socket_id, tx_conf);
+                                             numa_id, tx_conf);
                if (!txq)
                        return -ENOMEM;
 
@@ -491,7 +491,7 @@ qede_tx_queue_setup(struct rte_eth_dev *dev,
                                        &qdev->fp_array_cmt[queue_idx];
        } else {
                txq = qede_alloc_tx_queue_mem(dev, queue_idx, nb_desc,
-                                             socket_id, tx_conf);
+                                             numa_id, tx_conf);
                if (!txq)
                        return -ENOMEM;
 
diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h
index 013a4a07c7..54b35deca4 100644
--- a/drivers/net/qede/qede_rxtx.h
+++ b/drivers/net/qede/qede_rxtx.h
@@ -241,14 +241,14 @@ struct qede_fastpath_cmt {
  * RX/TX function prototypes
  */
 int qede_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 qede_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 qede_rx_queue_release(void *rx_queue);
-- 
2.55.0

Reply via email to