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/octeontx/octeontx_ethdev.c | 40 +++++++++++++-------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/net/octeontx/octeontx_ethdev.c 
b/drivers/net/octeontx/octeontx_ethdev.c
index bde4c2c615..4e83b81de9 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -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);
-- 
2.55.0

Reply via email to