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/af_xdp/rte_eth_af_xdp.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 9c99dcec20..02ede3f648 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -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; -- 2.55.0

