use NUMA node terminology across the tree
Subsystems (11)
PATCH 142/227 net/qede: use NUMA node terminology
In reply to Chengwen FengFrom: 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/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(-)
drivers/net/qede/base/bcm_osal.c +6 -6
@@ -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 "
drivers/net/qede/qede_filter.c +1 -1
@@ -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));
drivers/net/qede/qede_rxtx.c +27 -27
180 lines not on this page · raw message
drivers/net/qede/qede_rxtx.h +2 -2
@@ -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);
Signature · 1 line
2.55.0
PATCH 143/227 net/r8169: use NUMA node terminology
In reply to Chengwen FengFrom: 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/r8169/r8169_ethdev.h | 4 ++-- drivers/net/r8169/r8169_hw.c | 2 +- drivers/net/r8169/r8169_rxtx.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/r8169/r8169_ethdev.h +2 -2
@@ -289,11 +289,11 @@ uint64_t rtl_get_rx_port_offloads(struct rtl_hw *hw);uint64_t rtl_get_tx_port_offloads (void );int rtl_rx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx, -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 rtl_tx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx, -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 rtl_tx_done_cleanup (void *tx_queue,uint32_t free_cnt);
drivers/net/r8169/r8169_hw.c +1 -1
@@ -2597,7 +2597,7 @@ rtl_tally_init(struct rte_eth_dev *dev)const struct rte_memzone *mz; mz =rte_eth_dma_zone_reserve (dev,"tally_counters" ,0 , -sizeof (struct rtl_counters ),64 ,rte_socket_id ()); +sizeof (struct rtl_counters ),64 ,rte_numa_id ());if (mz ==NULL )return -ENOMEM ;
drivers/net/r8169/r8169_rxtx.c +8 -8
@@ -328,7 +328,7 @@ rtl_get_rx_port_offloads(struct rtl_hw *hw)int rtl_rx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx, -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) {
@@ -351,8 +351,8 @@ rtl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, }/* First allocate the rx queue data structure */ - rxq =rte_zmalloc_socket ("r8169 RX queue" ,sizeof (struct rtl_rx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("r8169 RX queue" ,sizeof (struct rtl_rx_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) {PMD_INIT_LOG (ERR ,"Cannot allocate Rx queue structure" );
@@ -385,7 +385,7 @@ rtl_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,*/ size = hw->RxDescLength * (nb_rx_desc +1 ); mz =rte_eth_dma_zone_reserve (dev,"rx_ring" , queue_idx, size, -RTL_RING_ALIGN , socket_id); +RTL_RING_ALIGN , numa_id);if (mz ==NULL ) { PMD_INIT_LOG(ERR, "Port %d: Cannot allocate software ring for queue %d",
@@ -1258,7 +1258,7 @@ rtl_get_tx_port_offloads(void)int rtl_tx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx, -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 rtl_tx_queue *txq;
@@ -1279,8 +1279,8 @@ rtl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dev->data->tx_queues[queue_idx] =NULL ; } - txq =rte_zmalloc_socket ("r8169 TX queue" ,sizeof (struct rtl_tx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("r8169 TX queue" ,sizeof (struct rtl_tx_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (!txq) {PMD_INIT_LOG (ERR ,"Cannot allocate Tx queue structure" );
@@ -1312,7 +1312,7 @@ rtl_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,*/ size =sizeof (struct rtl_tx_desc ) * (nb_tx_desc +1 ); mz =rte_eth_dma_zone_reserve (dev,"tx_ring" , queue_idx, size, -RTL_RING_ALIGN , socket_id); +RTL_RING_ALIGN , numa_id);if (mz ==NULL ) { PMD_INIT_LOG(ERR, "Port %d: Cannot allocate hardware ring for queue %d",
Signature · 1 line
2.55.0
PATCH 144/227 net/ring: use NUMA node terminology
In reply to Chengwen FengFrom: 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/ring/rte_eth_ring.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/ring/rte_eth_ring.c +10 -10
@@ -155,7 +155,7 @@ eth_dev_set_link_up(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 __rte_unused) {
@@ -168,7 +168,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 pmd_internals *internals = dev->data->dev_private;
@@ -374,21 +374,21 @@ do_eth_dev_ring_create(const char *name,PMD_LOG (INFO ,"Creating rings-backed ethdev on numa socket %u" , numa_node); - rx_queues_local =rte_calloc_socket (name, nb_rx_queues, + rx_queues_local =rte_calloc_numa (name, nb_rx_queues,sizeof (void *),0 , numa_node);if (rx_queues_local ==NULL ) { rte_errno =ENOMEM ; goto error; } - tx_queues_local =rte_calloc_socket (name, nb_tx_queues, + tx_queues_local =rte_calloc_numa (name, nb_tx_queues,sizeof (void *),0 , numa_node);if (tx_queues_local ==NULL ) { rte_errno =ENOMEM ; goto error; } - internals =rte_zmalloc_socket (name,sizeof (*internals),0 , numa_node); + internals =rte_zmalloc_numa (name,sizeof (*internals),0 , numa_node);if (internals ==NULL ) { rte_errno =ENOMEM ; goto error;
@@ -520,7 +520,7 @@ int rte_eth_from_ring(struct rte_ring *r) {return rte_eth_from_rings (r->name, &r,1 , &r,1 , - r->memzone ? r->memzone->socket_id :SOCKET_ID_ANY ); + r->memzone ? r->memzone->socket_id :RTE_NUMA_ID_ANY ); } static int
@@ -693,12 +693,12 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) }if (params ==NULL || params[0 ] =='\0' ) { - ret =eth_dev_ring_create (name, dev,rte_socket_id (),DEV_CREATE , + ret =eth_dev_ring_create (name, dev,rte_numa_id (),DEV_CREATE , ð_dev);if (ret ==-1 ) {PMD_LOG (INFO ,"Attach to pmd_ring for %s" , name); - ret =eth_dev_ring_create (name, dev,rte_socket_id (), + ret =eth_dev_ring_create (name, dev,rte_numa_id (),DEV_ATTACH , ð_dev); } }else {
@@ -707,13 +707,13 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)if (!kvlist) {PMD_LOG (INFO ,"Ignoring unsupported parameters when creating rings-backed ethernet device" ); - ret =eth_dev_ring_create (name, dev,rte_socket_id (), + ret =eth_dev_ring_create (name, dev,rte_numa_id (),DEV_CREATE , ð_dev);if (ret ==-1 ) {PMD_LOG (INFO ,"Attach to pmd_ring for %s" , name); - ret =eth_dev_ring_create (name, dev,rte_socket_id (), + ret =eth_dev_ring_create (name, dev,rte_numa_id (),DEV_ATTACH , ð_dev); }
Signature · 1 line
2.55.0
PATCH 145/227 net/rnp: use NUMA node terminology
In reply to Chengwen FengFrom: 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/rnp/base/rnp_osdep.h | 2 +- drivers/net/rnp/rnp_ethdev.c | 4 ++-- drivers/net/rnp/rnp_rxtx.c | 40 ++++++++++++++++---------------- drivers/net/rnp/rnp_rxtx.h | 4 ++-- 4 files changed, 25 insertions(+), 25 deletions(-)
drivers/net/rnp/base/rnp_osdep.h +1 -1
@@ -129,7 +129,7 @@ rnp_dma_mem_alloc(__rte_unused struct rnp_hw *hw, (uint64_t )rte_atomic_fetch_add_explicit (&rnp_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/rnp/rnp_ethdev.c +2 -2
@@ -33,7 +33,7 @@ rnp_alloc_eth_port(struct rte_pci_device *pci, char *name)RNP_PMD_ERR ("Could not allocate eth_dev for %s" , name);return NULL ; } - port =rte_zmalloc_socket (name, + port =rte_zmalloc_numa (name,sizeof (*port),RTE_CACHE_LINE_SIZE , pci->device.numa_node);
@@ -1633,7 +1633,7 @@ rnp_proc_priv_init(struct rte_eth_dev *dev) {struct rnp_proc_priv *priv; - priv =rte_zmalloc_socket ("rnp_proc_priv" , + priv =rte_zmalloc_numa ("rnp_proc_priv" ,sizeof (struct rnp_proc_priv ),RTE_CACHE_LINE_SIZE , dev->device->numa_node);
drivers/net/rnp/rnp_rxtx.c +20 -20
@@ -156,19 +156,19 @@ rnp_rx_queue_reset(struct rnp_eth_port *port,static int rnp_alloc_rxbdr (struct rte_eth_dev *dev,struct rnp_rx_queue *rxq, -uint16_t nb_rx_desc,int socket_id) +uint16_t nb_rx_desc,int numa_id) {const struct rte_memzone *rz =NULL ;uint32_t size =0 ; size = (nb_rx_desc +RNP_RX_MAX_BURST_SIZE ) *sizeof (struct rnp_rxsw_entry ); - rxq->sw_ring =rte_zmalloc_socket ("rx_swring" , size, -RTE_CACHE_LINE_SIZE , socket_id); + rxq->sw_ring =rte_zmalloc_numa ("rx_swring" , size, +RTE_CACHE_LINE_SIZE , numa_id);if (rxq->sw_ring ==NULL )return -ENOMEM ; rz =rte_eth_dma_zone_reserve (dev,"rx_ring" , rxq->attr.queue_id, -RNP_RX_MAX_RING_SZ ,RNP_BD_RING_ALIGN , socket_id); +RNP_RX_MAX_RING_SZ ,RNP_BD_RING_ALIGN , numa_id);if (rz ==NULL ) {rte_free (rxq->sw_ring); rxq->sw_ring =NULL ;
@@ -200,7 +200,7 @@ rnp_rx_queue_sw_reset(struct rnp_rx_queue *rxq)int rnp_rx_queue_setup (struct rte_eth_dev *eth_dev,uint16_t qidx,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) {
@@ -225,8 +225,8 @@ int rnp_rx_queue_setup(struct rte_eth_dev *eth_dev,rnp_rx_queue_release (data->rx_queues[qidx]); data->rx_queues[qidx] =NULL ; } - rxq =rte_zmalloc_socket ("rnp_rxq" ,sizeof (struct rnp_rx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("rnp_rxq" ,sizeof (struct rnp_rx_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) {RNP_PMD_ERR ("Failed to allocate rx ring memory" );return -ENOMEM ;
@@ -247,14 +247,14 @@ int rnp_rx_queue_setup(struct rte_eth_dev *eth_dev, rxq->rx_buf_len = (uint16_t )(rte_pktmbuf_data_room_size (mb_pool) -RTE_PKTMBUF_HEADROOM ); rxq->mb_pool = mb_pool; - err =rnp_alloc_rxbdr (eth_dev, rxq, nb_rx_desc, socket_id); + err =rnp_alloc_rxbdr (eth_dev, rxq, nb_rx_desc, numa_id);if (err) goto fail;RNP_PMD_LOG (INFO ,"PF[%u] dev:[%u] hw-lane[%u] rx_qid[%u] " "hw_ridx %u socket %u" , hw->mbx.pf_num, rxq->attr.port_id, rxq->attr.lane_id, qidx, - rxq->attr.index, socket_id); + rxq->attr.index, numa_id); rxq->rx_free_thresh = (rx_conf->rx_free_thresh) ? rx_conf->rx_free_thresh :RNP_DEFAULT_RX_FREE_THRESH ; rxq->pthresh = (rx_conf->rx_thresh.pthresh) ?
@@ -329,19 +329,19 @@ rnp_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)static int rnp_alloc_txbdr (struct rte_eth_dev *dev,struct rnp_tx_queue *txq, -uint16_t nb_desc,int socket_id) +uint16_t nb_desc,int numa_id) {const struct rte_memzone *rz =NULL ;int size; size = nb_desc *sizeof (struct rnp_txsw_entry ); - txq->sw_ring =rte_zmalloc_socket ("tx_swq" , size, -RTE_CACHE_LINE_SIZE , socket_id); + txq->sw_ring =rte_zmalloc_numa ("tx_swq" , size, +RTE_CACHE_LINE_SIZE , numa_id);if (txq->sw_ring ==NULL )return -ENOMEM ; rz =rte_eth_dma_zone_reserve (dev,"tx_ring" , txq->attr.queue_id, -RNP_TX_MAX_RING_SZ ,RNP_BD_RING_ALIGN , socket_id); +RNP_TX_MAX_RING_SZ ,RNP_BD_RING_ALIGN , numa_id);if (rz ==NULL ) {rte_free (txq->sw_ring); txq->sw_ring =NULL ;
@@ -384,7 +384,7 @@ rnp_tx_queue_sw_reset(struct rnp_tx_queue *txq)int rnp_tx_queue_setup (struct rte_eth_dev *dev,uint16_t qidx,uint16_t nb_desc, -unsigned int socket_id, +unsigned int numa_id,const struct rte_eth_txconf *tx_conf) {struct rnp_eth_port *port =RNP_DEV_TO_PORT (dev);
@@ -408,8 +408,8 @@ rnp_tx_queue_setup(struct rte_eth_dev *dev,rnp_tx_queue_release (data->tx_queues[qidx]); data->tx_queues[qidx] =NULL ; } - txq =rte_zmalloc_socket ("rnp_txq" ,sizeof (struct rnp_tx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("rnp_txq" ,sizeof (struct rnp_tx_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (!txq) {RNP_PMD_ERR ("Failed to allocate TX ring memory" );return -ENOMEM ;
@@ -440,9 +440,9 @@ rnp_tx_queue_setup(struct rte_eth_dev *dev, tx_conf->tx_thresh.pthresh : RNP_TX_DESC_FETCH_TH; txq->pburst = (tx_conf->tx_thresh.hthresh) ? tx_conf->tx_thresh.hthresh :RNP_TX_DESC_FETCH_BURST ; - txq->free_mbufs =rte_zmalloc_socket ("txq->free_mbufs" , + txq->free_mbufs =rte_zmalloc_numa ("txq->free_mbufs" ,sizeof (struct rte_mbuf *) * txq->tx_rs_thresh, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id); txq->attr.index =rnp_get_dma_ring_index (port, qidx); txq->attr.lane_id = port->attr.nr_lane; txq->attr.port_id = dev->data->port_id;
@@ -451,7 +451,7 @@ rnp_tx_queue_setup(struct rte_eth_dev *dev, txq->attr.nb_desc = nb_desc; txq->attr.queue_id = qidx; - err =rnp_alloc_txbdr (dev, txq, nb_desc, socket_id); + err =rnp_alloc_txbdr (dev, txq, nb_desc, numa_id);if (err) goto txbd_setup_failed;rnp_setup_txbdr (hw, txq);
@@ -462,7 +462,7 @@ rnp_tx_queue_setup(struct rte_eth_dev *dev,"dma_idx %u socket %u" , hw->mbx.pf_num, txq->attr.port_id, txq->attr.lane_id, qidx, - txq->attr.index, socket_id); + txq->attr.index, numa_id);if (qidx < dev->data->nb_tx_queues) data->tx_queues[qidx] = txq; port->tx_queues[qidx] = txq;
drivers/net/rnp/rnp_rxtx.h +2 -2
@@ -136,14 +136,14 @@ rnp_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);int rnp_rx_queue_setup (struct rte_eth_dev *eth_dev,uint16_t qidx,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);int rnp_tx_queue_stop (struct rte_eth_dev *eth_dev,uint16_t qidx);int rnp_tx_queue_start (struct rte_eth_dev *eth_dev,uint16_t qidx);int rnp_tx_queue_setup (struct rte_eth_dev *dev,uint16_t qidx,uint16_t nb_desc, -unsigned int socket_id, +unsigned int numa_id,const struct rte_eth_txconf *tx_conf);int rnp_rx_queue_stop (struct rte_eth_dev *eth_dev,uint16_t qidx);int rnp_rx_queue_start (struct rte_eth_dev *eth_dev,uint16_t qidx);
Signature · 1 line
2.55.0
PATCH 146/227 net/sfc: use NUMA node terminology
In reply to Chengwen FengFrom: 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/sfc/sfc.c | 20 ++++++++++---------- drivers/net/sfc/sfc.h | 4 ++-- drivers/net/sfc/sfc_dp_rx.h | 4 ++-- drivers/net/sfc/sfc_dp_tx.h | 4 ++-- drivers/net/sfc/sfc_ef100_rx.c | 10 +++++----- drivers/net/sfc/sfc_ef100_tx.c | 10 +++++----- drivers/net/sfc/sfc_ef10_essb_rx.c | 10 +++++----- drivers/net/sfc/sfc_ef10_rx.c | 10 +++++----- drivers/net/sfc/sfc_ef10_tx.c | 14 +++++++------- drivers/net/sfc/sfc_ethdev.c | 16 ++++++++-------- drivers/net/sfc/sfc_ev.c | 10 +++++----- drivers/net/sfc/sfc_ev.h | 2 +- drivers/net/sfc/sfc_mae.c | 2 +- drivers/net/sfc/sfc_mae_counter.c | 26 +++++++++++++------------- drivers/net/sfc/sfc_mcdi.c | 2 +- drivers/net/sfc/sfc_port.c | 10 +++++----- drivers/net/sfc/sfc_repr.c | 20 ++++++++++---------- drivers/net/sfc/sfc_repr_proxy.c | 18 +++++++++--------- drivers/net/sfc/sfc_rx.c | 26 +++++++++++++------------- drivers/net/sfc/sfc_rx.h | 2 +- drivers/net/sfc/sfc_service.c | 22 +++++++++++----------- drivers/net/sfc/sfc_service.h | 2 +- drivers/net/sfc/sfc_sw_stats.c | 4 ++-- drivers/net/sfc/sfc_tso.c | 6 +++--- drivers/net/sfc/sfc_tx.c | 28 ++++++++++++++-------------- drivers/net/sfc/sfc_tx.h | 4 ++-- 26 files changed, 143 insertions(+), 143 deletions(-)
drivers/net/sfc/sfc.c +10 -10
@@ -36,12 +36,12 @@ sfc_repr_supported(const struct sfc_adapter *sa)/* * Representor proxy should use service lcore on PF's socket -* (sa->socket_id) to be efficient. But the proxy will fall back +* (sa->numa_id) to be efficient. But the proxy will fall back * to any socket if it is not possible to get the service core * on the same socket. Check that at least service core on any * socket is available. */ -if (sfc_get_service_lcore (SOCKET_ID_ANY ) ==RTE_MAX_LCORE ) +if (sfc_get_service_lcore (RTE_NUMA_ID_ANY ) ==RTE_MAX_LCORE )return false;return true;
@@ -55,20 +55,20 @@ sfc_repr_available(const struct sfc_adapter_shared *sas)int sfc_dma_alloc (struct sfc_adapter *sa,const char *name,uint16_t id, -efx_nic_dma_addr_type_t addr_type,size_t len,int socket_id, +efx_nic_dma_addr_type_t addr_type,size_t len,int numa_id,efsys_mem_t *esmp) {const struct rte_memzone *mz;int rc; -sfc_log_init (sa,"name=%s id=%u len=%zu socket_id=%d" , - name, id, len, socket_id); +sfc_log_init (sa,"name=%s id=%u len=%zu numa_id=%d" , + name, id, len, numa_id); mz =rte_eth_dma_zone_reserve (sa->eth_dev, name, id, len, -sysconf (_SC_PAGESIZE), socket_id); +sysconf (_SC_PAGESIZE), numa_id);if (mz ==NULL ) {sfc_err (sa,"cannot reserve DMA zone for %s:%u %#x@%d: %s" , - name, (unsigned int )id, (unsigned int )len, socket_id, + name, (unsigned int )id, (unsigned int )len, numa_id,rte_strerror (rte_errno));return ENOMEM ; }
@@ -87,8 +87,8 @@ sfc_dma_alloc(struct sfc_adapter *sa, const char *name, uint16_t id, esmp->esm_base = mz->addr;sfc_info (sa, -"DMA name=%s id=%u len=%lu socket_id=%d => virt=%p iova=%lx" , - name, id, len, socket_id, esmp->esm_base, +"DMA name=%s id=%u len=%lu numa_id=%d => virt=%p iova=%lx" , + name, id, len, numa_id, esmp->esm_base, (unsigned long )esmp->esm_addr);return 0 ;
@@ -1292,7 +1292,7 @@ sfc_probe(struct sfc_adapter *sa)SFC_ASSERT (sfc_adapter_is_locked (sa)); - sa->socket_id =rte_socket_id (); + sa->numa_id =rte_numa_id (); sa->restart_required = false;sfc_log_init (sa,"get family" );
drivers/net/sfc/sfc.h +2 -2
@@ -251,7 +251,7 @@ struct sfc_adapter {enum sfc_ethdev_state state;struct rte_eth_dev *eth_dev;struct rte_kvargs *kvargs; -int socket_id; +int numa_id;efsys_bar_t mem_bar;/* Function control window offset */ efsys_dma_addr_t fcw_offset;
@@ -399,7 +399,7 @@ sfc_get_system_msecs(void) }int sfc_dma_alloc (struct sfc_adapter *sa,const char *name,uint16_t id, -efx_nic_dma_addr_type_t addr_type,size_t len,int socket_id, +efx_nic_dma_addr_type_t addr_type,size_t len,int numa_id,efsys_mem_t *esmp);void sfc_dma_free (const struct sfc_adapter *sa,efsys_mem_t *esmp);
drivers/net/sfc/sfc_dp_rx.h +2 -2
@@ -147,7 +147,7 @@ typedef int (sfc_dp_rx_qsize_up_rings_t)(uint16_t nb_rx_desc,* @param port_id The port identifier * @param queue_id The queue identifier * @param pci_addr PCI function address -* @param socket_id Socket identifier to allocate memory +* @param numa_id Socket identifier to allocate memory * @param info Receive queue information * @param dp_rxqp Location for generic datapath receive queue pointer *
@@ -155,7 +155,7 @@ typedef int (sfc_dp_rx_qsize_up_rings_t)(uint16_t nb_rx_desc,*/ typedef int (sfc_dp_rx_qcreate_t )(uint16_t port_id,uint16_t queue_id,const struct rte_pci_addr *pci_addr, -int socket_id, +int numa_id,const struct sfc_dp_rx_qcreate_info *info,struct sfc_dp_rxq **dp_rxqp);
drivers/net/sfc/sfc_dp_tx.h +2 -2
@@ -119,7 +119,7 @@ typedef int (sfc_dp_tx_qsize_up_rings_t)(uint16_t nb_tx_desc,* @param port_id The port identifier * @param queue_id The queue identifier * @param pci_addr PCI function address -* @param socket_id Socket identifier to allocate memory +* @param numa_id Socket identifier to allocate memory * @param info Tx queue details wrapped in structure * @param dp_txqp Location for generic datapath transmit queue pointer *
@@ -127,7 +127,7 @@ typedef int (sfc_dp_tx_qsize_up_rings_t)(uint16_t nb_tx_desc,*/ typedef int (sfc_dp_tx_qcreate_t )(uint16_t port_id,uint16_t queue_id,const struct rte_pci_addr *pci_addr, -int socket_id, +int numa_id,const struct sfc_dp_tx_qcreate_info *info,struct sfc_dp_txq **dp_txqp);
drivers/net/sfc/sfc_ef100_rx.c +5 -5
@@ -767,7 +767,7 @@ sfc_ef100_mk_mbuf_rearm_data(uint16_t port_id, uint16_t prefix_size)static sfc_dp_rx_qcreate_t sfc_ef100_rx_qcreate;static int sfc_ef100_rx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_rx_qcreate_info *info,struct sfc_dp_rxq **dp_rxqp) {
@@ -779,18 +779,18 @@ sfc_ef100_rx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_rxq_args; rc =ENOMEM ; - rxq =rte_zmalloc_socket ("sfc-ef100-rxq" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("sfc-ef100-rxq" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) goto fail_rxq_alloc;sfc_dp_queue_init (&rxq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - rxq->sw_ring =rte_calloc_socket ("sfc-ef100-rxq-sw_ring" , + rxq->sw_ring =rte_calloc_numa ("sfc-ef100-rxq-sw_ring" , info->rxq_entries,sizeof (*rxq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (rxq->sw_ring ==NULL ) goto fail_desc_alloc;
drivers/net/sfc/sfc_ef100_tx.c +5 -5
@@ -834,7 +834,7 @@ sfc_ef100_tx_qsize_up_rings(uint16_t nb_tx_desc,static sfc_dp_tx_qcreate_t sfc_ef100_tx_qcreate;static int sfc_ef100_tx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_tx_qcreate_info *info,struct sfc_dp_txq **dp_txqp) {
@@ -846,18 +846,18 @@ sfc_ef100_tx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_bad_args; rc =ENOMEM ; - txq =rte_zmalloc_socket ("sfc-ef100-txq" ,sizeof (*txq), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("sfc-ef100-txq" ,sizeof (*txq), +RTE_CACHE_LINE_SIZE , numa_id);if (txq ==NULL ) goto fail_txq_alloc;sfc_dp_queue_init (&txq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - txq->sw_ring =rte_calloc_socket ("sfc-ef100-txq-sw_ring" , + txq->sw_ring =rte_calloc_numa ("sfc-ef100-txq-sw_ring" , info->txq_entries,sizeof (*txq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txq->sw_ring ==NULL ) goto fail_sw_ring_alloc;
drivers/net/sfc/sfc_ef10_essb_rx.c +5 -5
@@ -564,7 +564,7 @@ sfc_ef10_essb_rx_qsize_up_rings(uint16_t nb_rx_desc,static sfc_dp_rx_qcreate_t sfc_ef10_essb_rx_qcreate;static int sfc_ef10_essb_rx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_rx_qcreate_info *info,struct sfc_dp_rxq **dp_rxqp) {
@@ -590,18 +590,18 @@ sfc_ef10_essb_rx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_no_block_dequeue; rc =ENOMEM ; - rxq =rte_zmalloc_socket ("sfc-ef10-rxq" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("sfc-ef10-rxq" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) goto fail_rxq_alloc;sfc_dp_queue_init (&rxq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - rxq->sw_ring =rte_calloc_socket ("sfc-ef10-rxq-sw_ring" , + rxq->sw_ring =rte_calloc_numa ("sfc-ef10-rxq-sw_ring" , info->rxq_entries,sizeof (*rxq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (rxq->sw_ring ==NULL ) goto fail_desc_alloc;
drivers/net/sfc/sfc_ef10_rx.c +5 -5
@@ -640,7 +640,7 @@ sfc_ef10_mk_mbuf_rearm_data(uint16_t port_id, uint16_t prefix_size)static sfc_dp_rx_qcreate_t sfc_ef10_rx_qcreate;static int sfc_ef10_rx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_rx_qcreate_info *info,struct sfc_dp_rxq **dp_rxqp) {
@@ -656,18 +656,18 @@ sfc_ef10_rx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_nic_dma; rc =ENOMEM ; - rxq =rte_zmalloc_socket ("sfc-ef10-rxq" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("sfc-ef10-rxq" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) goto fail_rxq_alloc;sfc_dp_queue_init (&rxq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - rxq->sw_ring =rte_calloc_socket ("sfc-ef10-rxq-sw_ring" , + rxq->sw_ring =rte_calloc_numa ("sfc-ef10-rxq-sw_ring" , info->rxq_entries,sizeof (*rxq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (rxq->sw_ring ==NULL ) goto fail_desc_alloc;
drivers/net/sfc/sfc_ef10_tx.c +7 -7
@@ -933,7 +933,7 @@ sfc_ef10_tx_qsize_up_rings(uint16_t nb_tx_desc,static sfc_dp_tx_qcreate_t sfc_ef10_tx_qcreate;static int sfc_ef10_tx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_tx_qcreate_info *info,struct sfc_dp_txq **dp_txqp) {
@@ -949,29 +949,29 @@ sfc_ef10_tx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_nic_dma; rc =ENOMEM ; - txq =rte_zmalloc_socket ("sfc-ef10-txq" ,sizeof (*txq), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("sfc-ef10-txq" ,sizeof (*txq), +RTE_CACHE_LINE_SIZE , numa_id);if (txq ==NULL ) goto fail_txq_alloc;sfc_dp_queue_init (&txq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - txq->sw_ring =rte_calloc_socket ("sfc-ef10-txq-sw_ring" , + txq->sw_ring =rte_calloc_numa ("sfc-ef10-txq-sw_ring" , info->txq_entries,sizeof (*txq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txq->sw_ring ==NULL ) goto fail_sw_ring_alloc;if (info->offloads & (RTE_ETH_TX_OFFLOAD_TCP_TSO |RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO )) { - txq->tsoh =rte_calloc_socket ("sfc-ef10-txq-tsoh" , + txq->tsoh =rte_calloc_numa ("sfc-ef10-txq-tsoh" , info->txq_entries,SFC_TSOH_STD_LEN ,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (txq->tsoh ==NULL ) goto fail_tsoh_alloc;
drivers/net/sfc/sfc_ethdev.c +8 -8
@@ -633,7 +633,7 @@ sfc_dev_allmulti_disable(struct rte_eth_dev *dev)static int sfc_rx_queue_setup (struct rte_eth_dev *dev,uint16_t ethdev_qid, -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) {
@@ -644,13 +644,13 @@ sfc_rx_queue_setup(struct rte_eth_dev *dev, uint16_t ethdev_qid,sfc_sw_index_t sw_index;int rc; -sfc_log_init (sa,"RxQ=%u nb_rx_desc=%u socket_id=%u" , - ethdev_qid, nb_rx_desc, socket_id); +sfc_log_init (sa,"RxQ=%u nb_rx_desc=%u numa_id=%u" , + ethdev_qid, nb_rx_desc, numa_id);sfc_adapter_lock (sa); sw_index =sfc_rxq_sw_index_by_ethdev_rx_qid (sas, sfc_ethdev_qid); - rc =sfc_rx_qinit (sa, sw_index, nb_rx_desc, socket_id, + rc =sfc_rx_qinit (sa, sw_index, nb_rx_desc, numa_id, rx_conf, mb_pool);if (rc !=0 ) goto fail_rx_qinit;
@@ -694,7 +694,7 @@ sfc_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)static int sfc_tx_queue_setup (struct rte_eth_dev *dev,uint16_t ethdev_qid, -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 sfc_adapter_shared *sas =sfc_adapter_shared_by_eth_dev (dev);
@@ -703,13 +703,13 @@ sfc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t ethdev_qid,sfc_sw_index_t sw_index;int rc; -sfc_log_init (sa,"TxQ = %u, nb_tx_desc = %u, socket_id = %u" , - ethdev_qid, nb_tx_desc, socket_id); +sfc_log_init (sa,"TxQ = %u, nb_tx_desc = %u, numa_id = %u" , + ethdev_qid, nb_tx_desc, numa_id);sfc_adapter_lock (sa); sw_index =sfc_txq_sw_index_by_ethdev_tx_qid (sas, ethdev_qid); - rc =sfc_tx_qinit (sa, sw_index, nb_tx_desc, socket_id, tx_conf); + rc =sfc_tx_qinit (sa, sw_index, nb_tx_desc, numa_id, tx_conf);if (rc !=0 ) goto fail_tx_qinit;
drivers/net/sfc/sfc_ev.c +5 -5
@@ -945,7 +945,7 @@ sfc_ev_stop(struct sfc_adapter *sa)int sfc_ev_qinit (struct sfc_adapter *sa,enum sfc_evq_type type,unsigned int type_index, -unsigned int entries,int socket_id,struct sfc_evq **evqp) +unsigned int entries,int numa_id,struct sfc_evq **evqp) {struct sfc_evq *evq;int rc;
@@ -956,8 +956,8 @@ sfc_ev_qinit(struct sfc_adapter *sa,SFC_ASSERT (rte_is_power_of_2 (entries)); rc =ENOMEM ; - evq =rte_zmalloc_socket ("sfc-evq" ,sizeof (*evq),RTE_CACHE_LINE_SIZE , - socket_id); + evq =rte_zmalloc_numa ("sfc-evq" ,sizeof (*evq),RTE_CACHE_LINE_SIZE , + numa_id);if (evq ==NULL ) goto fail_evq_alloc;
@@ -969,7 +969,7 @@ sfc_ev_qinit(struct sfc_adapter *sa, rc =sfc_dma_alloc (sa,sfc_evq_type2str (type), type_index,EFX_NIC_DMA_ADDR_EVENT_RING ,efx_evq_size (sa->nic, evq->entries, sa->evq_flags), - socket_id, &evq->mem); + numa_id, &evq->mem);if (rc !=0 ) goto fail_dma_alloc;
@@ -1044,7 +1044,7 @@ sfc_ev_attach(struct sfc_adapter *sa)rte_spinlock_init (&sa->mgmt_evq_lock); rc =sfc_ev_qinit (sa,SFC_EVQ_TYPE_MGMT ,0 , sa->evq_min_entries, - sa->socket_id, &sa->mgmt_evq); + sa->numa_id, &sa->mgmt_evq);if (rc !=0 ) goto fail_mgmt_evq_init;
drivers/net/sfc/sfc_ev.h +1 -1
@@ -214,7 +214,7 @@ void sfc_ev_stop(struct sfc_adapter *sa);int sfc_ev_qinit (struct sfc_adapter *sa,enum sfc_evq_type type,unsigned int type_index, -unsigned int entries,int socket_id,struct sfc_evq **evqp); +unsigned int entries,int numa_id,struct sfc_evq **evqp);void sfc_ev_qfini (struct sfc_evq *evq);int sfc_ev_qstart (struct sfc_evq *evq,unsigned int hw_index);void sfc_ev_qstop (struct sfc_evq *evq);
drivers/net/sfc/sfc_mae.c +1 -1
@@ -4418,7 +4418,7 @@ sfc_mae_rule_parse_action_count(struct sfc_adapter *sa, goto fail_counter_queue_uninit; } -if (sfc_get_service_lcore (SOCKET_ID_ANY ) ==RTE_MAX_LCORE ) { +if (sfc_get_service_lcore (RTE_NUMA_ID_ANY ) ==RTE_MAX_LCORE ) { rc =EINVAL ; goto fail_no_service_core; }
drivers/net/sfc/sfc_mae_counter.c +13 -13
@@ -47,19 +47,19 @@ sfc_mae_counter_get_service_lcore(struct sfc_adapter *sa) {uint32_t cid; - cid =sfc_get_service_lcore (sa->socket_id); + cid =sfc_get_service_lcore (sa->numa_id);if (cid !=RTE_MAX_LCORE )return cid; -if (sa->socket_id !=SOCKET_ID_ANY ) - cid =sfc_get_service_lcore (SOCKET_ID_ANY ); +if (sa->numa_id !=RTE_NUMA_ID_ANY ) + cid =sfc_get_service_lcore (RTE_NUMA_ID_ANY );if (cid ==RTE_MAX_LCORE ) {sfc_warn (sa,"failed to get service lcore for counter service" ); - }else if (sa->socket_id !=SOCKET_ID_ANY ) { + }else if (sa->numa_id !=RTE_NUMA_ID_ANY ) {sfc_warn (sa,"failed to get service lcore for counter service at socket %d, but got at socket %u" , - sa->socket_id,rte_lcore_to_socket_id (cid)); + sa->numa_id,rte_lcore_to_numa_id (cid)); }return cid; }
@@ -589,20 +589,20 @@ sfc_mae_counter_service_register(struct sfc_adapter *sa,/* Prepare service info */ memset (&service,0 ,sizeof (service));rte_strscpy (service.name, counter_service_name,sizeof (service.name)); - service.socket_id = sa->socket_id; + service.socket_id = sa->numa_id; service.callback = sfc_mae_counter_service_routine; service.callback_userdata = sa;sfc_mae_counter_registry_prepare (counter_registry, sa, counter_stream_flags); - cid =sfc_get_service_lcore (sa->socket_id); -if (cid ==RTE_MAX_LCORE && sa->socket_id !=SOCKET_ID_ANY ) { + cid =sfc_get_service_lcore (sa->numa_id); +if (cid ==RTE_MAX_LCORE && sa->numa_id !=RTE_NUMA_ID_ANY ) {/* Warn and try to allocate on any NUMA node */ sfc_warn (sa,"failed to get service lcore for counter service at socket %d" , - sa->socket_id); + sa->numa_id); - cid =sfc_get_service_lcore (SOCKET_ID_ANY ); + cid =sfc_get_service_lcore (RTE_NUMA_ID_ANY ); }if (cid ==RTE_MAX_LCORE ) { rc =ENOTSUP ;
@@ -795,7 +795,7 @@ sfc_mae_counter_rxq_attach(struct sfc_adapter *sa)* mempool backend is chosen since backend is unused. */ mp =rte_pktmbuf_pool_create (name, n_elements, cache_size, - priv_size, data_room_size, sa->socket_id); + priv_size, data_room_size, sa->numa_id);if (mp ==NULL ) {sfc_err (sa,"failed to create counter RxQ mempool" ); rc = rte_errno;
@@ -873,7 +873,7 @@ sfc_mae_counter_rxq_init(struct sfc_adapter *sa) goto fail_counter_rxq_init_info; rc =sfc_rx_qinit (sa, sa->counter_rxq.sw_index, nb_rx_desc, - sa->socket_id, &rxconf, sa->counter_rxq.mp); + sa->numa_id, &rxconf, sa->counter_rxq.mp);if (rc !=0 ) {sfc_err (sa,"failed to init counter RxQ" ); goto fail_counter_rxq_init;
@@ -1058,7 +1058,7 @@ bool sfc_mae_counter_stream_enabled(struct sfc_adapter *sa) {if ((sa->counter_rxq.state &SFC_COUNTER_RXQ_INITIALIZED ) ==0 || -sfc_get_service_lcore (SOCKET_ID_ANY ) ==RTE_MAX_LCORE ) +sfc_get_service_lcore (RTE_NUMA_ID_ANY ) ==RTE_MAX_LCORE )return B_FALSE ;else return B_TRUE ;
drivers/net/sfc/sfc_mcdi.c +1 -1
@@ -22,7 +22,7 @@ sfc_mcdi_dma_alloc(void *cookie, const char *name, size_t len,struct sfc_adapter *sa = cookie;return sfc_dma_alloc (sa, name,0 ,EFX_NIC_DMA_ADDR_MCDI_BUF , len, - sa->socket_id, esmp); + sa->numa_id, esmp); }static sfc_efx_mcdi_dma_free_cb sfc_mcdi_dma_free;
drivers/net/sfc/sfc_port.c +5 -5
@@ -454,19 +454,19 @@ sfc_port_attach(struct sfc_adapter *sa) port->max_mcast_addrs =EFX_MAC_MULTICAST_LIST_MAX ; port->nb_mcast_addrs =0 ; - port->mcast_addrs =rte_calloc_socket ("mcast_addr_list_buf" , + port->mcast_addrs =rte_calloc_numa ("mcast_addr_list_buf" , port->max_mcast_addrs,EFX_MAC_ADDR_LEN ,0 , - sa->socket_id); + sa->numa_id);if (port->mcast_addrs ==NULL ) { rc =ENOMEM ; goto fail_mcast_addr_list_buf_alloc; } rc =ENOMEM ; - port->mac_stats_buf =rte_calloc_socket ("mac_stats_buf" ,EFX_MAC_NSTATS , + port->mac_stats_buf =rte_calloc_numa ("mac_stats_buf" ,EFX_MAC_NSTATS ,sizeof (uint64_t ),0 , - sa->socket_id); + sa->numa_id);if (port->mac_stats_buf ==NULL ) goto fail_mac_stats_buf_alloc;
@@ -474,7 +474,7 @@ sfc_port_attach(struct sfc_adapter *sa) mac_stats_size =RTE_ALIGN (mac_nstats *sizeof (uint64_t ),EFX_BUF_SIZE ); rc =sfc_dma_alloc (sa,"mac_stats" ,0 ,EFX_NIC_DMA_ADDR_MAC_STATS_BUF , mac_stats_size, - sa->socket_id, &port->mac_stats_dma_mem); + sa->numa_id, &port->mac_stats_dma_mem);if (rc !=0 ) goto fail_mac_stats_dma_alloc;
drivers/net/sfc/sfc_repr.c +10 -10
@@ -513,7 +513,7 @@ sfc_repr_dev_link_update(struct rte_eth_dev *dev,static int sfc_repr_ring_create (uint16_t pf_port_id,uint16_t repr_id,const char *type_name,uint16_t qid,uint16_t nb_desc, -unsigned int socket_id,struct rte_ring **ring) +unsigned int numa_id,struct rte_ring **ring) {char ring_name[RTE_RING_NAMESIZE ];int ret;
@@ -529,7 +529,7 @@ sfc_repr_ring_create(uint16_t pf_port_id, uint16_t repr_id,* a single thread, and the user of the other end (representor proxy) * is also single-threaded. */ - *ring =rte_ring_create (ring_name, nb_desc, socket_id, + *ring =rte_ring_create (ring_name, nb_desc, numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ );if (*ring ==NULL )return -rte_errno;
@@ -570,7 +570,7 @@ sfc_repr_rx_qcheck_conf(struct sfc_repr *sr,static int sfc_repr_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, __rte_unused const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mb_pool) {
@@ -586,8 +586,8 @@ sfc_repr_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, goto fail_check_conf; ret = -ENOMEM ; - rxq =rte_zmalloc_socket ("sfc-repr-rxq" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("sfc-repr-rxq" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) {sfcr_err (sr,"%s() failed to alloc RxQ" , __func__); goto fail_rxq_alloc;
@@ -595,7 +595,7 @@ sfc_repr_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, ret =sfc_repr_ring_create (srs->pf_port_id, srs->repr_id,"rx" , rx_queue_id, nb_rx_desc, - socket_id, &rxq->ring); + numa_id, &rxq->ring);if (ret !=0 ) {sfcr_err (sr,"%s() failed to create ring" , __func__); goto fail_ring_create;
@@ -672,7 +672,7 @@ sfc_repr_tx_qcheck_conf(struct sfc_repr *sr,static int sfc_repr_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 sfc_repr_shared *srs =sfc_repr_shared_by_eth_dev (dev);
@@ -687,14 +687,14 @@ sfc_repr_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, goto fail_check_conf; ret = -ENOMEM ; - txq =rte_zmalloc_socket ("sfc-repr-txq" ,sizeof (*txq), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("sfc-repr-txq" ,sizeof (*txq), +RTE_CACHE_LINE_SIZE , numa_id);if (txq ==NULL ) goto fail_txq_alloc; ret =sfc_repr_ring_create (srs->pf_port_id, srs->repr_id,"tx" , tx_queue_id, nb_tx_desc, - socket_id, &txq->ring); + numa_id, &txq->ring);if (ret !=0 ) goto fail_ring_create;
drivers/net/sfc/sfc_repr_proxy.c +9 -9
@@ -393,7 +393,7 @@ sfc_repr_proxy_txq_init(struct sfc_adapter *sa)sfc_tx_qinit_info (sa, txq->sw_index); rc =sfc_tx_qinit (sa, txq->sw_index, -SFC_REPR_PROXY_TX_DESC_COUNT , sa->socket_id, +SFC_REPR_PROXY_TX_DESC_COUNT , sa->numa_id, &tx_conf);if (rc !=0 ) {
@@ -559,7 +559,7 @@ sfc_repr_proxy_rxq_init(struct sfc_adapter *sa, goto fail_repr_rxq_init_info; } - rc =sfc_rx_qinit (sa, rxq->sw_index, nb_rx_desc, sa->socket_id, &rxconf, + rc =sfc_rx_qinit (sa, rxq->sw_index, nb_rx_desc, sa->numa_id, &rxconf, rxq->mp);if (rc !=0 ) {sfc_err (sa,"failed to init representor proxy RxQ" );
@@ -898,14 +898,14 @@ sfc_repr_proxy_attach(struct sfc_adapter *sa)if (rc !=0 ) goto fail_ports_init; - cid =sfc_get_service_lcore (sa->socket_id); -if (cid ==RTE_MAX_LCORE && sa->socket_id !=SOCKET_ID_ANY ) { + cid =sfc_get_service_lcore (sa->numa_id); +if (cid ==RTE_MAX_LCORE && sa->numa_id !=RTE_NUMA_ID_ANY ) {/* Warn and try to allocate on any NUMA node */ sfc_warn (sa,"repr proxy: unable to get service lcore at socket %d" , - sa->socket_id); + sa->numa_id); - cid =sfc_get_service_lcore (SOCKET_ID_ANY ); + cid =sfc_get_service_lcore (RTE_NUMA_ID_ANY ); }if (cid ==RTE_MAX_LCORE ) { rc =ENOTSUP ;
@@ -916,7 +916,7 @@ sfc_repr_proxy_attach(struct sfc_adapter *sa)memset (&service,0 ,sizeof (service));snprintf (service.name,sizeof (service.name),"net_sfc_%hu_repr_proxy" ,sfc_sa2shared (sa)->port_id); - service.socket_id =rte_lcore_to_socket_id (cid); + service.socket_id =rte_lcore_to_numa_id (cid); service.callback = sfc_repr_proxy_routine; service.callback_userdata = rp;
@@ -947,7 +947,7 @@ sfc_repr_proxy_attach(struct sfc_adapter *sa) fail_register:/* * No need to rollback service lcore get since -* it just makes socket_id based search and remembers it. +* it just makes numa_id based search and remembers it. */ fail_get_service_lcore:
@@ -1270,7 +1270,7 @@ sfc_repr_proxy_add_port(uint16_t pf_port_id, uint16_t repr_id, } port =rte_zmalloc ("sfc-repr-proxy-port" ,sizeof (*port), - sa->socket_id); + sa->numa_id);if (port ==NULL ) { rc =ENOMEM ;sfc_err (sa,"failed to alloc memory for proxy port" );
drivers/net/sfc/sfc_rx.c +13 -13
@@ -477,7 +477,7 @@ sfc_efx_rx_qsize_up_rings(uint16_t nb_rx_desc,static sfc_dp_rx_qcreate_t sfc_efx_rx_qcreate;static int sfc_efx_rx_qcreate (uint16_t port_id,uint16_t queue_id, -const struct rte_pci_addr *pci_addr,int socket_id, +const struct rte_pci_addr *pci_addr,int numa_id,const struct sfc_dp_rx_qcreate_info *info,struct sfc_dp_rxq **dp_rxqp) {
@@ -489,18 +489,18 @@ sfc_efx_rx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_nic_dma; rc =ENOMEM ; - rxq =rte_zmalloc_socket ("sfc-efx-rxq" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("sfc-efx-rxq" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) goto fail_rxq_alloc;sfc_dp_queue_init (&rxq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - rxq->sw_desc =rte_calloc_socket ("sfc-efx-rxq-sw_desc" , + rxq->sw_desc =rte_calloc_numa ("sfc-efx-rxq-sw_desc" , info->rxq_entries,sizeof (*rxq->sw_desc), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (rxq->sw_desc ==NULL ) goto fail_desc_alloc;
@@ -1098,7 +1098,7 @@ sfc_rx_mb_pool_buf_size(struct sfc_adapter *sa, struct rte_mempool *mb_pool)int sfc_rx_qinit (struct sfc_adapter *sa,sfc_sw_index_t sw_index, -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) {
@@ -1206,7 +1206,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, rxq_info->type_flags |=EFX_RXQ_FLAG_VLAN_STRIPPED_TCI ; rc =sfc_ev_qinit (sa,SFC_EVQ_TYPE_RX , sw_index, - evq_entries, socket_id, &evq); + evq_entries, numa_id, &evq);if (rc !=0 ) goto fail_ev_qinit;
@@ -1247,7 +1247,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, rc =sfc_dma_alloc (sa,"rxq" , sw_index,EFX_NIC_DMA_ADDR_RX_RING ,efx_rxq_size (sa->nic, rxq_info->entries), - socket_id, &rxq->mem); + numa_id, &rxq->mem);if (rc !=0 ) goto fail_dma_alloc;
@@ -1280,7 +1280,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,struct rte_pci_device *pci_dev =RTE_CLASS_TO_BUS_DEVICE (sa->eth_dev, *pci_dev); rc = sa->priv.dp_rx->qcreate (sa->eth_dev->data->port_id, sw_index, &pci_dev->addr, - socket_id, &info, &rxq_info->dp); + numa_id, &info, &rxq_info->dp);if (rc !=0 ) goto fail_dp_rx_qcreate;
@@ -1420,9 +1420,9 @@ sfc_rx_hash_init(struct sfc_adapter *sa)if (rc !=0 )return rc; - hf_map =rte_calloc_socket ("sfc-rss-hf-map" , + hf_map =rte_calloc_numa ("sfc-rss-hf-map" ,RTE_DIM (sfc_rss_hf_map), -sizeof (*hf_map),0 , sa->socket_id); +sizeof (*hf_map),0 , sa->numa_id);if (hf_map ==NULL )return ENOMEM ;
@@ -1755,9 +1755,9 @@ sfc_rx_configure(struct sfc_adapter *sa)if (sas->rxq_info ==NULL ) { reconfigure = false; rc =ENOMEM ; - sas->rxq_info =rte_calloc_socket ("sfc-rxqs" , nb_rxq_total, + sas->rxq_info =rte_calloc_numa ("sfc-rxqs" , nb_rxq_total,sizeof (sas->rxq_info[0 ]),0 , - sa->socket_id); + sa->numa_id);if (sas->rxq_info ==NULL ) goto fail_rxqs_alloc;
drivers/net/sfc/sfc_rx.h +1 -1
@@ -133,7 +133,7 @@ void sfc_rx_stop(struct sfc_adapter *sa);int sfc_rx_qinit_info (struct sfc_adapter *sa,sfc_sw_index_t sw_index,unsigned int extra_efx_type_flags);int sfc_rx_qinit (struct sfc_adapter *sa,unsigned int 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 sfc_rx_qfini (struct sfc_adapter *sa,sfc_sw_index_t sw_index);
drivers/net/sfc/sfc_service.c +11 -11
@@ -27,7 +27,7 @@ RTE_INIT(sfc_service_lcore_init) }static uint32_t -sfc_find_service_lcore (int *socket_id) +sfc_find_service_lcore (int *numa_id) {uint32_t service_core_list[RTE_MAX_LCORE ];uint32_t lcore_id;
@@ -50,18 +50,18 @@ sfc_find_service_lcore(int *socket_id)for (i =0 ; i < num; ++i) { lcore_id = service_core_list[i]; -if (*socket_id ==SOCKET_ID_ANY ) { - *socket_id =rte_lcore_to_socket_id (lcore_id); +if (*numa_id ==RTE_NUMA_ID_ANY ) { + *numa_id =rte_lcore_to_numa_id (lcore_id);break ; - }else if (rte_lcore_to_socket_id (lcore_id) == - (unsigned int )*socket_id) { + }else if (rte_lcore_to_numa_id (lcore_id) == + (unsigned int )*numa_id) {break ; } }if (i == num) {SFC_GENERIC_LOG (WARNING , -"No service cores reserved at socket %d" , *socket_id); +"No service cores reserved at socket %d" , *numa_id);return RTE_MAX_LCORE ; }
@@ -69,14 +69,14 @@ sfc_find_service_lcore(int *socket_id) }uint32_t -sfc_get_service_lcore (int socket_id) +sfc_get_service_lcore (int numa_id) {uint32_t lcore_id =RTE_MAX_LCORE ;rte_spinlock_lock (&sfc_service_lcore_lock); -if (socket_id !=SOCKET_ID_ANY ) { - lcore_id = sfc_service_lcore[socket_id]; +if (numa_id !=RTE_NUMA_ID_ANY ) { + lcore_id = sfc_service_lcore[numa_id]; }else {size_t i;
@@ -89,9 +89,9 @@ sfc_get_service_lcore(int socket_id) }if (lcore_id ==RTE_MAX_LCORE ) { - lcore_id =sfc_find_service_lcore (&socket_id); + lcore_id =sfc_find_service_lcore (&numa_id);if (lcore_id !=RTE_MAX_LCORE ) - sfc_service_lcore[socket_id] = lcore_id; + sfc_service_lcore[numa_id] = lcore_id; }rte_spinlock_unlock (&sfc_service_lcore_lock);
drivers/net/sfc/sfc_service.h +1 -1
@@ -12,7 +12,7 @@extern "C" {#endif -uint32_t sfc_get_service_lcore (int socket_id); +uint32_t sfc_get_service_lcore (int numa_id); #ifdef __cplusplus }
drivers/net/sfc/sfc_sw_stats.c +2 -2
@@ -831,8 +831,8 @@ sfc_sw_xstats_alloc_queues_bitmap(struct sfc_adapter *sa) *queues_bitmap_mem =NULL ; *queues_bitmap =NULL ; - *queues_bitmap_mem =rte_calloc_socket ("bitmap_mem" , bmp_size,1 ,0 , - sa->socket_id); + *queues_bitmap_mem =rte_calloc_numa ("bitmap_mem" , bmp_size,1 ,0 , + sa->numa_id);if (*queues_bitmap_mem ==NULL )return ENOMEM ;
drivers/net/sfc/sfc_tso.c +3 -3
@@ -18,15 +18,15 @@int sfc_efx_tso_alloc_tsoh_objs (struct sfc_efx_tx_sw_desc *sw_ring, -unsigned int txq_entries,unsigned int socket_id) +unsigned int txq_entries,unsigned int numa_id) {unsigned int i;for (i =0 ; i < txq_entries; ++i) { - sw_ring[i].tsoh =rte_malloc_socket ("sfc-efx-txq-tsoh-obj" , + sw_ring[i].tsoh =rte_malloc_numa ("sfc-efx-txq-tsoh-obj" ,SFC_TSOH_STD_LEN ,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (sw_ring[i].tsoh ==NULL ) goto fail_alloc_tsoh_objs; }
drivers/net/sfc/sfc_tx.c +14 -14
@@ -132,7 +132,7 @@ sfc_tx_qflush_done(struct sfc_txq_info *txq_info)int sfc_tx_qinit (struct sfc_adapter *sa,sfc_sw_index_t sw_index, -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 sfc_adapter_shared *const sas =sfc_sa2shared (sa);
@@ -182,7 +182,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, txq_info->entries = txq_entries; rc =sfc_ev_qinit (sa,SFC_EVQ_TYPE_TX , sw_index, - evq_entries, socket_id, &evq); + evq_entries, numa_id, &evq);if (rc !=0 ) goto fail_ev_qinit;
@@ -196,7 +196,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index, rc =sfc_dma_alloc (sa,"txq" , sw_index,EFX_NIC_DMA_ADDR_TX_RING ,efx_txq_size (sa->nic, txq_info->entries), - socket_id, &txq->mem); + numa_id, &txq->mem);if (rc !=0 ) goto fail_dma_alloc;
@@ -233,7 +233,7 @@ sfc_tx_qinit(struct sfc_adapter *sa, sfc_sw_index_t sw_index,struct rte_pci_device *pci_dev =RTE_CLASS_TO_BUS_DEVICE (sa->eth_dev, *pci_dev); rc = sa->priv.dp_tx->qcreate (sa->eth_dev->data->port_id, sw_index, &pci_dev->addr, - socket_id, &info, &txq_info->dp); + numa_id, &info, &txq_info->dp);if (rc !=0 ) goto fail_dp_tx_qinit;
@@ -407,9 +407,9 @@ sfc_tx_configure(struct sfc_adapter *sa)if (sas->txq_info ==NULL ) { reconfigure = false; - sas->txq_info =rte_calloc_socket ("sfc-txqs" , nb_txq_total, + sas->txq_info =rte_calloc_numa ("sfc-txqs" , nb_txq_total,sizeof (sas->txq_info[0 ]),0 , - sa->socket_id); + sa->numa_id);if (sas->txq_info ==NULL ) goto fail_txqs_alloc;
@@ -1078,7 +1078,7 @@ static sfc_dp_tx_qcreate_t sfc_efx_tx_qcreate;static int sfc_efx_tx_qcreate (uint16_t port_id,uint16_t queue_id,const struct rte_pci_addr *pci_addr, -int socket_id, +int numa_id,const struct sfc_dp_tx_qcreate_info *info,struct sfc_dp_txq **dp_txqp) {
@@ -1091,33 +1091,33 @@ sfc_efx_tx_qcreate(uint16_t port_id, uint16_t queue_id, goto fail_nic_dma; rc =ENOMEM ; - txq =rte_zmalloc_socket ("sfc-efx-txq" ,sizeof (*txq), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("sfc-efx-txq" ,sizeof (*txq), +RTE_CACHE_LINE_SIZE , numa_id);if (txq ==NULL ) goto fail_txq_alloc;sfc_dp_queue_init (&txq->dp.dpq, port_id, queue_id, pci_addr); rc =ENOMEM ; - txq->pend_desc =rte_calloc_socket ("sfc-efx-txq-pend-desc" , + txq->pend_desc =rte_calloc_numa ("sfc-efx-txq-pend-desc" ,EFX_TXQ_LIMIT (info->txq_entries),sizeof (*txq->pend_desc),0 , - socket_id); + numa_id);if (txq->pend_desc ==NULL ) goto fail_pend_desc_alloc; rc =ENOMEM ; - txq->sw_ring =rte_calloc_socket ("sfc-efx-txq-sw_ring" , + txq->sw_ring =rte_calloc_numa ("sfc-efx-txq-sw_ring" , info->txq_entries,sizeof (*txq->sw_ring), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txq->sw_ring ==NULL ) goto fail_sw_ring_alloc; ctrl_txq =sfc_txq_by_dp_txq (&txq->dp);if (ctrl_txq->evq->sa->tso) { rc =sfc_efx_tso_alloc_tsoh_objs (txq->sw_ring, - info->txq_entries, socket_id); + info->txq_entries, numa_id);if (rc !=0 ) goto fail_alloc_tsoh_objs; }
drivers/net/sfc/sfc_tx.h +2 -2
@@ -110,7 +110,7 @@ void sfc_tx_close(struct sfc_adapter *sa);int sfc_tx_qinit_info (struct sfc_adapter *sa,sfc_sw_index_t sw_index);int sfc_tx_qinit (struct sfc_adapter *sa,sfc_sw_index_t sw_index, -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 sfc_tx_qfini (struct sfc_adapter *sa,sfc_sw_index_t sw_index);
@@ -126,7 +126,7 @@ uint64_t sfc_tx_get_queue_offload_caps(struct sfc_adapter *sa);/* From 'sfc_tso.c' */ int sfc_efx_tso_alloc_tsoh_objs (struct sfc_efx_tx_sw_desc *sw_ring,unsigned int txq_entries, -unsigned int socket_id); +unsigned int numa_id);void sfc_efx_tso_free_tsoh_objs (struct sfc_efx_tx_sw_desc *sw_ring,unsigned int txq_entries); int sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
Signature · 1 line
2.55.0
PATCH 147/227 net/softnic: use NUMA node terminology
In reply to Chengwen FengFrom: 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/softnic/rte_eth_softnic.c | 6 +++--- drivers/net/softnic/rte_eth_softnic_thread.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/softnic/rte_eth_softnic.c +3 -3
@@ -79,7 +79,7 @@ static int pmd_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 __rte_unused, struct rte_mempool *mb_pool __rte_unused) {
@@ -107,7 +107,7 @@ static int pmd_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 __rte_unused) { char name[NAME_SIZE];
@@ -254,7 +254,7 @@ pmd_init(struct pmd_params *params)struct pmd_internals *p;int status; - p =rte_zmalloc_socket (params->name, + p =rte_zmalloc_numa (params->name,sizeof (struct pmd_internals ),0 , params->cpu_id);
drivers/net/softnic/rte_eth_softnic_thread.c +1 -1
@@ -41,7 +41,7 @@ softnic_thread_init(struct pmd_internals *softnic)struct rte_ring *msgq_req, *msgq_rsp;struct softnic_thread *t = &softnic->thread[i];struct softnic_thread_data *t_data = &softnic->thread_data[i]; -uint32_t cpu_id =rte_lcore_to_socket_id (i); +uint32_t cpu_id =rte_lcore_to_numa_id (i);/* MSGQs */ snprintf(ring_name, sizeof(ring_name), "%s-TH%u-REQ",
Signature · 1 line
2.55.0
PATCH 148/227 net/sxe2: use NUMA node terminology
In reply to Chengwen FengFrom: 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/sxe2/sxe2_ethdev_repr.c | 2 +- drivers/net/sxe2/sxe2_mp.c | 2 +- drivers/net/sxe2/sxe2_rx.c | 16 ++++++++-------- drivers/net/sxe2/sxe2_rx.h | 2 +- drivers/net/sxe2/sxe2_tx.c | 16 ++++++++-------- drivers/net/sxe2/sxe2_tx.h | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-)
drivers/net/sxe2/sxe2_ethdev_repr.c +1 -1
@@ -560,7 +560,7 @@ int32_t sxe2_switchdev_repr_devs_init(struct sxe2_adapter *adapter, goto l_release_port; } eth_dev->data->numa_node = adapter->dev_info.dev_data->numa_node; - eth_dev->data->dev_private =rte_zmalloc_socket (name, + eth_dev->data->dev_private =rte_zmalloc_numa (name,sizeof (struct sxe2_adapter ),RTE_CACHE_LINE_SIZE , eth_dev->data->numa_node);
drivers/net/sxe2/sxe2_mp.c +1 -1
@@ -135,7 +135,7 @@ sxe2_mp_init_primary(__rte_unused struct rte_eth_dev *dev)if (sxe2_mp_mz ==NULL ) { sxe2_mp_mz =rte_memzone_reserve (SXE2_MP_MZ_NAME ,sizeof (struct sxe2_mp_shared_data ), -rte_socket_id (),0 ); +rte_numa_id (),0 );if (sxe2_mp_mz ==NULL && rte_errno !=EEXIST ) {PMD_LOG_ERR (DRV ,"Failed to reserve memzone %s, error: %d" ,SXE2_MP_MZ_NAME , -rte_errno);
drivers/net/sxe2/sxe2_rx.c +8 -8
@@ -189,7 +189,7 @@ void __rte_cold sxe2_all_rxqs_release(struct rte_eth_dev *dev) }static struct sxe2_rx_queue *sxe2_rx_queue_alloc (struct rte_eth_dev *dev,uint16_t queue_idx, -uint16_t ring_depth,uint32_t socket_id) +uint16_t ring_depth,uint32_t numa_id) {struct sxe2_rx_queue *rxq;const struct rte_memzone *tz;
@@ -200,8 +200,8 @@ static struct sxe2_rx_queue *sxe2_rx_queue_alloc(struct rte_eth_dev *dev, uint16 dev->data->rx_queues[queue_idx] =NULL ; } - rxq =rte_zmalloc_socket ("rx_queue" ,sizeof (*rxq), -RTE_CACHE_LINE_SIZE , socket_id); + rxq =rte_zmalloc_numa ("rx_queue" ,sizeof (*rxq), +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL ) {PMD_LOG_ERR (RX ,"rx queue[%d] alloc failed" , queue_idx);
@@ -211,9 +211,9 @@ static struct sxe2_rx_queue *sxe2_rx_queue_alloc(struct rte_eth_dev *dev, uint16 rxq->ring_depth = ring_depth; len = rxq->ring_depth +SXE2_RX_PKTS_BURST_BATCH_NUM ; - rxq->buffer_ring =rte_zmalloc_socket ("rx_buffer_ring" , + rxq->buffer_ring =rte_zmalloc_numa ("rx_buffer_ring" ,sizeof (struct rte_mbuf *) * len, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (!rxq->buffer_ring) {PMD_LOG_ERR (RX ,"Rxq malloc mbuf mem failed" );
@@ -223,7 +223,7 @@ static struct sxe2_rx_queue *sxe2_rx_queue_alloc(struct rte_eth_dev *dev, uint16 } tz =rte_eth_dma_zone_reserve (dev,"rx_dma" , queue_idx, -SXE2_RX_RING_SIZE ,SXE2_DESC_ADDR_ALIGN , socket_id); +SXE2_RX_RING_SIZE ,SXE2_DESC_ADDR_ALIGN , numa_id);if (tz ==NULL ) {PMD_LOG_ERR (RX ,"Rxq malloc desc mem failed" );rte_free (rxq->buffer_ring);
@@ -243,7 +243,7 @@ static struct sxe2_rx_queue *sxe2_rx_queue_alloc(struct rte_eth_dev *dev, uint16 } int32_t __rte_cold sxe2_rx_queue_setup(struct rte_eth_dev *dev, -uint16_t queue_idx,uint16_t nb_desc,uint32_t socket_id, +uint16_t queue_idx,uint16_t nb_desc,uint32_t numa_id,const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mp) {
@@ -299,7 +299,7 @@ int32_t __rte_cold sxe2_rx_queue_setup(struct rte_eth_dev *dev, goto l_end; } - rxq =sxe2_rx_queue_alloc (dev, queue_idx, nb_desc, socket_id); + rxq =sxe2_rx_queue_alloc (dev, queue_idx, nb_desc, numa_id);if (rxq ==NULL ) {PMD_LOG_ERR (RX ,"rx queue[%d] resource alloc failed" , queue_idx); ret = -ENOMEM ;
drivers/net/sxe2/sxe2_rx.h +1 -1
@@ -8,7 +8,7 @@#include "sxe2_queue.h" int32_t __rte_cold sxe2_rx_queue_setup(struct rte_eth_dev *dev, -uint16_t queue_idx,uint16_t nb_desc,uint32_t socket_id, +uint16_t queue_idx,uint16_t nb_desc,uint32_t numa_id,const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mp);
drivers/net/sxe2/sxe2_tx.c +8 -8
@@ -258,7 +258,7 @@ void __rte_cold sxe2_all_txqs_release(struct rte_eth_dev *dev)static struct sxe2_tx_queue *sxe2_tx_queue_alloc (struct rte_eth_dev *dev,uint16_t queue_idx, -uint16_t ring_depth,uint32_t socket_id) +uint16_t ring_depth,uint32_t numa_id) {struct sxe2_tx_queue *txq;const struct rte_memzone *tz;
@@ -268,8 +268,8 @@ static struct sxe2_tx_queue dev->data->tx_queues[queue_idx] =NULL ; } - txq =rte_zmalloc_socket ("tx_queue" ,sizeof (struct sxe2_tx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa ("tx_queue" ,sizeof (struct sxe2_tx_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (txq ==NULL ) {PMD_LOG_ERR (TX ,"tx queue:%d alloc failed" , queue_idx); goto l_end;
@@ -277,7 +277,7 @@ static struct sxe2_tx_queue tz =rte_eth_dma_zone_reserve (dev,"tx_dma" , queue_idx,sizeof (union sxe2_tx_data_desc ) *SXE2_MAX_RING_DESC , -SXE2_DESC_ADDR_ALIGN , socket_id); +SXE2_DESC_ADDR_ALIGN , numa_id);if (tz ==NULL ) {PMD_LOG_ERR (TX ,"tx desc ring alloc failed, queue_id:%d" , queue_idx);rte_free (txq);
@@ -285,9 +285,9 @@ static struct sxe2_tx_queue goto l_end; } - txq->buffer_ring =rte_zmalloc_socket ("tx_buffer_ring" , + txq->buffer_ring =rte_zmalloc_numa ("tx_buffer_ring" ,sizeof (struct sxe2_tx_buffer ) * ring_depth, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txq->buffer_ring ==NULL ) {PMD_LOG_ERR (TX ,"tx buffer alloc failed, queue_id:%d" , queue_idx);rte_memzone_free (tz);
@@ -305,7 +305,7 @@ static struct sxe2_tx_queue } int32_t __rte_cold sxe2_tx_queue_setup(struct rte_eth_dev *dev, -uint16_t queue_idx,uint16_t nb_desc,uint32_t socket_id, +uint16_t queue_idx,uint16_t nb_desc,uint32_t numa_id,const struct rte_eth_txconf *tx_conf) {int32_t ret =0 ;
@@ -329,7 +329,7 @@ int32_t __rte_cold sxe2_tx_queue_setup(struct rte_eth_dev *dev, goto end; } - txq =sxe2_tx_queue_alloc (dev, queue_idx, nb_desc, socket_id); + txq =sxe2_tx_queue_alloc (dev, queue_idx, nb_desc, numa_id);if (txq ==NULL ) {PMD_LOG_ERR (TX ,"failed to alloc sxe2vf tx queue:%u resource" , queue_idx); ret = -ENOMEM ;
drivers/net/sxe2/sxe2_tx.h +1 -1
@@ -20,7 +20,7 @@ void sxe2_tx_queue_mbufs_release(struct sxe2_tx_queue *txq); int32_t __rte_cold sxe2_tx_queue_stop(struct rte_eth_dev *dev, uint16_t queue_id); int32_t __rte_cold sxe2_tx_queue_setup(struct rte_eth_dev *dev, -uint16_t queue_idx,uint16_t nb_desc,uint32_t socket_id, +uint16_t queue_idx,uint16_t nb_desc,uint32_t numa_id,const struct rte_eth_txconf *tx_conf); void __rte_cold sxe2_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_idx);
Signature · 1 line
2.55.0
PATCH 149/227 net/tap: use NUMA node terminology
In reply to Chengwen FengFrom: 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/tap/rte_eth_tap.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/tap/rte_eth_tap.c +11 -11
@@ -1155,7 +1155,7 @@ tap_dev_close(struct rte_eth_dev *dev) internals = dev->data->dev_private;TAP_LOG (DEBUG ,"Closing %s Ethernet device on numa %u" , - tuntap_types[internals->type],rte_socket_id ()); + tuntap_types[internals->type],rte_numa_id ());rte_intr_instance_free (internals->intr_handle);
@@ -1503,7 +1503,7 @@ tap_gso_ctx_setup(struct rte_gso_ctx *gso_ctx, struct rte_eth_dev *dev) pmd->gso_ctx_mp =rte_pktmbuf_pool_create (pool_name,TAP_GSO_MBUFS_NUM ,TAP_GSO_MBUF_CACHE_SIZE ,0 ,RTE_PKTMBUF_HEADROOM +TAP_GSO_MBUF_SEG_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!pmd->gso_ctx_mp) { TAP_LOG(ERR, "%s: failed to create mbuf pool for device %s",
@@ -1569,7 +1569,7 @@ static int tap_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 *mp) {
@@ -1619,9 +1619,9 @@ tap_rx_queue_setup(struct rte_eth_dev *dev, dev->device->name, dev->data->mtu, max_rx_segs); } - rxq =rte_zmalloc_socket (dev->device->name, + rxq =rte_zmalloc_numa (dev->device->name,sizeof (*rxq) + (max_rx_segs +1 ) *sizeof (struct iovec ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (!rxq) { TAP_LOG(ERR, "%s: Couldn't allocate rx queue structure",
@@ -1687,7 +1687,7 @@ static int tap_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) { struct pmd_internals *internals = dev->data->dev_private;
@@ -1699,8 +1699,8 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,if (tx_queue_id >= dev->data->nb_tx_queues)return -1 ; - txq =rte_zmalloc_socket (dev->device->name,sizeof (*txq), -RTE_CACHE_LINE_SIZE , socket_id); + txq =rte_zmalloc_numa (dev->device->name,sizeof (*txq), +RTE_CACHE_LINE_SIZE , numa_id);if (!txq) { TAP_LOG(ERR, "%s: Couldn't allocate tx queue structure",
@@ -2150,7 +2150,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, const char *remote_iface, struct rte_ether_addr *mac_addr, enum rte_tuntap_type type, bool persist) { - int numa_node = rte_socket_id(); + int numa_node = rte_numa_id();struct rte_eth_dev *dev;struct pmd_internals *pmd;struct pmd_process_private *process_private;
@@ -2158,7 +2158,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,struct rte_eth_dev_data *data;int i; -TAP_LOG (DEBUG ,"%s device on numa %u" , tuntap_name,rte_socket_id ()); +TAP_LOG (DEBUG ,"%s device on numa %u" , tuntap_name,rte_numa_id ()); dev =rte_eth_vdev_allocate (vdev,sizeof (*pmd));if (!dev) {
@@ -2198,7 +2198,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, data->numa_node = numa_node; data->dev_link = pmd_link; - data->mac_addrs =rte_calloc_socket (rte_vdev_device_name (vdev), + data->mac_addrs =rte_calloc_numa (rte_vdev_device_name (vdev),TAP_MAX_MAC_ADDRS ,sizeof (*data->mac_addrs),0 , numa_node);
Signature · 1 line
2.55.0
PATCH 150/227 net/thunderx: use NUMA node terminology
In reply to Chengwen FengFrom: 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/thunderx/nicvf_ethdev.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/net/thunderx/nicvf_ethdev.c +12 -12
@@ -705,7 +705,7 @@ nicvf_qset_rbdr_alloc(struct rte_eth_dev *dev, struct nicvf *nic,uint32_t ring_size;assert (nic->rbdr ==NULL ); - rbdr =rte_zmalloc_socket ("rbdr" ,sizeof (struct nicvf_rbdr ), + rbdr =rte_zmalloc_numa ("rbdr" ,sizeof (struct nicvf_rbdr ),RTE_CACHE_LINE_SIZE , nic->node);if (rbdr ==NULL ) {PMD_INIT_LOG (ERR ,"Failed to allocate mem for rbdr" );
@@ -1012,7 +1012,7 @@ nicvf_set_rx_function(struct rte_eth_dev *dev)static int nicvf_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) {uint16_t tx_free_thresh;
@@ -1029,9 +1029,9 @@ nicvf_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, qidx = qidx %MAX_SND_QUEUES_PER_QS ;/* Socket id check */ -if (socket_id != (unsigned int )SOCKET_ID_ANY && socket_id != nic->node) -PMD_DRV_LOG (WARNING ,"socket_id expected %d, configured %d" , - socket_id, nic->node); +if (numa_id != (unsigned int )RTE_NUMA_ID_ANY && numa_id != nic->node) +PMD_DRV_LOG (WARNING ,"numa_id expected %d, configured %d" , + numa_id, nic->node);/* Tx deferred start is not supported */ if (tx_conf->tx_deferred_start) {
@@ -1070,7 +1070,7 @@ nicvf_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 nicvf_txq ), + txq =rte_zmalloc_numa ("ethdev TX queue" ,sizeof (struct nicvf_txq ),RTE_CACHE_LINE_SIZE , nic->node);if (txq ==NULL ) { PMD_INIT_LOG(ERR, "Failed to allocate txq=%d",
@@ -1102,7 +1102,7 @@ nicvf_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, dev->data->tx_queues[nicvf_netdev_qidx (nic, qidx)] = txq;/* Allocate software ring */ - txq->txbuffs =rte_zmalloc_socket ("txq->txbuffs" , + txq->txbuffs =rte_zmalloc_numa ("txq->txbuffs" , nb_desc *sizeof (struct rte_mbuf *),RTE_CACHE_LINE_SIZE , nic->node);
@@ -1343,7 +1343,7 @@ nicvf_rxq_mbuf_setup(struct nicvf_rxq *rxq)static int nicvf_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 *mp) {
@@ -1370,9 +1370,9 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, qidx = qidx %MAX_RCV_QUEUES_PER_QS ;/* Socket id check */ -if (socket_id != (unsigned int )SOCKET_ID_ANY && socket_id != nic->node) -PMD_DRV_LOG (WARNING ,"socket_id expected %d, configured %d" , - socket_id, nic->node); +if (numa_id != (unsigned int )RTE_NUMA_ID_ANY && numa_id != nic->node) +PMD_DRV_LOG (WARNING ,"numa_id expected %d, configured %d" , + numa_id, nic->node);/* Mempool memory must be contiguous, so must be one memory segment*/ if (mp->nb_mem_chunks !=1 ) {
@@ -1420,7 +1420,7 @@ nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, }/* Allocate rxq memory */ - rxq =rte_zmalloc_socket ("ethdev rx queue" ,sizeof (struct nicvf_rxq ), + rxq =rte_zmalloc_numa ("ethdev rx queue" ,sizeof (struct nicvf_rxq ),RTE_CACHE_LINE_SIZE , nic->node);if (rxq ==NULL ) { PMD_INIT_LOG(ERR, "Failed to allocate rxq=%d",
Signature · 1 line
2.55.0
PATCH 151/227 net/txgbe: use NUMA node terminology
In reply to Chengwen FengFrom: 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/txgbe/txgbe_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 4 ++-- drivers/net/txgbe/txgbe_rxtx.c | 34 ++++++++++++++++---------------- 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/net/txgbe/txgbe_ethdev.c +1 -1
@@ -719,7 +719,7 @@ eth_txgbe_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,"txgbe_driver" ,-1 , -16 ,TXGBE_ALIGN ,SOCKET_ID_ANY ); +16 ,TXGBE_ALIGN ,RTE_NUMA_ID_ANY );if (mz ==NULL )return -ENOMEM ;
drivers/net/txgbe/txgbe_ethdev.h +2 -2
@@ -435,12 +435,12 @@ void txgbe_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid);void txgbe_dev_tx_queue_release (struct rte_eth_dev *dev,uint16_t qid);int txgbe_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 txgbe_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 txgbe_dev_rx_queue_count (void *rx_queue);
drivers/net/txgbe/txgbe_rxtx.c +17 -17
@@ -2423,7 +2423,7 @@ txgbe_get_tx_port_offloads(struct rte_eth_dev *dev)static void txgbe_setup_headwb_resources (struct rte_eth_dev *dev,void *tx_queue, -unsigned int socket_id) +unsigned int numa_id) {struct txgbe_hw *hw =TXGBE_DEV_HW (dev);const struct rte_memzone *headwb;
@@ -2439,7 +2439,7 @@ txgbe_setup_headwb_resources(struct rte_eth_dev *dev, headwb_size = txq->headwb_size; headwb =rte_eth_dma_zone_reserve (dev,"tx_headwb_mem" , txq->queue_id,sizeof (u32) * headwb_size, -TXGBE_ALIGN , socket_id); +TXGBE_ALIGN , numa_id);if (headwb ==NULL ) { PMD_DRV_LOG(INFO,
@@ -2461,7 +2461,7 @@ int __rte_cold txgbe_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;
@@ -2522,16 +2522,16 @@ txgbe_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 txgbe_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 txgbe_tx_desc ) * nb_desc, -TXGBE_ALIGN , socket_id); +TXGBE_ALIGN , numa_id);if (tz ==NULL ) {txgbe_tx_queue_release (txq);return -ENOMEM ;
@@ -2573,9 +2573,9 @@ txgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, txq->tx_ring = (struct txgbe_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 txgbe_tx_entry ) * nb_desc, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txq->sw_ring ==NULL ) {txgbe_tx_queue_release (txq);return -ENOMEM ;
@@ -2586,7 +2586,7 @@ txgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,/* set up scalar TX function as appropriate */ txgbe_set_tx_function (dev, txq); -txgbe_setup_headwb_resources (dev, txq, socket_id); +txgbe_setup_headwb_resources (dev, txq, numa_id); txq->ops->reset (txq); txq->desc_error =0 ;
@@ -2774,7 +2774,7 @@ int __rte_cold txgbe_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) {
@@ -2809,9 +2809,9 @@ txgbe_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 txgbe_rx_queue ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (rxq ==NULL )return -ENOMEM ; rxq->mb_pool = mp;
@@ -2838,7 +2838,7 @@ txgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,/* Allocate RX ring hardware descriptors. */ size = (nb_desc +RTE_PMD_TXGBE_RX_MAX_BURST ) *sizeof (struct txgbe_rx_desc ); rz =rte_eth_dma_zone_reserve (dev,"rx_ring" , queue_idx, - size,TXGBE_ALIGN , socket_id); + size,TXGBE_ALIGN , numa_id);if (rz ==NULL ) {txgbe_rx_queue_release (rxq);return -ENOMEM ;
@@ -2890,9 +2890,9 @@ txgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,if (adapter->rx_bulk_alloc_allowed) len +=RTE_PMD_TXGBE_RX_MAX_BURST ; - rxq->sw_ring =rte_zmalloc_socket ("rxq->sw_ring" , + rxq->sw_ring =rte_zmalloc_numa ("rxq->sw_ring" ,sizeof (struct txgbe_rx_entry ) * len, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (!rxq->sw_ring) {txgbe_rx_queue_release (rxq);return -ENOMEM ;
@@ -2907,9 +2907,9 @@ txgbe_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 txgbe_scattered_rx_entry ) * len, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (!rxq->sw_sc_ring) {txgbe_rx_queue_release (rxq);return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 152/227 net/vhost: use NUMA node terminology
In reply to Chengwen FengFrom: 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/vhost/rte_eth_vhost.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/net/vhost/rte_eth_vhost.c +14 -14
@@ -1010,11 +1010,11 @@ vhost_driver_setup(struct rte_eth_dev *eth_dev)if (list)return 0 ; - list =rte_zmalloc_socket (name,sizeof (*list),0 , numa_node); + list =rte_zmalloc_numa (name,sizeof (*list),0 , numa_node);if (list ==NULL )return -1 ; - vring_state =rte_zmalloc_socket (name,sizeof (*vring_state), + vring_state =rte_zmalloc_numa (name,sizeof (*vring_state),0 , numa_node);if (vring_state ==NULL ) goto free_list;
@@ -1251,14 +1251,14 @@ eth_dev_close(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, +unsigned int numa_id, const struct rte_eth_rxconf *rx_conf __rte_unused,struct rte_mempool *mb_pool) {struct vhost_queue *vq; - vq =rte_zmalloc_socket (NULL ,sizeof (struct vhost_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + vq =rte_zmalloc_numa (NULL ,sizeof (struct vhost_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (vq ==NULL ) {VHOST_LOG_LINE (ERR ,"Failed to allocate memory for rx queue" );return -ENOMEM ;
@@ -1276,13 +1276,13 @@ 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, +unsigned int numa_id, const struct rte_eth_txconf *tx_conf __rte_unused) {struct vhost_queue *vq; - vq =rte_zmalloc_socket (NULL ,sizeof (struct vhost_queue ), -RTE_CACHE_LINE_SIZE , socket_id); + vq =rte_zmalloc_numa (NULL ,sizeof (struct vhost_queue ), +RTE_CACHE_LINE_SIZE , numa_id);if (vq ==NULL ) {VHOST_LOG_LINE (ERR ,"Failed to allocate memory for tx queue" );return -ENOMEM ;
@@ -1582,7 +1582,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, goto error; data = eth_dev->data; - eth_addr =rte_zmalloc_socket (name,sizeof (*eth_addr),0 , numa_node); + eth_addr =rte_zmalloc_numa (name,sizeof (*eth_addr),0 , numa_node);if (eth_addr ==NULL ) goto error; data->mac_addrs = eth_addr;
@@ -1595,7 +1595,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,* - and point eth_dev structure to new eth_dev_data structure */ internal = eth_dev->data->dev_private; - internal->iface_name =rte_malloc_socket (name,strlen (iface_name) +1 , + internal->iface_name =rte_malloc_numa (name,strlen (iface_name) +1 ,0 , numa_node);if (internal->iface_name ==NULL ) goto error;
@@ -1689,8 +1689,8 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev) eth_dev->rx_pkt_burst = eth_vhost_rx; eth_dev->tx_pkt_burst = eth_vhost_tx; eth_dev->dev_ops = &ops; -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 (); eth_dev->device = &dev->device;rte_eth_dev_probing_finish (eth_dev);return 0 ;
@@ -1795,8 +1795,8 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)if (legacy_ol_flags ==0 ) flags |=RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS ; -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 =eth_dev_vhost_create (dev, iface_name, queues, dev->device.numa_node, flags, disable_flags);
Signature · 1 line
2.55.0
PATCH 153/227 net/virtio: use NUMA node terminology
In reply to Chengwen FengFrom: 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/virtio/virtio_ethdev.c | 4 ++-- drivers/net/virtio/virtio_ethdev.h | 4 ++-- drivers/net/virtio/virtio_rxtx.c | 6 +++--- drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +- drivers/net/virtio/virtqueue.c | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/virtio/virtio_ethdev.c +2 -2
@@ -1811,7 +1811,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev)if (!hw->rss_key) {/* Setup default RSS key if not already setup by the user */ - hw->rss_key =rte_malloc_socket ("rss_key" , + hw->rss_key =rte_malloc_numa ("rss_key" ,VIRTIO_NET_RSS_KEY_SIZE ,0 , eth_dev->device->numa_node);if (!hw->rss_key) {
@@ -1833,7 +1833,7 @@ virtio_dev_rss_init(struct rte_eth_dev *eth_dev)if (!hw->rss_reta) {/* Setup default RSS reta if not already setup by the user */ - hw->rss_reta =rte_zmalloc_socket ("rss_reta" , + hw->rss_reta =rte_zmalloc_numa ("rss_reta" ,VIRTIO_NET_RSS_RETA_SIZE *sizeof (uint16_t ),0 , eth_dev->device->numa_node);if (!hw->rss_reta) {
drivers/net/virtio/virtio_ethdev.h +2 -2
@@ -61,7 +61,7 @@ void virtio_dev_cq_start(struct rte_eth_dev *dev);*/ int virtio_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);
@@ -69,7 +69,7 @@ int virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t rx_queue_id);int virtio_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 virtio_dev_tx_queue_setup_finish(struct rte_eth_dev *dev,
drivers/net/virtio/virtio_rxtx.c +3 -3
@@ -653,7 +653,7 @@ int virtio_dev_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) {
@@ -808,7 +808,7 @@ virtio_dev_rx_queue_setup_finish(struct rte_eth_dev *dev, uint16_t queue_idx)/* * struct rte_eth_dev *dev: Used to update dev * uint16_t nb_desc: Defaults to values read from config space -* unsigned int socket_id: Used to allocate memzone +* unsigned int numa_id: Used to allocate memzone * const struct rte_eth_txconf *tx_conf: Used to setup tx engine * uint16_t queue_idx: Just used as an index in dev txq list */
@@ -816,7 +816,7 @@ int virtio_dev_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) { uint16_t vq_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
drivers/net/virtio/virtio_user/virtio_user_dev.c +1 -1
@@ -1201,7 +1201,7 @@ virtio_user_dev_create_shadow_cvq(struct virtio_user_dev *dev, struct virtqueuesnprintf (name,sizeof (name),"port%d_shadow_cvq" , vq->hw->port_id); scvq =virtqueue_alloc (&dev->hw, vq->vq_queue_index, vq->vq_nentries, -VTNET_CQ ,SOCKET_ID_ANY , name); +VTNET_CQ ,RTE_NUMA_ID_ANY , name);if (!scvq) {PMD_INIT_LOG (ERR ,"(%s) Failed to alloc shadow control vq" , dev->path);return -ENOMEM ;
drivers/net/virtio/virtqueue.c +3 -3
@@ -390,13 +390,13 @@ virtio_rxq_sw_ring_alloc(struct virtqueue *vq, int numa_node) size = (RTE_PMD_VIRTIO_RX_MAX_BURST + vq->vq_nentries) *sizeof (vq->rxq.sw_ring[0 ]); - sw_ring =rte_zmalloc_socket ("sw_ring" , size,RTE_CACHE_LINE_SIZE , numa_node); + sw_ring =rte_zmalloc_numa ("sw_ring" , size,RTE_CACHE_LINE_SIZE , numa_node);if (!sw_ring) {PMD_INIT_LOG (ERR ,"can not allocate RX soft ring" );return -ENOMEM ; } - mbuf =rte_zmalloc_socket ("sw_ring" ,sizeof (*mbuf),RTE_CACHE_LINE_SIZE , numa_node); + mbuf =rte_zmalloc_numa ("sw_ring" ,sizeof (*mbuf),RTE_CACHE_LINE_SIZE , numa_node);if (!mbuf) {PMD_INIT_LOG (ERR ,"can not allocate fake mbuf" );rte_free (sw_ring);
@@ -429,7 +429,7 @@ virtqueue_alloc(struct virtio_hw *hw, uint16_t index, uint16_t num, int type, 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
PATCH 154/227 net/vmxnet3: use NUMA node terminology
In reply to Chengwen FengFrom: 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/vmxnet3/vmxnet3_ethdev.c | 14 +++++++------- drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++-- drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +7 -7
@@ -179,7 +179,7 @@ static const struct vmxnet3_xstats_name_off vmxnet3_rxq_stat_strings[] = {static const struct rte_memzone *gpa_zone_reserve (struct rte_eth_dev *dev,uint32_t size, -const char *post_string,int socket_id, +const char *post_string,int numa_id,uint16_t align,bool reuse) {char z_name[RTE_MEMZONE_NAMESIZE ];
@@ -191,14 +191,14 @@ gpa_zone_reserve(struct rte_eth_dev *dev, uint32_t size, mz =rte_memzone_lookup (z_name);if (!reuse) {rte_memzone_free (mz); -return rte_memzone_reserve_aligned (z_name, size, socket_id, +return rte_memzone_reserve_aligned (z_name, size, numa_id,RTE_MEMZONE_IOVA_CONTIG , align); }if (mz)return mz; -return rte_memzone_reserve_aligned (z_name, size, socket_id, +return rte_memzone_reserve_aligned (z_name, size, numa_id,RTE_MEMZONE_IOVA_CONTIG , align); }
@@ -653,7 +653,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)* on current socket */ mz =gpa_zone_reserve (dev,sizeof (struct Vmxnet3_DriverShared ), -"shared" ,rte_socket_id (),8 ,1 ); +"shared" ,rte_numa_id (),8 ,1 );if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"ERROR: Creating shared zone" );
@@ -672,7 +672,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)* depends on the number of tx and rx queues, which could be different * from one config to another. */ - mz =gpa_zone_reserve (dev, size,"queuedesc" ,rte_socket_id (), + mz =gpa_zone_reserve (dev, size,"queuedesc" ,rte_numa_id (),VMXNET3_QUEUE_DESC_ALIGN ,0 );if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"ERROR: Creating queue descriptors zone" );
@@ -689,7 +689,7 @@ vmxnet3_dev_configure(struct rte_eth_dev *dev)if (dev->data->dev_conf.rxmode.mq_mode ==RTE_ETH_MQ_RX_RSS ) {/* Allocate memory structure for UPT1_RSSConf and configure */ mz =gpa_zone_reserve (dev,sizeof (struct VMXNET3_RSSConf ), -"rss_conf" ,rte_socket_id (), +"rss_conf" ,rte_numa_id (),RTE_CACHE_LINE_SIZE ,1 );if (mz ==NULL ) { PMD_INIT_LOG(ERR,
@@ -820,7 +820,7 @@ vmxnet3_dev_setup_memreg(struct rte_eth_dev *dev) (2 *VMXNET3_MAX_MEMREG_QUEUES ) *sizeof (Vmxnet3_MemoryRegion); - mz =gpa_zone_reserve (dev, size,"memRegs" ,rte_socket_id (),8 , + mz =gpa_zone_reserve (dev, size,"memRegs" ,rte_numa_id (),8 ,1 );if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"ERROR: Creating memRegs zone" );
drivers/net/vmxnet3/vmxnet3_ethdev.h +2 -2
@@ -208,14 +208,14 @@ void vmxnet3_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid);int vmxnet3_v4_rss_configure (struct rte_eth_dev *dev);int vmxnet3_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 vmxnet3_dev_rx_queue_count (void *rx_queue);int vmxnet3_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 vmxnet3_dev_rxtx_init (struct rte_eth_dev *dev);
drivers/net/vmxnet3/vmxnet3_rxtx.c +4 -4
@@ -1031,7 +1031,7 @@ int vmxnet3_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 __rte_unused) { struct vmxnet3_hw *hw = dev->data->dev_private;
@@ -1092,7 +1092,7 @@ vmxnet3_dev_tx_queue_setup(struct rte_eth_dev *dev, size += txq->txdata_desc_size * data_ring->size; mz =rte_eth_dma_zone_reserve (dev,"txdesc" , queue_idx, size, -VMXNET3_RING_BA_ALIGN , socket_id); +VMXNET3_RING_BA_ALIGN , numa_id);if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"ERROR: Creating queue descriptors zone" );return -ENOMEM ;
@@ -1132,7 +1132,7 @@ int vmxnet3_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) {
@@ -1208,7 +1208,7 @@ vmxnet3_dev_rx_queue_setup(struct rte_eth_dev *dev, size += rxq->data_desc_size * data_ring->size; mz =rte_eth_dma_zone_reserve (dev,"rxdesc" , queue_idx, size, -VMXNET3_RING_BA_ALIGN , socket_id); +VMXNET3_RING_BA_ALIGN , numa_id);if (mz ==NULL ) {PMD_INIT_LOG (ERR ,"ERROR: Creating queue descriptors zone" );return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 155/227 net/xsc: use NUMA node terminology
In reply to Chengwen FengFrom: 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/xsc/xsc_ethdev.c | 4 ++-- drivers/net/xsc/xsc_rx.c | 2 +- drivers/net/xsc/xsc_rxtx.h | 6 +++--- drivers/net/xsc/xsc_tx.c | 4 ++-- drivers/net/xsc/xsc_vfio.c | 18 +++++++++--------- drivers/net/xsc/xsc_vfio_mbox.c | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-)
drivers/net/xsc/xsc_ethdev.c +2 -2
@@ -497,7 +497,7 @@ xsc_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,if (!rte_is_power_of_2 (desc)) desc_n =1 <<rte_log2_u32 (desc); - rxq_data =rte_malloc_socket (NULL ,sizeof (*rxq_data) + desc_n *sizeof (struct rte_mbuf *), + rxq_data =rte_malloc_numa (NULL ,sizeof (*rxq_data) + desc_n *sizeof (struct rte_mbuf *),RTE_CACHE_LINE_SIZE , socket);if (rxq_data ==NULL ) { PMD_DRV_LOG(ERR, "Port %u create rxq idx %d failure",
@@ -543,7 +543,7 @@ xsc_ethdev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,if (!rte_is_power_of_2 (desc)) desc_n =1 <<rte_log2_u32 (desc); - txq =rte_malloc_socket (NULL ,sizeof (*txq) + desc_n *sizeof (struct rte_mbuf *), + txq =rte_malloc_numa (NULL ,sizeof (*txq) + desc_n *sizeof (struct rte_mbuf *),RTE_CACHE_LINE_SIZE , socket); txq->offloads = conf->offloads | dev->data->dev_conf.txmode.offloads; txq->priv = priv;
drivers/net/xsc/xsc_rx.c +1 -1
@@ -535,7 +535,7 @@ xsc_rxq_rss_obj_new(struct xsc_ethdev_priv *priv, uint16_t port_id) cq_params.port_id = rxq_data->port_id; cq_params.qp_id = rxq_data->idx; cq_params.wqe_s = rxq_data->wqe_s; - cq_params.socket_id = rxq_data->socket; + cq_params.numa_id = rxq_data->socket; ret =xsc_dev_rx_cq_create (xdev, &cq_params, &cq_info);if (ret) {
drivers/net/xsc/xsc_rxtx.h +3 -3
@@ -124,7 +124,7 @@ struct xsc_tx_cq_params {uint16_t port_id;uint16_t qp_id;uint16_t elts_n; -int socket_id; +int numa_id; };struct xsc_tx_cq_info {
@@ -142,7 +142,7 @@ struct xsc_tx_qp_params {uint16_t port_id;uint16_t qp_id;uint16_t elts_n; -int socket_id; +int numa_id; };struct xsc_tx_qp_info {
@@ -167,7 +167,7 @@ struct xsc_rx_cq_params {uint16_t port_id;uint16_t qp_id;uint16_t wqe_s; -int socket_id; +int numa_id; };struct xsc_rx_cq_info {
drivers/net/xsc/xsc_tx.c +2 -2
@@ -37,7 +37,7 @@ xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data, uint16_t id cq_params.port_id = txq_data->port_id; cq_params.qp_id = txq_data->idx; cq_params.elts_n = txq_data->elts_n; - cq_params.socket_id = txq_data->socket; + cq_params.numa_id = txq_data->socket; ret =xsc_dev_tx_cq_create (xdev, &cq_params, &cq_info);if (ret) { rte_errno = errno;
@@ -61,7 +61,7 @@ xsc_txq_obj_new(struct xsc_dev *xdev, struct xsc_txq_data *txq_data, uint16_t id qp_params.port_id = txq_data->port_id; qp_params.qp_id = idx; qp_params.elts_n = txq_data->elts_n; - qp_params.socket_id = txq_data->socket; + qp_params.numa_id = txq_data->socket; ret =xsc_dev_tx_qp_create (xdev, &qp_params, &qp_info);if (ret !=0 ) {
drivers/net/xsc/xsc_vfio.c +9 -9
@@ -559,9 +559,9 @@ xsc_vfio_rx_cq_create(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,void *cmd_buf;int numa_node = xdev->pci_dev->device.numa_node; -if (numa_node != cq_params->socket_id) +if (numa_node != cq_params->numa_id)PMD_DRV_LOG (WARNING ,"Port %u rxq %u: cq numa_node=%u, device numa_node=%u" , - port_id, idx, cq_params->socket_id, numa_node); + port_id, idx, cq_params->numa_id, numa_node); cqe_n = cq_params->wqe_s *2 ; log_cq_sz =rte_log2_u32 (cqe_n);
@@ -598,7 +598,7 @@ xsc_vfio_rx_cq_create(struct xsc_dev *xdev, struct xsc_rx_cq_params *cq_params,snprintf (name,sizeof (name),"mz_cqe_mem_rx_%u_%u" , port_id, idx); cq_pas =rte_memzone_reserve_aligned (name, (XSC_PAGE_SIZE * pa_num), - cq_params->socket_id, + cq_params->numa_id,RTE_MEMZONE_IOVA_CONTIG ,XSC_PAGE_SIZE );if (cq_pas ==NULL ) {
@@ -664,10 +664,10 @@ xsc_vfio_tx_cq_create(struct xsc_dev *xdev, struct xsc_tx_cq_params *cq_params,void *cmd_buf =NULL ;int numa_node = xdev->pci_dev->device.numa_node; -if (numa_node != cq_params->socket_id) +if (numa_node != cq_params->numa_id)PMD_DRV_LOG (WARNING ,"Port %u txq %u: cq numa_node=%u, device numa_node=%u" , cq_params->port_id, cq_params->qp_id, - cq_params->socket_id, numa_node); + cq_params->numa_id, numa_node); cq =rte_zmalloc (NULL ,sizeof (struct xsc_vfio_cq ),0 );if (cq ==NULL ) {
@@ -682,7 +682,7 @@ xsc_vfio_tx_cq_create(struct xsc_dev *xdev, struct xsc_tx_cq_params *cq_params,snprintf (name,sizeof (name),"mz_cqe_mem_tx_%u_%u" , cq_params->port_id, cq_params->qp_id); cq_pas =rte_memzone_reserve_aligned (name, (XSC_PAGE_SIZE * pa_num), - cq_params->socket_id, + cq_params->numa_id,RTE_MEMZONE_IOVA_CONTIG ,XSC_PAGE_SIZE );if (cq_pas ==NULL ) {
@@ -772,10 +772,10 @@ xsc_vfio_tx_qp_create(struct xsc_dev *xdev, struct xsc_tx_qp_params *qp_params,bool tso_en = !!(qp_params->tx_offloads &RTE_ETH_TX_OFFLOAD_TCP_TSO );int numa_node = xdev->pci_dev->device.numa_node; -if (numa_node != qp_params->socket_id) +if (numa_node != qp_params->numa_id)PMD_DRV_LOG (WARNING ,"Port %u: txq %u numa_node=%u, device numa_node=%u" , qp_params->port_id, qp_params->qp_id, - qp_params->socket_id, numa_node); + qp_params->numa_id, numa_node); qp =rte_zmalloc (NULL ,sizeof (struct xsc_vfio_qp ),0 );if (qp ==NULL ) {
@@ -791,7 +791,7 @@ xsc_vfio_tx_qp_create(struct xsc_dev *xdev, struct xsc_tx_qp_params *qp_params,snprintf (name,sizeof (name),"mz_wqe_mem_tx_%u_%u" , qp_params->port_id, qp_params->qp_id); qp_pas =rte_memzone_reserve_aligned (name, (XSC_PAGE_SIZE * pa_num), - qp_params->socket_id, + qp_params->numa_id,RTE_MEMZONE_IOVA_CONTIG ,XSC_PAGE_SIZE );if (qp_pas ==NULL ) {
drivers/net/xsc/xsc_vfio_mbox.c +3 -3
@@ -562,7 +562,7 @@ xsc_vfio_mbox_init(struct xsc_dev *xdev)snprintf (name,RTE_MEMZONE_NAMESIZE ,"%s_cmdq" , xdev->pci_dev->device.name); size = (1 <<XSC_CMDQ_DEPTH_LOG ) *sizeof (struct xsc_cmdq_req_layout ); cmdq->req_mz =rte_memzone_reserve_aligned (name, - size,SOCKET_ID_ANY , + size,RTE_NUMA_ID_ANY ,RTE_MEMZONE_IOVA_CONTIG ,XSC_PAGE_SIZE );if (cmdq->req_mz ==NULL ) {
@@ -574,7 +574,7 @@ xsc_vfio_mbox_init(struct xsc_dev *xdev)snprintf (name,RTE_MEMZONE_NAMESIZE ,"%s_cmd_cq" , xdev->pci_dev->device.name); size = (1 <<XSC_CMDQ_DEPTH_LOG ) *sizeof (struct xsc_cmdq_rsp_layout );/* -V1048 */ cmdq->rsp_mz =rte_memzone_reserve_aligned (name, - size,SOCKET_ID_ANY , + size,RTE_NUMA_ID_ANY ,RTE_MEMZONE_IOVA_CONTIG ,XSC_PAGE_SIZE );if (cmdq->rsp_mz ==NULL ) {
@@ -588,7 +588,7 @@ xsc_vfio_mbox_init(struct xsc_dev *xdev)sizeof (struct xsc_cmdq_mbox_buf ),XSC_MBOX_BUF_CACHE_SIZE ,0 ,NULL ,NULL ,NULL ,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);if (cmdq->mbox_buf_pool ==NULL ) {PMD_DRV_LOG (ERR ,"Failed to create mailbox buf pool" ); goto error;
Signature · 1 line
2.55.0
PATCH 156/227 net/zxdh: use NUMA node terminology
In reply to Chengwen FengFrom: 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/zxdh/zxdh_ethdev.c | 18 +++++++++--------- drivers/net/zxdh/zxdh_queue.c | 4 ++-- drivers/net/zxdh/zxdh_queue.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-)
drivers/net/zxdh/zxdh_ethdev.c +9 -9
@@ -679,7 +679,7 @@ zxdh_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_logic_qidx) sz_hdr_mz = vq_size *sizeof (struct zxdh_tx_region ); } - vq =rte_zmalloc_socket (vq_name, size,RTE_CACHE_LINE_SIZE , numa_node); + vq =rte_zmalloc_numa (vq_name, size,RTE_CACHE_LINE_SIZE , numa_node);if (vq ==NULL ) {PMD_DRV_LOG (ERR ,"can not allocate vq" );return -ENOMEM ;
@@ -1665,7 +1665,7 @@ zxdh_dtb_dump_res_init(struct zxdh_hw *hw, ZXDH_DEV_INIT_CTRL_T *dpp_ctrl)const struct rte_memzone *generic_dump_mz =rte_memzone_reserve_aligned (p->mz_name, p->mz_size, -SOCKET_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE ); +RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE );if (generic_dump_mz ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot alloc mem for dtb table bulk dump, mz_name is %s, mz_size is %u" , p->mz_name, p->mz_size);
@@ -1732,7 +1732,7 @@ zxdh_np_dtb_res_init(struct rte_eth_dev *dev)if (!dtb_data->dtb_table_conf_mz) {snprintf (buf,sizeof (buf),"%s_%x" ,"zxdh_dtb_table_conf_mz" , hw->dev_id);const struct rte_memzone *conf_mz =rte_memzone_reserve_aligned (buf, -ZXDH_DTB_TABLE_CONF_SIZE ,SOCKET_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE ); +ZXDH_DTB_TABLE_CONF_SIZE ,RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE );if (conf_mz ==NULL ) { PMD_DRV_LOG(ERR,
@@ -1750,7 +1750,7 @@ zxdh_np_dtb_res_init(struct rte_eth_dev *dev)memset (buf,'\0' ,sizeof (buf));snprintf (buf,sizeof (buf),"%s_%x" ,"zxdh_dtb_table_dump_mz" , hw->dev_id);const struct rte_memzone *dump_mz =rte_memzone_reserve_aligned (buf, -ZXDH_DTB_TABLE_DUMP_SIZE ,SOCKET_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE ); +ZXDH_DTB_TABLE_DUMP_SIZE ,RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE );if (dump_mz ==NULL ) { PMD_DRV_LOG(ERR,
@@ -1842,7 +1842,7 @@ zxdh_init_shared_data(void)if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) {/* Allocate shared memory. */ mz =rte_memzone_reserve ("zxdh_pmd_shared_data" , -sizeof (*zxdh_shared_data),SOCKET_ID_ANY ,0 ); +sizeof (*zxdh_shared_data),RTE_NUMA_ID_ANY ,0 );if (mz ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot allocate zxdh shared data" ); ret = -rte_errno;
@@ -1898,14 +1898,14 @@ zxdh_init_sh_res(struct zxdh_shared_data *sd)if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { flow_mp =rte_mempool_create (MZ_ZXDH_FLOW_MP ,ZXDH_MAX_FLOW_NUM ,sizeof (struct zxdh_flow ),64 ,0 , -NULL ,NULL ,NULL ,NULL ,SOCKET_ID_ANY ,0 ); +NULL ,NULL ,NULL ,NULL ,RTE_NUMA_ID_ANY ,0 );if (flow_mp ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot allocate zxdh flow mempool" ); goto error; } mtr_mp =rte_mempool_create (MZ_ZXDH_MTR_MP ,ZXDH_MAX_MTR_NUM ,sizeof (struct zxdh_mtr_object ),64 ,0 , -NULL ,NULL ,NULL ,NULL ,SOCKET_ID_ANY ,0 ); +NULL ,NULL ,NULL ,NULL ,RTE_NUMA_ID_ANY ,0 );if (mtr_mp ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot allocate zxdh mtr mempool" ); goto error;
@@ -1913,14 +1913,14 @@ zxdh_init_sh_res(struct zxdh_shared_data *sd) mtr_profile_mp =rte_mempool_create (MZ_ZXDH_MTR_PROFILE_MP ,MAX_MTR_PROFILE_NUM ,sizeof (struct zxdh_meter_profile ),64 ,0 ,NULL ,NULL ,NULL , -NULL ,SOCKET_ID_ANY ,0 ); +NULL ,RTE_NUMA_ID_ANY ,0 );if (mtr_profile_mp ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot allocate zxdh mtr profile mempool" ); goto error; } mtr_policy_mp =rte_mempool_create (MZ_ZXDH_MTR_POLICY_MP ,ZXDH_MAX_POLICY_NUM ,sizeof (struct zxdh_meter_policy ), -64 ,0 ,NULL ,NULL ,NULL ,NULL ,SOCKET_ID_ANY ,0 ); +64 ,0 ,NULL ,NULL ,NULL ,NULL ,RTE_NUMA_ID_ANY ,0 );if (mtr_policy_mp ==NULL ) {PMD_DRV_LOG (ERR ,"Cannot allocate zxdh mtr profile mempool" ); goto error;
drivers/net/zxdh/zxdh_queue.c +2 -2
@@ -223,7 +223,7 @@ int32_t zxdh_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, - uint32_t socket_id __rte_unused, + uint32_t numa_id __rte_unused, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) {
@@ -316,7 +316,7 @@ int32_t zxdh_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, uint16_t nb_desc, - uint32_t socket_id __rte_unused, + uint32_t numa_id __rte_unused, const struct rte_eth_txconf *tx_conf) { struct zxdh_hw *hw = dev->data->dev_private;
drivers/net/zxdh/zxdh_queue.h +2 -2
@@ -376,12 +376,12 @@ int32_t zxdh_get_queue_type(uint16_t vtpci_queue_idx);int32_t zxdh_dev_tx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx,uint16_t nb_desc, -uint32_t socket_id, +uint32_t numa_id,const struct rte_eth_txconf *tx_conf);int32_t zxdh_dev_rx_queue_setup (struct rte_eth_dev *dev,uint16_t queue_idx,uint16_t nb_desc, -uint32_t socket_id, +uint32_t numa_id,const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mp);int32_t zxdh_dev_rx_queue_intr_disable (struct rte_eth_dev *dev,uint16_t queue_id);
Signature · 1 line
2.55.0
PATCH 157/227 raw/cnxk_bphy: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/raw/cnxk_bphy/cnxk_bphy.c +1 -1
@@ -343,7 +343,7 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv,bphy_rawdev_get_name (name, pci_dev); bphy_rawdev =rte_rawdev_pmd_allocate (name,sizeof (*bphy_dev), -rte_socket_id ()); +rte_numa_id ());if (bphy_rawdev ==NULL ) {CNXK_BPHY_LOG (ERR ,"Failed to allocate rawdev" );return -ENOMEM ;
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -313,7 +313,7 @@ cnxk_bphy_cgx_rawdev_probe(struct rte_pci_driver *pci_drv,return ret;cnxk_bphy_cgx_format_name (name,sizeof (name), pci_dev); - rawdev =rte_rawdev_pmd_allocate (name,sizeof (*cgx),rte_socket_id ()); + rawdev =rte_rawdev_pmd_allocate (name,sizeof (*cgx),rte_numa_id ());if (!rawdev)return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 158/227 raw/cnxk_gpio: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/cnxk_gpio/cnxk_gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/raw/cnxk_gpio/cnxk_gpio.c +2 -2
@@ -147,7 +147,7 @@ cnxk_gpio_params_reserve(size_t len) {const struct rte_memzone *mz; - mz =rte_memzone_reserve (CNXK_GPIO_PARAMS_MZ_NAME , len,rte_socket_id (),0 ); + mz =rte_memzone_reserve (CNXK_GPIO_PARAMS_MZ_NAME , len,rte_numa_id (),0 );if (!mz)return NULL ;
@@ -879,7 +879,7 @@ cnxk_gpio_probe(struct rte_vdev_device *dev)int ret;cnxk_gpio_format_name (name,sizeof (name)); - rawdev =rte_rawdev_pmd_allocate (name,sizeof (*gpiochip),rte_socket_id ()); + rawdev =rte_rawdev_pmd_allocate (name,sizeof (*gpiochip),rte_numa_id ());if (!rawdev) {CNXK_GPIO_LOG (ERR ,"failed to allocate %s rawdev" , name);return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 159/227 raw/cnxk_rvu_lf: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/cnxk_rvu_lf/cnxk_rvu_lf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c +1 -1
@@ -202,7 +202,7 @@ rvu_lf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)rvu_lf_rawdev_get_name (name, pci_dev); rvu_lf_rawdev =rte_rawdev_pmd_allocate (name,sizeof (*roc_rvu_lf), -rte_socket_id ()); +rte_numa_id ());if (rvu_lf_rawdev ==NULL ) {CNXK_RVU_LF_LOG (ERR ,"Failed to allocate rawdev" );return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 160/227 raw/dpaa2_cmdif: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/dpaa2_cmdif/dpaa2_cmdif.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +5 -5
@@ -195,14 +195,14 @@ static const struct rte_rawdev_ops dpaa2_cmdif_ops = {static int dpaa2_cmdif_create (const char *name,struct rte_vdev_device *vdev, -int socket_id) +int numa_id) {struct rte_rawdev *rawdev;struct dpaa2_dpci_dev *cidev;/* Allocate device structure */ rawdev =rte_rawdev_pmd_allocate (name,sizeof (struct dpaa2_dpci_dev ), - socket_id); + numa_id);if (!rawdev) {DPAA2_CMDIF_ERR ("Unable to allocate rawdevice" );return -EINVAL ;
@@ -258,9 +258,9 @@ dpaa2_cmdif_probe(struct rte_vdev_device *vdev) name =rte_vdev_device_name (vdev); -DPAA2_CMDIF_INFO ("Init %s on NUMA node %d" , name,rte_socket_id ()); +DPAA2_CMDIF_INFO ("Init %s on NUMA node %d" , name,rte_numa_id ()); - ret =dpaa2_cmdif_create (name, vdev,rte_socket_id ()); + ret =dpaa2_cmdif_create (name, vdev,rte_numa_id ());return ret; }
@@ -275,7 +275,7 @@ dpaa2_cmdif_remove(struct rte_vdev_device *vdev)if (name ==NULL )return -1 ; -DPAA2_CMDIF_INFO ("Closing %s on NUMA node %d" , name,rte_socket_id ()); +DPAA2_CMDIF_INFO ("Closing %s on NUMA node %d" , name,rte_numa_id ()); ret =dpaa2_cmdif_destroy (name);
Signature · 1 line
2.55.0
PATCH 161/227 raw/gdtc: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/gdtc/gdtc_rawdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/raw/gdtc/gdtc_rawdev.c +3 -3
@@ -697,7 +697,7 @@ zxdh_gdma_queue_init(struct rte_rawdev *dev, uint16_t queue_id)/* Init ring */ snprintf (name,RTE_MEMZONE_NAMESIZE ,"gdma_vq%d_ring" , queue_id); size =ZXDH_GDMA_RING_SIZE *sizeof (struct zxdh_gdma_buff_desc ); - mz =rte_memzone_reserve_aligned (name, size,rte_socket_id (), + mz =rte_memzone_reserve_aligned (name, size,rte_numa_id (),RTE_MEMZONE_IOVA_CONTIG , size);if (mz ==NULL ) {if (rte_errno ==EEXIST )
@@ -843,13 +843,13 @@ zxdh_gdma_rawdev_probe(struct rte_pci_driver *pci_drv __rte_unused, pci_dev->name, pci_dev->mem_resource[0 ].phys_addr, pci_dev->mem_resource[0].addr); - dev =rte_rawdev_pmd_allocate (dev_name,sizeof (struct zxdh_gdma_rawdev ),rte_socket_id ()); + dev =rte_rawdev_pmd_allocate (dev_name,sizeof (struct zxdh_gdma_rawdev ),rte_numa_id ());if (dev ==NULL ) {ZXDH_PMD_LOG (ERR ,"Unable to allocate gdma rawdev" ); goto err_out; }ZXDH_PMD_LOG (INFO ,"Init %s on NUMA node %d, dev_id is %d" , - dev_name,rte_socket_id (), dev->dev_id); + dev_name,rte_numa_id (), dev->dev_id); dev->dev_ops = &zxdh_gdma_rawdev_ops; dev->device = &pci_dev->device;
Signature · 1 line
2.55.0
PATCH 162/227 raw/ifpga: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/ifpga/afu_pmd_core.c | 14 +++++++------- drivers/raw/ifpga/base/ifpga_defines.h | 2 +- drivers/raw/ifpga/base/ifpga_fme.c | 4 ++-- drivers/raw/ifpga/base/ifpga_hw.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-)
drivers/raw/ifpga/afu_pmd_core.c +7 -7
@@ -214,7 +214,7 @@ static const struct rte_rawdev_ops afu_rawdev_ops = { };static int afu_shared_data_alloc (const char *name, -struct afu_shared_data **data,int socket_id) +struct afu_shared_data **data,int numa_id) {const struct rte_memzone *mz;char mz_name[RTE_MEMZONE_NAMESIZE ];
@@ -230,7 +230,7 @@ static int afu_shared_data_alloc(const char *name, mz =rte_memzone_lookup (mz_name);if (!mz) { mz =rte_memzone_reserve (mz_name,sizeof (struct afu_shared_data ), - socket_id,0 ); + numa_id,0 ); init_mz =1 ; }
@@ -283,7 +283,7 @@ static struct afu_ops *afu_ops_get(struct rte_afu_uuid *afu_id)return drv ? drv->ops :NULL ; } -static int afu_rawdev_create (struct rte_afu_device *afu_dev,int socket_id) +static int afu_rawdev_create (struct rte_afu_device *afu_dev,int numa_id) {struct rte_rawdev *rawdev =NULL ;struct afu_rawdev *dev =NULL ;
@@ -298,11 +298,11 @@ static int afu_rawdev_create(struct rte_afu_device *afu_dev, int socket_id)return ret;IFPGA_RAWDEV_PMD_INFO ("Create raw device %s on NUMA node %d" , - name, socket_id); + name, numa_id);/* Allocate device structure */ rawdev =rte_rawdev_pmd_allocate (name,sizeof (struct afu_rawdev ), - socket_id); + numa_id);if (!rawdev) {IFPGA_RAWDEV_PMD_ERR ("Unable to allocate raw device" );return -ENOMEM ;
@@ -333,7 +333,7 @@ static int afu_rawdev_create(struct rte_afu_device *afu_dev, int socket_id) } } - ret =afu_shared_data_alloc (name, &dev->sd, socket_id); + ret =afu_shared_data_alloc (name, &dev->sd, numa_id);if (ret) goto cleanup;
@@ -376,7 +376,7 @@ static int afu_rawdev_destroy(struct rte_afu_device *afu_dev)static int afu_rawdev_probe (struct rte_afu_device *afu_dev) {IFPGA_RAWDEV_PMD_FUNC_TRACE (); -return afu_rawdev_create (afu_dev,rte_socket_id ()); +return afu_rawdev_create (afu_dev,rte_numa_id ()); }static int afu_rawdev_remove (struct rte_afu_device *afu_dev)
drivers/raw/ifpga/base/ifpga_defines.h +1 -1
@@ -151,7 +151,7 @@ struct feature_fme_capability {u64 csr;struct {u8 fabric_verid;/* Fabric version ID */ -u8 socket_id:1 ;/* Socket id */ +u8 numa_id:1 ;/* Socket id */ u8 rsvd1:3 ;/* Reserved */ /* pci0 link available yes /no */ u8 pci0_link_avile:1 ;
drivers/raw/ifpga/base/ifpga_fme.c +2 -2
@@ -143,14 +143,14 @@ static int fme_hdr_get_version(struct ifpga_fme_hw *fme, u64 *version)return 0 ; } -static int fme_hdr_get_socket_id (struct ifpga_fme_hw *fme,u64 *socket_id) +static int fme_hdr_get_socket_id (struct ifpga_fme_hw *fme,u64 *numa_id) {struct feature_fme_header *fme_hdr =get_fme_feature_ioaddr_by_index (fme,FME_FEATURE_ID_HEADER );struct feature_fme_capability fme_capability; fme_capability.csr =readq (&fme_hdr->capability); - *socket_id = fme_capability.socket_id; + *numa_id = fme_capability.numa_id;return 0 ; }
drivers/raw/ifpga/base/ifpga_hw.h +1 -1
@@ -78,7 +78,7 @@ struct ifpga_fme_hw {struct uuid bitstream_id;u64 bitstream_md;size_t pr_bandwidth; -u32 socket_id; +u32 numa_id;u32 fabric_version_id;u32 cache_size;
drivers/raw/ifpga/ifpga_rawdev.c +5 -5
@@ -1531,7 +1531,7 @@ ifpga_register_msix_irq(struct ifpga_rawdev *dev, int port_id,static int ifpga_rawdev_create (struct rte_pci_device *pci_dev, -int socket_id) +int numa_id) {int ret =0 ;struct rte_rawdev *rawdev =NULL ;
@@ -1552,11 +1552,11 @@ ifpga_rawdev_create(struct rte_pci_device *pci_dev,snprintf (name,RTE_RAWDEV_NAME_MAX_LEN ,IFPGA_RAWDEV_NAME_FMT , pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); -IFPGA_RAWDEV_PMD_INFO ("Init %s on NUMA node %d" , name,rte_socket_id ()); +IFPGA_RAWDEV_PMD_INFO ("Init %s on NUMA node %d" , name,rte_numa_id ());/* Allocate device structure */ rawdev =rte_rawdev_pmd_allocate (name,sizeof (struct opae_adapter ), - socket_id); + numa_id);if (rawdev ==NULL ) {IFPGA_RAWDEV_PMD_ERR ("Unable to allocate rawdevice" ); ret = -EINVAL ;
@@ -1651,7 +1651,7 @@ ifpga_rawdev_destroy(struct rte_pci_device *pci_dev) pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function);IFPGA_RAWDEV_PMD_INFO ("Closing %s on NUMA node %d" , - name,rte_socket_id ()); + name,rte_numa_id ()); rawdev =rte_rawdev_pmd_get_named_dev (name);if (!rawdev) {
@@ -1672,7 +1672,7 @@ ifpga_rawdev_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) {IFPGA_RAWDEV_PMD_FUNC_TRACE (); -return ifpga_rawdev_create (pci_dev,rte_socket_id ()); +return ifpga_rawdev_create (pci_dev,rte_numa_id ()); } static int
Signature · 1 line
2.55.0
PATCH 163/227 raw/ntb: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/ntb/ntb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/raw/ntb/ntb.c +9 -9
@@ -187,7 +187,7 @@ ntb_rxq_setup(struct rte_rawdev *dev,return -EINVAL ;/* Allocate the rx queue data structure */ - rxq =rte_zmalloc_socket ("ntb rx queue" , + rxq =rte_zmalloc_numa ("ntb rx queue" ,sizeof (struct ntb_rx_queue ),RTE_CACHE_LINE_SIZE , dev->numa_id);
@@ -209,7 +209,7 @@ ntb_rxq_setup(struct rte_rawdev *dev,/* Allocate the software ring. */ rxq->sw_ring = - rte_zmalloc_socket("ntb rx sw ring", + rte_zmalloc_numa("ntb rx sw ring", sizeof(struct ntb_rx_entry) * rxq->nb_rx_desc, RTE_CACHE_LINE_SIZE,
@@ -273,7 +273,7 @@ ntb_txq_setup(struct rte_rawdev *dev,return -EINVAL ;/* Allocate the TX queue data structure. */ - txq =rte_zmalloc_socket ("ntb tx queue" , + txq =rte_zmalloc_numa ("ntb tx queue" ,sizeof (struct ntb_tx_queue ),RTE_CACHE_LINE_SIZE , dev->numa_id);
@@ -290,7 +290,7 @@ ntb_txq_setup(struct rte_rawdev *dev,/* Allocate software ring */ txq->sw_ring = - rte_zmalloc_socket("ntb tx sw ring", + rte_zmalloc_numa("ntb tx sw ring", sizeof(struct ntb_tx_entry) * txq->nb_tx_desc, RTE_CACHE_LINE_SIZE,
@@ -1319,7 +1319,7 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev) }static int -ntb_create (struct rte_pci_device *pci_dev,int socket_id) +ntb_create (struct rte_pci_device *pci_dev,int numa_id) {char name[RTE_RAWDEV_NAME_MAX_LEN ];struct rte_rawdev *rawdev =NULL ;
@@ -1335,11 +1335,11 @@ ntb_create(struct rte_pci_device *pci_dev, int socket_id) pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); -NTB_LOG (INFO ,"Init %s on NUMA node %d" , name, socket_id); +NTB_LOG (INFO ,"Init %s on NUMA node %d" , name, numa_id);/* Allocate device structure. */ rawdev =rte_rawdev_pmd_allocate (name,sizeof (struct ntb_hw ), - socket_id); + numa_id);if (rawdev ==NULL ) {NTB_LOG (ERR ,"Unable to allocate rawdev." );return -EINVAL ;
@@ -1382,7 +1382,7 @@ ntb_destroy(struct rte_pci_device *pci_dev) pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); -NTB_LOG (INFO ,"Closing %s on NUMA node %d" , name,rte_socket_id ()); +NTB_LOG (INFO ,"Closing %s on NUMA node %d" , name,rte_numa_id ()); rawdev =rte_rawdev_pmd_get_named_dev (name);if (rawdev ==NULL ) {
@@ -1402,7 +1402,7 @@ static int ntb_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) { -return ntb_create (pci_dev,rte_socket_id ()); +return ntb_create (pci_dev,rte_numa_id ()); } static int
Signature · 1 line
2.55.0
PATCH 164/227 raw/skeleton: use NUMA node terminology
In reply to Chengwen FengFrom: 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/raw/skeleton/skeleton_rawdev.c | 10 +++++----- drivers/raw/skeleton/skeleton_rawdev_test.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/raw/skeleton/skeleton_rawdev.c +5 -5
@@ -573,7 +573,7 @@ static const struct rte_rawdev_ops skeleton_rawdev_ops = {static int skeleton_rawdev_create (const char *name,struct rte_vdev_device *vdev, -int socket_id) +int numa_id) {int ret =0 , i;struct rte_rawdev *rawdev =NULL ;
@@ -587,7 +587,7 @@ skeleton_rawdev_create(const char *name,/* Allocate device structure */ rawdev =rte_rawdev_pmd_allocate (name,sizeof (struct skeleton_rawdev ), - socket_id); + numa_id);if (rawdev ==NULL ) {SKELETON_PMD_ERR ("Unable to allocate rawdevice" ); ret = -EINVAL ;
@@ -729,12 +729,12 @@ skeleton_rawdev_probe(struct rte_vdev_device *vdev)return -EINVAL ; } -SKELETON_PMD_INFO ("Init %s on NUMA node %d" , name,rte_socket_id ()); +SKELETON_PMD_INFO ("Init %s on NUMA node %d" , name,rte_numa_id ()); selftest =skeldev_parse_vdev_args (vdev);/* In case of invalid argument, selftest != 1; ignore other values */ - ret =skeleton_rawdev_create (name, vdev,rte_socket_id ()); + ret =skeleton_rawdev_create (name, vdev,rte_numa_id ());if (ret >=0 ) {/* In case command line argument for 'selftest' was passed; * if invalid arguments were passed, execution continues but
@@ -760,7 +760,7 @@ skeleton_rawdev_remove(struct rte_vdev_device *vdev)if (name ==NULL )return -1 ; -SKELETON_PMD_INFO ("Closing %s on NUMA node %d" , name,rte_socket_id ()); +SKELETON_PMD_INFO ("Closing %s on NUMA node %d" , name,rte_numa_id ()); ret =skeleton_rawdev_destroy (name);if (!ret)
drivers/raw/skeleton/skeleton_rawdev_test.c +7 -7
@@ -95,13 +95,13 @@ test_rawdev_get_dev_id(void)static int test_rawdev_socket_id (void ) { -int socket_id; - socket_id =rte_rawdev_socket_id (test_dev_id); -RTE_TEST_ASSERT (socket_id != -EINVAL , -"Failed to get socket_id %d" , socket_id); - socket_id =rte_rawdev_socket_id (RTE_RAWDEV_MAX_DEVS ); -RTE_TEST_ASSERT (socket_id == -EINVAL , -"Expected -EINVAL %d" , socket_id); +int numa_id; + numa_id =rte_rawdev_numa_id (test_dev_id); +RTE_TEST_ASSERT (numa_id != -EINVAL , +"Failed to get numa_id %d" , numa_id); + numa_id =rte_rawdev_numa_id (RTE_RAWDEV_MAX_DEVS ); +RTE_TEST_ASSERT (numa_id == -EINVAL , +"Expected -EINVAL %d" , numa_id);return TEST_SUCCESS ; }
Signature · 1 line
2.55.0
PATCH 165/227 regex/cn9k: use NUMA node terminology
In reply to Chengwen FengFrom: 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/regex/cn9k/cn9k_regexdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regex/cn9k/cn9k_regexdev.c +3 -3
@@ -99,7 +99,7 @@ ree_qp_create(const struct rte_regexdev *dev, uint16_t qp_id)qp_memzone_name_get (name,RTE_MEMZONE_NAMESIZE , dev->data->dev_id, qp_id); - lf_mem =rte_memzone_reserve_aligned (name, len,rte_socket_id (), + lf_mem =rte_memzone_reserve_aligned (name, len,rte_numa_id (),RTE_MEMZONE_SIZE_HINT_ONLY |RTE_MEMZONE_256MB ,RTE_CACHE_LINE_SIZE );if (lf_mem ==NULL ) {
@@ -204,10 +204,10 @@ ree_dev_register(const char *name)/* allocate private device structure */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { dev->data->dev_private = -rte_zmalloc_socket ("regexdev device private" , +rte_zmalloc_numa ("regexdev device private" ,sizeof (struct cn9k_ree_data ),RTE_CACHE_LINE_SIZE , -rte_socket_id ()); +rte_numa_id ());if (dev->data->dev_private ==NULL ) { cn9k_err("Cannot allocate memory for dev %s private data",
Signature · 1 line
2.55.0
PATCH 166/227 regex/mlx5: use NUMA node terminology
In reply to Chengwen FengFrom: 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/regex/mlx5/mlx5_regex_control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regex/mlx5/mlx5_regex_control.c +3 -3
@@ -83,7 +83,7 @@ regex_ctrl_create_cq(struct mlx5_regex_priv *priv, struct mlx5_regex_cq *cq) cq->ci =0 ; ret =mlx5_devx_cq_create (priv->cdev->ctx, &cq->cq_obj, cq->log_nb_desc, - &attr,SOCKET_ID_ANY ); + &attr,RTE_NUMA_ID_ANY );if (ret) {DRV_LOG (ERR ,"Can't create CQ object." );memset (cq,0 ,sizeof (*cq));
@@ -155,7 +155,7 @@ regex_ctrl_create_hw_qp(struct mlx5_regex_priv *priv, struct mlx5_regex_qp *qp, attr.mmo = priv->mmo_regex_qp_cap; ret =mlx5_devx_qp_create (priv->cdev->ctx, &qp_obj->qp_obj, attr.num_of_send_wqbbs *MLX5_WQE_SIZE , &attr, -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (ret) {DRV_LOG (ERR ,"Can't create QP object." ); rte_errno =ENOMEM ;
@@ -248,7 +248,7 @@ mlx5_regex_qp_setup(struct rte_regexdev *dev, uint16_t qp_ind, } ret =mlx5_mr_ctrl_init (&qp->mr_ctrl, &priv->cdev->mr_scache.dev_gen, -rte_socket_id ()); +rte_numa_id ());if (ret) {DRV_LOG (ERR ,"Error setting up mr btree" ); goto err_btree;
Signature · 1 line
2.55.0
PATCH 167/227 vdpa/mlx5: use NUMA node terminology
In reply to Chengwen FengFrom: 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/vdpa/mlx5/mlx5_vdpa_cthread.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/vdpa/mlx5/mlx5_vdpa_cthread.c +1 -1
@@ -265,7 +265,7 @@ mlx5_vdpa_c_thread_create(void) thrd_idx); conf_thread_mng.cthrd[thrd_idx].rng =rte_ring_create_elem (name,sizeof (struct mlx5_vdpa_task ), ring_num, -rte_socket_id (), +rte_numa_id (),RING_F_MP_HTS_ENQ |RING_F_MC_HTS_DEQ |RING_F_EXACT_SZ );if (!conf_thread_mng.cthrd[thrd_idx].rng) {
drivers/vdpa/mlx5/mlx5_vdpa_event.c +2 -2
@@ -96,7 +96,7 @@ mlx5_vdpa_cq_create(struct mlx5_vdpa_priv *priv, uint16_t log_desc_n,int ret; ret =mlx5_devx_cq_create (priv->cdev->ctx, &cq->cq_obj, log_desc_n, - &attr,SOCKET_ID_ANY ); + &attr,RTE_NUMA_ID_ANY );if (ret) goto error; cq->cq_ci =0 ;
@@ -671,7 +671,7 @@ mlx5_vdpa_event_qp_prepare(struct mlx5_vdpa_priv *priv, uint16_t desc_n,mlx5_ts_format_conv (priv->cdev->config.hca_attr.qp_ts_format); ret =mlx5_devx_qp_create (priv->cdev->ctx, &(eqp->sw_qp), attr.num_of_receive_wqes *MLX5_WSEG_SIZE , - &attr,SOCKET_ID_ANY ); + &attr,RTE_NUMA_ID_ANY );if (ret) {DRV_LOG (ERR ,"Failed to create SW QP(%u)." , rte_errno); goto error;
Signature · 1 line
2.55.0
PATCH 168/227 drivers: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology across the qat common, crypto and compress drivers, and switch calls to the NUMA-named APIs.
--- drivers/common/qat/qat_device.c | 2 +- drivers/common/qat/qat_qp.c | 22 +++++++------- drivers/common/qat/qat_qp.h | 2 +- drivers/compress/qat/qat_comp.c | 14 ++++----- drivers/compress/qat/qat_comp.h | 2 +- drivers/compress/qat/qat_comp_pmd.c | 22 +++++++------- drivers/compress/qat/qat_comp_pmd.h | 2 +- drivers/crypto/qat/asym/qat_asym.c | 2 +- drivers/crypto/qat/dev/qat_asym_pmd_gen1.c | 2 +- drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c | 6 ++-- drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c | 2 +- drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c | 4 +-- drivers/crypto/qat/dev/qat_crypto_pmd_gen5.c | 2 +- drivers/crypto/qat/dev/qat_crypto_pmd_gen6.c | 2 +- .../crypto/qat/dev/qat_crypto_pmd_gen_lce.c | 2 +- drivers/crypto/qat/dev/qat_sym_pmd_gen1.c | 2 +- drivers/crypto/qat/qat_crypto.c | 4 +-- drivers/crypto/qat/qat_crypto.h | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/net/mlx5/mlx5_flow.c | 29 ++++++++++--------- drivers/net/mlx5/mlx5_rxq.c | 24 ++++++++------- drivers/net/mlx5/mlx5_txq.c | 13 +++++---- 22 files changed, 84 insertions(+), 80 deletions(-)
drivers/common/qat/qat_device.c +1 -1
@@ -320,7 +320,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) qat_dev_size =sizeof (struct qat_pci_device ) +sizeof (void *) *QAT_MAX_SERVICES + extra_size; qat_dev_mz =rte_memzone_reserve (name, qat_dev_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (qat_dev_mz ==NULL ) { QAT_LOG(ERR, "Error when allocating memzone for QAT_%d",
drivers/common/qat/qat_qp.c +11 -11
@@ -84,7 +84,7 @@ static int adf_queue_arb_disable(enum qat_device_gen qat_dev_gen,static int qat_qp_build_ring_base (struct qat_pci_device *qat_dev,void *io_addr,struct qat_queue *queue);static const struct rte_memzone *queue_dma_zone_reserve (const char *queue_name, -uint32_t queue_size,int socket_id); +uint32_t queue_size,int numa_id);static int qat_qp_csr_setup (struct qat_pci_device *qat_dev,void *io_addr,struct qat_qp *qp);
@@ -128,17 +128,17 @@ qat_qp_setup(struct qat_pci_device *qat_dev, }/* Allocate the queue pair data structure. */ - qp =rte_zmalloc_socket ("qat PMD qp metadata" , + qp =rte_zmalloc_numa ("qat PMD qp metadata" ,sizeof (*qp),RTE_CACHE_LINE_SIZE , - qat_qp_conf->socket_id); + qat_qp_conf->numa_id);if (qp ==NULL ) {QAT_LOG (ERR ,"Failed to alloc mem for qp struct" );return -ENOMEM ; } qp->nb_descriptors = qat_qp_conf->nb_descriptors; - qp->op_cookies =rte_zmalloc_socket ("qat PMD op cookie pointer" , + qp->op_cookies =rte_zmalloc_numa ("qat PMD op cookie pointer" , qat_qp_conf->nb_descriptors *sizeof (*qp->op_cookies), -RTE_CACHE_LINE_SIZE , qat_qp_conf->socket_id); +RTE_CACHE_LINE_SIZE , qat_qp_conf->numa_id);if (qp->op_cookies ==NULL ) {QAT_LOG (ERR ,"Failed to alloc mem for cookie" );rte_free (qp);
@@ -309,15 +309,15 @@ qat_queue_create(struct qat_pci_device *qat_dev, struct qat_queue *queue,static const struct rte_memzone *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))) {QAT_LOG (DEBUG ,"re-use memzone already " "allocated for %s" , queue_name);return mz;
@@ -327,14 +327,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 ; }QAT_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 , queue_size); + numa_id,RTE_MEMZONE_IOVA_CONTIG , queue_size); }int
drivers/common/qat/qat_qp.h +1 -1
@@ -120,7 +120,7 @@ struct qat_qp_config {const struct qat_qp_hw_data *hw;uint32_t nb_descriptors;uint32_t cookie_size; -int socket_id; +int numa_id;const char *service_str; };
drivers/compress/qat/qat_comp.c +7 -7
@@ -63,10 +63,10 @@ qat_comp_allocate_split_op_memzones(struct qat_comp_op_cookie *cookie,unsigned int i;/* allocate the array of memzone pointers */ - cookie->dst_memzones =rte_zmalloc_socket ("qat PMD im buf mz pointers" , + cookie->dst_memzones =rte_zmalloc_numa ("qat PMD im buf mz pointers" , (nb_descriptors_needed -1 ) *sizeof (const struct rte_memzone *), -RTE_CACHE_LINE_SIZE , cookie->socket_id); +RTE_CACHE_LINE_SIZE , cookie->numa_id);if (cookie->dst_memzones ==NULL ) { QAT_DP_LOG(ERR,
@@ -84,7 +84,7 @@ qat_comp_allocate_split_op_memzones(struct qat_comp_op_cookie *cookie, cookie->dst_memzones[i] =rte_memzone_reserve_aligned ( dst_memz_name,RTE_PMD_QAT_COMP_IM_BUFFER_SIZE , - cookie->socket_id,RTE_MEMZONE_IOVA_CONTIG , + cookie->numa_id,RTE_MEMZONE_IOVA_CONTIG ,RTE_CACHE_LINE_SIZE );if (cookie->dst_memzones[i] ==NULL ) {
@@ -211,11 +211,11 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg,/* we need to allocate more elements in SGL*/ void *tmp; - tmp =rte_realloc_socket (cookie->qat_sgl_src_d, + tmp =rte_realloc_numa (cookie->qat_sgl_src_d,sizeof (struct qat_sgl ) +sizeof (struct qat_flat_buf ) * op->m_src->nb_segs,64 , - cookie->socket_id); + cookie->numa_id);if (unlikely (tmp ==NULL )) { QAT_DP_LOG(ERR, "QAT PMD can't allocate memory"
@@ -252,11 +252,11 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg,/* we need to allocate more elements in SGL*/ struct qat_sgl *tmp; - tmp =rte_realloc_socket (cookie->qat_sgl_dst_d, + tmp =rte_realloc_numa (cookie->qat_sgl_dst_d,sizeof (struct qat_sgl ) +sizeof (struct qat_flat_buf ) * op->m_dst->nb_segs,64 , - cookie->socket_id); + cookie->numa_id);if (unlikely (tmp ==NULL )) { QAT_DP_LOG(ERR, "QAT PMD can't allocate memory"
drivers/compress/qat/qat_comp.h +1 -1
@@ -61,7 +61,7 @@ struct qat_comp_op_cookie {phys_addr_t qat_sgl_dst_phys_addr;/* dynamically created SGLs */ uint8_t error; -uint8_t socket_id; +uint8_t numa_id;uint16_t src_nb_elems;uint16_t dst_nb_elems;struct qat_sgl *qat_sgl_src_d;
drivers/compress/qat/qat_comp_pmd.c +11 -11
@@ -20,7 +20,7 @@ struct qat_comp_gen_dev_ops qat_comp_gen_dev_ops[QAT_N_GENS];struct stream_create_info {struct qat_comp_dev_private *comp_dev; -int socket_id; +int numa_id;int error; };
@@ -103,7 +103,7 @@ qat_comp_qp_release(struct rte_compressdev *dev, uint16_t queue_pair_id)int qat_comp_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 qat_qp_config qat_qp_conf = {0 }; struct qat_qp **qp_addr =
@@ -135,7 +135,7 @@ qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, } qat_qp_conf.cookie_size =sizeof (struct qat_comp_op_cookie ); qat_qp_conf.nb_descriptors = max_inflight_ops; - qat_qp_conf.socket_id = socket_id; + qat_qp_conf.numa_id = numa_id; qat_qp_conf.service_str ="comp" ; ret =qat_qp_setup (qat_private->qat_dev, qp_addr, qp_id, &qat_qp_conf);
@@ -156,13 +156,13 @@ qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, cookie->qp = qp; cookie->cookie_index = i; - cookie->qat_sgl_src_d =rte_zmalloc_socket (NULL , + cookie->qat_sgl_src_d =rte_zmalloc_numa (NULL ,sizeof (struct qat_sgl ) +sizeof (struct qat_flat_buf ) *QAT_PMD_COMP_SGL_DEF_SEGMENTS ,64 , dev->data->numa_id); - cookie->qat_sgl_dst_d = rte_zmalloc_socket(NULL, + cookie->qat_sgl_dst_d = rte_zmalloc_numa(NULL, sizeof(struct qat_sgl) + sizeof(struct qat_flat_buf) * QAT_PMD_COMP_SGL_DEF_SEGMENTS,
@@ -185,7 +185,7 @@ qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, cookie->dst_nb_elems = cookie->src_nb_elems =QAT_PMD_COMP_SGL_DEF_SEGMENTS ; - cookie->socket_id = dev->data->numa_id; + cookie->numa_id = dev->data->numa_id; cookie->error =0 ; }
@@ -386,7 +386,7 @@ qat_comp_stream_init(struct rte_mempool *mp __rte_unused, void *opaque,QAT_STATE_REGISTERS_MAX_SIZE +sizeof (struct qat_inter_sgl ) +QAT_INFLATE_CONTEXT_SIZE , - info->socket_id, + info->numa_id, RTE_MEMZONE_IOVA_CONTIG, QAT_64_BYTE_ALIGN);if (memzone ==NULL ) { QAT_LOG(ERR,
@@ -428,7 +428,7 @@ qat_comp_stream_destroy(struct rte_mempool *mp __rte_unused,static struct rte_mempool *qat_comp_create_stream_pool (struct qat_comp_dev_private *comp_dev, -int socket_id, +int numa_id,uint32_t num_elements) {char stream_pool_name[RTE_MEMPOOL_NAMESIZE ];
@@ -454,14 +454,14 @@ qat_comp_create_stream_pool(struct qat_comp_dev_private *comp_dev,if (mp ==NULL ) {struct stream_create_info info = { .comp_dev = comp_dev, - .socket_id = socket_id, + .numa_id = numa_id, .error =0 }; mp =rte_mempool_create (stream_pool_name, num_elements,qat_comp_stream_size (),0 ,0 ,NULL ,NULL , qat_comp_stream_init, &info, - socket_id,0 ); + numa_id,0 );if (mp ==NULL ) { QAT_LOG(ERR, "Err creating mempool %s w %d elements of size %d",
@@ -758,7 +758,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev)if (comp_dev->capa_mz ==NULL ) { comp_dev->capa_mz =rte_memzone_reserve (capa_memz_name, capa_size, -rte_socket_id (),0 ); +rte_numa_id (),0 ); }if (comp_dev->capa_mz ==NULL ) { QAT_LOG(DEBUG,
drivers/compress/qat/qat_comp_pmd.h +1 -1
@@ -100,7 +100,7 @@ qat_comp_qp_release(struct rte_compressdev *dev, uint16_t queue_pair_id);int qat_comp_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);const struct rte_memzone * qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
drivers/crypto/qat/asym/qat_asym.c +1 -1
@@ -1700,7 +1700,7 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev) &qat_pci_devs[qat_pci_dev->qat_dev_id];struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id = qat_dev_instance->pci_dev->device.numa_node, + .numa_id = qat_dev_instance->pci_dev->device.numa_node, .private_data_size =sizeof (struct qat_cryptodev_private ) }; const struct qat_crypto_gen_dev_ops *gen_dev_ops =
drivers/crypto/qat/dev/qat_asym_pmd_gen1.c +1 -1
@@ -65,7 +65,7 @@ qat_asym_crypto_cap_get_gen1(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen2.c +3 -3
@@ -139,13 +139,13 @@ static struct rte_cryptodev_capabilities qat_sym_crypto_caps_gen2[] = {static int qat_sym_crypto_qp_setup_gen2 (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 qat_cryptodev_private *qat_sym_private = dev->data->dev_private;struct qat_qp *qp;int ret; -if (qat_cryptodev_qp_setup (dev, qp_id, qp_conf, socket_id)) { +if (qat_cryptodev_qp_setup (dev, qp_id, qp_conf, numa_id)) {QAT_LOG (DEBUG ,"QAT qp setup failed" );return -1 ; }
@@ -296,7 +296,7 @@ qat_sym_crypto_cap_get_gen2(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c +1 -1
@@ -211,7 +211,7 @@ qat_sym_crypto_cap_get_gen3(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen4.c +2 -2
@@ -178,7 +178,7 @@ qat_sym_crypto_cap_get_gen4(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
@@ -216,7 +216,7 @@ qat_asym_crypto_cap_get_gen4(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen5.c +1 -1
@@ -147,7 +147,7 @@ qat_sym_crypto_cap_get_gen5(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen6.c +1 -1
@@ -84,7 +84,7 @@ qat_sym_crypto_cap_get_gen6(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/dev/qat_crypto_pmd_gen_lce.c +1 -1
@@ -267,7 +267,7 @@ qat_sym_crypto_cap_get_gen_lce(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { - internals->capa_mz =rte_memzone_reserve (capa_memz_name, size,rte_socket_id (),0 ); + internals->capa_mz =rte_memzone_reserve (capa_memz_name, size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );return -1 ;
drivers/crypto/qat/dev/qat_sym_pmd_gen1.c +1 -1
@@ -170,7 +170,7 @@ qat_sym_crypto_cap_get_gen1(struct qat_cryptodev_private *internals, internals->capa_mz =rte_memzone_lookup (capa_memz_name);if (internals->capa_mz ==NULL ) { internals->capa_mz =rte_memzone_reserve (capa_memz_name, - size,rte_socket_id (),0 ); + size,rte_numa_id (),0 );if (internals->capa_mz ==NULL ) {QAT_LOG (DEBUG ,"Error allocating memzone for capabilities" );
drivers/crypto/qat/qat_crypto.c +2 -2
@@ -120,7 +120,7 @@ qat_cryptodev_qp_release(struct rte_cryptodev *dev, uint16_t queue_pair_id)int qat_cryptodev_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 qat_qp **qp_addr = (struct qat_qp **)&(dev->data->queue_pairs[qp_id]);
@@ -154,7 +154,7 @@ qat_cryptodev_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id, sizeof(struct qat_sym_op_cookie) :sizeof (struct qat_asym_op_cookie ); qat_qp_conf.nb_descriptors = qp_conf->nb_descriptors; - qat_qp_conf.socket_id = socket_id; + qat_qp_conf.numa_id = numa_id; qat_qp_conf.service_str =qat_service_get_str (service_type); ret =qat_qp_setup (qat_dev, qp_addr, qp_id, &qat_qp_conf);
drivers/crypto/qat/qat_crypto.h +1 -1
@@ -94,7 +94,7 @@ qat_cryptodev_stats_reset(struct rte_cryptodev *dev);int qat_cryptodev_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);int qat_cryptodev_qp_release (struct rte_cryptodev *dev,uint16_t queue_pair_id);
drivers/crypto/qat/qat_sym.c +1 -1
@@ -206,7 +206,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev) &qat_pci_devs[qat_pci_dev->qat_dev_id];struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id = qat_dev_instance->pci_dev->device.numa_node, + .numa_id = qat_dev_instance->pci_dev->device.numa_node, .private_data_size =sizeof (struct qat_cryptodev_private ) };char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/net/mlx5/mlx5_flow.c +15 -14
@@ -4642,7 +4642,7 @@ flow_action_handles_translate(struct rte_eth_dev *dev,if (!copied_n)return 0 ; actions_size =sizeof (struct rte_flow_action ) * n; - translated =mlx5_malloc (MLX5_MEM_ZERO , actions_size,0 ,SOCKET_ID_ANY ); + translated =mlx5_malloc (MLX5_MEM_ZERO , actions_size,0 ,RTE_NUMA_ID_ANY );if (!translated) { rte_errno =ENOMEM ;return -ENOMEM ;
@@ -6683,7 +6683,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev,sizeof (struct rte_flow_action_set_tag ) +sizeof (struct rte_flow_action_jump ); ext_actions =mlx5_malloc (MLX5_MEM_ZERO , act_size,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!ext_actions) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
@@ -6710,7 +6710,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev, act_size =sizeof (struct rte_flow_action ) * (actions_n +1 ) +sizeof (struct mlx5_flow_action_copy_mreg ); ext_actions =mlx5_malloc (MLX5_MEM_ZERO , act_size,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!ext_actions) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
@@ -6998,7 +6998,7 @@ flow_create_split_meter(struct rte_eth_dev *dev, item_size =sizeof (struct rte_flow_item ) * (METER_SUFFIX_ITEM + vlan_items_n) +sizeof (struct mlx5_rte_flow_item_tag ) *2 ; sfx_actions =mlx5_malloc (MLX5_MEM_ZERO , (act_size + item_size), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!sfx_actions) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
@@ -7148,7 +7148,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, item_size =sizeof (struct rte_flow_item ) *SAMPLE_SUFFIX_ITEM +sizeof (struct mlx5_rte_flow_item_tag ) *2 ; sfx_actions =mlx5_malloc (MLX5_MEM_ZERO , (act_size + - item_size),0 ,SOCKET_ID_ANY ); + item_size),0 ,RTE_NUMA_ID_ANY );if (!sfx_actions) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
@@ -7767,7 +7767,7 @@ mlx5_flow_cache_flow_info(struct rte_eth_dev *dev,struct rte_flow_error error;int len, ret; - flow_info =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*flow_info),0 ,SOCKET_ID_ANY ); + flow_info =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*flow_info),0 ,RTE_NUMA_ID_ANY );if (!flow_info) {DRV_LOG (ERR ,"No enough memory for flow_info caching." );return -1 ;
@@ -7784,7 +7784,7 @@ mlx5_flow_cache_flow_info(struct rte_eth_dev *dev, goto end; } len =RTE_ALIGN (ret,16 ); - flow_info->items =mlx5_malloc (MLX5_MEM_ZERO , len,0 ,SOCKET_ID_ANY ); + flow_info->items =mlx5_malloc (MLX5_MEM_ZERO , len,0 ,RTE_NUMA_ID_ANY );if (!flow_info->items) {DRV_LOG (ERR ,"No enough memory for items caching." ); goto end;
@@ -7802,7 +7802,7 @@ mlx5_flow_cache_flow_info(struct rte_eth_dev *dev, goto end; } len =RTE_ALIGN (ret,16 ); - flow_info->actions =mlx5_malloc (MLX5_MEM_ZERO , len,0 ,SOCKET_ID_ANY ); + flow_info->actions =mlx5_malloc (MLX5_MEM_ZERO , len,0 ,RTE_NUMA_ID_ANY );if (!flow_info->actions) {DRV_LOG (ERR ,"No enough memory for actions caching." ); goto end;
@@ -8557,7 +8557,8 @@ mlx5_ctrl_flow_vlan(struct rte_eth_dev *dev,for (i =0 ; i != priv->reta_idx_n; ++i) queue[i] = (*priv->reta_idx)[i]; - entry = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*entry), alignof(typeof(*entry)), SOCKET_ID_ANY); + entry = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*entry), alignof(typeof(*entry)), +RTE_NUMA_ID_ANY );if (entry ==NULL ) { rte_errno =ENOMEM ; goto err;
@@ -9670,7 +9671,7 @@ mlx5_flow_create_counter_stat_mem_mng(struct mlx5_dev_ctx_shared *sh) rte_errno =ENOMEM ;return -ENOMEM ; } - mem =mlx5_malloc (MLX5_MEM_ZERO , size, pgsize,SOCKET_ID_ANY ); + mem =mlx5_malloc (MLX5_MEM_ZERO , size, pgsize,RTE_NUMA_ID_ANY );if (!mem) { rte_errno =ENOMEM ;return -ENOMEM ;
@@ -11175,7 +11176,7 @@ flow_tunnel_add_default_miss(struct rte_eth_dev *dev, miss_actions[1 ].type =RTE_FLOW_ACTION_TYPE_RSS ; q_size = priv->reta_idx_n *sizeof (ctx->queue[0 ]); ctx->queue =mlx5_malloc (MLX5_MEM_SYS |MLX5_MEM_ZERO , q_size, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!ctx->queue)return rte_flow_error_set (error, ENOMEM,
@@ -11304,7 +11305,7 @@ mlx5_flow_tunnel_grp2tbl_create_cb(void *tool_ctx, void *cb_ctx) tte =mlx5_malloc (MLX5_MEM_SYS |MLX5_MEM_ZERO ,sizeof (*tte),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!tte) goto err; mlx5_ipool_malloc(sh->ipool[MLX5_IPOOL_TNL_TBL_ID],
@@ -11334,7 +11335,7 @@ mlx5_flow_tunnel_grp2tbl_clone_cb(void *tool_ctx __rte_unused, void *cb_ctx __rte_unused) {struct tunnel_tbl_entry *tte =mlx5_malloc (MLX5_MEM_SYS ,sizeof (*tte), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!tte)return NULL ;
@@ -11588,7 +11589,7 @@ int mlx5_alloc_tunnel_hub(struct mlx5_dev_ctx_shared *sh)struct mlx5_flow_tunnel_hub *thub; thub =mlx5_malloc (MLX5_MEM_SYS |MLX5_MEM_ZERO ,sizeof (*thub), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!thub)return -ENOMEM ;LIST_INIT (&thub->tunnels);
drivers/net/mlx5/mlx5_rxq.c +13 -11
@@ -994,7 +994,7 @@ mlx5_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, }/* Allocate RXQ. */ rxq =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (*rxq),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!rxq) {DRV_LOG (ERR ,"port %u unable to allocate rx queue index %u private data" , dev->data->port_id, idx);
@@ -1083,7 +1083,7 @@ mlx5_rx_hairpin_queue_setup(struct rte_eth_dev *dev, uint16_t idx, } } rxq =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (*rxq),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!rxq) {DRV_LOG (ERR ,"port %u unable to allocate hairpin rx queue index %u private data" , dev->data->port_id, idx);
@@ -1875,7 +1875,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, desc >>= mprq_log_actual_stride_num; alloc_size += desc *sizeof (struct mlx5_mprq_buf *); } -if (socket != (unsigned int )SOCKET_ID_ANY ) { +if (socket != (unsigned int )RTE_NUMA_ID_ANY ) { tmpl =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO , alloc_size,0 , socket); }else { tmpl = mlx5_malloc_numa_tolerant(MLX5_MEM_RTE | MLX5_MEM_ZERO, alloc_size, 0,
@@ -1983,7 +1983,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, goto error; } tmpl->is_hairpin = false; -if (socket != (unsigned int )SOCKET_ID_ANY ) { +if (socket != (unsigned int )RTE_NUMA_ID_ANY ) {if (mlx5_mr_ctrl_init (&tmpl->rxq.mr_ctrl, &priv->sh->cdev->mr_scache.dev_gen, socket))/* rte_errno is already set. */
@@ -1993,13 +1993,14 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, &priv->sh->cdev->mr_scache.dev_gen, dev->device->numa_node);if (ret == -ENOMEM ) { ret =mlx5_mr_ctrl_init (&tmpl->rxq.mr_ctrl, - &priv->sh->cdev->mr_scache.dev_gen,SOCKET_ID_ANY ); + &priv->sh->cdev->mr_scache.dev_gen, +RTE_NUMA_ID_ANY ); }if (ret)/* rte_errno is already set. */ goto error; } - tmpl->socket = (socket == (unsigned int )SOCKET_ID_ANY ? + tmpl->socket = (socket == (unsigned int )RTE_NUMA_ID_ANY ? (unsigned int )dev->device->numa_node : socket);if (dev->data->dev_conf.intr_conf.rxq) tmpl->irq =1 ;
@@ -2159,7 +2160,7 @@ mlx5_rxq_hairpin_new(struct rte_eth_dev *dev, struct mlx5_rxq_priv *rxq,struct mlx5_rxq_ctrl *tmpl; tmpl =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (*tmpl),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!tmpl) { rte_errno =ENOMEM ;return NULL ;
@@ -2168,7 +2169,7 @@ mlx5_rxq_hairpin_new(struct rte_eth_dev *dev, struct mlx5_rxq_priv *rxq, rxq->ctrl = tmpl;LIST_INSERT_HEAD (&tmpl->owners, rxq, owner_entry); tmpl->is_hairpin = true; - tmpl->socket =SOCKET_ID_ANY ; + tmpl->socket =RTE_NUMA_ID_ANY ; tmpl->rxq.rss_hash =0 ; tmpl->rxq.port_id = dev->data->port_id; tmpl->sh = priv->sh;
@@ -2769,7 +2770,7 @@ mlx5_ind_table_obj_new(struct rte_eth_dev *dev, const uint16_t *queues,*/ ind_tbl =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*ind_tbl) + (standalone ? max_queues_n : queues_n) * -sizeof (uint16_t ),0 ,SOCKET_ID_ANY ); +sizeof (uint16_t ),0 ,RTE_NUMA_ID_ANY );if (!ind_tbl) { rte_errno =ENOMEM ;return NULL ;
@@ -3276,7 +3277,8 @@ mlx5_drop_action_create(struct rte_eth_dev *dev)if (priv->drop_queue.hrxq)return priv->drop_queue.hrxq; - hrxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*hrxq) +MLX5_RSS_HASH_KEY_LEN ,0 ,SOCKET_ID_ANY ); + hrxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*hrxq) +MLX5_RSS_HASH_KEY_LEN , +0 ,RTE_NUMA_ID_ANY );if (!hrxq) { DRV_LOG(WARNING, "Port %u cannot allocate memory for drop queue.",
@@ -3286,7 +3288,7 @@ mlx5_drop_action_create(struct rte_eth_dev *dev) } priv->drop_queue.hrxq = hrxq; hrxq->ind_table =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*hrxq->ind_table), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!hrxq->ind_table) { rte_errno =ENOMEM ; goto error;
drivers/net/mlx5/mlx5_txq.c +7 -6
@@ -1128,7 +1128,7 @@ mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,uint16_t max_wqe;uint32_t wqebb_cnt, log_desc_n; -if (socket != (unsigned int )SOCKET_ID_ANY ) { +if (socket != (unsigned int )RTE_NUMA_ID_ANY ) { tmpl =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (*tmpl) + desc *sizeof (struct rte_mbuf *),0 , socket); }else {
@@ -1140,7 +1140,7 @@ mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, rte_errno =ENOMEM ;return NULL ; } -if (socket != (unsigned int )SOCKET_ID_ANY ) { +if (socket != (unsigned int )RTE_NUMA_ID_ANY ) {if (mlx5_mr_ctrl_init (&tmpl->txq.mr_ctrl, &priv->sh->cdev->mr_scache.dev_gen, socket))/* rte_errno is already set. */
@@ -1150,7 +1150,8 @@ mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, &priv->sh->cdev->mr_scache.dev_gen, dev->device->numa_node);if (ret == -ENOMEM ) { ret =mlx5_mr_ctrl_init (&tmpl->txq.mr_ctrl, - &priv->sh->cdev->mr_scache.dev_gen,SOCKET_ID_ANY ); + &priv->sh->cdev->mr_scache.dev_gen, +RTE_NUMA_ID_ANY ); }if (ret)/* rte_errno is already set. */
@@ -1160,7 +1161,7 @@ mlx5_txq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, tmpl->txq.offloads = conf->offloads | dev->data->dev_conf.txmode.offloads; tmpl->priv = priv; - tmpl->socket = (socket == (unsigned int )SOCKET_ID_ANY ? + tmpl->socket = (socket == (unsigned int )RTE_NUMA_ID_ANY ? (unsigned int )dev->device->numa_node : socket); tmpl->txq.elts_n =log2above (desc); tmpl->txq.elts_s = desc;
@@ -1221,13 +1222,13 @@ mlx5_txq_hairpin_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc,struct mlx5_txq_ctrl *tmpl; tmpl =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (*tmpl),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!tmpl) { rte_errno =ENOMEM ;return NULL ; } tmpl->priv = priv; - tmpl->socket =SOCKET_ID_ANY ; + tmpl->socket =RTE_NUMA_ID_ANY ; tmpl->txq.elts_n =log2above (desc); tmpl->txq.port_id = dev->data->port_id; tmpl->txq.idx = idx;
Signature · 1 line
2.55.0
PATCH 169/227 drivers: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal structure fields, variables and comments to the NUMA node terminology across the mlx5 common and net drivers, and switch calls to the NUMA-named APIs.
--- .../common/mlx5/linux/mlx5_common_auxiliary.c | 6 +-- drivers/common/mlx5/linux/mlx5_nl.c | 4 +- drivers/common/mlx5/mlx5_common.c | 4 +- drivers/common/mlx5/mlx5_common_mr.c | 16 +++--- drivers/common/mlx5/mlx5_common_mr.h | 2 +- drivers/common/mlx5/mlx5_common_utils.c | 6 +-- drivers/common/mlx5/mlx5_devx_cmds.c | 50 +++++++++---------- drivers/common/mlx5/mlx5_malloc.c | 10 ++-- drivers/common/mlx5/mlx5_malloc.h | 4 +- drivers/common/mlx5/windows/mlx5_common_os.c | 4 +- drivers/net/mlx5/hws/mlx5dr_internal.h | 4 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 8 +-- drivers/net/mlx5/linux/mlx5_os.c | 14 +++--- drivers/net/mlx5/linux/mlx5_verbs.c | 6 +-- drivers/net/mlx5/linux/mlx5_vlan_os.c | 2 +- drivers/net/mlx5/mlx5.c | 16 +++--- drivers/net/mlx5/mlx5_devx.c | 12 ++--- drivers/net/mlx5/mlx5_ethdev.c | 6 +-- drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/mlx5/mlx5_flow_aso.c | 8 +-- drivers/net/mlx5/mlx5_flow_dv.c | 32 ++++++------ drivers/net/mlx5/mlx5_flow_flex.c | 4 +- drivers/net/mlx5/mlx5_flow_geneve.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 48 +++++++++--------- drivers/net/mlx5/mlx5_flow_meter.c | 14 +++--- drivers/net/mlx5/mlx5_flow_quota.c | 6 +-- drivers/net/mlx5/mlx5_flow_verbs.c | 2 +- drivers/net/mlx5/mlx5_hws_cnt.c | 30 +++++------ drivers/net/mlx5/mlx5_nta_sample.c | 16 +++--- drivers/net/mlx5/mlx5_nta_split.c | 2 +- drivers/net/mlx5/mlx5_rss.c | 4 +- drivers/net/mlx5/mlx5_rxq.c | 4 +- drivers/net/mlx5/mlx5_stats.c | 2 +- drivers/net/mlx5/mlx5_trigger.c | 2 +- drivers/net/mlx5/mlx5_tx.c | 2 +- drivers/net/mlx5/mlx5_utils.c | 30 +++++------ drivers/net/mlx5/windows/mlx5_flow_os.c | 4 +- drivers/net/mlx5/windows/mlx5_os.c | 8 +-- 38 files changed, 198 insertions(+), 198 deletions(-)
drivers/common/mlx5/linux/mlx5_common_auxiliary.c +3 -3
@@ -97,14 +97,14 @@ mlx5_auxiliary_get_numa(const struct rte_auxiliary_device *dev)char numa_path[PATH_MAX ];if (mlx5_auxiliary_get_pci_path (dev, numa_path,sizeof (numa_path)) !=0 ) -return SOCKET_ID_ANY ; +return RTE_NUMA_ID_ANY ;if (strcat (numa_path,"/numa_node" ) ==NULL ) { rte_errno =ENAMETOOLONG ; -return SOCKET_ID_ANY ; +return RTE_NUMA_ID_ANY ; }if (eal_parse_sysfs_value (numa_path, &numa) !=0 ) { rte_errno =EINVAL ; -return SOCKET_ID_ANY ; +return RTE_NUMA_ID_ANY ; }return (int )numa; }
drivers/common/mlx5/linux/mlx5_nl.c +2 -2
@@ -400,7 +400,7 @@ mlx5_nl_recv(int nlsk_fd, uint32_t sn, int (*cb)(struct nlmsghdr *, void *arg),if (recv_bytes <MLX5_RECV_BUF_SIZE ) recv_bytes =MLX5_RECV_BUF_SIZE ;mlx5_free (buf); - buf =mlx5_malloc (0 , recv_bytes,0 ,SOCKET_ID_ANY ); + buf =mlx5_malloc (0 , recv_bytes,0 ,RTE_NUMA_ID_ANY );if (!buf) { rte_errno =ENOMEM ; ret = -rte_errno;
@@ -1338,7 +1338,7 @@ mlx5_nl_portnum(int nl, const char *name, struct mlx5_dev_info *dev_info) size = (data.portnum +1 ) *sizeof (struct mlx5_port_nl_info ); dev_info->port_info =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE , size,RTE_CACHE_LINE_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (dev_info->port_info ==NULL ) {memset (dev_info,0 ,sizeof (*dev_info)); rte_errno =ENOMEM ;
drivers/common/mlx5/mlx5_common.c +2 -2
@@ -854,7 +854,7 @@ mlx5_common_probe_again_args_validate(struct mlx5_common_device *cdev,return 0 ; config =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_common_dev_config ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (config ==NULL ) { rte_errno = -ENOMEM ;return -rte_errno;
@@ -1135,7 +1135,7 @@ mlx5_common_dev_dma_map(struct rte_device *rte_dev, void *addr,return -1 ; } mr =mlx5_create_mr_ext (dev->pd, (uintptr_t )addr, len, -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!mr) {DRV_LOG (WARNING ,"Device %s unable to DMA map" , rte_dev->name); rte_errno =EINVAL ;
drivers/common/mlx5/mlx5_common_mr.c +8 -8
@@ -88,14 +88,14 @@ mr_btree_expand(struct mlx5_mr_btree *bt, uint32_t 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 * it is expanded, expansion wouldn't be needed again ever. */ mem =mlx5_realloc (bt->table,MLX5_MEM_RTE |MLX5_MEM_ZERO , - n *sizeof (struct mr_cache_entry ),0 ,SOCKET_ID_ANY ); + n *sizeof (struct mr_cache_entry ),0 ,RTE_NUMA_ID_ANY );if (mem ==NULL ) {/* Not an error, B-tree search will be skipped. */ DRV_LOG(WARNING, "failed to expand MR B-tree (%p) table",
@@ -773,7 +773,7 @@ mlx5_mr_create_primary(void *pd, bmp_size =rte_bitmap_get_memory_footprint (ms_n); mr =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,RTE_ALIGN_CEIL (sizeof (*mr),RTE_CACHE_LINE_SIZE ) + - bmp_size,RTE_CACHE_LINE_SIZE , msl->socket_id); + bmp_size,RTE_CACHE_LINE_SIZE , msl->numa_id);if (mr ==NULL ) {DRV_LOG (DEBUG ,"Unable to allocate memory for a new MR of" " address (%p)." , (void *)addr);
@@ -909,7 +909,7 @@ mlx5_mr_create_primary(void *pd,/* * Finally create an MR for the memory chunk. Verbs: ibv_reg_mr() can * be called with holding the memory lock because it doesn't use -* mlx5_alloc_buf_extern() which eventually calls rte_malloc_socket() +* mlx5_alloc_buf_extern() which eventually calls rte_malloc_numa() * through mlx5_alloc_verbs_buf(). */ mlx5_os_reg_mr (pd, (void *)data.start, len, &mr->pmd_mr);
@@ -1186,13 +1186,13 @@ mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl)* Pointer to MR structure on success, NULL otherwise. */ struct mlx5_mr * -mlx5_create_mr_ext (void *pd,uintptr_t addr,size_t len,int socket_id) +mlx5_create_mr_ext (void *pd,uintptr_t addr,size_t len,int numa_id) {struct mlx5_mr *mr =NULL ; mr =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,RTE_ALIGN_CEIL (sizeof (*mr),RTE_CACHE_LINE_SIZE ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (mr ==NULL )return NULL ;mlx5_os_reg_mr (pd, (void *)addr, len, &mr->pmd_mr);
@@ -1592,7 +1592,7 @@ mlx5_mempool_reg_create(struct rte_mempool *mp, unsigned int mrs_n, mpr =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (struct mlx5_mempool_reg ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (mpr ==NULL ) {DRV_LOG (ERR ,"Cannot allocate mempool %s registration object" , mp->name);
@@ -1600,7 +1600,7 @@ mlx5_mempool_reg_create(struct rte_mempool *mp, unsigned int mrs_n, } mpr->mrs =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO , mrs_n *sizeof (struct mlx5_mempool_mr ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!mpr->mrs) {DRV_LOG (ERR ,"Cannot allocate mempool %s registration MRs" , mp->name);
drivers/common/mlx5/mlx5_common_mr.h +1 -1
@@ -224,7 +224,7 @@ struct mlx5_mr * mlx5_mr_lookup_list(struct mlx5_mr_share_cache *share_cache, struct mr_cache_entry *entry, uintptr_t addr);struct mlx5_mr * -mlx5_create_mr_ext (void *pd,uintptr_t addr,size_t len,int socket_id); +mlx5_create_mr_ext (void *pd,uintptr_t addr,size_t len,int numa_id);void mlx5_mr_free (struct mlx5_mr *mr);__rte_internal uint32_t
drivers/common/mlx5/mlx5_common_utils.c +3 -3
@@ -46,7 +46,7 @@ mlx5_list_create(const char *name, void *ctx, bool lcores_share, } list =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*list) + (lcores_share ?sizeof (*gc) :0 ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!list)return NULL ;
@@ -183,7 +183,7 @@ _mlx5_list_register(struct mlx5_list_inconst *l_inconst,if (unlikely (!l_inconst->cache[lcore_index])) { l_inconst->cache[lcore_index] =mlx5_malloc (0 ,sizeof (struct mlx5_list_cache ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!l_inconst->cache[lcore_index]) { rte_errno =ENOMEM ;return NULL ;
@@ -423,7 +423,7 @@ mlx5_hlist_create(const char *name, uint32_t size, bool direct_key, alloc_size +=sizeof (struct mlx5_list_cache ) * act_size;/* Using zmalloc, then no need to initialize the heads. */ h =mlx5_malloc (MLX5_MEM_ZERO , alloc_size,RTE_CACHE_LINE_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!h) {DRV_LOG (ERR ,"No memory for hash list %s creation" , name ? name :"None" );
drivers/common/mlx5/mlx5_devx_cmds.c +25 -25
199 lines not on this page · raw message
drivers/common/mlx5/mlx5_malloc.c +5 -5
@@ -165,8 +165,8 @@ mlx5_alloc_align(size_t size, unsigned int align, unsigned int zero)static void *mlx5_malloc_socket_internal (size_t size,unsigned int align,int socket,bool zero) { -return zero ?rte_zmalloc_socket (NULL , size, align, socket) : -rte_malloc_socket (NULL , size, align, socket); +return zero ?rte_zmalloc_numa (NULL , size, align, socket) : +rte_malloc_numa (NULL , size, align, socket); }RTE_EXPORT_INTERNAL_SYMBOL (mlx5_malloc)
@@ -188,9 +188,9 @@ mlx5_malloc(uint32_t flags, size_t size, unsigned int align, int socket) rte_mem = mlx5_sys_mem.enable ? false : true;if (rte_mem) { addr =mlx5_malloc_socket_internal (size, align, socket, !!(flags &MLX5_MEM_ZERO )); -if (addr ==NULL && socket !=SOCKET_ID_ANY && (flags &MLX5_NUMA_TOLERANT )) { +if (addr ==NULL && socket !=RTE_NUMA_ID_ANY && (flags &MLX5_NUMA_TOLERANT )) {size_t alloc_size = size; - addr =mlx5_malloc_socket_internal (size, align,SOCKET_ID_ANY , + addr =mlx5_malloc_socket_internal (size, align,RTE_NUMA_ID_ANY , !!(flags &MLX5_MEM_ZERO ));if (addr) { DRV_LOG(WARNING, "Allocated %p (size %zu socket %d) through NUMA tolerant fallback",
@@ -245,7 +245,7 @@ mlx5_realloc(void *addr, uint32_t flags, size_t size, unsigned int align, }/* Allocate memory from rte memory. */ if (rte_mem) { - new_addr =rte_realloc_socket (addr, size, align, socket); + new_addr =rte_realloc_numa (addr, size, align, socket);mlx5_mem_update_msl (new_addr);#ifdef RTE_PMD_MLX5_DEBUG if (new_addr)
drivers/common/mlx5/mlx5_malloc.h +2 -2
@@ -106,9 +106,9 @@ void mlx5_free(void *addr);#if defined(RTE_TOOLCHAIN_GCC ) || defined(RTE_TOOLCHAIN_CLANG )#define mlx5_malloc_numa_tolerant (flags, size, align, socket) (__extension__ ({ \ void *mem = mlx5_malloc((uint32_t)(flags), (size_t)(size), (align), (socket)); \ - if ((mem == NULL) && ((int)(socket) != SOCKET_ID_ANY)) { \ + if ((mem == NULL) && ((int)(socket) != RTE_NUMA_ID_ANY)) { \ mem = mlx5_malloc((uint32_t)(flags), (size_t)(size), \ - (align), SOCKET_ID_ANY); \ + (align), RTE_NUMA_ID_ANY); \ if (mem) { \ DRV_LOG(WARNING, \ "Allocated %p (size %zu socket %d) through NUMA tolerant fallback", \
drivers/common/mlx5/windows/mlx5_common_os.c +2 -2
@@ -84,7 +84,7 @@ mlx5_os_pd_prepare(struct mlx5_common_device *cdev) {struct mlx5_pd *pd; - pd =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pd),0 ,SOCKET_ID_ANY ); + pd =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pd),0 ,RTE_NUMA_ID_ANY );if (!pd)return -1 ;struct mlx5_devx_obj *obj =mlx5_devx_cmd_alloc_pd (cdev->ctx);
@@ -321,7 +321,7 @@ mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access)struct mlx5_devx_umem *umem; umem =mlx5_malloc (MLX5_MEM_ZERO , - (sizeof (*umem)),0 ,SOCKET_ID_ANY ); + (sizeof (*umem)),0 ,RTE_NUMA_ID_ANY );if (!umem) { errno =ENOMEM ;return NULL ;
drivers/net/mlx5/hws/mlx5dr_internal.h +2 -2
@@ -74,7 +74,7 @@ static inline void *simple_malloc(size_t size)return mlx5_malloc (MLX5_MEM_SYS , size,MLX5_MALLOC_ALIGNMENT , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY ); }static inline void *simple_calloc (size_t nmemb,size_t size)
@@ -82,7 +82,7 @@ static inline void *simple_calloc(size_t nmemb, size_t size)return mlx5_malloc (MLX5_MEM_SYS |MLX5_MEM_ZERO , nmemb * size,MLX5_MALLOC_ALIGNMENT , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY ); }static inline void simple_free (void *addr)
drivers/net/mlx5/linux/mlx5_ethdev_os.c +4 -4
@@ -1305,7 +1305,7 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev, } eeprom =mlx5_malloc (MLX5_MEM_ZERO , (sizeof (struct ethtool_eeprom ) + info->length),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!eeprom) {DRV_LOG (WARNING ,"port %u cannot allocate memory for " "eeprom data" , dev->data->port_id);
@@ -1879,7 +1879,7 @@ mlx5_os_stats_init(struct rte_eth_dev *dev) str_sz = max_stats_n *ETH_GSTRING_LEN ; strings = (struct ethtool_gstrings *)mlx5_malloc (0 , str_sz +sizeof (struct ethtool_gstrings ),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!strings) {DRV_LOG (WARNING ,"port %u unable to allocate memory for xstats" , dev->data->port_id);
@@ -1954,7 +1954,7 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev)int ret; sset_info =mlx5_malloc (0 ,sizeof (struct ethtool_sset_info ) + -sizeof (uint32_t ),0 ,SOCKET_ID_ANY ); +sizeof (uint32_t ),0 ,RTE_NUMA_ID_ANY );if (sset_info ==NULL ) { rte_errno =ENOMEM ;return -rte_errno;
@@ -1998,7 +1998,7 @@ int mlx5_get_flag_dropless_rq(struct rte_eth_dev *dev) str_sz =ETH_GSTRING_LEN * len; strings = (struct ethtool_gstrings *)mlx5_malloc (0 , str_sz +sizeof (struct ethtool_gstrings ),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!strings) {DRV_LOG (WARNING ,"port %u unable to allocate memory for" " private flags" , dev->data->port_id);
drivers/net/mlx5/linux/mlx5_os.c +7 -7
@@ -903,7 +903,7 @@ mlx5_init_shared_data(void)/* Allocate shared memory. */ mz =rte_memzone_reserve (MZ_MLX5_PMD_SHARED_DATA ,sizeof (*mlx5_shared_data), -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (mz ==NULL ) {DRV_LOG (ERR ,"Cannot allocate mlx5 shared data" );
@@ -1440,7 +1440,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,/* Allocate private eth device data. */ priv =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (*priv), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv ==NULL ) {DRV_LOG (ERR ,"priv allocation failure" ); err =ENOMEM ;
@@ -1451,7 +1451,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->pci_dev = spawn->pci_dev; priv->mac =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (*priv->mac) * sh->dev_cap.max_mac_addrs, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv->mac ==NULL ) {DRV_LOG (ERR ,"Failed to allocate MAC address array." ); err =ENOMEM ;
@@ -1459,7 +1459,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, } priv->mac_own =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,RTE_BITSET_SIZE (sh->dev_cap.max_mac_addrs), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv->mac_own ==NULL ) {DRV_LOG (ERR ,"Failed to allocate MAC ownership bitmap." ); err =ENOMEM ;
@@ -1821,7 +1821,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->ext_rxqs =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_external_q ) *MLX5_MAX_EXT_RX_QUEUES ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (priv->ext_rxqs ==NULL ) {DRV_LOG (ERR ,"Fail to allocate external RxQ array." ); err =ENOMEM ;
@@ -1830,7 +1830,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->ext_txqs =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_external_q ) *MLX5_MAX_EXT_TX_QUEUES ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (priv->ext_txqs ==NULL ) {DRV_LOG (ERR ,"Fail to allocate external TxQ array." ); err =ENOMEM ;
@@ -2684,7 +2684,7 @@ mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev,/* Now we can determine the maximal amount of devices to be spawned. */ list =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_dev_spawn_data ) * (np ? np : nd), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!list) {DRV_LOG (ERR ,"Spawn data array allocation failure." ); rte_errno =ENOMEM ;
drivers/net/mlx5/linux/mlx5_verbs.c +3 -3
@@ -697,7 +697,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev)if (rxq !=NULL )return 0 ; - rxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*rxq),0 ,SOCKET_ID_ANY ); + rxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*rxq),0 ,RTE_NUMA_ID_ANY );if (rxq ==NULL ) {DRV_LOG (DEBUG ,"Port %u cannot allocate drop Rx queue memory." , dev->data->port_id);
@@ -706,7 +706,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev) } priv->drop_queue.rxq = rxq; rxq_ctrl =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*rxq_ctrl),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (rxq_ctrl ==NULL ) {DRV_LOG (DEBUG ,"Port %u cannot allocate drop Rx queue control memory." , dev->data->port_id);
@@ -715,7 +715,7 @@ mlx5_rxq_ibv_obj_drop_create(struct rte_eth_dev *dev) } rxq->ctrl = rxq_ctrl; rxq_obj =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*rxq_obj),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (rxq_obj ==NULL ) {DRV_LOG (DEBUG ,"Port %u cannot allocate drop Rx queue memory." , dev->data->port_id);
drivers/net/mlx5/linux/mlx5_vlan_os.c +1 -1
@@ -127,7 +127,7 @@ mlx5_vlan_vmwa_init(struct rte_eth_dev *dev, uint32_t ifindex)return NULL ; } vmwa =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*vmwa),sizeof (uint32_t ), -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!vmwa) {DRV_LOG (WARNING , "Can not allocate memory"
drivers/net/mlx5/mlx5.c +8 -8
@@ -462,7 +462,7 @@ mlx5_flow_aso_age_mng_init(struct mlx5_dev_ctx_shared *sh)if (sh->aso_age_mng)return 0 ; sh->aso_age_mng =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*sh->aso_age_mng), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!sh->aso_age_mng) {DRV_LOG (ERR ,"aso_age_mng allocation was failed." ); rte_errno =ENOMEM ;
@@ -600,7 +600,7 @@ mlx5_flow_counters_mng_init(struct mlx5_dev_ctx_shared *sh) pools =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_flow_counter_pool *) *MLX5_COUNTER_POOLS_MAX_NUM , -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!pools) {DRV_LOG (ERR ,"Counter management allocation was failed." );
@@ -724,7 +724,7 @@ mlx5_aso_flow_mtrs_mng_init(struct mlx5_dev_ctx_shared *sh)if (!sh->mtrmng) { sh->mtrmng =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*sh->mtrmng), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!sh->mtrmng) {DRV_LOG (ERR ,"meter management allocation was failed." );
@@ -827,7 +827,7 @@ mlx5_flow_aso_ct_mng_init(struct mlx5_dev_ctx_shared *sh)return 0 ; sh->ct_mng =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*sh->ct_mng) +sizeof (struct mlx5_aso_sq ) *MLX5_ASO_CT_SQ_NUM , -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!sh->ct_mng) {DRV_LOG (ERR ,"ASO CT management allocation failed." ); rte_errno =ENOMEM ;
@@ -1094,7 +1094,7 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev) rte_memory_order_relaxed) > 0) goto end; priv->sh->srh_flex_parser.flex.devx_fp =mlx5_malloc (MLX5_MEM_ZERO , -sizeof (struct mlx5_flex_parser_devx ),0 ,SOCKET_ID_ANY ); +sizeof (struct mlx5_flex_parser_devx ),0 ,RTE_NUMA_ID_ANY );if (!priv->sh->srh_flex_parser.flex.devx_fp) { rte_errno =ENOMEM ; goto error;
@@ -1781,7 +1781,7 @@ mlx5_get_physical_device(struct mlx5_common_device *cdev) } phdev =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_physical_device ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!phdev) {DRV_LOG (ERR ,"Physical device allocation failure." ); rte_errno =ENOMEM ;
@@ -1889,7 +1889,7 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn, sh =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_dev_ctx_shared ) + spawn->max_port *sizeof (struct mlx5_dev_shared_port ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!sh) {DRV_LOG (ERR ,"Shared context allocation failure." ); rte_errno =ENOMEM ;
@@ -3158,7 +3158,7 @@ mlx5_probe_again_args_validate(struct mlx5_common_device *cdev,return 0 ; config =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_sh_config ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (config ==NULL ) { rte_errno = -ENOMEM ;return -rte_errno;
drivers/net/mlx5/mlx5_devx.c +6 -6
@@ -742,7 +742,7 @@ mlx5_devx_ind_table_create_rqt_attr(struct rte_eth_dev *dev,unsigned int i, j; rqt_attr =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*rqt_attr) + - rqt_n *sizeof (uint32_t ),0 ,SOCKET_ID_ANY ); + rqt_n *sizeof (uint32_t ),0 ,RTE_NUMA_ID_ANY );if (!rqt_attr) {DRV_LOG (ERR ,"Port %u cannot allocate RQT resources." , dev->data->port_id);
@@ -1108,7 +1108,7 @@ static int mlx5_rxq_devx_obj_drop_create(struct rte_eth_dev *dev) {struct mlx5_priv *priv = dev->data->dev_private; -int socket_id = dev->device->numa_node; +int numa_id = dev->device->numa_node;struct mlx5_rxq_priv *rxq;struct mlx5_rxq_ctrl *rxq_ctrl =NULL ;struct mlx5_rxq_obj *rxq_obj =NULL ;
@@ -1119,7 +1119,7 @@ mlx5_rxq_devx_obj_drop_create(struct rte_eth_dev *dev)* They are required to hold pointers for cleanup * and are only accessible via drop queue DevX objects. */ - rxq =mlx5_malloc_numa_tolerant (MLX5_MEM_ZERO ,sizeof (*rxq),0 , socket_id); + rxq =mlx5_malloc_numa_tolerant (MLX5_MEM_ZERO ,sizeof (*rxq),0 , numa_id);if (rxq ==NULL ) {DRV_LOG (ERR ,"Port %u could not allocate drop queue private" , dev->data->port_id);
@@ -1127,14 +1127,14 @@ mlx5_rxq_devx_obj_drop_create(struct rte_eth_dev *dev) goto error; } rxq_ctrl =mlx5_malloc_numa_tolerant (MLX5_MEM_ZERO ,sizeof (*rxq_ctrl), -0 , socket_id); +0 , numa_id);if (rxq_ctrl ==NULL ) {DRV_LOG (ERR ,"Port %u could not allocate drop queue control" , dev->data->port_id); rte_errno =ENOMEM ; goto error; } - rxq_obj =mlx5_malloc_numa_tolerant (MLX5_MEM_ZERO ,sizeof (*rxq_obj),0 , socket_id); + rxq_obj =mlx5_malloc_numa_tolerant (MLX5_MEM_ZERO ,sizeof (*rxq_obj),0 , numa_id);if (rxq_obj ==NULL ) {DRV_LOG (ERR ,"Port %u could not allocate drop queue object" , dev->data->port_id);
@@ -1142,7 +1142,7 @@ mlx5_rxq_devx_obj_drop_create(struct rte_eth_dev *dev) goto error; }/* set the CPU socket ID where the rxq_ctrl was allocated */ - rxq_ctrl->socket = socket_id; + rxq_ctrl->socket = numa_id; rxq_obj->rxq_ctrl = rxq_ctrl; rxq_ctrl->is_hairpin = false; rxq_ctrl->sh = priv->sh;
drivers/net/mlx5/mlx5_ethdev.c +3 -3
@@ -85,7 +85,7 @@ mlx5_dev_configure(struct rte_eth_dev *dev) priv->rss_conf.rss_key =mlx5_realloc (priv->rss_conf.rss_key,MLX5_MEM_RTE ,MLX5_RSS_HASH_KEY_LEN ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!priv->rss_conf.rss_key) {DRV_LOG (ERR ,"port %u cannot allocate RSS hash key memory (%u)" , dev->data->port_id, rxqs_n);
@@ -110,7 +110,7 @@ mlx5_dev_configure(struct rte_eth_dev *dev) priv->rxq_privs =mlx5_realloc (priv->rxq_privs,MLX5_MEM_RTE |MLX5_MEM_ZERO ,sizeof (void *) * rxqs_n,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (rxqs_n && priv->rxq_privs ==NULL ) {DRV_LOG (ERR ,"port %u cannot allocate rxq private data" , dev->data->port_id);
@@ -187,7 +187,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev)if (priv->skip_default_rss_reta)return ret; rss_queue_arr =mlx5_malloc (0 , rxqs_n *sizeof (unsigned int ),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!rss_queue_arr) {DRV_LOG (ERR ,"port %u cannot allocate RSS queue list (%u)" , dev->data->port_id, rxqs_n);
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -8558,7 +8558,7 @@ mlx5_ctrl_flow_vlan(struct rte_eth_dev *dev, queue[i] = (*priv->reta_idx)[i]; entry = mlx5_malloc(MLX5_MEM_ZERO, sizeof(*entry), alignof(typeof(*entry)), -RTE_NUMA_ID_ANY ); +RTE_NUMA_ID_ANY );if (entry ==NULL ) { rte_errno =ENOMEM ; goto err;
drivers/net/mlx5/mlx5_flow_aso.c +4 -4
@@ -52,7 +52,7 @@ mlx5_aso_reg_mr(struct mlx5_common_device *cdev, size_t length,int ret; mr->addr =mlx5_malloc (MLX5_MEM_RTE |MLX5_MEM_ZERO , length,4096 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!mr->addr) {DRV_LOG (ERR ,"Failed to create ASO bits mem for MR." );return -1 ;
@@ -241,7 +241,7 @@ mlx5_aso_sq_create(struct mlx5_common_device *cdev, struct mlx5_aso_sq *sq,if (mlx5_devx_cq_create (cdev->ctx, &sq->cq.cq_obj, log_desc_n, &cq_attr, -SOCKET_ID_ANY )) +RTE_NUMA_ID_ANY )) goto error; sq->cq.cq_ci =0 ; sq->cq.log_desc_n = log_desc_n;
@@ -250,7 +250,7 @@ mlx5_aso_sq_create(struct mlx5_common_device *cdev, struct mlx5_aso_sq *sq,/* for mlx5_aso_wqe that is twice the size of mlx5_wqe */ log_wqbb_n = sq->log_desc_n +1 ; ret =mlx5_devx_sq_create (cdev->ctx, &sq->sq_obj, log_wqbb_n, &sq_attr, -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (ret) {DRV_LOG (ERR ,"Can't create SQ object." ); rte_errno =ENOMEM ;
@@ -303,7 +303,7 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh,if (hws_pool) { sq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_aso_sq ) * nb_queues, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!sq)return -1 ; hws_pool->sq = sq;
drivers/net/mlx5/mlx5_flow_dv.c +16 -16
@@ -6863,7 +6863,7 @@ flow_dv_pool_create(struct rte_eth_dev *dev, struct mlx5_devx_obj *dcs, } size +=MLX5_COUNTERS_PER_POOL *MLX5_CNT_SIZE ; size += (!age ?0 :MLX5_COUNTERS_PER_POOL *MLX5_AGE_SIZE ); - pool =mlx5_malloc (MLX5_MEM_ZERO , size,0 ,SOCKET_ID_ANY ); + pool =mlx5_malloc (MLX5_MEM_ZERO , size,0 ,RTE_NUMA_ID_ANY );if (!pool) { rte_errno =ENOMEM ;return NULL ;
@@ -7195,7 +7195,7 @@ flow_dv_mtr_container_resize(struct rte_eth_dev *dev)void *old_pools = pools_mng->pools;uint32_t resize = pools_mng->n +MLX5_MTRS_CONTAINER_RESIZE ;uint32_t mem_size =sizeof (struct mlx5_aso_mtr_pool *) * resize; -void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,SOCKET_ID_ANY ); +void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,RTE_NUMA_ID_ANY );if (!pools) { rte_errno =ENOMEM ;
@@ -7246,7 +7246,7 @@ flow_dv_mtr_pool_create(struct rte_eth_dev *dev, struct mlx5_aso_mtr **mtr_free) rte_errno =ENODATA ;return NULL ; } - pool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pool),0 ,SOCKET_ID_ANY ); + pool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pool),0 ,RTE_NUMA_ID_ANY );if (!pool) { rte_errno =ENOMEM ;claim_zero (mlx5_devx_cmd_destroy (dcs));
@@ -10398,7 +10398,7 @@ flow_dev_geneve_tlv_option_resource_register(struct rte_eth_dev *dev, sh->geneve_tlv_option_resource =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*geneve_opt_resource), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!sh->geneve_tlv_option_resource) {claim_zero (mlx5_devx_cmd_destroy (obj)); ret = rte_flow_error_set(error, ENOMEM,
@@ -11782,7 +11782,7 @@ mlx5_flow_matcher_clone_cb(void *tool_ctx __rte_unused, typeof(*tbl), tbl);struct mlx5_flow_dv_matcher *resource =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*resource), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!resource) { rte_flow_error_set(ctx->error, ENOMEM,
@@ -12111,7 +12111,7 @@ mlx5_flow_matcher_create_cb(void *tool_ctx, void *cb_ctx)int ret; resource =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*resource),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!resource) { rte_flow_error_set(ctx->error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -12993,7 +12993,7 @@ mlx5_flow_dv_dest_array_create_cb(void *tool_ctx __rte_unused, void *cb_ctx) dest_attr[idx] = (struct mlx5dv_dr_action_dest_attr *)mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5dv_dr_action_dest_attr ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!dest_attr[idx]) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -13641,7 +13641,7 @@ flow_dv_aso_age_pools_resize(struct rte_eth_dev *dev)void *old_pools = mng->pools;uint32_t resize = mng->n +MLX5_ASO_AGE_CONTAINER_RESIZE ;uint32_t mem_size =sizeof (struct mlx5_aso_age_pool *) * resize; -void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,SOCKET_ID_ANY ); +void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,RTE_NUMA_ID_ANY );if (!pools) { rte_errno =ENOMEM ;
@@ -13694,7 +13694,7 @@ flow_dv_age_pool_create(struct rte_eth_dev *dev,DRV_LOG (ERR ,"Failed to create flow_hit_aso_obj using DevX." );return NULL ; } - pool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pool),0 ,SOCKET_ID_ANY ); + pool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pool),0 ,RTE_NUMA_ID_ANY );if (!pool) {claim_zero (mlx5_devx_cmd_destroy (obj)); rte_errno =ENOMEM ;
@@ -14076,7 +14076,7 @@ flow_dv_aso_ct_pools_resize(struct rte_eth_dev *dev)/* Magic number now, need a macro. */ uint32_t resize = mng->n +64 ;uint32_t mem_size =sizeof (struct mlx5_aso_ct_pool *) * resize; -void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,SOCKET_ID_ANY ); +void *pools =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,RTE_NUMA_ID_ANY );if (!pools) { rte_errno =ENOMEM ;
@@ -14131,7 +14131,7 @@ flow_dv_ct_pool_create(struct rte_eth_dev *dev, mem_size =sizeof (struct mlx5_aso_ct_action ) *MLX5_ASO_CT_ACTIONS_PER_POOL +sizeof (*pool); - pool =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,SOCKET_ID_ANY ); + pool =mlx5_malloc (MLX5_MEM_ZERO , mem_size,0 ,RTE_NUMA_ID_ANY );if (!pool) { rte_errno =ENOMEM ;claim_zero (mlx5_devx_cmd_destroy (obj));
@@ -17347,7 +17347,7 @@ __flow_dv_action_rss_update(struct rte_eth_dev *dev, uint32_t idx, "cannot modify indirection table"); queue =mlx5_malloc (MLX5_MEM_ZERO ,RTE_ALIGN_CEIL (queue_size,sizeof (void *)), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!queue) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -17885,7 +17885,7 @@ __flow_dv_create_domain_policy_acts(struct rte_eth_dev *dev,NULL ,"Get the wrong " "rss action struct size"); act_cnt->rss =mlx5_malloc (MLX5_MEM_ZERO , - rss_size,0 ,SOCKET_ID_ANY ); + rss_size,0 ,RTE_NUMA_ID_ANY );if (!act_cnt->rss) return -rte_mtr_error_set(error, ENOTSUP,
@@ -18631,7 +18631,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev,continue ; color_rule =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_sub_policy_color_rule ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!color_rule) {DRV_LOG (ERR ,"No memory to create color rule." ); goto err_exit;
@@ -18913,7 +18913,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain)if (!def_policy) { def_policy =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_flow_meter_def_policy ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!def_policy) {DRV_LOG (ERR ,"Failed to alloc default policy table." ); goto def_policy_error;
@@ -19591,7 +19591,7 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev, } color_rule =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_sub_policy_color_rule ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!color_rule) {rte_spinlock_unlock (&mtr_policy->sl); rte_flow_error_set(error, ENOMEM,
drivers/net/mlx5/mlx5_flow_flex.c +2 -2
@@ -1478,7 +1478,7 @@ mlx5_flex_parser_create_cb(void *list_ctx, void *ctx)int ret; fp =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_flex_parser_devx ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!fp)return NULL ;/* Copy the requested configurations. */
@@ -1551,7 +1551,7 @@ mlx5_flex_parser_clone_cb(void *list_ctx,RTE_SET_USED (list_ctx);RTE_SET_USED (entry); fp =mlx5_malloc (0 ,sizeof (struct mlx5_flex_parser_devx ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!fp)return NULL ;memcpy (fp, ctx,sizeof (struct mlx5_flex_parser_devx ));
drivers/net/mlx5/mlx5_flow_geneve.c +1 -1
@@ -616,7 +616,7 @@ mlx5_geneve_tlv_options_create(void *ctx, options =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (struct mlx5_geneve_tlv_options ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (options ==NULL ) {DRV_LOG (ERR ,"Failed to allocate memory for GENEVE TLV options." );
drivers/net/mlx5/mlx5_flow_hw.c +24 -24
192 lines not on this page · raw message
drivers/net/mlx5/mlx5_flow_meter.c +7 -7
@@ -95,7 +95,7 @@ mlx5_flow_meter_init_guest(struct rte_eth_dev *dev) goto err; } priv->hws_mpool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_aso_mtr_pool ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!priv->hws_mpool) { rte_errno =ENOMEM ; ret = -rte_errno;
@@ -217,7 +217,7 @@ mlx5_flow_meter_init(struct rte_eth_dev *dev,sizeof (struct mlx5_aso_mtr ) * nb_meters,RTE_CACHE_LINE_SIZE , - SOCKET_ID_ANY); + RTE_NUMA_ID_ANY);if (!priv->mtr_bulk.aso) { ret =ENOMEM ; rte_flow_error_set(&error, ENOMEM,
@@ -235,7 +235,7 @@ mlx5_flow_meter_init(struct rte_eth_dev *dev, } priv->hws_mpool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_aso_mtr_pool ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!priv->hws_mpool) { ret =ENOMEM ; rte_flow_error_set(&error, ENOMEM,
@@ -273,7 +273,7 @@ mlx5_flow_meter_init(struct rte_eth_dev *dev,sizeof (struct mlx5_flow_meter_profile ) * nb_meter_profiles,RTE_CACHE_LINE_SIZE , - SOCKET_ID_ANY); + RTE_NUMA_ID_ANY);if (!priv->mtr_profile_arr) { ret =ENOMEM ; rte_flow_error_set(&error, ENOMEM,
@@ -289,7 +289,7 @@ mlx5_flow_meter_init(struct rte_eth_dev *dev,sizeof (struct mlx5_flow_meter_policy ) * nb_meter_policies,RTE_CACHE_LINE_SIZE , - SOCKET_ID_ANY); + RTE_NUMA_ID_ANY);if (!priv->mtr_policy_arr) { ret =ENOMEM ; rte_flow_error_set(&error, ENOMEM,
@@ -829,7 +829,7 @@ mlx5_flow_meter_profile_add(struct rte_eth_dev *dev,return ret;/* Meter profile memory allocation. */ fmp =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_flow_meter_profile ), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (fmp ==NULL ) return -rte_mtr_error_set(error, ENOMEM, RTE_MTR_ERROR_TYPE_UNSPECIFIED,
@@ -1317,7 +1317,7 @@ mlx5_flow_meter_policy_add(struct rte_eth_dev *dev, policy_size +=sizeof (struct mlx5_flow_meter_sub_policy *); } mtr_policy =mlx5_malloc (MLX5_MEM_ZERO , policy_size, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!mtr_policy) return -rte_mtr_error_set(error, ENOMEM, RTE_MTR_ERROR_TYPE_METER_POLICY, NULL,
drivers/net/mlx5/mlx5_flow_quota.c +3 -3
@@ -391,7 +391,7 @@ mlx5_quota_alloc_sq(struct mlx5_priv *priv) qctx->sq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (qctx->sq[0 ]) * nb_queues, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!qctx->sq) {DRV_LOG (DEBUG ,"QUOTA: failed to allocate SQ pool" );return -ENOMEM ;
@@ -440,7 +440,7 @@ mlx5_quota_alloc_read_buf(struct mlx5_priv *priv)/* ACCESS MTR ASO WQE reads 2 MTR objects */ rd_buf_size =2 * sq_size_sum *sizeof (buf[0 ]); buf =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO , rd_buf_size, - page_size,SOCKET_ID_ANY ); + page_size,RTE_NUMA_ID_ANY );if (!buf) {DRV_LOG (DEBUG ,"QUOTA: failed to allocate MTR ASO READ buffer [1]" );return -ENOMEM ;
@@ -452,7 +452,7 @@ mlx5_quota_alloc_read_buf(struct mlx5_priv *priv) } qctx->read_buf =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (qctx->read_buf[0 ]) * nb_queues, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!qctx->read_buf) {DRV_LOG (DEBUG ,"QUOTA: failed to allocate MTR ASO READ buffer [2]" );return -ENOMEM ;
drivers/net/mlx5/mlx5_flow_verbs.c +1 -1
@@ -250,7 +250,7 @@ flow_verbs_counter_new(struct rte_eth_dev *dev, uint32_t id __rte_unused) }/* Allocate memory for new pool */ size =sizeof (*pool) +sizeof (*cnt) *MLX5_COUNTERS_PER_POOL ; - pool =mlx5_malloc (MLX5_MEM_ZERO , size,0 ,SOCKET_ID_ANY ); + pool =mlx5_malloc (MLX5_MEM_ZERO , size,0 ,RTE_NUMA_ID_ANY );if (!pool)return 0 ;for (i =0 ; i <MLX5_COUNTERS_PER_POOL ; ++i) {
drivers/net/mlx5/mlx5_hws_cnt.c +15 -15
@@ -30,7 +30,7 @@ __hws_cnt_id_load(struct mlx5_hws_cnt_pool *cpool)cnt_id_t *cnt_arr =NULL ; cnt_arr =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO , - cnt_num *sizeof (cnt_id_t),0 ,SOCKET_ID_ANY ); + cnt_num *sizeof (cnt_id_t),0 ,RTE_NUMA_ID_ANY );if (cnt_arr ==NULL )return -ENOMEM ;/*
@@ -280,7 +280,7 @@ mlx5_hws_cnt_raw_data_alloc(struct mlx5_dev_ctx_shared *sh, uint32_t n,MLX5_ASSERT (pgsz >0 ); mng =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO ,sizeof (*mng),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (mng ==NULL ) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -288,7 +288,7 @@ mlx5_hws_cnt_raw_data_alloc(struct mlx5_dev_ctx_shared *sh, uint32_t n, goto error; } mng->raw =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO , sz, pgsz, -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (mng->raw ==NULL ) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
@@ -389,7 +389,7 @@ mlx5_hws_cnt_cache_init(const struct mlx5_hws_cnt_pool_cfg *pcfg, cache =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO ,sizeof (*cache) +sizeof (((struct mlx5_hws_cnt_pool_caches *)0 )->qcache[0 ]) - * ccfg->q_num,0 ,SOCKET_ID_ANY ); + * ccfg->q_num,0 ,RTE_NUMA_ID_ANY );if (cache ==NULL )return NULL ;/* Store the necessary cache parameters. */
@@ -400,7 +400,7 @@ mlx5_hws_cnt_cache_init(const struct mlx5_hws_cnt_pool_cfg *pcfg,for (qidx =0 ; qidx < ccfg->q_num; qidx++) {snprintf (mz_name,sizeof (mz_name),"%s_qc/%x" , pcfg->name, qidx); cache->qcache[qidx] =rte_ring_create (mz_name, ccfg->size, -SOCKET_ID_ANY , +RTE_NUMA_ID_ANY ,RING_F_SP_ENQ |RING_F_SC_DEQ |RING_F_EXACT_SZ );if (cache->qcache[qidx] ==NULL )
@@ -428,7 +428,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh,MLX5_ASSERT (pcfg);MLX5_ASSERT (ccfg); cntp =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO ,sizeof (*cntp),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (cntp ==NULL ) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -467,7 +467,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh, cnt_num =RTE_MIN ((uint32_t )cnt_num, sh->hws_max_nb_counters); cntp->pool =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO ,sizeof (struct mlx5_hws_cnt ) * cnt_num, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (cntp->pool ==NULL ) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
@@ -476,7 +476,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh, }snprintf (mz_name,sizeof (mz_name),"%s_F_RING" , pcfg->name); cntp->free_list =rte_ring_create_elem (mz_name,sizeof (cnt_id_t), - (uint32_t )cnt_num,SOCKET_ID_ANY , + (uint32_t )cnt_num,RTE_NUMA_ID_ANY ,RING_F_MP_HTS_ENQ |RING_F_MC_HTS_DEQ |RING_F_EXACT_SZ );if (cntp->free_list ==NULL ) {
@@ -487,7 +487,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh, }snprintf (mz_name,sizeof (mz_name),"%s_R_RING" , pcfg->name); cntp->wait_reset_list =rte_ring_create_elem (mz_name,sizeof (cnt_id_t), - (uint32_t )cnt_num,SOCKET_ID_ANY , + (uint32_t )cnt_num,RTE_NUMA_ID_ANY ,RING_F_MP_HTS_ENQ |RING_F_SC_DEQ |RING_F_EXACT_SZ );if (cntp->wait_reset_list ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -497,7 +497,7 @@ mlx5_hws_cnt_pool_init(struct mlx5_dev_ctx_shared *sh, }snprintf (mz_name,sizeof (mz_name),"%s_U_RING" , pcfg->name); cntp->reuse_list =rte_ring_create_elem (mz_name,sizeof (cnt_id_t), - (uint32_t )cnt_num,SOCKET_ID_ANY , + (uint32_t )cnt_num,RTE_NUMA_ID_ANY ,RING_F_MP_HTS_ENQ |RING_F_MC_HTS_DEQ |RING_F_EXACT_SZ );if (cntp->reuse_list ==NULL ) { rte_flow_error_set(error, ENOMEM,
@@ -734,7 +734,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,int ret =0 ;size_t sz; - mp_name =mlx5_malloc (MLX5_MEM_ZERO ,RTE_MEMZONE_NAMESIZE ,0 ,SOCKET_ID_ANY ); + mp_name =mlx5_malloc (MLX5_MEM_ZERO ,RTE_MEMZONE_NAMESIZE ,0 ,RTE_NUMA_ID_ANY );if (mp_name ==NULL ) { ret =rte_flow_error_set (error,ENOMEM ,RTE_FLOW_ERROR_TYPE_UNSPECIFIED ,NULL ,"failed to allocate counter pool name prefix" );
@@ -853,7 +853,7 @@ mlx5_hws_cnt_svc_init(struct mlx5_dev_ctx_shared *sh,int ret; sh->cnt_svc =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO , -sizeof (*sh->cnt_svc),0 ,SOCKET_ID_ANY ); +sizeof (*sh->cnt_svc),0 ,RTE_NUMA_ID_ANY );if (sh->cnt_svc ==NULL ) goto err; sh->cnt_svc->query_interval = sh->config.cnt_svc.cycle_time;
@@ -1225,14 +1225,14 @@ mlx5_hws_age_info_init(struct rte_eth_dev *dev, uint16_t nb_queues,sizeof (struct rte_ring *) * nb_queues; age_info->hw_q_age =mlx5_malloc (MLX5_MEM_ANY |MLX5_MEM_ZERO , - size,0 ,SOCKET_ID_ANY ); + size,0 ,RTE_NUMA_ID_ANY );if (age_info->hw_q_age ==NULL )return -ENOMEM ;for (qidx =0 ; qidx < nb_queues; ++qidx) {snprintf (mz_name,sizeof (mz_name),"port_%u_queue_%u_aged_out_ring" , dev->data->port_id, qidx); - r =rte_ring_create (mz_name, ring_size,SOCKET_ID_ANY , + r =rte_ring_create (mz_name, ring_size,RTE_NUMA_ID_ANY , flags);if (r ==NULL ) { DRV_LOG(ERR, "\"%s\" creation failed: %s",
@@ -1248,7 +1248,7 @@ mlx5_hws_age_info_init(struct rte_eth_dev *dev, uint16_t nb_queues, }else {snprintf (mz_name,sizeof (mz_name),"port_%u_aged_out_ring" , dev->data->port_id); - r =rte_ring_create (mz_name, ring_size,SOCKET_ID_ANY , flags); + r =rte_ring_create (mz_name, ring_size,RTE_NUMA_ID_ANY , flags);if (r ==NULL ) {DRV_LOG (ERR ,"\"%s\" creation failed: %s" , mz_name,rte_strerror (rte_errno));
drivers/net/mlx5/mlx5_nta_sample.c +8 -8
@@ -164,7 +164,7 @@ mlx5_nta_sample_cached_mirror_create(void *cache_ctx, void *cb_ctx) };struct mlx5_nta_sample_cached_mirror *obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*obj),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (obj ==NULL )return NULL ; obj->mirror =mlx5_hw_create_mirror (dev, ctx->table_cfg, mirror_actions,NULL );
@@ -187,7 +187,7 @@ mlx5_nta_sample_cached_mirror_clone(void *tool_ctx __rte_unused, container_of(entry, struct mlx5_nta_sample_cached_mirror, entry);struct mlx5_nta_sample_cached_mirror *new_obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*new_obj),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (new_obj ==NULL )return NULL ;
@@ -245,7 +245,7 @@ serialize_actions(struct mlx5_nta_sample_cached_group_ctx *obj_ctx)int size =rte_flow_conv (RTE_FLOW_CONV_OP_ACTIONS ,NULL ,0 , obj_ctx->actions,NULL );if (size <0 )return size; - tgt_buffer =mlx5_malloc (MLX5_MEM_ANY , size,0 ,SOCKET_ID_ANY ); + tgt_buffer =mlx5_malloc (MLX5_MEM_ANY , size,0 ,RTE_NUMA_ID_ANY );if (tgt_buffer ==NULL )return -ENOMEM ; obj_ctx->actions_size = size;
@@ -270,7 +270,7 @@ mlx5_nta_sample_cached_group_create(void *cache_ctx, void *cb_ctx)if (actions_size <0 )return NULL ; - obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*obj),0 ,SOCKET_ID_ANY ); + obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*obj),0 ,RTE_NUMA_ID_ANY );if (obj ==NULL )return NULL ; obj->group =alloc_cached_group (dev);
@@ -319,7 +319,7 @@ mlx5_nta_sample_cached_group_clone(void *tool_ctx __rte_unused, container_of(entry, struct mlx5_nta_sample_cached_group, entry);struct mlx5_nta_sample_cached_group *new_obj; - new_obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*new_obj),0 ,SOCKET_ID_ANY ); + new_obj =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*new_obj),0 ,RTE_NUMA_ID_ANY );if (new_obj ==NULL )return NULL ;memcpy (new_obj, cached_obj,sizeof (*new_obj));
@@ -351,7 +351,7 @@ mlx5_init_nta_sample_context(struct rte_eth_dev *dev) .type = "mlx5_nta_sample" };struct mlx5_nta_sample_ctx *ctx =mlx5_malloc (MLX5_MEM_ZERO , -sizeof (*ctx),0 ,SOCKET_ID_ANY ); +sizeof (*ctx),0 ,RTE_NUMA_ID_ANY );if (ctx ==NULL )return -ENOMEM ;
@@ -744,7 +744,7 @@ mlx5_nta_create_sample_flow(struct rte_eth_dev *dev,if (sample_group ==0 )return NULL ; - release =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*release),0 ,SOCKET_ID_ANY ); + release =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*release),0 ,RTE_NUMA_ID_ANY );if (release ==NULL ) {rte_flow_error_set (error,ENOMEM ,RTE_FLOW_ERROR_TYPE_ACTION ,NULL ,"Failed to allocate release context" );
@@ -804,7 +804,7 @@ mlx5_nta_create_mirror_flow(struct rte_eth_dev *dev,int ret;struct rte_flow_hw *base_flow =NULL ;struct mlx5_sample_release_ctx *release =mlx5_malloc (MLX5_MEM_ANY ,sizeof (*release), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (release ==NULL ) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
drivers/net/mlx5/mlx5_nta_split.c +1 -1
@@ -227,7 +227,7 @@ mlx5_flow_nta_split_metadata(struct rte_eth_dev *dev, item_size =sizeof (struct rte_flow_item ) *2 +sizeof (struct mlx5_rte_flow_item_tag ); total_size = pefx_act_size + sfx_act_size + attr_size + item_size; - prfx_actions =mlx5_malloc (MLX5_MEM_ZERO , total_size,0 ,SOCKET_ID_ANY ); + prfx_actions =mlx5_malloc (MLX5_MEM_ZERO , total_size,0 ,RTE_NUMA_ID_ANY );if (!prfx_actions) return rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ACTION,
drivers/net/mlx5/mlx5_rss.c +2 -2
@@ -53,7 +53,7 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev, priv->rss_conf.rss_key =mlx5_realloc (priv->rss_conf.rss_key,MLX5_MEM_RTE , rss_conf->rss_key_len, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!priv->rss_conf.rss_key) { rte_errno =ENOMEM ;return -rte_errno;
@@ -130,7 +130,7 @@ mlx5_rss_reta_index_resize(struct rte_eth_dev *dev, unsigned int reta_size) mem =mlx5_realloc (priv->reta_idx,MLX5_MEM_RTE , reta_size *sizeof ((*priv->reta_idx)[0 ]),0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!mem) { rte_errno =ENOMEM ;return -rte_errno;
drivers/net/mlx5/mlx5_rxq.c +2 -2
@@ -3277,8 +3277,8 @@ mlx5_drop_action_create(struct rte_eth_dev *dev)if (priv->drop_queue.hrxq)return priv->drop_queue.hrxq; - hrxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*hrxq) +MLX5_RSS_HASH_KEY_LEN , -0 ,RTE_NUMA_ID_ANY ); + hrxq =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*hrxq) +MLX5_RSS_HASH_KEY_LEN ,0 , +RTE_NUMA_ID_ANY );if (!hrxq) { DRV_LOG(WARNING, "Port %u cannot allocate memory for drop queue.",
drivers/net/mlx5/mlx5_stats.c +1 -1
@@ -354,7 +354,7 @@ mlx5_xstats_reset(struct rte_eth_dev *dev)mlx5_os_stats_init (dev);/* Considering to use stack directly. */ counters =mlx5_malloc (MLX5_MEM_SYS ,sizeof (*counters) * xstats_ctrl->mlx5_stats_n, -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!counters) {DRV_LOG (WARNING ,"port %u unable to allocate memory for xstats counters" , dev->data->port_id);
drivers/net/mlx5/mlx5_trigger.c +1 -1
@@ -126,7 +126,7 @@ mlx5_alloc_null_mbuf(uint32_t data_len)rte_align32pow2 (data_len);struct rte_mbuf *m; - m =mlx5_malloc (MLX5_MEM_ZERO , alloc_size,0 ,SOCKET_ID_ANY ); + m =mlx5_malloc (MLX5_MEM_ZERO , alloc_size,0 ,RTE_NUMA_ID_ANY );if (m ==NULL )return NULL ; m->buf_addr =RTE_PTR_ADD (m,sizeof (*m));
drivers/net/mlx5/mlx5_tx.c +1 -1
@@ -908,7 +908,7 @@ int rte_pmd_mlx5_pp_rate_table_query(uint16_t port_id,return 0 ; } seen =mlx5_malloc (MLX5_MEM_SYS |MLX5_MEM_ZERO , - priv->txqs_n *sizeof (*seen),0 ,SOCKET_ID_ANY ); + priv->txqs_n *sizeof (*seen),0 ,RTE_NUMA_ID_ANY );if (seen ==NULL )return -ENOMEM ;/*
drivers/net/mlx5/mlx5_utils.c +15 -15
@@ -18,8 +18,8 @@uint32_t a = (uint32_t )(align); \int so = (int )(socket); \void *mem = p->cfg.malloc (f, s, a, so); \ -if (mem ==NULL && so !=SOCKET_ID_ANY ) { \ - mem = p->cfg.malloc (f, s, a,SOCKET_ID_ANY ); \ +if (mem ==NULL && so !=RTE_NUMA_ID_ANY ) { \ + mem = p->cfg.malloc (f, s, a,RTE_NUMA_ID_ANY ); \if (mem) { \ DRV_LOG(WARNING, \ "Allocated %p (size %zu socket %d) through NUMA tolerant fallback", \
@@ -116,7 +116,7 @@ mlx5_ipool_create(struct mlx5_indexed_pool_config *cfg)return NULL ; pool =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*pool) + cfg->grow_trunk *sizeof (pool->grow_tbl[0 ]),RTE_CACHE_LINE_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!pool)return NULL ; pool->cfg = *cfg;
@@ -174,7 +174,7 @@ mlx5_ipool_grow(struct mlx5_indexed_pool *pool) p =pool_malloc (pool,MLX5_MEM_ZERO , (pool->n_trunk_valid + n_grow) *sizeof (struct mlx5_indexed_trunk *), -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (!p)return -ENOMEM ;if (pool->trunks)
@@ -203,7 +203,7 @@ mlx5_ipool_grow(struct mlx5_indexed_pool *pool) trunk_size +=RTE_CACHE_LINE_ROUNDUP (data_size * pool->cfg.size); trunk_size += bmp_size; trunk =pool_malloc (pool,MLX5_MEM_ZERO , trunk_size, -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (!trunk)return -ENOMEM ; pool->trunks[idx] = trunk;
@@ -279,7 +279,7 @@ mlx5_ipool_grow_bmp(struct mlx5_indexed_pool *pool, uint32_t new_size) pool->cache_validator.bmp_mem =pool_malloc (pool,MLX5_MEM_ZERO , bmp_mem_size,RTE_CACHE_LINE_SIZE , -rte_socket_id ()); +rte_numa_id ());if (unlikely (!pool->cache_validator.bmp_mem)) {DRV_LOG_IPOOL (ERR ,"Unable to allocate memory for a new bitmap" );return ;
@@ -370,7 +370,7 @@ mlx5_ipool_allocate_from_global(struct mlx5_indexed_pool *pool, int cidx) p =pool_malloc (pool,MLX5_MEM_ZERO , ((trunk_idx + n_grow) *sizeof (struct mlx5_indexed_trunk *)) + (cur_max_idx *sizeof (uint32_t )) +sizeof (*p), -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (!p)return 0 ; p->trunks = (struct mlx5_indexed_trunk **)&p->idx[cur_max_idx];
@@ -390,7 +390,7 @@ mlx5_ipool_allocate_from_global(struct mlx5_indexed_pool *pool, int cidx) data_size =mlx5_trunk_size_get (pool, trunk_idx); trunk_size +=RTE_CACHE_LINE_ROUNDUP (data_size * pool->cfg.size); trunk =pool_malloc (pool,MLX5_MEM_ZERO , trunk_size, -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (unlikely (!trunk)) { pool->cfg.free (p);return 0 ;
@@ -456,7 +456,7 @@ _mlx5_ipool_get_cache(struct mlx5_indexed_pool *pool, int cidx, uint32_t idx) pool->cache[cidx] =pool_malloc (pool,MLX5_MEM_ZERO ,sizeof (struct mlx5_ipool_per_lcore ) + (pool->cfg.per_core_cache *sizeof (uint32_t )), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!pool->cache[cidx]) {DRV_LOG (ERR ,"Ipool cache%d allocate failed\n" , cidx);return NULL ;
@@ -542,7 +542,7 @@ _mlx5_ipool_malloc_cache(struct mlx5_indexed_pool *pool, int cidx, pool->cache[cidx] =pool_malloc (pool,MLX5_MEM_ZERO ,sizeof (struct mlx5_ipool_per_lcore ) + (pool->cfg.per_core_cache *sizeof (uint32_t )), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!pool->cache[cidx]) {DRV_LOG (ERR ,"Ipool cache%d allocate failed\n" , cidx);return NULL ;
@@ -604,7 +604,7 @@ _mlx5_ipool_free_cache(struct mlx5_indexed_pool *pool, int cidx, uint32_t idx) pool->cache[cidx] =pool_malloc (pool,MLX5_MEM_ZERO ,sizeof (struct mlx5_ipool_per_lcore ) + (pool->cfg.per_core_cache *sizeof (uint32_t )), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (!pool->cache[cidx]) {DRV_LOG (ERR ,"Ipool cache%d allocate failed\n" , cidx);return ;
@@ -910,7 +910,7 @@ mlx5_ipool_flush_cache(struct mlx5_indexed_pool *pool) bmp_num =mlx5_trunk_idx_offset_get (pool, gc->n_trunk_valid); mem_size =rte_bitmap_get_memory_footprint (bmp_num); pool->bmp_mem =pool_malloc (pool,MLX5_MEM_ZERO , mem_size, -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (!pool->bmp_mem) {DRV_LOG (ERR ,"Ipool bitmap mem allocate failed.\n" );return ;
@@ -1045,7 +1045,7 @@ mlx5_l3t_create(enum mlx5_l3t_type type)return NULL ; } tbl =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_l3t_tbl ),1 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!tbl) { rte_errno =ENOMEM ;return NULL ;
@@ -1282,7 +1282,7 @@ __l3t_set_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx, g_tbl =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_l3t_level_tbl ) +sizeof (void *) *MLX5_L3T_GT_SIZE ,1 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!g_tbl) { rte_errno =ENOMEM ;return -1 ;
@@ -1298,7 +1298,7 @@ __l3t_set_entry(struct mlx5_l3t_tbl *tbl, uint32_t idx, m_tbl =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_l3t_level_tbl ) +sizeof (void *) *MLX5_L3T_MT_SIZE ,1 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (!m_tbl) { rte_errno =ENOMEM ;return -1 ;
drivers/net/mlx5/windows/mlx5_flow_os.c +2 -2
@@ -91,7 +91,7 @@ mlx5_flow_os_create_flow_matcher(void *ctx,mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_matcher ) +MLX5_ST_SZ_BYTES (fte_match_param), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!mlx5_matcher) { rte_errno =ENOMEM ;return -rte_errno;
@@ -139,7 +139,7 @@ mlx5_flow_os_create_flow_action_dest_devx_tir(struct mlx5_devx_obj *tir,struct mlx5_action *mlx5_action =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (struct mlx5_action ), -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (!mlx5_action) { rte_errno =ENOMEM ;
drivers/net/mlx5/windows/mlx5_os.c +4 -4
@@ -108,7 +108,7 @@ mlx5_init_shared_data(void)/* Allocate shared memory. */ mz =rte_memzone_reserve (MZ_MLX5_PMD_SHARED_DATA ,sizeof (*mlx5_shared_data), -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (mz ==NULL ) {DRV_LOG (ERR ,"Cannot allocate mlx5 shared data" );
@@ -397,7 +397,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,/* Allocate private eth device data. */ priv =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (*priv), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv ==NULL ) {DRV_LOG (ERR ,"priv allocation failure" ); err =ENOMEM ;
@@ -408,7 +408,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, priv->pci_dev = spawn->pci_dev; priv->mac =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,sizeof (*priv->mac) * sh->dev_cap.max_mac_addrs, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv->mac ==NULL ) {DRV_LOG (ERR ,"Failed to allocate MAC address array." ); err =ENOMEM ;
@@ -416,7 +416,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, } priv->mac_own =mlx5_malloc (MLX5_MEM_ZERO |MLX5_MEM_RTE ,RTE_BITSET_SIZE (sh->dev_cap.max_mac_addrs), -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );if (priv->mac_own ==NULL ) {DRV_LOG (ERR ,"Failed to allocate MAC ownership bitmap." ); err =ENOMEM ;
Signature · 1 line
2.55.0
PATCH 170/227 test: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test/sample_packet_forward.c | 10 +- app/test/test_acl.c | 8 +- app/test/test_bitratestats.c | 2 +- app/test/test_bpf.c | 8 +- app/test/test_cksum.c | 2 +- app/test/test_compressdev.c | 22 ++-- app/test/test_cryptodev.c | 50 ++++----- app/test/test_cryptodev_asym.c | 8 +- app/test/test_cryptodev_crosscheck.c | 10 +- app/test/test_distributor.c | 14 +-- app/test/test_distributor_perf.c | 6 +- app/test/test_dmadev.c | 4 +- app/test/test_efd.c | 64 +++++------ app/test/test_efd_perf.c | 22 ++-- app/test/test_ethdev_api.c | 6 +- app/test/test_event_crypto_adapter.c | 14 +-- app/test/test_event_dma_adapter.c | 6 +- app/test/test_event_eth_rx_adapter.c | 8 +- app/test/test_event_eth_tx_adapter.c | 6 +- app/test/test_event_ring.c | 14 +-- app/test/test_event_timer_adapter.c | 6 +- app/test/test_event_vector_adapter.c | 8 +- app/test/test_eventdev.c | 16 +-- app/test/test_external_mem.c | 14 +-- app/test/test_fib.c | 48 ++++---- app/test/test_fib6.c | 56 +++++----- app/test/test_fib6_perf.c | 2 +- app/test/test_fib_perf.c | 2 +- app/test/test_func_reentrancy.c | 12 +- app/test/test_graph_perf.c | 6 +- app/test/test_hash.c | 20 ++-- app/test/test_ipfrag.c | 6 +- app/test/test_ipsec.c | 12 +- app/test/test_ipsec_perf.c | 12 +- app/test/test_latencystats.c | 2 +- app/test/test_link_bonding.c | 22 ++-- app/test/test_link_bonding_mode4.c | 16 +-- app/test/test_link_bonding_rssconf.c | 8 +- app/test/test_lpm.c | 64 +++++------ app/test/test_lpm6.c | 70 ++++++------ app/test/test_lpm6_perf.c | 2 +- app/test/test_lpm_perf.c | 4 +- app/test/test_malloc.c | 146 ++++++++++++------------- app/test/test_malloc_perf.c | 2 +- app/test/test_mbuf.c | 18 +-- app/test/test_member_perf.c | 2 +- app/test/test_mempool.c | 40 +++---- app/test/test_mempool_perf.c | 10 +- app/test/test_memzone.c | 119 ++++++++++---------- app/test/test_metrics.c | 2 +- app/test/test_mp_secondary.c | 8 +- app/test/test_net_ether.c | 2 +- app/test/test_pcapng.c | 2 +- app/test/test_pdcp.c | 14 +-- app/test/test_pdump.c | 2 +- app/test/test_per_lcore.c | 4 +- app/test/test_pmd_af_packet.c | 10 +- app/test/test_pmd_memif.c | 2 +- app/test/test_pmd_pcap.c | 6 +- app/test/test_pmd_perf.c | 72 ++++++------ app/test/test_pmd_ring.c | 2 +- app/test/test_pmd_ring_perf.c | 2 +- app/test/test_pmd_tap.c | 6 +- app/test/test_reassembly.c | 4 +- app/test/test_reassembly_perf.c | 4 +- app/test/test_reorder.c | 20 ++-- app/test/test_rib.c | 20 ++-- app/test/test_rib6.c | 20 ++-- app/test/test_ring.c | 28 ++--- app/test/test_ring.h | 6 +- app/test/test_ring_perf.c | 20 ++-- app/test/test_security.c | 2 +- app/test/test_security_inline_macsec.c | 8 +- app/test/test_security_inline_proto.c | 12 +- app/test/test_stack.c | 10 +- app/test/test_stack_perf.c | 14 +-- app/test/test_timer_secondary.c | 4 +- app/test/virtual_pmd.c | 32 +++--- app/test/virtual_pmd.h | 2 +- 79 files changed, 685 insertions(+), 684 deletions(-)
app/test/sample_packet_forward.c +5 -5
@@ -30,12 +30,12 @@ test_dev_start(uint16_t port, struct rte_mempool *mp)if (rc !=0 )return rc; - rc =rte_eth_rx_queue_setup (port,0 ,RING_SIZE ,SOCKET_ID_ANY , + rc =rte_eth_rx_queue_setup (port,0 ,RING_SIZE ,RTE_NUMA_ID_ANY ,NULL , mp);if (rc !=0 )return rc; - rc =rte_eth_tx_queue_setup (port,0 ,RING_SIZE ,SOCKET_ID_ANY , + rc =rte_eth_tx_queue_setup (port,0 ,RING_SIZE ,RTE_NUMA_ID_ANY ,NULL );if (rc !=0 )return rc;
@@ -48,7 +48,7 @@ test_dev_start(uint16_t port, struct rte_mempool *mp)int test_ring_setup (struct rte_ring **ring,uint16_t *portid) { - *ring =rte_ring_create ("R0" ,RING_SIZE ,rte_socket_id (), + *ring =rte_ring_create ("R0" ,RING_SIZE ,rte_numa_id (),RING_F_SP_ENQ |RING_F_SC_DEQ );if (*ring ==NULL ) { printf("%s() line %u: rte_ring_create R0 failed",
@@ -56,7 +56,7 @@ test_ring_setup(struct rte_ring **ring, uint16_t *portid)return -1 ; } *portid =rte_eth_from_rings ("net_ringa" , ring,NUM_QUEUES , - ring,NUM_QUEUES ,rte_socket_id ()); + ring,NUM_QUEUES ,rte_numa_id ());return 0 ; }
@@ -87,7 +87,7 @@ int test_get_mempool(struct rte_mempool **mp, char *poolname) { *mp =rte_pktmbuf_pool_create (poolname,NB_MBUF ,32 ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (*mp ==NULL )return -1 ;return 0 ;
app/test/test_acl.c +4 -4
@@ -34,7 +34,7 @@ RTE_ACL_RULE_DEF(acl_ipv4vlan_rule, RTE_ACL_IPV4VLAN_NUM_FIELDS);struct rte_acl_param acl_param = { .name ="acl_ctx" , - .socket_id =SOCKET_ID_ANY , + .numa_id =RTE_NUMA_ID_ANY , .rule_size =RTE_ACL_IPV4VLAN_RULE_SZ , .max_rule_num =0x30000 , };
@@ -1407,7 +1407,7 @@ test_invalid_parameters(void)if (rte_eal_has_hugepages ()) {/* invalid NUMA node */ memcpy (¶m, &acl_param,sizeof (param)); - param.socket_id =RTE_MAX_NUMA_NODES +1 ; + param.numa_id =RTE_MAX_NUMA_NODES +1 ; acx =rte_acl_create (¶m);if (acx !=NULL ) {
@@ -1726,11 +1726,11 @@ static struct rte_acl_ctx *acl_ctx;static void *running_alloc (char *name,size_t size, -size_t align,int32_t socket_id,void *udata) +size_t align,int32_t numa_id,void *udata) {size_t aligned_size =RTE_ALIGN_CEIL (size, align);RTE_SET_USED (name); -RTE_SET_USED (socket_id); +RTE_SET_USED (numa_id);if (udata != acl_ctx) { printf("%s#%i udata mismatch!\n",
app/test/test_bitratestats.c +1 -1
@@ -59,7 +59,7 @@ test_stats_bitrate_reg(void) "without metrics init, ret:%d", ret);/* Metrics initialization */ -rte_metrics_init (rte_socket_id ()); +rte_metrics_init (rte_numa_id ());/* Test to register bit rate after metrics init */ ret =rte_stats_bitrate_reg (bitrate_data);TEST_ASSERT ((ret >=0 ),"Test Failed: rte_stats_bitrate_reg %d" , ret);
app/test/test_bpf.c +4 -4
@@ -4490,11 +4490,11 @@ static int null_vdev_setup(const char *name, uint16_t *port, struct rte_mempoolTEST_ASSERT (ret ==0 ,"failed to configure port %u: %d" , *port, ret);struct rte_eth_txconf txconf = { }; - ret =rte_eth_tx_queue_setup (*port,0 ,BPF_TEST_BURST ,SOCKET_ID_ANY , &txconf); + ret =rte_eth_tx_queue_setup (*port,0 ,BPF_TEST_BURST ,RTE_NUMA_ID_ANY , &txconf);TEST_ASSERT (ret ==0 ,"failed to setup tx queue port %u: %d" , *port, ret);struct rte_eth_rxconf rxconf = { }; - ret =rte_eth_rx_queue_setup (*port,0 ,BPF_TEST_BURST ,SOCKET_ID_ANY , + ret =rte_eth_rx_queue_setup (*port,0 ,BPF_TEST_BURST ,RTE_NUMA_ID_ANY , &rxconf, pool);TEST_ASSERT (ret ==0 ,"failed to setup rx queue port %u: %d" , *port, ret);
@@ -4623,7 +4623,7 @@ test_bpf_elf_tx_load(load_elf_image_t load_elf_image)/* Make a pool for packets */ mb_pool =rte_pktmbuf_pool_create ("bpf_tx_test_pool" ,BPF_TEST_POOLSIZE ,0 ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );TEST_ASSERT (mb_pool !=NULL ,"failed to create mempool" ); ret =null_vdev_setup (null_dev, &port, mb_pool);
@@ -4712,7 +4712,7 @@ test_bpf_elf_rx_load(load_elf_image_t load_elf_image)/* Make a pool for packets */ pool =rte_pktmbuf_pool_create ("bpf_rx_test_pool" ,2 *BPF_TEST_BURST ,0 ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );TEST_ASSERT (pool !=NULL ,"failed to create mempool" ); ret =null_vdev_setup (null_dev, &port, pool);
app/test/test_cksum.c +1 -1
@@ -333,7 +333,7 @@ test_cksum(void)/* create pktmbuf pool if it does not exist */ pktmbuf_pool =rte_pktmbuf_pool_create ("test_cksum_mbuf_pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,0 ,MBUF_DATA_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (pktmbuf_pool ==NULL )GOTO_FAIL ("cannot allocate mbuf pool" );
app/test/test_compressdev.c +11 -11
@@ -219,7 +219,7 @@ testsuite_setup(void)NUM_LARGE_MBUFS ,CACHE_SIZE ,0 , max_buf_size +RTE_PKTMBUF_HEADROOM , - rte_socket_id()); + rte_numa_id());if (ts_params->large_mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Large mbuf pool could not be created\n" );return TEST_FAILED ;
@@ -230,7 +230,7 @@ testsuite_setup(void)NUM_LARGE_MBUFS *MAX_SEGS ,CACHE_SIZE ,0 ,SMALL_SEG_SIZE +RTE_PKTMBUF_HEADROOM , - rte_socket_id()); + rte_numa_id());if (ts_params->small_mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Small mbuf pool could not be created\n" ); goto exit;
@@ -241,7 +241,7 @@ testsuite_setup(void)NUM_BIG_MBUFS +1 ,CACHE_SIZE ,0 ,MAX_MBUF_SEGMENT_SIZE , - rte_socket_id()); + rte_numa_id());if (ts_params->big_mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Big mbuf pool could not be created\n" ); goto exit;
@@ -249,7 +249,7 @@ testsuite_setup(void) ts_params->op_pool =rte_comp_op_pool_create ("op_pool" ,NUM_OPS ,0 ,sizeof (struct priv_op_data ), -rte_socket_id ()); +rte_numa_id ());if (ts_params->op_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Operation pool could not be created\n" ); goto exit;
@@ -297,7 +297,7 @@ generic_ut_setup(void) {/* Configure compressdev (one device, one queue pair) */ struct rte_compressdev_config config = { - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .nb_queue_pairs =1 , .max_nb_priv_xforms =NUM_MAX_XFORMS , .max_nb_streams =1
@@ -309,7 +309,7 @@ generic_ut_setup(void) }if (rte_compressdev_queue_pair_setup (0 ,0 ,NUM_MAX_INFLIGHT_OPS , -rte_socket_id ()) <0 ) { +rte_numa_id ()) <0 ) {RTE_LOG (ERR ,USER1 ,"Queue pair setup failed\n" );return -1 ; }
@@ -335,7 +335,7 @@ test_compressdev_invalid_configuration(void) {struct rte_compressdev_config invalid_config;struct rte_compressdev_config valid_config = { - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .nb_queue_pairs =1 , .max_nb_priv_xforms =NUM_MAX_XFORMS , .max_nb_streams =1
@@ -368,7 +368,7 @@ test_compressdev_invalid_configuration(void)/* Invalid queue pair setup, with no number of queue pairs set */ TEST_ASSERT_FAIL (rte_compressdev_queue_pair_setup (0 ,0 , -NUM_MAX_INFLIGHT_OPS ,rte_socket_id ()), +NUM_MAX_INFLIGHT_OPS ,rte_numa_id ()),"Queue pair setup was successful " "with no queue pairs set (invalid)\n" );
@@ -3065,18 +3065,18 @@ test_compressdev_deflate_stateful_decomp_checksum(void)static const struct rte_memzone *make_memzone (const char *name,size_t size) { -unsigned int socket_id =rte_socket_id (); +unsigned int numa_id =rte_numa_id ();char mz_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *memzone; -snprintf (mz_name,RTE_MEMZONE_NAMESIZE ,"%s_%u" , name, socket_id); +snprintf (mz_name,RTE_MEMZONE_NAMESIZE ,"%s_%u" , name, numa_id); memzone =rte_memzone_lookup (mz_name);if (memzone !=NULL && memzone->len != size) {rte_memzone_free (memzone); memzone =NULL ; }if (memzone ==NULL ) { - memzone =rte_memzone_reserve_aligned (mz_name, size, socket_id, + memzone =rte_memzone_reserve_aligned (mz_name, size, numa_id,RTE_MEMZONE_IOVA_CONTIG ,RTE_CACHE_LINE_SIZE );if (memzone ==NULL ) RTE_LOG(ERR, USER1, "Can't allocate memory zone %s",
app/test/test_cryptodev.c +25 -25
194 lines not on this page · raw message
app/test/test_cryptodev_asym.c +4 -4
@@ -1130,7 +1130,7 @@ testsuite_setup(void)RTE_CRYPTO_OP_TYPE_ASYMMETRIC ,TEST_NUM_BUFS ,0 ,0 , - rte_socket_id()); + rte_numa_id());if (ts_params->op_mpool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create ASYM_CRYPTO_OP_POOL\n" );return TEST_FAILED ;
@@ -1199,14 +1199,14 @@ testsuite_setup(void)for (qp_id =0 ; qp_id < info.max_nb_queue_pairs; qp_id++) {TEST_ASSERT_SUCCESS (rte_cryptodev_queue_pair_setup ( dev_id, qp_id, &ts_params->qp_conf, -rte_cryptodev_socket_id (dev_id)), +rte_cryptodev_numa_id (dev_id)),"Failed to setup queue pair %u on cryptodev %u ASYM" , qp_id, dev_id); } ts_params->session_mpool =rte_cryptodev_asym_session_pool_create ("test_asym_sess_mp" ,TEST_NUM_SESSIONS ,0 ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );TEST_ASSERT_NOT_NULL (ts_params->session_mpool,"session mempool allocation failed" );
@@ -1262,7 +1262,7 @@ ut_setup_asym(void)TEST_ASSERT_SUCCESS (rte_cryptodev_queue_pair_setup ( ts_params->valid_devs[0 ], qp_id, &ts_params->qp_conf, -rte_cryptodev_socket_id (ts_params->valid_devs[0 ])), +rte_cryptodev_numa_id (ts_params->valid_devs[0 ])),"Failed to setup queue pair %u on cryptodev %u" , qp_id, ts_params->valid_devs[0 ]); }
app/test/test_cryptodev_crosscheck.c +5 -5
@@ -403,7 +403,7 @@ crosscheck_init(void)/* Create pools for mbufs, crypto operations and sessions */ ts_params->mbuf_pool =rte_pktmbuf_pool_create ("CRYPTO_MBUFPOOL" ,NUM_MBUFS , -MBUF_CACHE_SIZE ,0 ,MBUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,MBUF_SIZE ,rte_numa_id ());if (ts_params->mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_MBUFPOOL\n" );return TEST_FAILED ;
@@ -412,7 +412,7 @@ crosscheck_init(void) ts_params->op_mpool =rte_crypto_op_pool_create ("MBUF_CRYPTO_SYM_OP_POOL" ,RTE_CRYPTO_OP_TYPE_SYMMETRIC ,NUM_MBUFS ,MBUF_CACHE_SIZE ,DEFAULT_NUM_XFORMS *sizeof (struct rte_crypto_sym_xform ) + -MAXIMUM_IV_LENGTH ,rte_socket_id ()); +MAXIMUM_IV_LENGTH ,rte_numa_id ());if (ts_params->op_mpool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_OP_POOL\n" );
@@ -420,12 +420,12 @@ crosscheck_init(void) } ts_params->session_mpool =rte_cryptodev_sym_session_pool_create ("test_sess_mp" , -MAX_NB_SESSIONS , session_priv_size,0 ,0 ,SOCKET_ID_ANY ); +MAX_NB_SESSIONS , session_priv_size,0 ,0 ,RTE_NUMA_ID_ANY );TEST_ASSERT_NOT_NULL (ts_params->session_mpool,"session mempool allocation failed" );/* Setup queue pair conf params */ ts_params->conf.nb_queue_pairs = nb_queue_pairs; - ts_params->conf.numa_id =SOCKET_ID_ANY ; + ts_params->conf.numa_id =RTE_NUMA_ID_ANY ; ts_params->conf.ff_disable =RTE_CRYPTODEV_FF_SECURITY ; ts_params->qp_conf.nb_descriptors =MAX_NUM_OPS_INFLIGHT ; ts_params->qp_conf.mp_session = ts_params->session_mpool;
@@ -525,7 +525,7 @@ dev_configure_and_start(uint64_t ff_disable)for (qp_id =0 ; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {TEST_ASSERT_SUCCESS (rte_cryptodev_queue_pair_setup ( dev_id, qp_id, &ts_params->qp_conf, -rte_cryptodev_socket_id (dev_id)), +rte_cryptodev_numa_id (dev_id)),"Failed to setup queue pair %u on cryptodev %u" , qp_id, dev_id); }
app/test/test_distributor.c +7 -7
@@ -736,7 +736,7 @@ int test_error_distributor_create_name(void)struct rte_distributor *db =NULL ;char *name =NULL ; - d =rte_distributor_create (name,rte_socket_id (), + d =rte_distributor_create (name,rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_SINGLE );if (d !=NULL || rte_errno !=EINVAL ) {
@@ -744,7 +744,7 @@ int test_error_distributor_create_name(void)return -1 ; } - db =rte_distributor_create (name,rte_socket_id (), + db =rte_distributor_create (name,rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_BURST );if (db !=NULL || rte_errno !=EINVAL ) {
@@ -762,7 +762,7 @@ int test_error_distributor_create_numworkers(void)struct rte_distributor *ds =NULL ;struct rte_distributor *db =NULL ; - ds =rte_distributor_create ("test_numworkers" ,rte_socket_id (), + ds =rte_distributor_create ("test_numworkers" ,rte_numa_id (),RTE_MAX_LCORE +10 ,RTE_DIST_ALG_SINGLE );if (ds !=NULL || rte_errno !=EINVAL ) {
@@ -770,7 +770,7 @@ int test_error_distributor_create_numworkers(void)return -1 ; } - db =rte_distributor_create ("test_numworkers" ,rte_socket_id (), + db =rte_distributor_create ("test_numworkers" ,rte_numa_id (),RTE_MAX_LCORE +10 ,RTE_DIST_ALG_BURST );if (db !=NULL || rte_errno !=EINVAL ) {
@@ -847,7 +847,7 @@ test_distributor(void) }if (db ==NULL ) { - db =rte_distributor_create ("Test_dist_burst" ,rte_socket_id (), + db =rte_distributor_create ("Test_dist_burst" ,rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_BURST );if (db ==NULL ) {
@@ -861,7 +861,7 @@ test_distributor(void)if (ds ==NULL ) { ds =rte_distributor_create ("Test_dist_single" , -rte_socket_id (), +rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_SINGLE );if (ds ==NULL ) {
@@ -877,7 +877,7 @@ test_distributor(void) (BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());if (p ==NULL ) { p =rte_pktmbuf_pool_create ("DT_MBUF_POOL" , nb_bufs,BURST , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (p ==NULL ) {printf ("Error creating mempool\n" );return -1 ;
app/test/test_distributor_perf.c +3 -3
@@ -226,7 +226,7 @@ test_distributor_perf(void)time_cache_line_switch ();if (ds ==NULL ) { - ds =rte_distributor_create ("Test_perf" ,rte_socket_id (), + ds =rte_distributor_create ("Test_perf" ,rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_SINGLE );if (ds ==NULL ) {
@@ -238,7 +238,7 @@ test_distributor_perf(void) }if (db ==NULL ) { - db =rte_distributor_create ("Test_burst" ,rte_socket_id (), + db =rte_distributor_create ("Test_burst" ,rte_numa_id (),rte_lcore_count () -1 ,RTE_DIST_ALG_BURST );if (db ==NULL ) {
@@ -253,7 +253,7 @@ test_distributor_perf(void) (BIG_BATCH * 2) - 1 : (511 * rte_lcore_count());if (p ==NULL ) { p =rte_pktmbuf_pool_create ("DPT_MBUF_POOL" , nb_bufs,BURST , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (p ==NULL ) {printf ("Error creating mempool\n" );return -1 ;
app/test/test_dmadev.c +2 -2
@@ -1132,13 +1132,13 @@ test_enq_deq_ops(int16_t dev_id, uint16_t vchan)ERR_RETURN ("Error with rte_dma_info_get()\n" ); pkt_pool =rte_pktmbuf_pool_create ("pkt_pool" , info.max_desc *2 ,0 ,0 , -CPY_LEN +RTE_PKTMBUF_HEADROOM ,rte_socket_id ()); +CPY_LEN +RTE_PKTMBUF_HEADROOM ,rte_numa_id ());if (pkt_pool ==NULL )ERR_RETURN ("Error creating pkt pool\n" ); ops_pool =rte_mempool_create ("ops_pool" , info.max_desc,sizeof (struct rte_dma_op ) + (sizeof (struct rte_dma_sge ) *2 ), -0 ,0 ,NULL ,NULL ,NULL ,NULL ,rte_socket_id (),0 ); +0 ,0 ,NULL ,NULL ,NULL ,NULL ,rte_numa_id (),0 );if (ops_pool ==NULL )ERR_RETURN ("Error creating ops pool\n" );
app/test/test_efd.c +32 -32
212 lines not on this page · raw message
app/test/test_efd_perf.c +11 -11
@@ -37,20 +37,20 @@ test_efd_perf(void)#else #define VALUE_BITMASK ((1 << RTE_EFD_VALUE_NUM_BITS) - 1)#endif -static unsigned int test_socket_id; +static unsigned int test_numa_id; -static inline uint64_t efd_get_all_sockets_bitmask (void ) +static inline uint64_t efd_get_all_numas_bitmask (void ) { -uint64_t all_cpu_sockets_bitmask =0 ; +uint64_t all_cpu_numas_bitmask =0 ;unsigned int i;unsigned int next_lcore =rte_get_main_lcore ();const int val_true =1 , val_false =0 ;for (i =0 ; i <rte_lcore_count (); i++) { - all_cpu_sockets_bitmask |=1 <<rte_lcore_to_socket_id (next_lcore); + all_cpu_numas_bitmask |=1 <<rte_lcore_to_numa_id (next_lcore); next_lcore =rte_get_next_lcore (next_lcore, val_false, val_true); } -return all_cpu_sockets_bitmask; +return all_cpu_numas_bitmask; }enum operations {
@@ -168,7 +168,7 @@ setup_keys_and_data(struct efd_perf_params *params, unsigned int cycle) params->efd_table =rte_efd_create ("test_efd_perf" ,MAX_ENTRIES , params->key_size, -efd_get_all_sockets_bitmask (), test_socket_id); +efd_get_all_numas_bitmask (), test_numa_id);TEST_ASSERT_NOT_NULL (params->efd_table,"Error creating the efd table\n" );return 0 ;
@@ -182,7 +182,7 @@ timed_adds(struct efd_perf_params *params)int32_t ret;for (i =0 ; i <KEYS_TO_ADD ; i++) { - ret =rte_efd_update (params->efd_table, test_socket_id, keys[i], + ret =rte_efd_update (params->efd_table, test_numa_id, keys[i], data[i]);if (ret !=0 ) {printf ("Error %d in rte_efd_update - key=0x" , ret);
@@ -211,7 +211,7 @@ timed_lookups(struct efd_perf_params *params)for (i =0 ; i <NUM_LOOKUPS /KEYS_TO_ADD ; i++) {for (j =0 ; j <KEYS_TO_ADD ; j++) { ret_data =rte_efd_lookup (params->efd_table, - test_socket_id, keys[j]); + test_numa_id, keys[j]);if (ret_data != data[j]) {printf ("Value mismatch using rte_efd_lookup: " "key #%d (0x" , i);
@@ -248,7 +248,7 @@ timed_lookups_multi(struct efd_perf_params *params)for (k =0 ; k <RTE_EFD_BURST_MAX ; k++) keys_burst[k] = keys[j *RTE_EFD_BURST_MAX + k]; -rte_efd_lookup_bulk (params->efd_table, test_socket_id, +rte_efd_lookup_bulk (params->efd_table, test_numa_id,RTE_EFD_BURST_MAX , keys_burst, result);
@@ -287,7 +287,7 @@ timed_deletes(struct efd_perf_params *params)int32_t ret;for (i =0 ; i <KEYS_TO_ADD ; i++) { - ret =rte_efd_delete (params->efd_table, test_socket_id, keys[i], + ret =rte_efd_delete (params->efd_table, test_numa_id, keys[i],NULL );if (ret !=0 ) {
@@ -337,7 +337,7 @@ run_all_tbl_perf_tests(void)printf ("Measuring performance, please wait\n" );fflush (stdout); - test_socket_id =rte_socket_id (); + test_numa_id =rte_numa_id ();for (i =0 ; i <NUM_KEYSIZES ; i++) {
app/test/test_ethdev_api.c +3 -3
@@ -30,7 +30,7 @@ ethdev_api_queue_status(void)return TEST_SKIPPED ; mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUF ,MBUF_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());RTE_ETH_FOREACH_DEV (port_id) {memset (ð_conf,0 ,sizeof (eth_conf));
@@ -41,7 +41,7 @@ ethdev_api_queue_status(void)/* RxQ setup */ for (uint16_t queue_id =0 ; queue_id <NUM_RXQ ; queue_id++) { ret =rte_eth_rx_queue_setup (port_id, queue_id,NUM_RXD , -rte_socket_id (),NULL , mbuf_pool); +rte_numa_id (),NULL , mbuf_pool);TEST_ASSERT (ret ==0 ,"Port(%u), queue(%u) failed to setup RxQ.\n" , port_id, queue_id);
@@ -50,7 +50,7 @@ ethdev_api_queue_status(void)/* TxQ setup */ for (uint16_t queue_id =0 ; queue_id <NUM_TXQ ; queue_id++) { ret =rte_eth_tx_queue_setup (port_id, queue_id,NUM_TXD , -rte_socket_id (),NULL ); +rte_numa_id (),NULL );TEST_ASSERT (ret ==0 ,"Port(%u), queue(%u) failed to setup TxQ.\n" , port_id, queue_id);
app/test/test_event_crypto_adapter.c +7 -7
@@ -1052,7 +1052,7 @@ configure_cryptodev(void) params.mbuf_pool =rte_pktmbuf_pool_create ("CRYPTO_ADAPTER_MBUFPOOL" ,NUM_MBUFS ,MBUF_CACHE_SIZE ,0 ,MBUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (params.mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_MBUFPOOL\n" );return TEST_FAILED ;
@@ -1066,7 +1066,7 @@ configure_cryptodev(void)sizeof (struct rte_crypto_sym_xform ) +MAXIMUM_IV_LENGTH +sizeof (union rte_event_crypto_metadata ), - rte_socket_id()); + rte_numa_id());if (params.op_mpool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_OP_POOL\n" );return TEST_FAILED ;
@@ -1100,7 +1100,7 @@ configure_cryptodev(void)"CRYPTO_ADAPTER_SESSION_MP" ,MAX_NB_SESSIONS , session_size,0 ,sizeof (union rte_event_crypto_metadata ), - SOCKET_ID_ANY); + RTE_NUMA_ID_ANY);TEST_ASSERT_NOT_NULL (params.session_mpool,"session mempool allocation failed\n" );
@@ -1116,7 +1116,7 @@ configure_cryptodev(void) (DEFAULT_NUM_XFORMS *sizeof (struct rte_crypto_asym_xform )) +sizeof (union rte_event_crypto_metadata ), - rte_socket_id()); + rte_numa_id());TEST_ASSERT_NOT_NULL (params.asym_op_mpool,"Can't create CRYPTO_ASYM_OP_POOL\n" );
@@ -1125,7 +1125,7 @@ configure_cryptodev(void)"CRYPTO_AD_ASYM_SESS_MP" ,MAX_NB_SESSIONS ,0 ,sizeof (union rte_event_crypto_metadata ), - SOCKET_ID_ANY); + RTE_NUMA_ID_ANY);TEST_ASSERT_NOT_NULL (params.asym_sess_mpool,"asym session mempool allocation failed\n" );break ;
@@ -1133,7 +1133,7 @@ configure_cryptodev(void) } conf.nb_queue_pairs = info.max_nb_queue_pairs; - conf.socket_id =SOCKET_ID_ANY ; + conf.numa_id =RTE_NUMA_ID_ANY ; conf.ff_disable =RTE_CRYPTODEV_FF_SECURITY ; TEST_ASSERT_SUCCESS(rte_cryptodev_configure(TEST_CDEV_ID, &conf),
@@ -1145,7 +1145,7 @@ configure_cryptodev(void)TEST_ASSERT_SUCCESS (rte_cryptodev_queue_pair_setup (TEST_CDEV_ID ,TEST_CDEV_QP_ID , &qp_conf, -rte_cryptodev_socket_id (TEST_CDEV_ID )), +rte_cryptodev_numa_id (TEST_CDEV_ID )),"Failed to setup queue pair %u on cryptodev %u\n" ,TEST_CDEV_QP_ID ,TEST_CDEV_ID );
app/test/test_event_dma_adapter.c +3 -3
@@ -389,17 +389,17 @@ configure_dmadev(void) params.src_mbuf_pool =rte_pktmbuf_pool_create ("DMA_ADAPTER_SRC_MBUFPOOL" ,NUM_MBUFS ,MBUF_CACHE_SIZE ,0 ,MBUF_SIZE , -rte_socket_id ()); +rte_numa_id ());RTE_TEST_ASSERT_NOT_NULL (params.src_mbuf_pool,"Can't create DMA_SRC_MBUFPOOL\n" ); params.dst_mbuf_pool =rte_pktmbuf_pool_create ("DMA_ADAPTER_DST_MBUFPOOL" ,NUM_MBUFS ,MBUF_CACHE_SIZE ,0 ,MBUF_SIZE , -rte_socket_id ()); +rte_numa_id ());RTE_TEST_ASSERT_NOT_NULL (params.dst_mbuf_pool,"Can't create DMA_DST_MBUFPOOL\n" ); elt_size =sizeof (struct rte_dma_op ) + (sizeof (struct rte_dma_sge ) *2 ); params.op_mpool =rte_mempool_create ("EVENT_DMA_OP_POOL" ,DMA_OP_POOL_SIZE , elt_size,0 , -0 ,NULL ,NULL ,NULL ,NULL ,rte_socket_id (),0 ); +0 ,NULL ,NULL ,NULL ,NULL ,rte_numa_id (),0 );RTE_TEST_ASSERT_NOT_NULL (params.op_mpool,"Can't create DMA_OP_POOL\n" );return TEST_SUCCESS ;
app/test/test_event_eth_rx_adapter.c +4 -4
@@ -86,7 +86,7 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,for (q =0 ; q < default_params.rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, rx_ring_size, -rte_eth_dev_socket_id (port),NULL , mp); +rte_eth_dev_numa_id (port),NULL , mp);if (retval <0 )return retval; }
@@ -94,7 +94,7 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,/* Allocate and set up 1 TX queue per Ethernet port. */ for (q =0 ; q < default_params.tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, tx_ring_size, -rte_eth_dev_socket_id (port),NULL ); +rte_eth_dev_numa_id (port),NULL );if (retval <0 )return retval; }
@@ -170,7 +170,7 @@ init_port_rx_intr(int num_ports)MBUF_CACHE_SIZE ,MBUF_PRIV_SIZE ,RTE_MBUF_DEFAULT_BUF_SIZE , - rte_socket_id()); + rte_numa_id());if (!default_params.mp)return -ENOMEM ;
@@ -209,7 +209,7 @@ init_ports(int num_ports)MBUF_CACHE_SIZE ,MBUF_PRIV_SIZE ,RTE_MBUF_DEFAULT_BUF_SIZE , - rte_socket_id()); + rte_numa_id()); else default_params.mp = ptr;
app/test/test_event_eth_tx_adapter.c +3 -3
@@ -79,14 +79,14 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,for (q =0 ; q < default_params.rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, rx_ring_size, -rte_eth_dev_socket_id (port),NULL , mp); +rte_eth_dev_numa_id (port),NULL , mp);if (retval <0 )return retval; }for (q =0 ; q < default_params.tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, tx_ring_size, -rte_eth_dev_socket_id (port),NULL ); +rte_eth_dev_numa_id (port),NULL );if (retval <0 )return retval; }
@@ -135,7 +135,7 @@ init_ports(void)if (!default_params.mp) default_params.mp =rte_pktmbuf_pool_create ("mbuf_pool" ,NB_MBUF ,32 , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (!default_params.mp)return -ENOMEM ;
app/test/test_event_ring.c +7 -7
@@ -42,13 +42,13 @@ test_event_ring_creation_with_wrong_size(void)/* Test if ring size is not power of 2 */ rp =rte_event_ring_create ("test_bad_ring_size" ,RING_SIZE +1 , -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (rp !=NULL )return -1 ;/* Test if ring size is exceeding the limit */ rp =rte_event_ring_create ("test_bad_ring_size" , (RTE_RING_SZ_MASK +1 ), -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (rp !=NULL )return -1 ;return 0 ;
@@ -62,7 +62,7 @@ static inttest_create_count_odd (void) {struct rte_event_ring *r =rte_event_ring_create ("test_event_ring_count" , -4097 ,SOCKET_ID_ANY ,0 ); +4097 ,RTE_NUMA_ID_ANY ,0 );if (r !=NULL )return -1 ;return 0 ;
@@ -87,7 +87,7 @@ test_basic_event_enqueue_dequeue(void)uint16_t ret, free_count, used_count;memset (evs,0 ,sizeof (evs)); - sr =rte_event_ring_create ("spsc_ring" ,32 ,rte_socket_id (), + sr =rte_event_ring_create ("spsc_ring" ,32 ,rte_numa_id (),RING_F_SP_ENQ |RING_F_SC_DEQ );if (sr ==NULL ) {printf ("Failed to create sp/sc ring\n" );
@@ -151,14 +151,14 @@ test_event_ring_with_exact_size(void)static const unsigned int ring_sz =RTE_DIM (ev_array);unsigned int i; - std_ring =rte_event_ring_create ("std" , ring_sz,rte_socket_id (), + std_ring =rte_event_ring_create ("std" , ring_sz,rte_numa_id (),RING_F_SP_ENQ |RING_F_SC_DEQ );if (std_ring ==NULL ) {printf ("%s: error, can't create std ring\n" , __func__);return -1 ; } exact_sz_ring =rte_event_ring_create ("exact sz" , - ring_sz,rte_socket_id (), + ring_sz,rte_numa_id (),RING_F_SP_ENQ |RING_F_SC_DEQ |RING_F_EXACT_SZ );if (exact_sz_ring ==NULL ) {printf ("%s: error, can't create exact size ring\n" , __func__);
@@ -218,7 +218,7 @@ test_event_ring(void) {if (r ==NULL ) r =rte_event_ring_create ("ev_test" ,RING_SIZE , -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (r ==NULL )return -1 ;
app/test/test_event_timer_adapter.c +3 -3
@@ -338,7 +338,7 @@ _timdev_setup(uint64_t max_tmo_ns, uint64_t bkt_tck_ns, uint64_t flags)sizeof (struct rte_event_timer ),/* element size*/ 0 ,/* cache size*/ 0 ,NULL ,NULL ,NULL ,NULL , - rte_socket_id(), 0); + rte_numa_id(), 0);if (!eventdev_test_mempool) {printf ("ERROR creating mempool\n" );return TEST_FAILED ;
@@ -995,7 +995,7 @@ test_timer_cancel_multicore(void) { arm_done =0 ; timer_producer_ring =rte_ring_create ("timer_cancel_queue" , -MAX_TIMERS *2 ,rte_socket_id (),0 ); +MAX_TIMERS *2 ,rte_numa_id (),0 );TEST_ASSERT_NOT_NULL (timer_producer_ring,"Unable to reserve memory for ring" );
@@ -1021,7 +1021,7 @@ test_timer_cancel_burst_multicore(void) { arm_done =0 ; timer_producer_ring =rte_ring_create ("timer_cancel_queue" , -MAX_TIMERS *2 ,rte_socket_id (),0 ); +MAX_TIMERS *2 ,rte_numa_id (),0 );TEST_ASSERT_NOT_NULL (timer_producer_ring,"Unable to reserve memory for ring" );
app/test/test_event_vector_adapter.c +4 -4
@@ -86,12 +86,12 @@ test_event_vector_adapter_create_multi(void)TEST_ASSERT_SUCCESS (ret,"Failed to get event vector adapter info" ); vector_mp =rte_event_vector_pool_create ("vector_mp" ,MAX_EVENTS ,0 ,MAX_VECTOR_SIZE , -rte_socket_id ()); +rte_numa_id ());TEST_ASSERT (vector_mp !=NULL ,"Failed to create mempool" ); conf.event_dev_id = evdev; - conf.socket_id =rte_socket_id (); + conf.numa_id =rte_numa_id (); conf.vector_sz =RTE_MIN (MAX_VECTOR_SIZE , info.max_vector_sz); conf.vector_timeout_ns = info.max_vector_timeout_ns; conf.vector_mp = vector_mp;
@@ -140,11 +140,11 @@ test_event_vector_adapter_create(void)TEST_ASSERT_SUCCESS (ret,"Failed to get event vector adapter info" ); vector_mp =rte_event_vector_pool_create ("vector_mp" ,MAX_EVENTS ,0 ,MAX_VECTOR_SIZE , -rte_socket_id ()); +rte_numa_id ());TEST_ASSERT (vector_mp !=NULL ,"Failed to create mempool" ); conf.event_dev_id = evdev; - conf.socket_id =rte_socket_id (); + conf.numa_id =rte_numa_id (); conf.vector_sz =RTE_MIN (MAX_VECTOR_SIZE , info.max_vector_sz); conf.vector_timeout_ns =RTE_MIN (1E6 , info.max_vector_timeout_ns); conf.vector_mp = vector_mp;
app/test/test_eventdev.c +8 -8
@@ -70,14 +70,14 @@ test_eventdev_get_dev_id(void) }static int -test_eventdev_socket_id (void ) +test_eventdev_numa_id (void ) { -int socket_id; - socket_id =rte_event_dev_socket_id (TEST_DEV_ID ); -TEST_ASSERT (socket_id != -EINVAL ,"Failed to get socket_id %d" , - socket_id); - socket_id =rte_event_dev_socket_id (RTE_EVENT_MAX_DEVS ); -TEST_ASSERT (socket_id == -EINVAL ,"Expected -EINVAL %d" , socket_id); +int numa_id; + numa_id =rte_event_dev_numa_id (TEST_DEV_ID ); +TEST_ASSERT (numa_id != -EINVAL ,"Failed to get numa_id %d" , + numa_id); + numa_id =rte_event_dev_numa_id (RTE_EVENT_MAX_DEVS ); +TEST_ASSERT (numa_id == -EINVAL ,"Expected -EINVAL %d" , numa_id);return TEST_SUCCESS ; }
@@ -1407,7 +1407,7 @@ static struct unit_test_suite eventdev_common_testsuite = {TEST_CASE_ST (NULL ,NULL , test_eventdev_get_dev_id),TEST_CASE_ST (NULL ,NULL , - test_eventdev_socket_id), + test_eventdev_numa_id),TEST_CASE_ST (NULL ,NULL , test_eventdev_info_get), TEST_CASE_ST(NULL, NULL,
app/test/test_external_mem.c +7 -7
@@ -285,7 +285,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, {const char *heap_name ="heap" ;void *ptr =NULL ; -int socket_id; +int numa_id;const struct rte_memzone *mz =NULL , *contig_mz =NULL ;/* create heap */
@@ -296,15 +296,15 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, }/* get socket ID corresponding to this heap */ - socket_id =rte_malloc_heap_get_numa_id (heap_name); -if (socket_id <0 ) { + numa_id =rte_malloc_heap_get_numa_id (heap_name); +if (numa_id <0 ) {printf ("%s():%i: cannot find socket for external heap\n" , __func__, __LINE__); goto fail; }/* heap is empty, so any allocation should fail */ - ptr =rte_malloc_socket ("EXTMEM" ,64 ,0 , socket_id); + ptr =rte_malloc_numa ("EXTMEM" ,64 ,0 , numa_id);if (ptr !=NULL ) {printf ("%s():%i: Allocated from empty heap\n" , __func__, __LINE__);
@@ -324,7 +324,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, goto fail;/* allocate - this now should succeed */ - ptr =rte_malloc_socket ("EXTMEM" ,64 ,0 , socket_id); + ptr =rte_malloc_numa ("EXTMEM" ,64 ,0 , numa_id);if (ptr ==NULL ) {printf ("%s():%i: Failed to allocate from external heap\n" , __func__, __LINE__);
@@ -352,7 +352,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, }/* try allocating a memzone */ - mz =rte_memzone_reserve ("heap_test" , pgsz *2 , socket_id,0 ); + mz =rte_memzone_reserve ("heap_test" , pgsz *2 , numa_id,0 );if (mz ==NULL ) {printf ("%s():%i: Failed to reserve memzone\n" , __func__, __LINE__);
@@ -361,7 +361,7 @@ test_malloc_basic(void *addr, size_t len, size_t pgsz, rte_iova_t *iova,/* try allocating an IOVA-contiguous memzone - this should succeed * if we've set up a contiguous IOVA table, and fail if we haven't. */ - contig_mz =rte_memzone_reserve ("heap_test_contig" , pgsz *2 , socket_id, + contig_mz =rte_memzone_reserve ("heap_test_contig" , pgsz *2 , numa_id,RTE_MEMZONE_IOVA_CONTIG );if ((iova ==NULL ) != (contig_mz ==NULL )) { printf("%s():%i: Failed to reserve memzone\n",
app/test/test_fib.c +24 -24
163 lines not on this page · raw message
app/test/test_fib6.c +28 -28
195 lines not on this page · raw message
app/test/test_fib6_perf.c +1 -1
@@ -100,7 +100,7 @@ test_fib6_perf(void)*/ generate_large_ips_table (0 ); - fib =rte_fib6_create (__func__,SOCKET_ID_ANY , &conf); + fib =rte_fib6_create (__func__,RTE_NUMA_ID_ANY , &conf);TEST_FIB_ASSERT (fib !=NULL );/* Measure add. */
app/test/test_fib_perf.c +1 -1
@@ -341,7 +341,7 @@ test_fib_perf(void)print_route_distribution (large_route_table, (uint32_t )NUM_ROUTE_ENTRIES ); - fib =rte_fib_create (__func__,SOCKET_ID_ANY , &config); + fib =rte_fib_create (__func__,RTE_NUMA_ID_ANY , &config);TEST_FIB_ASSERT (fib !=NULL );/* Measure add. */
app/test/test_func_reentrancy.c +6 -6
@@ -115,7 +115,7 @@ ring_create_lookup(__rte_unused void *arg)/* create the same ring simultaneously on all threads */ for (i =0 ; i <MAX_ITER_ONCE ; i++) { - rp =rte_ring_create ("fr_test_once" ,4096 ,SOCKET_ID_ANY ,0 ); + rp =rte_ring_create ("fr_test_once" ,4096 ,RTE_NUMA_ID_ANY ,0 );if (rp !=NULL )rte_atomic_fetch_add_explicit (&obj_count,1 , rte_memory_order_relaxed); }
@@ -123,7 +123,7 @@ ring_create_lookup(__rte_unused void *arg)/* create/lookup new ring several times */ for (i =0 ; i <MAX_ITER_MULTI ; i++) {snprintf (ring_name,sizeof (ring_name),"fr_test_%d_%d" , lcore_self, i); - rp =rte_ring_create (ring_name,4096 ,SOCKET_ID_ANY ,0 ); + rp =rte_ring_create (ring_name,4096 ,RTE_NUMA_ID_ANY ,0 );if (NULL == rp)return -1 ;if (rte_ring_lookup (ring_name) != rp)
@@ -180,7 +180,7 @@ mempool_create_lookup(__rte_unused void *arg)MEMPOOL_ELT_SIZE ,0 ,0 ,NULL ,NULL , my_obj_init,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);if (mp !=NULL )rte_atomic_fetch_add_explicit (&obj_count,1 , rte_memory_order_relaxed); }
@@ -192,7 +192,7 @@ mempool_create_lookup(__rte_unused void *arg)MEMPOOL_ELT_SIZE ,0 ,0 ,NULL ,NULL , my_obj_init,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);if (NULL == mp)return -1 ;if (rte_mempool_lookup (mempool_name) != mp)
@@ -378,7 +378,7 @@ lpm_create_free(__rte_unused void *arg)/* create the same lpm simultaneously on all threads */ for (i =0 ; i <MAX_ITER_ONCE ; i++) { - lpm =rte_lpm_create ("fr_test_once" ,SOCKET_ID_ANY , &config); + lpm =rte_lpm_create ("fr_test_once" ,RTE_NUMA_ID_ANY , &config);if (lpm !=NULL )rte_atomic_fetch_add_explicit (&obj_count,1 , rte_memory_order_relaxed); }
@@ -386,7 +386,7 @@ lpm_create_free(__rte_unused void *arg)/* create multiple fbk tables simultaneously */ for (i =0 ; i <MAX_LPM_ITER_TIMES ; i++) {snprintf (lpm_name,sizeof (lpm_name),"fr_test_%d_%d" , lcore_self, i); - lpm =rte_lpm_create (lpm_name,SOCKET_ID_ANY , &config); + lpm =rte_lpm_create (lpm_name,RTE_NUMA_ID_ANY , &config);if (NULL == lpm)return -1 ;
app/test/test_graph_perf.c +3 -3
@@ -572,7 +572,7 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks, }/* Create a Graph */ - gconf.socket_id =SOCKET_ID_ANY ; + gconf.numa_id =RTE_NUMA_ID_ANY ; gconf.nb_node_patterns = graph_data->nb_nodes; gconf.node_patterns = (const char **)(uintptr_t )node_patterns;
@@ -646,7 +646,7 @@ measure_perf_get(rte_graph_t graph_id)if (rte_graph_has_stats_feature ()) {memset (¶m,0 ,sizeof (param)); param.f = stdout; - param.socket_id =SOCKET_ID_ANY ; + param.numa_id =RTE_NUMA_ID_ANY ; param.graph_patterns = &pattern; param.nb_graph_patterns =1 ;
@@ -1143,7 +1143,7 @@ graph_init_diamond(void) node_patterns[3 ] =rte_node_id_to_name (branch); node_patterns[4 ] =rte_node_id_to_name (snk); - gconf.socket_id =SOCKET_ID_ANY ; + gconf.numa_id =RTE_NUMA_ID_ANY ; gconf.nb_node_patterns =5 ; gconf.node_patterns = (const char **)(uintptr_t )node_patterns;
app/test/test_hash.c +10 -10
@@ -2012,8 +2012,8 @@ test_hash_rcu_qsbr_add(void)/* Create RCU QSBR variable */ sz =rte_rcu_qsbr_get_memsize (RTE_MAX_LCORE ); - g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_socket (NULL , sz, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_numa (NULL , sz, +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RETURN_IF_ERROR_RCU_QSBR (g_qsv ==NULL ,"RCU QSBR variable creation failed" );
@@ -2034,8 +2034,8 @@ test_hash_rcu_qsbr_add(void) "Attach RCU QSBR to hash table failed");/* Create and attach another RCU QSBR to hash table */ - qsv2 = (struct rte_rcu_qsbr *)rte_zmalloc_socket (NULL , sz, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + qsv2 = (struct rte_rcu_qsbr *)rte_zmalloc_numa (NULL , sz, +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RETURN_IF_ERROR_RCU_QSBR (qsv2 ==NULL ,"RCU QSBR variable creation failed" );
@@ -2116,8 +2116,8 @@ test_hash_rcu_qsbr_dq_mode(uint8_t ext_bkt)/* Create RCU QSBR variable */ sz =rte_rcu_qsbr_get_memsize (RTE_MAX_LCORE ); - g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_socket (NULL , sz, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_numa (NULL , sz, +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RETURN_IF_ERROR_RCU_QSBR (g_qsv ==NULL ,"RCU QSBR variable creation failed" );
@@ -2286,8 +2286,8 @@ test_hash_rcu_qsbr_sync_mode(uint8_t ext_bkt)/* Create RCU QSBR variable */ sz =rte_rcu_qsbr_get_memsize (RTE_MAX_LCORE ); - g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_socket (NULL , sz, -RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_numa (NULL , sz, +RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RETURN_IF_ERROR_RCU_QSBR (g_qsv ==NULL ,"RCU QSBR variable creation failed" );
@@ -2376,8 +2376,8 @@ test_hash_rcu_qsbr_dq_reclaim(void)/* Create RCU QSBR variable */ sz =rte_rcu_qsbr_get_memsize (RTE_MAX_LCORE ); - g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_socket ( -NULL , sz,RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + g_qsv = (struct rte_rcu_qsbr *)rte_zmalloc_numa ( +NULL , sz,RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RETURN_IF_ERROR_RCU_QSBR (g_qsv ==NULL ,"RCU QSBR variable creation failed" ); status =rte_rcu_qsbr_init (g_qsv,RTE_MAX_LCORE );
app/test/test_ipfrag.c +3 -3
@@ -65,7 +65,7 @@ setup_buf_pool(void) pkt_pool =rte_pktmbuf_pool_create ("FRAG_MBUF_POOL" ,NUM_MBUFS ,BURST ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (pkt_pool ==NULL ) {printf ("%s: Error creating pkt mempool\n" , __func__); goto bad_setup;
@@ -74,7 +74,7 @@ setup_buf_pool(void) direct_pool =rte_pktmbuf_pool_create ("FRAG_D_MBUF_POOL" ,NUM_MBUFS ,BURST ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (direct_pool ==NULL ) {printf ("%s: Error creating direct mempool\n" , __func__); goto bad_setup;
@@ -82,7 +82,7 @@ setup_buf_pool(void) indirect_pool =rte_pktmbuf_pool_create ("FRAG_I_MBUF_POOL" ,NUM_MBUFS ,BURST ,0 , -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (indirect_pool ==NULL ) {printf ("%s: Error creating indirect mempool\n" , __func__); goto bad_setup;
app/test/test_ipsec.c +6 -6
@@ -329,7 +329,7 @@ testsuite_setup(void) ts_params->mbuf_pool =rte_pktmbuf_pool_create ("CRYPTO_MBUFPOOL" ,NUM_MBUFS ,MBUF_CACHE_SIZE ,0 ,MBUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (ts_params->mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_MBUFPOOL\n" );return TEST_FAILED ;
@@ -342,7 +342,7 @@ testsuite_setup(void)DEFAULT_NUM_XFORMS *sizeof (struct rte_crypto_sym_xform ) +MAXIMUM_IV_LENGTH , - rte_socket_id()); + rte_numa_id());if (ts_params->cop_mpool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_OP_POOL\n" );return TEST_FAILED ;
@@ -354,7 +354,7 @@ testsuite_setup(void)rte_cryptodev_info_get (dev_id, &info); ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs; - ts_params->conf.socket_id =SOCKET_ID_ANY ; + ts_params->conf.numa_id =RTE_NUMA_ID_ANY ; ts_params->conf.ff_disable =RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO ; sess_sz =rte_cryptodev_sym_get_private_session_size (dev_id);
@@ -373,7 +373,7 @@ testsuite_setup(void) ts_params->qp_conf.mp_session =rte_cryptodev_sym_session_pool_create ("test_sess_mp" , -MAX_NB_SESSIONS , sess_sz,0 ,0 ,SOCKET_ID_ANY ); +MAX_NB_SESSIONS , sess_sz,0 ,0 ,RTE_NUMA_ID_ANY );TEST_ASSERT_NOT_NULL (ts_params->qp_conf.mp_session,"session mempool allocation failed" );
@@ -387,7 +387,7 @@ testsuite_setup(void)TEST_ASSERT_SUCCESS (rte_cryptodev_queue_pair_setup ( dev_id,0 , &ts_params->qp_conf, -rte_cryptodev_socket_id (dev_id)), +rte_cryptodev_numa_id (dev_id)),"Failed to setup queue pair %u on cryptodev %u" ,0 , dev_id);
@@ -430,7 +430,7 @@ ut_setup_ipsec(void)memset (ut_params,0 ,sizeof (*ut_params));/* Reconfigure device to default parameters */ - ts_params->conf.socket_id =SOCKET_ID_ANY ; + ts_params->conf.numa_id =RTE_NUMA_ID_ANY ;/* Start the device */ TEST_ASSERT_SUCCESS(rte_cryptodev_start(ts_params->valid_dev),
app/test/test_ipsec_perf.c +6 -6
@@ -452,7 +452,7 @@ testsuite_setup(void) mbuf_pool =rte_pktmbuf_pool_create ("IPSEC_PERF_MBUFPOOL" ,NUM_MBUFS ,MBUF_CACHE_SIZE ,0 ,MBUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (mbuf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create MBUFPOOL\n" );return TEST_FAILED ;
@@ -465,29 +465,29 @@ testsuite_setup(void)DEFAULT_NUM_XFORMS *sizeof (struct rte_crypto_sym_xform ) +MAXIMUM_IV_LENGTH , - rte_socket_id()); + rte_numa_id());if (cop_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Can't create CRYPTO_OP_POOL\n" );return TEST_FAILED ; } ring_inb_prepare =rte_ring_create ("ipsec_test_ring_inb_prepare" , -RING_SIZE ,SOCKET_ID_ANY ,0 ); +RING_SIZE ,RTE_NUMA_ID_ANY ,0 );if (ring_inb_prepare ==NULL )return TEST_FAILED ; ring_inb_process =rte_ring_create ("ipsec_test_ring_inb_process" , -RING_SIZE ,SOCKET_ID_ANY ,0 ); +RING_SIZE ,RTE_NUMA_ID_ANY ,0 );if (ring_inb_process ==NULL )return TEST_FAILED ; ring_outb_prepare =rte_ring_create ("ipsec_test_ring_outb_prepare" , -RING_SIZE ,SOCKET_ID_ANY ,0 ); +RING_SIZE ,RTE_NUMA_ID_ANY ,0 );if (ring_outb_prepare ==NULL )return TEST_FAILED ; ring_outb_process =rte_ring_create ("ipsec_test_ring_outb_process" , -RING_SIZE ,SOCKET_ID_ANY ,0 ); +RING_SIZE ,RTE_NUMA_ID_ANY ,0 );if (ring_outb_process ==NULL )return TEST_FAILED ;
app/test/test_latencystats.c +1 -1
@@ -39,7 +39,7 @@ static int test_latency_init(void)int ret =0 ;/* Metrics Initialization */ -rte_metrics_init (rte_socket_id ()); +rte_metrics_init (rte_numa_id ()); ret =rte_latencystats_init (1 ,NULL );TEST_ASSERT (ret >=0 ,"Test Failed: rte_latencystats_init failed" );
app/test/test_link_bonding.c +11 -11
@@ -187,13 +187,13 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr)for (q_id =0 ; q_id < test_params->nb_rx_q; q_id++)TEST_ASSERT_SUCCESS (rte_eth_rx_queue_setup (port_id, q_id,RX_RING_SIZE , -rte_eth_dev_socket_id (port_id), &rx_conf_default, +rte_eth_dev_numa_id (port_id), &rx_conf_default, test_params->mbuf_pool) ,"rte_eth_rx_queue_setup for port %d failed" , port_id);for (q_id =0 ; q_id < test_params->nb_tx_q; q_id++)TEST_ASSERT_SUCCESS (rte_eth_tx_queue_setup (port_id, q_id,TX_RING_SIZE , -rte_eth_dev_socket_id (port_id), &tx_conf_default), +rte_eth_dev_numa_id (port_id), &tx_conf_default),"rte_eth_tx_queue_setup for port %d failed" , port_id);if (start)
@@ -230,7 +230,7 @@ test_setup(void)if (test_params->mbuf_pool ==NULL ) { test_params->mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" , nb_mbuf_per_pool,MBUF_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());TEST_ASSERT_NOT_NULL (test_params->mbuf_pool,"rte_mempool_create failed" ); }
@@ -245,7 +245,7 @@ test_setup(void)snprintf (pmd_name,RTE_ETH_NAME_MAX_LEN ,"eth_virt_%d" , i); test_params->member_port_ids[i] =virtual_ethdev_create (pmd_name, - mac_addr,rte_socket_id (),1 ); + mac_addr,rte_numa_id (),1 );TEST_ASSERT (test_params->member_port_ids[i] >=0 ,"Failed to create virtual virtual ethdev %s" , pmd_name);
@@ -269,7 +269,7 @@ test_create_bonding_device(void)/* Don't try to recreate bonding device if re-running test suite*/ if (test_params->bonding_port_id ==-1 ) { test_params->bonding_port_id =rte_eth_bond_create (BONDING_DEV_NAME , - test_params->bonding_mode,rte_socket_id ()); + test_params->bonding_mode,rte_numa_id ());TEST_ASSERT (test_params->bonding_port_id >=0 ,"Failed to create bonding ethdev %s" ,BONDING_DEV_NAME );
@@ -309,14 +309,14 @@ test_create_bonding_device_with_invalid_params(void)/* Invalid name */ port_id =rte_eth_bond_create (NULL , test_params->bonding_mode, -rte_socket_id ()); +rte_numa_id ());TEST_ASSERT (port_id <0 ,"Created bonding device unexpectedly" ); test_params->bonding_mode =INVALID_BONDING_MODE ;/* Invalid bonding mode */ port_id =rte_eth_bond_create (BONDING_DEV_NAME , test_params->bonding_mode, -rte_socket_id ()); +rte_numa_id ());TEST_ASSERT (port_id <0 ,"Created bonding device unexpectedly." ); test_params->bonding_mode =BONDING_MODE_ROUND_ROBIN ;
@@ -460,7 +460,7 @@ test_add_already_bonding_member_to_bonding_device(void)snprintf (pmd_name,RTE_ETH_NAME_MAX_LEN ,"%s_%d" ,BONDING_DEV_NAME , ++bonding_id); port_id =rte_eth_bond_create (pmd_name, test_params->bonding_mode, -rte_socket_id ()); +rte_numa_id ());TEST_ASSERT (port_id >=0 ,"Failed to create bonding device." ); TEST_ASSERT(rte_eth_bond_member_add(port_id,
@@ -928,7 +928,7 @@ test_set_bonding_port_initialization_mac_assignment(void)*/ if (bonding_port_id ==-1 ) { bonding_port_id =rte_eth_bond_create ("net_bonding_mac_ass_test" , -BONDING_MODE_ACTIVE_BACKUP ,rte_socket_id ()); +BONDING_MODE_ACTIVE_BACKUP ,rte_numa_id ());TEST_ASSERT (bonding_port_id >0 ,"failed to create bonding device" ); TEST_ASSERT_SUCCESS(configure_ethdev(bonding_port_id, 0, 0),
@@ -946,7 +946,7 @@ test_set_bonding_port_initialization_mac_assignment(void) "eth_member_%d", i); member_port_ids[i] =virtual_ethdev_create (pmd_name, - &member_mac_addr,rte_socket_id (),1 ); + &member_mac_addr,rte_numa_id (),1 ); TEST_ASSERT(member_port_ids[i] >= 0, "Failed to create member ethdev %s",
@@ -2062,7 +2062,7 @@ test_roundrobin_verify_polling_member_link_status_change(void)/* Create member devices with no ISR Support */ if (polling_test_members[i] ==-1 ) { polling_test_members[i] =virtual_ethdev_create (member_name, mac_addr, -rte_socket_id (),0 ); +rte_numa_id (),0 );TEST_ASSERT (polling_test_members[i] >=0 ,"Failed to create virtual ethdev %s\n" , member_name);
app/test/test_link_bonding_mode4.c +8 -8
@@ -204,11 +204,11 @@ configure_ethdev(uint16_t port_id, uint8_t start) "Failed to configure device %u", port_id);TEST_ASSERT (rte_eth_rx_queue_setup (port_id,0 ,RX_RING_SIZE , -rte_eth_dev_socket_id (port_id),NULL , test_params.mbuf_pool) ==0 , +rte_eth_dev_numa_id (port_id),NULL , test_params.mbuf_pool) ==0 ,"Failed to setup rx queue." );TEST_ASSERT (rte_eth_tx_queue_setup (port_id,0 ,TX_RING_SIZE , -rte_eth_dev_socket_id (port_id),NULL ) ==0 , +rte_eth_dev_numa_id (port_id),NULL ) ==0 ,"Failed to setup tx queue." );if (start) {
@@ -384,7 +384,7 @@ test_setup(void)int retval, nb_mbuf_per_pool;char name[RTE_ETH_NAME_MAX_LEN ];struct member_conf *port; -const uint8_t socket_id =rte_socket_id (); +const uint8_t numa_id =rte_numa_id ();uint16_t i;if (test_params.mbuf_pool ==NULL ) {
@@ -392,7 +392,7 @@ test_setup(void)TEST_TX_DESC_MAX +MAX_PKT_BURST ; test_params.mbuf_pool =rte_pktmbuf_pool_create ("TEST_MODE4" , nb_mbuf_per_pool,MBUF_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE , socket_id); +RTE_MBUF_DEFAULT_BUF_SIZE , numa_id);TEST_ASSERT (test_params.mbuf_pool !=NULL ,"rte_mempool_create failed\n" );
@@ -405,7 +405,7 @@ test_setup(void)if (port->rx_queue ==NULL ) { retval =snprintf (name,RTE_DIM (name),MEMBER_RX_QUEUE_FMT , i);TEST_ASSERT (retval <= (int )RTE_DIM (name) -1 ,"Name too long" ); - port->rx_queue =rte_ring_create (name,RX_RING_SIZE , socket_id,0 ); + port->rx_queue =rte_ring_create (name,RX_RING_SIZE , numa_id,0 );TEST_ASSERT (port->rx_queue !=NULL ,"Failed to allocate rx ring '%s': %s" , name,rte_strerror (rte_errno));
@@ -414,7 +414,7 @@ test_setup(void)if (port->tx_queue ==NULL ) { retval =snprintf (name,RTE_DIM (name),MEMBER_TX_QUEUE_FMT , i);TEST_ASSERT (retval <= (int )RTE_DIM (name) -1 ,"Name too long" ); - port->tx_queue =rte_ring_create (name,TX_RING_SIZE , socket_id,0 ); + port->tx_queue =rte_ring_create (name,TX_RING_SIZE , numa_id,0 );TEST_ASSERT_NOT_NULL (port->tx_queue,"Failed to allocate tx ring '%s': %s" , name,rte_strerror (rte_errno));
@@ -424,7 +424,7 @@ test_setup(void) retval =snprintf (name,RTE_DIM (name),MEMBER_DEV_NAME_FMT , i);TEST_ASSERT (retval < (int )RTE_DIM (name) -1 ,"Name too long" ); retval =rte_eth_from_rings (name, &port->rx_queue,1 , - &port->tx_queue,1 , socket_id); + &port->tx_queue,1 , numa_id);TEST_ASSERT (retval >=0 ,"Failed to create ring ethdev '%s'\n" , name);
@@ -438,7 +438,7 @@ test_setup(void)if (test_params.bonding_port_id ==INVALID_PORT_ID ) { retval =rte_eth_bond_create (BONDING_DEV_NAME ,BONDING_MODE_8023AD , - socket_id); + numa_id);TEST_ASSERT (retval >=0 ,"Failed to create bonding ethdev %s" ,BONDING_DEV_NAME );
app/test/test_link_bonding_rssconf.c +4 -4
@@ -132,13 +132,13 @@ configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf,for (rxq =0 ; rxq <RXTX_QUEUE_COUNT ; rxq++) {TEST_ASSERT (rte_eth_rx_queue_setup (port_id, rxq,RXTX_RING_SIZE , -rte_eth_dev_socket_id (port_id),NULL , +rte_eth_dev_numa_id (port_id),NULL , test_params.mbuf_pool) ==0 ,"Failed to setup rx queue." ); }for (txq =0 ; txq <RXTX_QUEUE_COUNT ; txq++) {TEST_ASSERT (rte_eth_tx_queue_setup (port_id, txq,RXTX_RING_SIZE , -rte_eth_dev_socket_id (port_id),NULL ) ==0 , +rte_eth_dev_numa_id (port_id),NULL ) ==0 ,"Failed to setup tx queue." ); }
@@ -586,7 +586,7 @@ test_setup(void) test_params.mbuf_pool =rte_pktmbuf_pool_create ("RSS_MBUF_POOL" ,NUM_MBUFS *MEMBER_COUNT , -MBUF_CACHE_SIZE ,0 ,MBUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,MBUF_SIZE ,rte_numa_id ());TEST_ASSERT (test_params.mbuf_pool !=NULL ,"rte_pktmbuf_pool_create failed\n" );
@@ -623,7 +623,7 @@ test_setup(void) }if (test_params.bond_port_id ==INVALID_PORT_ID ) { - retval =rte_eth_bond_create (BONDING_DEV_NAME ,0 ,rte_socket_id ()); + retval =rte_eth_bond_create (BONDING_DEV_NAME ,0 ,rte_numa_id ());TEST_ASSERT (retval >=0 ,"Failed to create bonding ethdev %s" ,BONDING_DEV_NAME );
app/test/test_lpm.c +32 -32
221 lines not on this page · raw message
app/test/test_lpm6.c +35 -35
266 lines not on this page · raw message
app/test/test_lpm6_perf.c +1 -1
@@ -75,7 +75,7 @@ test_lpm6_perf(void)*/ generate_large_ips_table (0 ); - lpm =rte_lpm6_create (__func__,SOCKET_ID_ANY , &config); + lpm =rte_lpm6_create (__func__,RTE_NUMA_ID_ANY , &config);TEST_LPM_ASSERT (lpm !=NULL );/* Measure add. */
app/test/test_lpm_perf.c +2 -2
@@ -518,7 +518,7 @@ test_lpm_rcu_perf_multi_writer(uint8_t use_rcu) config.max_rules =NUM_LDEPTH_ROUTE_ENTRIES ; config.number_tbl8s =NUM_LDEPTH_ROUTE_ENTRIES ; config.flags =0 ; - lpm =rte_lpm_create (__func__,SOCKET_ID_ANY , &config); + lpm =rte_lpm_create (__func__,RTE_NUMA_ID_ANY , &config);TEST_LPM_ASSERT (lpm !=NULL );/* Init RCU variable */
@@ -611,7 +611,7 @@ test_lpm_perf(void)print_route_distribution (large_route_table, (uint32_t )NUM_ROUTE_ENTRIES ); - lpm =rte_lpm_create (__func__,SOCKET_ID_ANY , &config); + lpm =rte_lpm_create (__func__,RTE_NUMA_ID_ANY , &config);TEST_LPM_ASSERT (lpm !=NULL );/* Measure add. */
app/test/test_malloc.c +73 -73
384 lines not on this page · raw message
app/test/test_malloc_perf.c +1 -1
@@ -136,7 +136,7 @@ memzone_alloc(const char *name __rte_unused, size_t size, unsigned int align)char gen_name[RTE_MEMZONE_NAMESIZE ];snprintf (gen_name,sizeof (gen_name),"test-mz-%" PRIx64,rte_rdtsc ()); - mz =rte_memzone_reserve_aligned (gen_name, size,SOCKET_ID_ANY , + mz =rte_memzone_reserve_aligned (gen_name, size,RTE_NUMA_ID_ANY ,RTE_MEMZONE_1GB |RTE_MEMZONE_SIZE_HINT_ONLY , align);return (void *)(uintptr_t )mz; }
app/test/test_mbuf.c +9 -9
@@ -758,14 +758,14 @@ test_pktmbuf_pool_bulk(void)*/ printf ("Create mbuf pools for bulk allocation.\n" ); pool =rte_pktmbuf_pool_create ("test_pktmbuf_bulk" , -NB_MBUF ,0 ,0 ,MBUF_DATA_SIZE ,SOCKET_ID_ANY ); +NB_MBUF ,0 ,0 ,MBUF_DATA_SIZE ,RTE_NUMA_ID_ANY );if (pool ==NULL ) {printf ("rte_pktmbuf_pool_create() failed. rte_errno %d\n" , rte_errno); goto err; } pool2 =rte_pktmbuf_pool_create ("test_pktmbuf_bulk2" , -NB_MBUF ,0 ,0 ,MBUF_DATA_SIZE ,SOCKET_ID_ANY ); +NB_MBUF ,0 ,0 ,MBUF_DATA_SIZE ,RTE_NUMA_ID_ANY );if (pool2 ==NULL ) {printf ("rte_pktmbuf_pool_create() failed. rte_errno %d\n" , rte_errno);
@@ -1130,7 +1130,7 @@ test_refcnt_mbuf(void) refcnt_pool =rte_pktmbuf_pool_create (MAKE_STRING (refcnt_pool),REFCNT_MBUF_NUM ,0 ,0 ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (refcnt_pool ==NULL ) { printf("%s: cannot allocate " MAKE_STRING(refcnt_pool) "\n", __func__);
@@ -1138,7 +1138,7 @@ test_refcnt_mbuf(void) } refcnt_mbuf_ring =rte_ring_create ("refcnt_mbuf_ring" , -rte_align32pow2 (REFCNT_RING_SIZE ),SOCKET_ID_ANY , +rte_align32pow2 (REFCNT_RING_SIZE ),RTE_NUMA_ID_ANY ,RING_F_SP_ENQ );if (refcnt_mbuf_ring ==NULL ) { printf("%s: cannot allocate " MAKE_STRING(refcnt_mbuf_ring)
@@ -2451,7 +2451,7 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)/* Allocate memzone for the external data buffer */ mz =rte_memzone_reserve ("pinned_pool" ,NB_MBUF *MBUF_DATA_SIZE , -SOCKET_ID_ANY , +RTE_NUMA_ID_ANY ,RTE_MEMZONE_2MB |RTE_MEMZONE_SIZE_HINT_ONLY );if (mz ==NULL )GOTO_FAIL ("%s: Memzone allocation failed\n" , __func__);
@@ -2464,7 +2464,7 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool) pinned_pool =rte_pktmbuf_pool_create_extbuf ("test_pinned_pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,0 , -MBUF_DATA_SIZE ,SOCKET_ID_ANY , +MBUF_DATA_SIZE ,RTE_NUMA_ID_ANY , &ext_mem,1 );if (pinned_pool ==NULL ) GOTO_FAIL("%s: Mbuf pool with pinned external"
@@ -2712,7 +2712,7 @@ test_nb_segs_and_next_reset(void)struct rte_mempool *pool =NULL ; pool =rte_pktmbuf_pool_create ("test_mbuf_reset" , -3 ,0 ,0 ,MBUF_DATA_SIZE ,SOCKET_ID_ANY ); +3 ,0 ,0 ,MBUF_DATA_SIZE ,RTE_NUMA_ID_ANY );if (pool ==NULL )GOTO_FAIL ("Failed to create mbuf pool" );
@@ -2782,7 +2782,7 @@ test_mbuf(void)/* create pktmbuf pool if it does not exist */ pktmbuf_pool =rte_pktmbuf_pool_create ("test_pktmbuf_pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,0 ,MBUF_DATA_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (pktmbuf_pool ==NULL ) {printf ("cannot allocate mbuf pool\n" );
@@ -2799,7 +2799,7 @@ test_mbuf(void)* room size */ pktmbuf_pool2 =rte_pktmbuf_pool_create ("test_pktmbuf_pool2" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,MBUF2_PRIV_SIZE ,0 , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (pktmbuf_pool2 ==NULL ) {printf ("cannot allocate mbuf pool\n" );
app/test/test_member_perf.c +1 -1
@@ -658,7 +658,7 @@ run_all_tbl_perf_tests(void)printf ("Measuring performance, please wait\n" );fflush (stdout); - test_socket_id =rte_socket_id (); + test_socket_id =rte_numa_id ();for (i =0 ; i <NUM_KEYSIZES ; i++) {if (setup_keys_and_data (¶ms, i,0 ) <0 ) {
app/test/test_mempool.c +20 -20
@@ -90,7 +90,7 @@ test_mempool_basic(struct rte_mempool *mp, int use_external_cache)if (use_external_cache) {/* Create a user-owned mempool cache. */ cache =rte_mempool_cache_create (RTE_MEMPOOL_CACHE_MAX_SIZE , -SOCKET_ID_ANY ); +RTE_NUMA_ID_ANY );if (cache ==NULL )RET_ERR (); }else {
@@ -198,7 +198,7 @@ static int test_mempool_creation_with_exceeded_cache_size(void)MEMPOOL_SIZE +32 ,0 ,NULL ,NULL , my_obj_init,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);if (mp_cov !=NULL ) {rte_mempool_free (mp_cov);
@@ -216,7 +216,7 @@ static int test_mempool_creation_with_invalid_flags(void)MEMPOOL_ELT_SIZE ,0 ,0 ,NULL ,NULL ,NULL ,NULL , - SOCKET_ID_ANY, ~RTE_MEMPOOL_VALID_USER_FLAGS); + RTE_NUMA_ID_ANY, ~RTE_MEMPOOL_VALID_USER_FLAGS);if (mp_cov !=NULL ) {rte_mempool_free (mp_cov);
@@ -338,7 +338,7 @@ test_mempool_sp_sc(void)MEMPOOL_ELT_SIZE ,0 ,0 , my_mp_init,NULL , my_obj_init,NULL , -SOCKET_ID_ANY , +RTE_NUMA_ID_ANY ,RTE_MEMPOOL_F_NO_CACHE_ALIGN |RTE_MEMPOOL_F_SP_PUT | RTE_MEMPOOL_F_SC_GET);if (mp_spsc ==NULL )
@@ -445,7 +445,7 @@ test_mempool_same_name_twice_creation(void)MEMPOOL_ELT_SIZE ,0 ,0 ,NULL ,NULL ,NULL ,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);
Lines of this file are not shown. View the raw message.
app/test/test_memzone.c +60 -59
119 lines not on this page · raw message
app/test/test_pmd_perf.c +36 -36
72 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.55.0
Part of the diff is not shown here. View the raw message.
PATCH 171/227 app/testpmd: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-pmd/cmdline.c | 22 +++---- app/test-pmd/config.c | 10 ++-- app/test-pmd/noisy_vnf.c | 2 +- app/test-pmd/parameters.c | 46 +++++++-------- app/test-pmd/testpmd.c | 118 +++++++++++++++++++------------------- app/test-pmd/testpmd.h | 20 +++---- 6 files changed, 109 insertions(+), 109 deletions(-)
app/test-pmd/cmdline.c +11 -11
@@ -3038,7 +3038,7 @@ cmd_setup_rxtx_queue_parsed(struct cmd_setup_rxtx_queue *res = parsed_result;struct rte_port *port;struct rte_mempool *mp; -unsigned int socket_id; +unsigned int numa_id;uint8_t isrx =0 ;int ret;
@@ -3069,32 +3069,32 @@ cmd_setup_rxtx_queue_parsed( port = &ports[res->portid];if (isrx) { - socket_id = rxring_numa[res->portid]; -if (!numa_support || socket_id ==NUMA_NO_CONFIG ) - socket_id = port->socket_id; + numa_id = rxring_numa[res->portid]; +if (!numa_support || numa_id ==NUMA_NO_CONFIG ) + numa_id = port->numa_id; - mp =mbuf_pool_find_first (socket_id); + mp =mbuf_pool_find_first (numa_id);if (mp ==NULL ) {char buf[16 ];fprintf (stderr,"Failed to setup RX queue: No mempool allocation on the socket %s\n" , -socket_id_str (socket_id, buf,sizeof (buf))); +socket_id_str (numa_id, buf,sizeof (buf)));return ; } ret =rx_queue_setup (res->portid, res->qid, port->nb_rx_desc[res->qid], - socket_id, + numa_id, &port->rxq[res->qid].conf, mp);if (ret)fprintf (stderr,"Failed to setup RX queue: %s\n" ,rte_strerror (-ret)); }else { - socket_id = txring_numa[res->portid]; -if (!numa_support || socket_id ==NUMA_NO_CONFIG ) - socket_id = port->socket_id; + numa_id = txring_numa[res->portid]; +if (!numa_support || numa_id ==NUMA_NO_CONFIG ) + numa_id = port->numa_id;if (port->nb_tx_desc[res->qid] < tx_pkt_nb_segs) { fprintf(stderr,
@@ -3104,7 +3104,7 @@ cmd_setup_rxtx_queue_parsed( ret =rte_eth_tx_queue_setup (res->portid, res->qid, port->nb_tx_desc[res->qid], - socket_id, + numa_id, &port->txq[res->qid].conf);if (ret) fprintf(stderr, "Failed to setup TX queue: %s\n",
app/test-pmd/config.c +5 -5
@@ -843,7 +843,7 @@ port_infos_display(portid_t port_id)if (rte_dev_devargs (dev_info.device) &&rte_dev_devargs (dev_info.device)->args)printf ("\nDevargs: %s" ,rte_dev_devargs (dev_info.device)->args);printf ("\nConnect to socket: %s" , -socket_id_str (port->socket_id, buf,sizeof (buf))); +socket_id_str (port->numa_id, buf,sizeof (buf)));if (port_numa[port_id] !=NUMA_NO_CONFIG ) { mp =mbuf_pool_find (port_numa[port_id],0 );
@@ -852,7 +852,7 @@ port_infos_display(portid_t port_id) port_numa[port_id]); }else printf ("\nmemory allocation on the socket: %s" , -socket_id_str (port->socket_id, buf,sizeof (buf))); +socket_id_str (port->numa_id, buf,sizeof (buf)));printf ("\nLink status: %s\n" , (link.link_status) ? ("up" ) : ("down" ));printf ("Link speed: %s\n" ,rte_eth_link_speed_to_str (link.link_speed));
@@ -5725,17 +5725,17 @@ pkt_fwd_config_display(struct fwd_config *cfg)printf ("Logical Core %u (socket %u) forwards packets on " "%d streams:" , fwd_lcores_cpuids[lc_id], -rte_lcore_to_socket_id (fwd_lcores_cpuids[lc_id]), +rte_lcore_to_numa_id (fwd_lcores_cpuids[lc_id]), fwd_lcores[lc_id]->stream_nb);for (sm_id =0 ; sm_id < fwd_lcores[lc_id]->stream_nb; sm_id++) { fs = fwd_streams[fwd_lcores[lc_id]->stream_idx + sm_id];printf ("\n RX P=%d/Q=%d (socket %s) -> " , fs->rx_port, fs->rx_queue, -socket_id_str (ports[fs->rx_port].socket_id, +socket_id_str (ports[fs->rx_port].numa_id, buf,sizeof (buf)));printf ("TX P=%d/Q=%d (socket %s) " , fs->tx_port, fs->tx_queue, -socket_id_str (ports[fs->tx_port].socket_id, +socket_id_str (ports[fs->tx_port].numa_id, buf,sizeof (buf)));print_ethaddr ("peer=" , &peer_eth_addrs[fs->peer_addr]);
app/test-pmd/noisy_vnf.c +1 -1
@@ -273,7 +273,7 @@ noisy_fwd_begin(portid_t pi)if (n->do_buffering) {snprintf (name,NOISY_STRSIZE ,NOISY_RING , pi); n->f =rte_ring_create (name, noisy_tx_sw_bufsz, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (!n->f) rte_exit(EXIT_FAILURE, "rte_ring_create(%d), size %d) failed\n",
app/test-pmd/parameters.c +23 -23
103 lines not on this page · raw message
app/test-pmd/testpmd.c +59 -59
374 lines not on this page · raw message
app/test-pmd/testpmd.h +10 -10
@@ -342,7 +342,7 @@ struct rte_port {struct rte_eth_conf dev_conf;/**< Port configuration. */ struct rte_ether_addr eth_addr;/**< Port ethernet address */ struct rte_eth_stats stats;/**< Last port statistics */ -unsigned int socket_id;/**< For NUMA support */ +unsigned int numa_id;/**< For NUMA support */ uint16_t parse_tunnel:1; /**< Parse internal headers */uint16_t tso_segsz;/**< Segmentation offload MSS for non-tunneled packets. */ uint16_t tunnel_tso_segsz;/**< Segmentation offload MSS for tunneled pkts. */
@@ -576,8 +576,8 @@ extern lcoreid_t nb_lcores; /**< Number of logical cores probed at init time. */extern lcoreid_t nb_cfg_lcores;/**< Number of configured logical cores. */ extern lcoreid_t nb_fwd_lcores;/**< Number of forwarding logical cores. */ extern unsigned int fwd_lcores_cpuids[RTE_MAX_LCORE ]; -extern unsigned int num_sockets; -extern unsigned int socket_ids[RTE_MAX_NUMA_NODES ]; +extern unsigned int num_numas; +extern unsigned int numa_ids[RTE_MAX_NUMA_NODES ];/* * Configuration of Ethernet ports:
@@ -873,14 +873,14 @@ current_fwd_lcore(void)void parse_fwd_portlist (const char *port); -/* Format a socket id for display, SOCKET_ID_ANY as "any". */ +/* Format a socket id for display, RTE_NUMA_ID_ANY as "any". */ static inline const char * -socket_id_str (unsigned int socket_id,char *buf,size_t size) +socket_id_str (unsigned int numa_id,char *buf,size_t size) { -if (socket_id == (unsigned int )SOCKET_ID_ANY ) +if (numa_id == (unsigned int )RTE_NUMA_ID_ANY )snprintf (buf, size,"any" );else -snprintf (buf, size,"%u" , socket_id); +snprintf (buf, size,"%u" , numa_id);return buf; }
@@ -1000,7 +1000,7 @@ void pkt_fwd_config_display(struct fwd_config *cfg);void rxtx_config_display (void );void fwd_config_setup (void );void set_def_fwd_config (void ); -void reconfig (portid_t new_port_id,unsigned socket_id); +void reconfig (portid_t new_port_id,unsigned int numa_id);int init_fwd_streams (void );void update_fwd_ports (portid_t new_pid);
@@ -1222,7 +1222,7 @@ void set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on);int rx_queue_setup (uint16_t port_id,uint16_t rx_queue_id, -uint16_t nb_rx_desc,unsigned int socket_id, +uint16_t nb_rx_desc,unsigned int numa_id,struct rte_eth_rxconf *rx_conf,struct rte_mempool *mp);int set_queue_rate_limit (portid_t port_id,uint16_t queue_idx,uint32_t rate);
@@ -1275,7 +1275,7 @@ enum print_warning { };int port_id_is_invalid (portid_t port_id,enum print_warning warning);void print_valid_ports (void ); -int new_socket_id (unsigned int socket_id); +int new_numa_id (unsigned int numa_id);queueid_t get_allowed_max_nb_rxq (portid_t *pid);int check_nb_rxq (queueid_t rxq);
Signature · 1 line
2.55.0
PATCH 172/227 app/proc-info: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/proc-info/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
app/proc-info/main.c +2 -2
@@ -1034,7 +1034,7 @@ show_port(void)printf ("\t -- driver %s device %s socket %d\n" , dev_info.driver_name,rte_dev_name (dev_info.device), -rte_eth_dev_socket_id (i)); +rte_eth_dev_numa_id (i)); ret =rte_eth_dev_owner_get (i, &owner);if (ret ==0 && owner.id !=RTE_ETH_DEV_NO_OWNER )
@@ -1631,7 +1631,7 @@ show_mempool(char *name)"\t -- No IOVA config (%c)\n" "\t -- Not used for IO (%c)\n" , ptr->name, - ptr->socket_id, + ptr->numa_id, (flags &RTE_MEMPOOL_F_NO_SPREAD ) ?'y' :'n' , (flags &RTE_MEMPOOL_F_NO_CACHE_ALIGN ) ?'y' :'n' , (flags & RTE_MEMPOOL_F_SP_PUT) ? 'y' : 'n',
Signature · 1 line
2.55.0
PATCH 173/227 app/graph: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/graph/ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
app/graph/ethdev.c +2 -2
@@ -433,8 +433,8 @@ ethdev_process(const char *name, struct ethdev_config *params) } } - numa_node =rte_eth_dev_socket_id (port_id); -if (numa_node ==SOCKET_ID_ANY ) + numa_node =rte_eth_dev_numa_id (port_id); +if (numa_node ==RTE_NUMA_ID_ANY ) numa_node =0 ;if (params->mtu)
Signature · 1 line
2.55.0
PATCH 174/227 app/pdump: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/pdump/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
app/pdump/main.c +6 -6
@@ -595,7 +595,7 @@ configure_vdev(uint16_t port_id)for (q =0 ; q < txRings; q++) { ret =rte_eth_tx_queue_setup (port_id, q,TX_DESC_PER_QUEUE , -rte_eth_dev_socket_id (port_id),NULL ); +rte_eth_dev_numa_id (port_id),NULL );if (ret <0 )rte_exit (EXIT_FAILURE ,"queue setup failed\n" ); }
@@ -645,7 +645,7 @@ create_mp_ring_vdev(void) pt->total_num_mbufs,MBUF_POOL_CACHE_SIZE ,0 , pt->mbuf_data_size, - rte_socket_id(), "ring_mp_mc"); + rte_numa_id(), "ring_mp_mc");if (mbuf_pool ==NULL ) {cleanup_rings (); rte_exit(EXIT_FAILURE,
@@ -660,7 +660,7 @@ create_mp_ring_vdev(void)/* create rx_ring */ snprintf (ring_name,SIZE ,RX_RING , i); pt->rx_ring =rte_ring_create (ring_name, pt->ring_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (pt->rx_ring ==NULL ) {cleanup_rings (); rte_exit(EXIT_FAILURE, "%s:%s:%d\n",
@@ -671,7 +671,7 @@ create_mp_ring_vdev(void)/* create tx_ring */ snprintf (ring_name,SIZE ,TX_RING , i); pt->tx_ring =rte_ring_create (ring_name, pt->ring_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (pt->tx_ring ==NULL ) {cleanup_rings (); rte_exit(EXIT_FAILURE, "%s:%s:%d\n",
@@ -743,7 +743,7 @@ create_mp_ring_vdev(void)/* create rx_ring */ snprintf (ring_name,SIZE ,RX_RING , i); pt->rx_ring =rte_ring_create (ring_name, pt->ring_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (pt->rx_ring ==NULL ) {cleanup_rings (); rte_exit(EXIT_FAILURE, "%s\n",
@@ -780,7 +780,7 @@ create_mp_ring_vdev(void)/* create tx_ring */ snprintf (ring_name,SIZE ,TX_RING , i); pt->tx_ring =rte_ring_create (ring_name, pt->ring_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (pt->tx_ring ==NULL ) {cleanup_rings (); rte_exit(EXIT_FAILURE, "%s\n",
Signature · 1 line
2.55.0
PATCH 175/227 app/dumpcap: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/dumpcap/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
app/dumpcap/main.c +2 -2
@@ -701,7 +701,7 @@ static struct rte_ring *create_ring(void) "dumpcap-%d", getpid()); ring =rte_ring_create (ring_name, ring_size, -rte_socket_id (),0 ); +rte_numa_id (),0 );if (ring ==NULL )rte_exit (EXIT_FAILURE ,"Could not create ring :%s\n" ,rte_strerror (rte_errno));
@@ -730,7 +730,7 @@ static struct rte_mempool *create_mempool(void) mp =rte_pktmbuf_pool_create_by_ops (pool_name, num_mbufs,MBUF_POOL_CACHE_SIZE ,0 , data_size, -rte_socket_id (),"ring_mp_mc" ); +rte_numa_id (),"ring_mp_mc" );if (mp ==NULL ) rte_exit(EXIT_FAILURE, "Mempool (%s) creation failed: %s\n", pool_name,
Signature · 1 line
2.55.0
PATCH 176/227 app/test-mldev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-mldev/ml_options.c | 14 +++++++------- app/test-mldev/ml_options.h | 4 ++-- app/test-mldev/test_common.c | 10 +++++----- app/test-mldev/test_device_ops.c | 10 +++++----- app/test-mldev/test_inference_common.c | 26 +++++++++++++------------- app/test-mldev/test_model_ops.c | 4 ++-- 6 files changed, 34 insertions(+), 34 deletions(-)
app/test-mldev/ml_options.c +7 -7
@@ -22,7 +22,7 @@ ml_options_default(struct ml_options *opt)memset (opt,0 ,sizeof (*opt));strlcpy (opt->test_name,"device_ops" ,ML_TEST_NAME_MAX_LEN ); opt->dev_id =0 ; - opt->socket_id =SOCKET_ID_ANY ; + opt->numa_id =RTE_NUMA_ID_ANY ; opt->nb_filelist =0 ; opt->quantized_io = false; opt->repetitions =1 ;
@@ -64,9 +64,9 @@ ml_parse_socket_id(struct ml_options *opt, const char *arg) {int ret; - ret =parser_read_int32 (&opt->socket_id, arg); + ret =parser_read_int32 (&opt->numa_id, arg);if (ret <0 ) -ml_err ("Invalid option: socket_id = %s\n" , arg); +ml_err ("Invalid option: numa_id = %s\n" , arg);return ret; }
@@ -257,7 +257,7 @@ print_usage(char *program)printf ("application options:\n" );printf ("\t--test : name of the test application to run\n" "\t--dev_id : device id of the ML device\n" -"\t--socket_id : socket_id of application resources\n" +"\t--numa_id : numa_id of application resources\n" "\t--debug : enable debug mode\n" "\t--help : print help\n" );printf ("\n" );
@@ -362,10 +362,10 @@ ml_options_dump(struct ml_options *opt)ml_dump ("test" ,"%s" , opt->test_name);ml_dump ("dev_id" ,"%d" , opt->dev_id); -if (opt->socket_id ==SOCKET_ID_ANY ) -ml_dump ("socket_id" ,"%d (SOCKET_ID_ANY)" , opt->socket_id); +if (opt->numa_id ==RTE_NUMA_ID_ANY ) +ml_dump ("numa_id" ,"%d (RTE_NUMA_ID_ANY)" , opt->numa_id);else -ml_dump ("socket_id" ,"%d" , opt->socket_id); +ml_dump ("numa_id" ,"%d" , opt->numa_id);ml_dump ("debug" ,"%s" , (opt->debug ?"true" :"false" ));ml_dump ("quantized_io" ,"%s" , (opt->quantized_io ?"true" :"false" ));
app/test-mldev/ml_options.h +2 -2
@@ -14,7 +14,7 @@/* Options names */ #define ML_TEST ("test")#define ML_DEVICE_ID ("dev_id") -#define ML_SOCKET_ID ("socket_id") +#define ML_SOCKET_ID ("numa_id")#define ML_MODELS ("models")#define ML_FILELIST ("filelist")#define ML_QUANTIZED_IO ("quantized_io")
@@ -37,7 +37,7 @@ struct ml_filelist {struct ml_options {char test_name[ML_TEST_NAME_MAX_LEN ];int16_t dev_id; -int socket_id; +int numa_id;struct ml_filelist filelist[ML_TEST_MAX_MODELS ];uint8_t nb_filelist;uint64_t repetitions;
app/test-mldev/test_common.c +5 -5
@@ -86,7 +86,7 @@ int ml_test_opt_check(struct ml_options *opt) {uint16_t dev_count; -int socket_id; +int numa_id;RTE_SET_USED (opt);
@@ -101,9 +101,9 @@ ml_test_opt_check(struct ml_options *opt)return -EINVAL ; } - socket_id =rte_ml_dev_numa_id (opt->dev_id); -if ((opt->socket_id !=SOCKET_ID_ANY ) && (opt->socket_id != socket_id)) { -ml_err ("Invalid option, socket_id = %d\n" , opt->socket_id); + numa_id =rte_ml_dev_numa_id (opt->dev_id); +if ((opt->numa_id !=RTE_NUMA_ID_ANY ) && (opt->numa_id != numa_id)) { +ml_err ("Invalid option, numa_id = %d\n" , opt->numa_id);return -EINVAL ; }
@@ -140,7 +140,7 @@ ml_test_device_configure(struct ml_test *test, struct ml_options *opt) }/* configure device */ - dev_config.numa_id = opt->socket_id; + dev_config.numa_id = opt->numa_id; dev_config.nb_models = t->dev_info.max_models; dev_config.nb_queue_pairs = opt->queue_pairs; ret =rte_ml_dev_configure (opt->dev_id, &dev_config);
app/test-mldev/test_device_ops.c +5 -5
@@ -47,8 +47,8 @@ test_device_setup(struct ml_test *test, struct ml_options *opt)int ret =0 ;/* allocate for test structure */ - test_device =rte_zmalloc_socket (test->name,sizeof (struct test_device ), -RTE_CACHE_LINE_SIZE , opt->socket_id); + test_device =rte_zmalloc_numa (test->name,sizeof (struct test_device ), +RTE_CACHE_LINE_SIZE , opt->numa_id);if (test_device ==NULL ) {ml_err ("failed to allocate memory for test_model" ); ret = -ENOMEM ;
@@ -107,7 +107,7 @@ test_device_reconfigure(struct ml_test *test, struct ml_options *opt) qp_conf.nb_desc = opt->queue_size; qp_conf.cb =NULL ; - ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->socket_id); + ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->numa_id);if (ret !=0 ) {ml_err ("Failed to setup ML device queue-pair, dev_id = %d, qp_id = %u\n" , opt->dev_id, qp_id);
@@ -128,7 +128,7 @@ test_device_reconfigure(struct ml_test *test, struct ml_options *opt) }/* reconfigure device based on dev_info */ - dev_config.numa_id = opt->socket_id; + dev_config.numa_id = opt->numa_id; dev_config.nb_models = t->cmn.dev_info.max_models; dev_config.nb_queue_pairs = t->cmn.dev_info.max_queue_pairs; ret =rte_ml_dev_configure (opt->dev_id, &dev_config);
@@ -142,7 +142,7 @@ test_device_reconfigure(struct ml_test *test, struct ml_options *opt) qp_conf.nb_desc = t->cmn.dev_info.max_desc; qp_conf.cb =NULL ; - ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->socket_id); + ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->numa_id);if (ret !=0 ) {ml_err ("Failed to setup ML device queue-pair, dev_id = %d, qp_id = %u\n" , opt->dev_id, qp_id);
app/test-mldev/test_inference_common.c +13 -13
@@ -531,8 +531,8 @@ test_inference_setup(struct ml_test *test, struct ml_options *opt)int ret =0 ;uint32_t i; - test_inference =rte_zmalloc_socket (test->name,sizeof (struct test_inference ), -RTE_CACHE_LINE_SIZE , opt->socket_id); + test_inference =rte_zmalloc_numa (test->name,sizeof (struct test_inference ), +RTE_CACHE_LINE_SIZE , opt->numa_id);if (test_inference ==NULL ) {ml_err ("failed to allocate memory for test_model" ); ret = -ENOMEM ;
@@ -567,15 +567,15 @@ test_inference_setup(struct ml_test *test, struct ml_options *opt) t->model[i].state =MODEL_INITIAL ;for (lcore_id =0 ; lcore_id <RTE_MAX_LCORE ; lcore_id++) { - t->args[lcore_id].enq_ops =rte_zmalloc_socket ( + t->args[lcore_id].enq_ops =rte_zmalloc_numa ("ml_test_enq_ops" , opt->burst_size *sizeof (struct rte_ml_op *), -RTE_CACHE_LINE_SIZE , opt->socket_id); - t->args[lcore_id].deq_ops =rte_zmalloc_socket ( +RTE_CACHE_LINE_SIZE , opt->numa_id); + t->args[lcore_id].deq_ops =rte_zmalloc_numa ("ml_test_deq_ops" , opt->burst_size *sizeof (struct rte_ml_op *), -RTE_CACHE_LINE_SIZE , opt->socket_id); - t->args[lcore_id].reqs =rte_zmalloc_socket ( +RTE_CACHE_LINE_SIZE , opt->numa_id); + t->args[lcore_id].reqs =rte_zmalloc_numa ("ml_test_requests" , opt->burst_size *sizeof (struct ml_request *), -RTE_CACHE_LINE_SIZE , opt->socket_id); +RTE_CACHE_LINE_SIZE , opt->numa_id); }for (i =0 ; i <RTE_MAX_LCORE ; i++) {
@@ -634,7 +634,7 @@ ml_inference_mldev_setup(struct ml_test *test, struct ml_options *opt) qp_conf.nb_desc = opt->queue_size; qp_conf.cb =NULL ; - ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->socket_id); + ret =rte_ml_dev_queue_pair_setup (opt->dev_id, qp_id, &qp_conf, opt->numa_id);if (ret !=0 ) {ml_err ("Failed to setup ml device queue-pair, dev_id = %d, qp_id = %u\n" , opt->dev_id, qp_id);
@@ -800,7 +800,7 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, uint16_t mz_size += t->model[fid].out_dsize;sprintf (mz_name,"ml_user_data_%d" , fid); - mz =rte_memzone_reserve (mz_name, mz_size, opt->socket_id,0 ); + mz =rte_memzone_reserve (mz_name, mz_size, opt->numa_id,0 );if (mz ==NULL ) {ml_err ("Memzone allocation failed for ml_user_data\n" ); ret = -ENOMEM ;
@@ -860,7 +860,7 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, uint16_t t->fid = fid;sprintf (mp_name,"ml_io_pool_%d" , fid); t->model[fid].io_pool =rte_mempool_create (mp_name, nb_buffers, buff_size,0 ,0 ,NULL ,NULL , - ml_request_initialize, test, opt->socket_id,0 ); + ml_request_initialize, test, opt->numa_id,0 );if (t->model[fid].io_pool ==NULL ) {ml_err ("Failed to create io pool : %s\n" ,"ml_io_pool" ); ret = -ENOMEM ;
@@ -909,7 +909,7 @@ ml_inference_mem_setup(struct ml_test *test, struct ml_options *opt)/* create op pool */ t->op_pool =rte_ml_op_pool_create ("ml_test_op_pool" ,ML_TEST_MAX_POOL_SIZE ,0 ,0 , - opt->socket_id); + opt->numa_id);if (t->op_pool ==NULL ) {ml_err ("Failed to create op pool : %s\n" ,"ml_op_pool" );return -ENOMEM ;
@@ -920,7 +920,7 @@ ml_inference_mem_setup(struct ml_test *test, struct ml_options *opt)*/ t->buf_seg_pool =rte_mempool_create ("ml_test_mbuf_pool" ,ML_TEST_MAX_POOL_SIZE *2 ,sizeof (struct rte_ml_buff_seg ),0 ,0 ,NULL ,NULL ,NULL , -NULL , opt->socket_id,0 ); +NULL , opt->numa_id,0 );if (t->buf_seg_pool ==NULL ) {ml_err ("Failed to create buf_segs pool : %s\n" ,"ml_test_mbuf_pool" );rte_ml_op_pool_free (t->op_pool);
app/test-mldev/test_model_ops.c +2 -2
@@ -73,8 +73,8 @@ test_model_ops_setup(struct ml_test *test, struct ml_options *opt)uint32_t i;/* allocate model ops test structure */ - test_model_ops =rte_zmalloc_socket (test->name,sizeof (struct test_model_ops ), -RTE_CACHE_LINE_SIZE , opt->socket_id); + test_model_ops =rte_zmalloc_numa (test->name,sizeof (struct test_model_ops ), +RTE_CACHE_LINE_SIZE , opt->numa_id);if (test_model_ops ==NULL ) {ml_err ("Failed to allocate memory for test_model" ); ret = -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 177/227 app/test-eventdev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-eventdev/evt_common.h | 2 +- app/test-eventdev/evt_options.c | 8 +++--- app/test-eventdev/evt_options.h | 2 +- app/test-eventdev/test_order_common.c | 14 +++++----- app/test-eventdev/test_perf_common.c | 34 ++++++++++++------------ app/test-eventdev/test_pipeline_common.c | 14 +++++----- 6 files changed, 37 insertions(+), 37 deletions(-)
app/test-eventdev/evt_common.h +1 -1
@@ -57,7 +57,7 @@ struct evt_options {bool wlcores[RTE_MAX_LCORE ];bool crypto_cipher_bit_mode;int pool_sz; -int socket_id; +int numa_id;int nb_stages;int verbose_level;uint8_t dev_id;
app/test-eventdev/evt_options.c +4 -4
@@ -25,7 +25,7 @@ evt_options_default(struct evt_options *opt) opt->dev_id =0 ;strlcpy (opt->test_name,"order_queue" ,sizeof (opt->test_name)); opt->nb_flows =1024 ; - opt->socket_id =SOCKET_ID_ANY ; + opt->numa_id =RTE_NUMA_ID_ANY ; opt->pool_sz =16 *1024 ; opt->prod_enq_burst_sz =0 ; opt->wkr_deq_dep =16 ;
@@ -291,7 +291,7 @@ evt_parse_test_name(struct evt_options *opt, const char *arg)static int evt_parse_socket_id (struct evt_options *opt,const char *arg) { - opt->socket_id =atoi (arg); + opt->numa_id =atoi (arg);return 0 ; }
@@ -482,7 +482,7 @@ usage(char *program)printf ("\t--verbose : verbose level\n" "\t--dev : device id of the event device\n" "\t--test : name of the test application to run\n" -"\t--socket_id : socket_id of application resources\n" +"\t--numa_id : numa_id of application resources\n" "\t--pool_sz : pool size of the mempool\n" "\t--plcores : list of lcore ids for producers\n" "\t--wlcores : list of lcore ids for workers\n"
@@ -720,7 +720,7 @@ evt_options_dump(struct evt_options *opt)evt_dump ("test" ,"%s" , opt->test_name);evt_dump ("dev" ,"%d" , opt->dev_id);evt_dump ("verbose_level" ,"%d" , opt->verbose_level); -evt_dump ("socket_id" ,"%d" , opt->socket_id); +evt_dump ("numa_id" ,"%d" , opt->numa_id);evt_dump ("pool_sz" ,"%d" , opt->pool_sz);evt_dump ("main lcore" ,"%d" ,rte_get_main_lcore ());evt_dump ("nb_pkts" ,"%" PRIu64, opt->nb_pkts);
app/test-eventdev/evt_options.h +1 -1
@@ -24,7 +24,7 @@#define EVT_PROD_LCORES ("plcores")#define EVT_WORK_LCORES ("wlcores")#define EVT_NB_FLOWS ("nb_flows") -#define EVT_SOCKET_ID ("socket_id") +#define EVT_SOCKET_ID ("numa_id")#define EVT_POOL_SZ ("pool_sz")#define EVT_WKR_DEQ_DEP ("worker_deq_depth")#define EVT_NB_PKTS ("nb_pkts")
app/test-eventdev/test_order_common.c +7 -7
@@ -149,8 +149,8 @@ order_test_setup(struct evt_test *test, struct evt_options *opt) .align = alignof(seqn_t), }; - test_order =rte_zmalloc_socket (test->name,sizeof (struct test_order ), -RTE_CACHE_LINE_SIZE , opt->socket_id); + test_order =rte_zmalloc_numa (test->name,sizeof (struct test_order ), +RTE_CACHE_LINE_SIZE , opt->numa_id);if (test_order ==NULL ) {evt_err ("failed to allocate test_order memory" ); goto nomem;
@@ -172,18 +172,18 @@ order_test_setup(struct evt_test *test, struct evt_options *opt)return -rte_errno; } - t->producer_flow_seq =rte_zmalloc_socket ("test_producer_flow_seq" , + t->producer_flow_seq =rte_zmalloc_numa ("test_producer_flow_seq" ,sizeof (*t->producer_flow_seq) * opt->nb_flows, -RTE_CACHE_LINE_SIZE , opt->socket_id); +RTE_CACHE_LINE_SIZE , opt->numa_id);if (t->producer_flow_seq ==NULL ) {evt_err ("failed to allocate t->producer_flow_seq memory" ); goto prod_nomem; } - t->expected_flow_seq =rte_zmalloc_socket ("test_expected_flow_seq" , + t->expected_flow_seq =rte_zmalloc_numa ("test_expected_flow_seq" ,sizeof (*t->expected_flow_seq) * opt->nb_flows, -RTE_CACHE_LINE_SIZE , opt->socket_id); +RTE_CACHE_LINE_SIZE , opt->numa_id);if (t->expected_flow_seq ==NULL ) {evt_err ("failed to allocate t->expected_flow_seq memory" );
@@ -224,7 +224,7 @@ order_mempool_setup(struct evt_test *test, struct evt_options *opt) t->pool =rte_pktmbuf_pool_create (test->name, opt->pool_sz,256 /* Cache */ ,0 ,512 ,/* Use very small mbufs */ - opt->socket_id); + opt->numa_id);if (t->pool ==NULL ) {evt_err ("failed to create mempool" );return -ENOMEM ;
app/test-eventdev/test_perf_common.c +17 -17
@@ -1521,9 +1521,9 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, p->queue_id = prod * stride; p->ca.cdev_id = cdev_id; p->ca.cdev_qp_id = qp_id; - p->ca.crypto_sess =rte_zmalloc_socket ( + p->ca.crypto_sess =rte_zmalloc_numa (NULL ,sizeof (void *) * t->nb_flows, -RTE_CACHE_LINE_SIZE , opt->socket_id); +RTE_CACHE_LINE_SIZE , opt->numa_id); p->t = t; ret =perf_event_crypto_adapter_setup (t, p);
@@ -1649,7 +1649,7 @@ perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, conf.event_dev_id = opt->dev_id; conf.vector_sz = opt->vector_size; conf.vector_timeout_ns = opt->vector_tmo_nsec; - conf.numa_id = opt->socket_id; + conf.numa_id = opt->numa_id; conf.vector_mp = t->pool; conf.ev.sched_type = opt->sched_type_list[0 ];
@@ -1934,14 +1934,14 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt) }if (rte_eth_rx_queue_setup (i,0 ,NB_RX_DESC , -rte_socket_id (),NULL , t->pool) <0 ) { +rte_numa_id (),NULL , t->pool) <0 ) {evt_err ("Failed to setup eth port [%d] rx_queue: %d." , i,0 );return -EINVAL ; }if (rte_eth_tx_queue_setup (i,0 ,NB_TX_DESC , -rte_socket_id (),NULL ) <0 ) { +rte_numa_id (),NULL ) <0 ) {evt_err ("Failed to setup eth port [%d] tx_queue: %d." , i,0 );return -EINVAL ;
@@ -2010,7 +2010,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) t->ca_op_pool =rte_crypto_op_pool_create ("crypto_op_pool" , opt->crypto_op_type, opt->pool_sz,128 ,sizeof (union rte_event_crypto_metadata ) +EVT_CRYPTO_MAX_IV_SIZE , -rte_socket_id ()); +rte_numa_id ());if (t->ca_op_pool ==NULL ) {evt_err ("Failed to create crypto op pool" );return -ENOMEM ;
@@ -2019,7 +2019,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) nb_sessions =evt_nr_active_lcores (opt->plcores) * t->nb_flows; t->ca_asym_sess_pool =rte_cryptodev_asym_session_pool_create ("ca_asym_sess_pool" , nb_sessions,0 , -sizeof (union rte_event_crypto_metadata ),SOCKET_ID_ANY ); +sizeof (union rte_event_crypto_metadata ),RTE_NUMA_ID_ANY );if (t->ca_asym_sess_pool ==NULL ) {evt_err ("Failed to create sym session pool" ); ret = -ENOMEM ;
@@ -2038,7 +2038,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) t->ca_sess_pool =rte_cryptodev_sym_session_pool_create ("ca_sess_pool" , nb_sessions, max_session_size,0 , -sizeof (union rte_event_crypto_metadata ),SOCKET_ID_ANY ); +sizeof (union rte_event_crypto_metadata ),RTE_NUMA_ID_ANY );if (t->ca_sess_pool ==NULL ) {evt_err ("Failed to create sym session pool" ); ret = -ENOMEM ;
@@ -2050,7 +2050,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) nb_elem =RTE_MAX (512U , nb_elem); nb_elem +=evt_nr_active_lcores (opt->wlcores) *32 ; t->ca_vector_pool =rte_event_vector_pool_create ("vector_pool" , nb_elem,32 , - opt->vector_size, opt->socket_id); + opt->vector_size, opt->numa_id);if (t->ca_vector_pool ==NULL ) {evt_err ("Failed to create event vector pool" ); ret = -ENOMEM ;
@@ -2097,7 +2097,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt)for (qp_id =0 ; qp_id < conf.nb_queue_pairs; qp_id++) { ret =rte_cryptodev_queue_pair_setup ( cdev_id, qp_id, &qp_conf, -rte_cryptodev_socket_id (cdev_id)); +rte_cryptodev_numa_id (cdev_id));if (ret) {evt_err ("Failed to setup queue pairs on cryptodev %u\n" , cdev_id);
@@ -2237,7 +2237,7 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt) cache_sz,/* cache size*/ 0 ,NULL ,NULL , perf_elt_init,/* obj constructor */ - NULL, opt->socket_id, 0); /* flags */ + NULL, opt->numa_id, 0); /* flags */ }else if (opt->prod_type ==EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR && opt->crypto_op_type ==RTE_CRYPTO_OP_TYPE_ASYMMETRIC ) { t->pool = rte_mempool_create(test->name, /* mempool name */
@@ -2247,7 +2247,7 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt) cache_sz,/* cache size*/ 0 ,NULL ,NULL ,NULL ,/* obj constructor */ - NULL, opt->socket_id, 0); /* flags */ + NULL, opt->numa_id, 0); /* flags */ }else if (opt->prod_type ==EVT_PROD_TYPE_EVENT_DMA_ADPTR ) { t->pool = rte_mempool_create(test->name, /* mempool name */ opt->pool_sz, /* number of elements*/
@@ -2255,17 +2255,17 @@ perf_mempool_setup(struct evt_test *test, struct evt_options *opt) (sizeof (struct rte_dma_sge ) *2 ), cache_sz,/* cache size*/ 0 ,NULL ,NULL ,NULL ,/* obj constructor */ - NULL, opt->socket_id, 0); /* flags */ + NULL, opt->numa_id, 0); /* flags */ }else if (opt->prod_type ==EVT_PROD_TYPE_EVENT_VECTOR_ADPTR ) { t->pool =rte_event_vector_pool_create (test->name, opt->pool_sz, cache_sz, - opt->vector_size, opt->socket_id); + opt->vector_size, opt->numa_id); }else { t->pool =rte_pktmbuf_pool_create (test->name,/* mempool name */ opt->pool_sz,/* number of elements*/ cache_sz,/* cache size*/ 0 ,RTE_MBUF_DEFAULT_BUF_SIZE , - opt->socket_id);/* flags */ + opt->numa_id);/* flags */ }if (t->pool ==NULL ) {
@@ -2290,8 +2290,8 @@ perf_test_setup(struct evt_test *test, struct evt_options *opt) {void *test_perf; - test_perf =rte_zmalloc_socket (test->name,sizeof (struct test_perf ), -RTE_CACHE_LINE_SIZE , opt->socket_id); + test_perf =rte_zmalloc_numa (test->name,sizeof (struct test_perf ), +RTE_CACHE_LINE_SIZE , opt->numa_id);if (test_perf ==NULL ) {evt_err ("failed to allocate test_perf memory" ); goto nomem;
app/test-eventdev/test_pipeline_common.c +7 -7
@@ -398,7 +398,7 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)for (j =0 ; j < opt->eth_queues; j++) {if (rte_eth_rx_queue_setup ( - i, j,NB_RX_DESC ,rte_socket_id (), &rx_conf, + i, j,NB_RX_DESC ,rte_numa_id (), &rx_conf, opt->per_port_pool ? t->pool[i] : t->pool[0 ]) <0 ) { evt_err("Failed to setup eth port [%d] rx_queue: %d.",
@@ -408,7 +408,7 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) }if (rte_eth_tx_queue_setup (i,0 ,NB_TX_DESC , -rte_socket_id (),NULL ) <0 ) { +rte_numa_id (),NULL ) <0 ) {evt_err ("Failed to setup eth port [%d] tx_queue: %d." , i,0 );return -EINVAL ;
@@ -481,7 +481,7 @@ pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, nb_elem +=evt_nr_active_lcores (opt->wlcores) *32 ; vector_pool =rte_event_vector_pool_create ("vector_pool" , nb_elem,32 , opt->vector_size, - opt->socket_id); + opt->numa_id);if (vector_pool ==NULL ) {evt_err ("failed to create event vector pool" );return -ENOMEM ;
@@ -776,7 +776,7 @@ pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt) name,/* mempool name */ opt->pool_sz,/* number of elements*/ 0 ,/* cache size*/ - 0, opt->mbuf_sz, opt->socket_id); /* flags */ + 0, opt->mbuf_sz, opt->numa_id); /* flags */if (t->pool[i] ==NULL ) {evt_err ("failed to create mempool %s" , name);
@@ -790,7 +790,7 @@ pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt) test->name,/* mempool name */ opt->pool_sz,/* number of elements*/ 0 ,/* cache size*/ - 0, opt->mbuf_sz, opt->socket_id); /* flags */ + 0, opt->mbuf_sz, opt->numa_id); /* flags */if (t->pool[0 ] ==NULL ) {evt_err ("failed to create mempool" );
@@ -821,9 +821,9 @@ pipeline_test_setup(struct evt_test *test, struct evt_options *opt) {void *test_pipeline; - test_pipeline =rte_zmalloc_socket (test->name, + test_pipeline =rte_zmalloc_numa (test->name,sizeof (struct test_pipeline ),RTE_CACHE_LINE_SIZE , - opt->socket_id); + opt->numa_id);if (test_pipeline ==NULL ) {evt_err ("failed to allocate test_pipeline memory" ); goto nomem;
Signature · 1 line
2.55.0
PATCH 178/227 app/test-compress-perf: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- .../comp_perf_test_common.c | 44 +++++++++---------- .../comp_perf_test_cyclecount.c | 6 +-- .../comp_perf_test_throughput.c | 6 +-- .../comp_perf_test_verify.c | 4 +- app/test-compress-perf/main.c | 22 +++++----- 5 files changed, 41 insertions(+), 41 deletions(-)
app/test-compress-perf/comp_perf_test_common.c +22 -22
@@ -121,19 +121,19 @@ static const struct rte_memzone * comp_perf_make_memzone(const char *name, struct cperf_mem_resources *mem, unsigned int number, size_t size) { - unsigned int socket_id = rte_socket_id(); + unsigned int numa_id = rte_numa_id();char mz_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *memzone;snprintf (mz_name,RTE_MEMZONE_NAMESIZE ,"%s_s%u_d%u_q%u_%d" , name, - socket_id, mem->dev_id, mem->qp_id, number); + numa_id, mem->dev_id, mem->qp_id, number); memzone =rte_memzone_lookup (mz_name);if (memzone !=NULL && memzone->len != size) {rte_memzone_free (memzone); memzone =NULL ; }if (memzone ==NULL ) { - memzone =rte_memzone_reserve_aligned (mz_name, size, socket_id, + memzone =rte_memzone_reserve_aligned (mz_name, size, numa_id,RTE_MEMZONE_IOVA_CONTIG ,RTE_CACHE_LINE_SIZE ); if (memzone == NULL) RTE_LOG(ERR, USER1, "Can't allocate memory zone %s\n",
@@ -148,9 +148,9 @@ comp_perf_allocate_external_mbufs(struct comp_test_data *test_data, {uint32_t i; - mem->comp_memzones =rte_zmalloc_socket (NULL , + mem->comp_memzones =rte_zmalloc_numa (NULL , test_data->total_segs *sizeof (struct rte_memzone *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->comp_memzones ==NULL ) { RTE_LOG(ERR, USER1,
@@ -158,9 +158,9 @@ comp_perf_allocate_external_mbufs(struct comp_test_data *test_data,return -1 ; } - mem->decomp_memzones =rte_zmalloc_socket (NULL , + mem->decomp_memzones =rte_zmalloc_numa (NULL , test_data->total_segs *sizeof (struct rte_memzone *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->decomp_memzones ==NULL ) { RTE_LOG(ERR, USER1,
@@ -168,9 +168,9 @@ comp_perf_allocate_external_mbufs(struct comp_test_data *test_data,return -1 ; } - mem->comp_buf_infos =rte_zmalloc_socket (NULL , + mem->comp_buf_infos =rte_zmalloc_numa (NULL , test_data->total_segs *sizeof (struct rte_mbuf_ext_shared_info ), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->comp_buf_infos ==NULL ) { RTE_LOG(ERR, USER1,
@@ -178,9 +178,9 @@ comp_perf_allocate_external_mbufs(struct comp_test_data *test_data,return -1 ; } - mem->decomp_buf_infos =rte_zmalloc_socket (NULL , + mem->decomp_buf_infos =rte_zmalloc_numa (NULL , test_data->total_segs *sizeof (struct rte_mbuf_ext_shared_info ), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->decomp_buf_infos ==NULL ) { RTE_LOG(ERR, USER1,
@@ -272,7 +272,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data, test_data->total_segs,0 ,0 , comp_mbuf_size, - rte_socket_id()); + rte_numa_id());if (mem->comp_buf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Mbuf mempool could not be created\n" );return -1 ;
@@ -284,7 +284,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data, test_data->total_segs,0 ,0 , decomp_mbuf_size, - rte_socket_id()); + rte_numa_id());if (mem->decomp_buf_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Mbuf mempool could not be created\n" );return -1 ;
@@ -299,7 +299,7 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,/* one mempool for both src and dst mbufs */ mem->op_pool =rte_comp_op_pool_create (pool_name, mem->total_bufs *2 , -0 ,0 ,rte_socket_id ()); +0 ,0 ,rte_numa_id ());if (mem->op_pool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Comp op mempool could not be created\n" );return -1 ;
@@ -317,34 +317,34 @@ comp_perf_allocate_memory(struct comp_test_data *test_data, decomp_data_size = output_data_sz; } - mem->compressed_data =rte_zmalloc_socket (NULL , comp_data_size,0 , -rte_socket_id ()); + mem->compressed_data =rte_zmalloc_numa (NULL , comp_data_size,0 , +rte_numa_id ());if (mem->compressed_data ==NULL ) {RTE_LOG (ERR ,USER1 ,"Memory to hold the data from the input " "file could not be allocated\n" );return -1 ; } - mem->decompressed_data =rte_zmalloc_socket (NULL , decomp_data_size,0 , -rte_socket_id ()); + mem->decompressed_data =rte_zmalloc_numa (NULL , decomp_data_size,0 , +rte_numa_id ());if (mem->decompressed_data ==NULL ) {RTE_LOG (ERR ,USER1 ,"Memory to hold the data from the input " "file could not be allocated\n" );return -1 ; } - mem->comp_bufs =rte_zmalloc_socket (NULL , + mem->comp_bufs =rte_zmalloc_numa (NULL , mem->total_bufs *sizeof (struct rte_mbuf *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->comp_bufs ==NULL ) {RTE_LOG (ERR ,USER1 ,"Memory to hold the compression mbufs" " could not be allocated\n" );return -1 ; } - mem->decomp_bufs =rte_zmalloc_socket (NULL , + mem->decomp_bufs =rte_zmalloc_numa (NULL , mem->total_bufs *sizeof (struct rte_mbuf *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (mem->decomp_bufs ==NULL ) {RTE_LOG (ERR ,USER1 ,"Memory to hold the decompression mbufs" " could not be allocated\n" );
app/test-compress-perf/comp_perf_test_cyclecount.c +3 -3
@@ -176,10 +176,10 @@ main_loop(struct cperf_cyclecount_ctx *ctx, enum rte_comp_xform_type type) ctx->ops_deq_retries =0 ;/* one array for both enqueue and dequeue */ - ops =rte_zmalloc_socket (NULL , + ops =rte_zmalloc_numa (NULL , (test_data->burst_sz + mem->total_bufs) *sizeof (struct rte_comp_op *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (ops ==NULL ) { RTE_LOG(ERR, USER1,
@@ -510,7 +510,7 @@ cperf_cyclecount_test_runner(void *test_ctx) ctx->ver.options->driver_name,rte_compressdev_name_get (ctx->ver.mem.dev_id), ctx->ver.mem.dev_id, -rte_compressdev_socket_id (ctx->ver.mem.dev_id), +rte_compressdev_numa_id (ctx->ver.mem.dev_id), ctx->ver.mem.qp_id);/*
app/test-compress-perf/comp_perf_test_throughput.c +3 -3
@@ -68,9 +68,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)return -1 ; } - ops =rte_zmalloc_socket (NULL , + ops =rte_zmalloc_numa (NULL ,2 * mem->total_bufs *sizeof (struct rte_comp_op *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (ops ==NULL ) { RTE_LOG(ERR, USER1,
@@ -357,7 +357,7 @@ cperf_throughput_test_runner(void *test_ctx) ctx->ver.options->driver_name,rte_compressdev_name_get (ctx->ver.mem.dev_id), ctx->ver.mem.dev_id, -rte_compressdev_socket_id (ctx->ver.mem.dev_id), +rte_compressdev_numa_id (ctx->ver.mem.dev_id), ctx->ver.mem.qp_id);/*
app/test-compress-perf/comp_perf_test_verify.c +2 -2
@@ -88,9 +88,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type) } - ops =rte_zmalloc_socket (NULL , + ops =rte_zmalloc_numa (NULL ,2 * mem->total_bufs *sizeof (struct rte_comp_op *), -0 ,rte_socket_id ()); +0 ,rte_numa_id ());if (ops ==NULL ) { RTE_LOG(ERR, USER1,
app/test-compress-perf/main.c +11 -11
@@ -196,7 +196,7 @@ comp_perf_initialize_compressdev(struct comp_test_data *td, cdev_id = enabled_cdevs[i];struct rte_compressdev_info cdev_info; -int socket_id =rte_compressdev_socket_id (cdev_id); +int numa_id =rte_compressdev_numa_id (cdev_id);rte_compressdev_info_get (cdev_id, &cdev_info); if (cdev_info.max_nb_queue_pairs &&
@@ -216,7 +216,7 @@ comp_perf_initialize_compressdev(struct comp_test_data *td,/* Configure compressdev */ struct rte_compressdev_config config = { - .socket_id = socket_id, + .numa_id = numa_id, .nb_queue_pairs = nb_lcores > td->nb_qps ? td->nb_qps : nb_lcores, .max_nb_priv_xforms =NUM_MAX_XFORMS ,
@@ -231,7 +231,7 @@ comp_perf_initialize_compressdev(struct comp_test_data *td,for (j =0 ; j < td->nb_qps; j++) { ret =rte_compressdev_queue_pair_setup (cdev_id, j, -NUM_MAX_INFLIGHT_OPS , socket_id); +NUM_MAX_INFLIGHT_OPS , numa_id);if (ret <0 ) { RTE_LOG(ERR, USER1, "Failed to setup queue pair %u on compressdev %u",
@@ -291,8 +291,8 @@ comp_perf_dump_input_data(struct comp_test_data *td) goto end; } - td->input_data =rte_zmalloc_socket (NULL , - td->input_data_sz,0 ,rte_socket_id ()); + td->input_data =rte_zmalloc_numa (NULL , + td->input_data_sz,0 ,rte_numa_id ());if (td->input_data ==NULL ) { RTE_LOG(ERR, USER1, "Memory to hold the data from the input "
@@ -375,8 +375,8 @@ comp_perf_dump_dictionary_data(struct comp_test_data *td) goto end; } - td->dictionary_data =rte_zmalloc_socket (NULL , - td->dictionary_data_sz,0 ,rte_socket_id ()); + td->dictionary_data =rte_zmalloc_numa (NULL , + td->dictionary_data_sz,0 ,rte_numa_id ());if (td->dictionary_data ==NULL ) { RTE_LOG(ERR, USER1, "Memory to hold the data from the dictionary "
@@ -457,12 +457,12 @@ main(int argc, char **argv) argc -= ret; argv += ret; - test_data =rte_zmalloc_socket (NULL ,sizeof (struct comp_test_data ), -0 ,rte_socket_id ()); + test_data =rte_zmalloc_numa (NULL ,sizeof (struct comp_test_data ), +0 ,rte_numa_id ());if (test_data ==NULL )rte_exit (EXIT_FAILURE ,"Cannot reserve memory in socket %d\n" , -rte_socket_id ()); +rte_numa_id ());comp_perf_register_cleanup_on_signal ();
@@ -510,7 +510,7 @@ main(int argc, char **argv)else test_data->level = test_data->level_lst.list[0 ]; -printf ("\nApp uses socket: %u\n" ,rte_socket_id ()); +printf ("\nApp uses socket: %u\n" ,rte_numa_id ());printf ("Burst size = %u\n" , test_data->burst_sz);printf ("Input data size = %zu\n" , test_data->input_data_sz);if (test_data->test ==CPERF_TEST_TYPE_PMDCC )
Signature · 1 line
2.55.0
PATCH 179/227 app/test-crypto-perf: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-crypto-perf/cperf_test_common.c | 6 +-- app/test-crypto-perf/main.c | 54 ++++++++++++------------ 2 files changed, 30 insertions(+), 30 deletions(-)
app/test-crypto-perf/cperf_test_common.c +3 -3
@@ -155,11 +155,11 @@ cperf_alloc_common_memory(const struct cperf_options *options,if (cperf_is_asym_test (options)) { crypto_op_size +=sizeof (struct rte_crypto_asym_op );snprintf (pool_name,RTE_MEMPOOL_NAMESIZE ,"perf_asym_op_pool%u" , -rte_socket_id ()); +rte_numa_id ()); *pool =rte_crypto_op_pool_create ( pool_name,RTE_CRYPTO_OP_TYPE_ASYMMETRIC , options->pool_sz,RTE_MEMPOOL_CACHE_MAX_SIZE ,0 , -rte_socket_id ()); +rte_numa_id ());if (*pool ==NULL ) { RTE_LOG(ERR, USER1, "Cannot allocate mempool for device %u\n",
@@ -234,7 +234,7 @@ cperf_alloc_common_memory(const struct cperf_options *options, *pool =rte_mempool_create_empty (pool_name, options->pool_sz, obj_size,512 ,0 , -rte_socket_id (),0 ); +rte_numa_id (),0 );if (*pool ==NULL ) { RTE_LOG(ERR, USER1, "Cannot allocate mempool for device %u\n",
app/test-crypto-perf/main.c +27 -27
132 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH 180/227 app/test-bbdev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-bbdev/test_bbdev.c | 26 ++++----- app/test-bbdev/test_bbdev_perf.c | 90 ++++++++++++++++---------------- 2 files changed, 58 insertions(+), 58 deletions(-)
app/test-bbdev/test_bbdev.c +13 -13
@@ -71,7 +71,7 @@ ut_setup(void) num_queues =1 ;TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (null_dev_id, num_queues, -SOCKET_ID_ANY ),"Failed to setup queues for bbdev %u" , +RTE_NUMA_ID_ANY ),"Failed to setup queues for bbdev %u" ,0 );/* Start the device */
@@ -97,7 +97,7 @@ test_bbdev_configure_invalid_dev_id(void)for (dev_id =0 ; dev_id <RTE_BBDEV_MAX_DEVS ; dev_id++) {if (!rte_bbdev_is_valid (dev_id)) {TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id, - num_queues,SOCKET_ID_ANY ), + num_queues,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "invalid dev_num %u" , dev_id); TEST_ASSERT(rte_bbdev_intr_enable(dev_id) == -ENODEV,
@@ -130,12 +130,12 @@ test_bbdev_configure_invalid_num_queues(void)/* Stop the device in case it's started so it can be configured */ rte_bbdev_stop (dev_id); -TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,0 ,SOCKET_ID_ANY ), +TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,0 ,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "invalid num_queues %d" ,0 );TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (dev_id, num_queues, -SOCKET_ID_ANY ), +RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "invalid dev_num %u" , dev_id);
@@ -153,13 +153,13 @@ test_bbdev_configure_invalid_num_queues(void) num_queues = info.drv.max_num_queues;TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (dev_id, num_queues, -SOCKET_ID_ANY ), +RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "invalid num_queues: %u" , num_queues); num_queues++;TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id, num_queues, -SOCKET_ID_ANY ), +RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "invalid num_queues: %u" , num_queues);
@@ -188,7 +188,7 @@ test_bbdev_configure_stop_device(void) "started value: %u", info.started);TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (dev_id, - info.drv.max_num_queues,SOCKET_ID_ANY ), + info.drv.max_num_queues,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "device should be stopped, dev_id: %u" , dev_id);
@@ -213,7 +213,7 @@ test_bbdev_configure_stop_device(void) "started value: %u", info.started);TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id, - info.drv.max_num_queues,SOCKET_ID_ANY ), + info.drv.max_num_queues,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "device should be started, dev_id: %u" , dev_id);
@@ -238,7 +238,7 @@ test_bbdev_configure_stop_device(void) "started value: %u", info.started);TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (dev_id, - info.drv.max_num_queues,SOCKET_ID_ANY ), + info.drv.max_num_queues,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "device should be stopped, dev_id: %u" , dev_id);
@@ -1104,7 +1104,7 @@ test_bbdev_invalid_driver(void)/* Tests for rte_bbdev_setup_queues */ dev2->dev_ops =NULL ; -TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,SOCKET_ID_ANY ), +TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "NULL dev_ops structure " ); dev2->dev_ops = dev1.dev_ops;
@@ -1112,7 +1112,7 @@ test_bbdev_invalid_driver(void) dev_ops_tmp = *dev2->dev_ops; dev_ops_tmp.info_get =NULL ; dev2->dev_ops = &dev_ops_tmp; -TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,SOCKET_ID_ANY ), +TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "NULL info_get " ); dev2->dev_ops = dev1.dev_ops;
@@ -1120,14 +1120,14 @@ test_bbdev_invalid_driver(void) dev_ops_tmp = *dev2->dev_ops; dev_ops_tmp.queue_release =NULL ; dev2->dev_ops = &dev_ops_tmp; -TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,SOCKET_ID_ANY ), +TEST_ASSERT_FAIL (rte_bbdev_setup_queues (dev_id,1 ,RTE_NUMA_ID_ANY ),"Failed test for rte_bbdev_setup_queues: " "NULL queue_release " ); dev2->dev_ops = dev1.dev_ops; dev2->data->numa_id =RTE_NUMA_ID_ANY ;TEST_ASSERT_SUCCESS (rte_bbdev_setup_queues (dev_id,1 , -SOCKET_ID_ANY ),"Failed to configure bbdev %u" , dev_id); +RTE_NUMA_ID_ANY ),"Failed to configure bbdev %u" , dev_id);/* Test for rte_bbdev_queue_configure */ dev2->dev_ops =NULL ;
app/test-bbdev/test_bbdev_perf.c +45 -45
324 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH 181/227 app/test-security-perf: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-security-perf/test_security_perf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
app/test-security-perf/test_security_perf.c +5 -5
@@ -58,7 +58,7 @@ cryptodev_init(struct test_ctx *ctx, uint8_t nb_lcores)struct rte_cryptodev_info dev_info;struct rte_cryptodev_config config;unsigned int j, nb_qp, qps_reqd; -uint8_t socket_id; +uint8_t numa_id;uint32_t dev_cnt;int ret, core_id;void *sec_ctx;
@@ -86,7 +86,7 @@ cryptodev_init(struct test_ctx *ctx, uint8_t nb_lcores) sec_ctx =rte_cryptodev_get_sec_ctx (0 ); ctx->sec_ctx = sec_ctx; - socket_id =rte_socket_id (); + numa_id =rte_numa_id (); qps_reqd = nb_lcores; core_id =0 ; i =0 ;
@@ -108,7 +108,7 @@ cryptodev_init(struct test_ctx *ctx, uint8_t nb_lcores)memset (&config,0 ,sizeof (config)); config.nb_queue_pairs = nb_qp; - config.socket_id = socket_id; + config.numa_id = numa_id; ret =rte_cryptodev_configure (i, &config);if (ret <0 ) {
@@ -123,7 +123,7 @@ cryptodev_init(struct test_ctx *ctx, uint8_t nb_lcores)for (j =0 ; j < nb_qp; j++) { ret =rte_cryptodev_queue_pair_setup (i, j, &qp_conf, - socket_id); + numa_id);if (ret <0 ) {RTE_LOG (ERR ,USER1 , "Could not configure queue pair:"
@@ -178,7 +178,7 @@ mempool_init(struct test_ctx *ctx, uint8_t nb_lcores) sess_mpool =rte_cryptodev_sym_session_pool_create ("test_sess_mp" , nb_sess_total, sec_sess_sz,RTE_MEMPOOL_CACHE_MAX_SIZE , -0 ,SOCKET_ID_ANY ); +0 ,RTE_NUMA_ID_ANY );if (sess_mpool ==NULL ) {RTE_LOG (ERR ,USER1 ,"Could not create mempool\n" );return -1 ;
Signature · 1 line
2.55.0
PATCH 182/227 app/test-regex: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-regex/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
app/test-regex/main.c +3 -3
@@ -425,7 +425,7 @@ run_regex(void *args)0 ,0 , (nb_segs ==1 ) ?MBUF_SIZE : (rte_align32pow2 (job_len + (data_len % nb_jobs)) / nb_segs +RTE_PKTMBUF_HEADROOM ), - rte_socket_id()); + rte_numa_id());if (mbuf_mp ==NULL ) {printf ("Error, can't create memory pool\n" );return -ENOMEM ;
@@ -689,8 +689,8 @@ distribute_qps_to_lcores(uint32_t nb_cores, uint32_t nb_qps,if (detected_lcores >= nb_cores)break ; qps_per_lcore[detected_lcores].lcore_id = lcore_id; - socket =rte_lcore_to_socket_id (lcore_id); -if (socket ==SOCKET_ID_ANY ) + socket =rte_lcore_to_numa_id (lcore_id); +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ; qps_per_lcore[detected_lcores].socket = socket; qps_per_lcore[detected_lcores].qp_id_base = min_qp_id;
Signature · 1 line
2.55.0
PATCH 183/227 app/test-flow-perf: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- app/test-flow-perf/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
app/test-flow-perf/main.c +3 -3
@@ -2088,7 +2088,7 @@ init_port(void) mbuf_mp =rte_pktmbuf_pool_create ("mbuf_pool" , total_mbuf_num, mbuf_cache_size,0 , mbuf_size, -rte_socket_id ()); +rte_numa_id ());if (mbuf_mp ==NULL )rte_exit (EXIT_FAILURE ,"Error: can't init mbuf pool\n" );
@@ -2136,7 +2136,7 @@ init_port(void) rxq_conf = dev_info.default_rxconf;for (std_queue =0 ; std_queue < rx_queues_count; std_queue++) { ret =rte_eth_rx_queue_setup (port_id, std_queue, rxd_count, -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &rxq_conf, mbuf_mp);if (ret <0 )
@@ -2148,7 +2148,7 @@ init_port(void) txq_conf = dev_info.default_txconf;for (std_queue =0 ; std_queue < tx_queues_count; std_queue++) { ret =rte_eth_tx_queue_setup (port_id, std_queue, txd_count, -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE,
Signature · 1 line
2.55.0
PATCH 184/227 examples/bbdev_app: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/bbdev_app/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
examples/bbdev_app/main.c +7 -7
@@ -467,7 +467,7 @@ initialize_ports(struct app_config_params *app_params,for (q =0 ; q < app_params->num_enc_cores; q++) { ret =rte_eth_rx_queue_setup (port_id, q,RX_DESC_DEFAULT , -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id),NULL , ethdev_mbuf_mempool);if (ret <0 ) { printf("rte_eth_rx_queue_setup: err=%d, queue=%u\n",
@@ -479,7 +479,7 @@ initialize_ports(struct app_config_params *app_params,for (q =0 ; q < app_params->num_dec_cores; q++) { ret =rte_eth_tx_queue_setup (port_id, q,TX_DESC_DEFAULT , -rte_eth_dev_socket_id (port_id),NULL ); +rte_eth_dev_numa_id (port_id),NULL );if (ret <0 ) {printf ("rte_eth_tx_queue_setup: err=%d, queue=%u\n" , ret, q);
@@ -1079,10 +1079,10 @@ main(int argc, char **argv)/*create bbdev op pools*/ bbdev_op_pools[RTE_BBDEV_OP_TURBO_DEC ] =rte_bbdev_op_pool_create ("bbdev_op_pool_dec" , -RTE_BBDEV_OP_TURBO_DEC ,NB_MBUF ,128 ,rte_socket_id ()); +RTE_BBDEV_OP_TURBO_DEC ,NB_MBUF ,128 ,rte_numa_id ()); bbdev_op_pools[RTE_BBDEV_OP_TURBO_ENC ] =rte_bbdev_op_pool_create ("bbdev_op_pool_enc" , -RTE_BBDEV_OP_TURBO_ENC ,NB_MBUF ,128 ,rte_socket_id ()); +RTE_BBDEV_OP_TURBO_ENC ,NB_MBUF ,128 ,rte_numa_id ());if ((bbdev_op_pools[RTE_BBDEV_OP_TURBO_DEC ] ==NULL ) || (bbdev_op_pools[RTE_BBDEV_OP_TURBO_ENC ] ==NULL ))
@@ -1094,7 +1094,7 @@ main(int argc, char **argv) flags |=RING_F_SC_DEQ ; enc_to_dec_ring =rte_ring_create ("enc_to_dec_ring" , -rte_align32pow2 (NB_MBUF ),rte_socket_id (), flags); +rte_align32pow2 (NB_MBUF ),rte_numa_id (), flags);/* Get the number of available bbdev devices */ nb_bbdevs =rte_bbdev_count ();
@@ -1112,14 +1112,14 @@ main(int argc, char **argv)/* create the mbuf mempool for ethdev pkts */ ethdev_mbuf_mempool =rte_pktmbuf_pool_create ("ethdev_mbuf_pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (ethdev_mbuf_mempool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create ethdev mbuf mempool\n" );/* create the mbuf mempool for encoder output */ bbdev_mbuf_mempool =rte_pktmbuf_pool_create ("bbdev_mbuf_pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (bbdev_mbuf_mempool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create ethdev mbuf mempool\n" );
Signature · 1 line
2.55.0
PATCH 185/227 examples/bond: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/bond/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
examples/bond/main.c +6 -6
@@ -166,7 +166,7 @@ member_port_init(uint16_t portid) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; retval =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, mbuf_pool);if (retval <0 )
@@ -177,7 +177,7 @@ member_port_init(uint16_t portid) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; retval =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), &txq_conf); +rte_eth_dev_numa_id (portid), &txq_conf);if (retval <0 ) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
@@ -216,7 +216,7 @@ bond_port_init(void)uint16_t wait_counter =20 ; retval =rte_eth_bond_create ("net_bonding0" ,BONDING_MODE_ALB , -0 /*SOCKET_ID_ANY*/ ); +0 /*RTE_NUMA_ID_ANY*/ );if (retval <0 )rte_exit (EXIT_FAILURE ,"Failed to create bond port\n" );
@@ -253,7 +253,7 @@ bond_port_init(void) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; retval =rte_eth_rx_queue_setup (BOND_PORT ,0 , nb_rxd, -rte_eth_dev_socket_id (BOND_PORT ), +rte_eth_dev_numa_id (BOND_PORT ), &rxq_conf, mbuf_pool);if (retval <0 ) rte_exit(retval, " port %u: RX queue 0 setup failed (res=%d)",
@@ -263,7 +263,7 @@ bond_port_init(void) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; retval =rte_eth_tx_queue_setup (BOND_PORT ,0 , nb_txd, -rte_eth_dev_socket_id (BOND_PORT ), &txq_conf); +rte_eth_dev_numa_id (BOND_PORT ), &txq_conf);if (retval <0 ) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)",
@@ -698,7 +698,7 @@ main(int argc, char *argv[])rte_exit (EXIT_FAILURE ,"You can have max 4 ports\n" ); mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NB_MBUF ,32 , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" );
Signature · 1 line
2.55.0
PATCH 186/227 examples/distributor: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/distributor/main.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
examples/distributor/main.c +15 -15
@@ -156,7 +156,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)for (q =0 ; q < rxRings; q++) { retval =rte_eth_rx_queue_setup (port, q, nb_rxd, -rte_eth_dev_socket_id (port), +rte_eth_dev_numa_id (port),NULL , mbuf_pool);if (retval <0 )return retval;
@@ -166,7 +166,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) txconf.offloads = port_conf.txmode.offloads;for (q =0 ; q < txRings; q++) { retval =rte_eth_tx_queue_setup (port, q, nb_txd, -rte_eth_dev_socket_id (port), +rte_eth_dev_numa_id (port), &txconf);if (retval <0 )return retval;
@@ -226,7 +226,7 @@ static int lcore_rx(struct lcore_params *p) {const uint16_t nb_ports =rte_eth_dev_count_avail (); -const int socket_id =rte_socket_id (); +const int numa_id =rte_numa_id ();uint16_t port;struct rte_mbuf *bufs[BURST_SIZE *2 ];
@@ -235,8 +235,8 @@ lcore_rx(struct lcore_params *p)if ((enabled_port_mask & (1 << port)) ==0 )continue ; -if (rte_eth_dev_socket_id (port) >=0 && -rte_eth_dev_socket_id (port) != socket_id) +if (rte_eth_dev_numa_id (port) >=0 && +rte_eth_dev_numa_id (port) != numa_id)printf ("WARNING, port %u is on remote NUMA node to " "RX thread.\n\tPerformance will not " "be optimal.\n" , port);
@@ -295,7 +295,7 @@ lcore_rx_and_distributor(struct lcore_params *p) {struct rte_distributor *d = p->d;const uint16_t nb_ports =rte_eth_dev_count_avail (); -const int socket_id =rte_socket_id (); +const int numa_id =rte_numa_id ();uint16_t port;struct rte_mbuf *bufs[BURST_SIZE *2 ];
@@ -304,8 +304,8 @@ lcore_rx_and_distributor(struct lcore_params *p)if ((enabled_port_mask & (1 << port)) ==0 )continue ; -if (rte_eth_dev_socket_id (port) >0 && -rte_eth_dev_socket_id (port) != socket_id) +if (rte_eth_dev_numa_id (port) >0 && +rte_eth_dev_numa_id (port) != numa_id)printf ("WARNING, port %u is on remote NUMA node to " "RX thread.\n\tPerformance will not " "be optimal.\n" , port);
@@ -465,7 +465,7 @@ static int lcore_tx(struct rte_ring *in_r) {static struct output_buffer tx_buffers[RTE_MAX_ETHPORTS ]; -const int socket_id =rte_socket_id (); +const int numa_id =rte_numa_id ();uint16_t port;RTE_ETH_FOREACH_DEV (port) {
@@ -473,8 +473,8 @@ lcore_tx(struct rte_ring *in_r)if ((enabled_port_mask & (1 << port)) ==0 )continue ; -if (rte_eth_dev_socket_id (port) >=0 && -rte_eth_dev_socket_id (port) != socket_id) +if (rte_eth_dev_numa_id (port) >=0 && +rte_eth_dev_numa_id (port) != numa_id)printf ("WARNING, port %u is on remote NUMA node to " "TX thread.\n\tPerformance will not " "be optimal.\n" , port);
@@ -828,7 +828,7 @@ main(int argc, char *argv[]) mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUFS * nb_ports,MBUF_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" ); nb_ports_available = nb_ports;
@@ -854,7 +854,7 @@ main(int argc, char *argv[]) "All available ports are disabled. Please set portmask.\n"); } - d =rte_distributor_create ("PKT_DIST" ,rte_socket_id (), + d =rte_distributor_create ("PKT_DIST" ,rte_numa_id (), num_workers,RTE_DIST_ALG_BURST );if (d ==NULL )
@@ -865,12 +865,12 @@ main(int argc, char *argv[])* by scheduler core */ dist_tx_ring =rte_ring_create ("Output_ring" ,SCHED_TX_RING_SZ , -rte_socket_id (),RING_F_SC_DEQ |RING_F_SP_ENQ ); +rte_numa_id (),RING_F_SC_DEQ |RING_F_SP_ENQ );if (dist_tx_ring ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create output ring\n" ); rx_dist_ring =rte_ring_create ("Input_ring" ,SCHED_RX_RING_SZ , -rte_socket_id (),RING_F_SC_DEQ |RING_F_SP_ENQ ); +rte_numa_id (),RING_F_SC_DEQ |RING_F_SP_ENQ );if (rx_dist_ring ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create output ring\n" );
Signature · 1 line
2.55.0
PATCH 187/227 examples/dma: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/dma/dmafwd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
examples/dma/dmafwd.c +4 -4
@@ -832,7 +832,7 @@ assign_rings(void)/* Create ring for inter core communication */ cfg.ports[i].rx_to_tx_ring =rte_ring_create ( ring_name, ring_size, -rte_socket_id (),RING_F_SP_ENQ |RING_F_SC_DEQ ); +rte_numa_id (),RING_F_SP_ENQ |RING_F_SC_DEQ );if (cfg.ports[i].rx_to_tx_ring ==NULL ) rte_exit(EXIT_FAILURE, "Ring create failed: %s\n",
@@ -943,7 +943,7 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool) rxq_conf.offloads = local_port_conf.rxmode.offloads;for (i =0 ; i < nb_queues; i++) { ret =rte_eth_rx_queue_setup (portid, i, nb_rxd, -rte_eth_dev_socket_id (portid), &rxq_conf, +rte_eth_dev_numa_id (portid), &rxq_conf, mbuf_pool);if (ret <0 ) rte_exit(EXIT_FAILURE,
@@ -955,7 +955,7 @@ port_init(uint16_t portid, struct rte_mempool *mbuf_pool) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE,
@@ -1047,7 +1047,7 @@ main(int argc, char **argv) sz = max_frame_size +RTE_PKTMBUF_HEADROOM ; sz =RTE_MAX (sz, (size_t )RTE_MBUF_DEFAULT_BUF_SIZE ); dma_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" , nb_mbufs, -MEMPOOL_CACHE_SIZE ,0 , sz,rte_socket_id ()); +MEMPOOL_CACHE_SIZE ,0 , sz,rte_numa_id ());if (dma_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );/* >8 End of allocates mempool to hold the mbufs. */
Signature · 1 line
2.55.0
PATCH 188/227 examples/ethtool: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ethtool/ethtool-app/main.c | 6 +++--- examples/ethtool/lib/rte_ethtool.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
examples/ethtool/ethtool-app/main.c +3 -3
@@ -118,7 +118,7 @@ static void setup_ports(struct app_config *ptr_cfg, int cnt_ports) size_pktpool,PKTPOOL_CACHE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id () +rte_numa_id () );if (ptr_port->pkt_pool ==NULL ) rte_exit(EXIT_FAILURE,
@@ -140,14 +140,14 @@ static void setup_ports(struct app_config *ptr_cfg, int cnt_ports)if (rte_eth_rx_queue_setup ( idx_port,0 , nb_rxd, -rte_eth_dev_socket_id (idx_port),NULL , +rte_eth_dev_numa_id (idx_port),NULL , ptr_port->pkt_pool) <0 )rte_exit (EXIT_FAILURE ,"rte_eth_rx_queue_setup failed" );if (rte_eth_tx_queue_setup ( idx_port,0 , nb_txd, -rte_eth_dev_socket_id (idx_port),NULL ) <0 ) +rte_eth_dev_numa_id (idx_port),NULL ) <0 )rte_exit (EXIT_FAILURE ,"rte_eth_tx_queue_setup failed" );
examples/ethtool/lib/rte_ethtool.c +2 -2
@@ -444,12 +444,12 @@ rte_ethtool_set_ringparam(uint16_t port_id,return stat; stat =rte_eth_tx_queue_setup (port_id,0 , ring_param->tx_pending, -rte_eth_dev_socket_id (port_id),NULL ); +rte_eth_dev_numa_id (port_id),NULL );if (stat !=0 )return stat; stat =rte_eth_rx_queue_setup (port_id,0 , ring_param->rx_pending, -rte_eth_dev_socket_id (port_id),NULL , rx_qinfo.mp); +rte_eth_dev_numa_id (port_id),NULL , rx_qinfo.mp);if (stat !=0 )return stat;
Signature · 1 line
2.55.0
PATCH 189/227 examples/eventdev_pipeline: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/eventdev_pipeline/pipeline_worker_generic.c | 6 +++--- examples/eventdev_pipeline/pipeline_worker_tx.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
examples/eventdev_pipeline/pipeline_worker_generic.c +3 -3
@@ -357,7 +357,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 RX queue per Ethernet port. */ for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, rx_ring_size, -rte_eth_dev_socket_id (port), &rx_conf, +rte_eth_dev_numa_id (port), &rx_conf, mbuf_pool);if (retval <0 )return retval;
@@ -368,7 +368,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 TX queue per Ethernet port. */ for (q =0 ; q < tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, tx_ring_size, -rte_eth_dev_socket_id (port), &txconf); +rte_eth_dev_numa_id (port), &txconf);if (retval <0 )return retval; }
@@ -407,7 +407,7 @@ init_ports(uint16_t num_ports)/* cache_size */ 512 ,/* priv_size*/ 0 ,/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE , - rte_socket_id()); + rte_numa_id());RTE_ETH_FOREACH_DEV (portid) if (port_init(portid, mp) != 0)
examples/eventdev_pipeline/pipeline_worker_tx.c +3 -3
@@ -702,7 +702,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 RX queue per Ethernet port. */ for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, rx_ring_size, -rte_eth_dev_socket_id (port), &rx_conf, +rte_eth_dev_numa_id (port), &rx_conf, mbuf_pool);if (retval <0 )return retval;
@@ -713,7 +713,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 TX queue per Ethernet port. */ for (q =0 ; q < tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, tx_ring_size, -rte_eth_dev_socket_id (port), &txconf); +rte_eth_dev_numa_id (port), &txconf);if (retval <0 )return retval; }
@@ -752,7 +752,7 @@ init_ports(uint16_t num_ports)/* cache_size */ 512 ,/* priv_size*/ 0 ,/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE , - rte_socket_id()); + rte_numa_id());RTE_ETH_FOREACH_DEV (portid) if (port_init(portid, mp) != 0)
Signature · 1 line
2.55.0
PATCH 190/227 examples/fips_validation: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/fips_validation/fips_dev_self_test.c | 10 +++++----- examples/fips_validation/main.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-)
examples/fips_validation/fips_dev_self_test.c +5 -5
@@ -1533,7 +1533,7 @@ fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env)char name[128 ];int ret; - conf.socket_id =rte_cryptodev_socket_id (dev_id); + conf.numa_id =rte_cryptodev_numa_id (dev_id); conf.nb_queue_pairs =1 ; conf.ff_disable =0 ;
@@ -1547,7 +1547,7 @@ fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env)memset (env,0 ,sizeof (*env)); env->mpool =rte_pktmbuf_pool_create (name,128 ,0 ,0 , -UINT16_MAX ,rte_cryptodev_socket_id (dev_id)); +UINT16_MAX ,rte_cryptodev_numa_id (dev_id));if (!env->mpool) { ret = -ENOMEM ; goto error_exit;
@@ -1561,7 +1561,7 @@ fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env)RTE_CRYPTO_OP_TYPE_SYMMETRIC ,16 ,0 ,16 , - rte_socket_id()); + rte_numa_id());if (!env->op_pool) { ret = -ENOMEM ; goto error_exit;
@@ -1571,7 +1571,7 @@ fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env)snprintf (name,128 ,"%s%u" ,"SELF_TEST_SESS_POOL" , dev_id); env->sess_pool =rte_cryptodev_sym_session_pool_create (name, -128 , sess_sz,0 ,0 ,rte_cryptodev_socket_id (dev_id)); +128 , sess_sz,0 ,0 ,rte_cryptodev_numa_id (dev_id));if (!env->sess_pool) { ret = -ENOMEM ; goto error_exit;
@@ -1580,7 +1580,7 @@ fips_dev_auto_test_init(uint8_t dev_id, struct fips_dev_auto_test_env *env) qp_conf.mp_session = env->sess_pool; ret =rte_cryptodev_queue_pair_setup (dev_id,0 , &qp_conf, -rte_cryptodev_socket_id (dev_id)); +rte_cryptodev_numa_id (dev_id));if (ret <0 ) goto error_exit;
examples/fips_validation/main.c +7 -7
@@ -95,7 +95,7 @@ cryptodev_fips_validate_app_sym_init(void) ret = -ENOMEM ; sym->sess_mpool =rte_cryptodev_sym_session_pool_create ( -"FIPS_SYM_SESS_MEMPOOL" ,16 , sess_sz,0 ,0 ,rte_socket_id ()); +"FIPS_SYM_SESS_MEMPOOL" ,16 , sess_sz,0 ,0 ,rte_numa_id ());if (!sym->sess_mpool) goto error_exit;
@@ -104,7 +104,7 @@ cryptodev_fips_validate_app_sym_init(void)RTE_CRYPTO_OP_TYPE_SYMMETRIC ,1 ,0 ,16 , - rte_socket_id()); + rte_numa_id());if (!sym->op_pool) goto error_exit;
@@ -140,7 +140,7 @@ cryptodev_fips_validate_app_asym_init(void) ret = -ENOMEM ; asym->sess_mpool =rte_cryptodev_asym_session_pool_create ( -"FIPS_ASYM_SESS_MEMPOOL" ,16 ,0 ,0 ,rte_socket_id ()); +"FIPS_ASYM_SESS_MEMPOOL" ,16 ,0 ,0 ,rte_numa_id ());if (!asym->sess_mpool) goto error_exit;
@@ -149,7 +149,7 @@ cryptodev_fips_validate_app_asym_init(void)RTE_CRYPTO_OP_TYPE_ASYMMETRIC ,1 ,0 ,16 , - rte_socket_id()); + rte_numa_id());if (!asym->op_pool) goto error_exit;
@@ -179,7 +179,7 @@ cryptodev_fips_validate_app_asym_uninit(void)static int cryptodev_fips_validate_app_init (void ) { -struct rte_cryptodev_config conf = {rte_socket_id (),1 ,0 }; +struct rte_cryptodev_config conf = {rte_numa_id (),1 ,0 };struct rte_cryptodev_qp_conf qp_conf = {128 ,NULL };uint32_t nb_mbufs =UINT16_MAX / env.mbuf_data_room +1 ;int ret;
@@ -201,7 +201,7 @@ cryptodev_fips_validate_app_init(void) ret = -ENOMEM ; env.mpool =rte_pktmbuf_pool_create ("FIPS_MEMPOOL" , nb_mbufs,0 ,0 ,sizeof (struct rte_mbuf ) +RTE_PKTMBUF_HEADROOM + - env.mbuf_data_room,rte_socket_id ()); + env.mbuf_data_room,rte_numa_id ());if (!env.mpool)return ret;
@@ -218,7 +218,7 @@ cryptodev_fips_validate_app_init(void) qp_conf.mp_session = env.sym.sess_mpool; ret =rte_cryptodev_queue_pair_setup (env.dev_id,0 , &qp_conf, -rte_socket_id ()); +rte_numa_id ());if (ret <0 ) goto error_exit;
Signature · 1 line
2.55.0
PATCH 191/227 examples/flow_filtering: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/flow_filtering/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/flow_filtering/main.c +3 -3
@@ -191,7 +191,7 @@ init_port(void)/* Configuring number of RX and TX queues connected to single port. */ for (i =0 ; i <NR_QUEUES ; i++) { ret =rte_eth_rx_queue_setup (port_id, i,512 , -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &rxq_conf, mbuf_pool);if (ret <0 ) {
@@ -206,7 +206,7 @@ init_port(void)for (i =0 ; i <NR_QUEUES ; i++) { ret =rte_eth_tx_queue_setup (port_id, i,512 , -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &txq_conf);if (ret <0 ) { rte_exit(EXIT_FAILURE,
@@ -334,7 +334,7 @@ main(int argc, char **argv)/* Allocates a mempool to hold the mbufs. 8< */ mbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" ,4096 ,128 ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());/* >8 End of allocating a mempool to hold the mbufs. */ if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );
Signature · 1 line
2.55.0
PATCH 192/227 examples/ip_fragmentation: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ip_fragmentation/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
examples/ip_fragmentation/main.c +5 -5
@@ -788,9 +788,9 @@ init_mem(void)if (rte_lcore_is_enabled (lcore_id) ==0 )continue ; - socket =rte_lcore_to_socket_id (lcore_id); + socket =rte_lcore_to_numa_id (lcore_id); -if (socket ==SOCKET_ID_ANY ) +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ;if (socket_direct_pool[socket] ==NULL ) {
@@ -928,8 +928,8 @@ main(int argc, char **argv) qconf = &lcore_queue_conf[rx_lcore_id]; } - socket = (int )rte_lcore_to_socket_id (rx_lcore_id); -if (socket ==SOCKET_ID_ANY ) + socket = (int )rte_lcore_to_numa_id (rx_lcore_id); +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ; rxq = &qconf->rx_queue_list[qconf->n_rx_queue];
@@ -1011,7 +1011,7 @@ main(int argc, char **argv)if (queueid >= dev_info.nb_tx_queues)break ; - socket = (int )rte_lcore_to_socket_id (lcore_id); + socket = (int )rte_lcore_to_numa_id (lcore_id);printf ("txq=%u,%d " , lcore_id, queueid);fflush (stdout);
Signature · 1 line
2.55.0
PATCH 193/227 examples/ip_reassembly: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ip_reassembly/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
examples/ip_reassembly/main.c +9 -9
@@ -827,8 +827,8 @@ setup_port_tbl(struct lcore_queue_conf *qconf, uint32_t lcore, int socket, n =RTE_MAX (max_flow_num,2UL *MAX_PKT_BURST ); sz =sizeof (*mtb) +sizeof (mtb->m_table[0 ]) * n; -if ((mtb =rte_zmalloc_socket (__func__, sz,RTE_CACHE_LINE_SIZE , - socket)) ==NULL ) { + mtb =rte_zmalloc_numa (__func__, sz,RTE_CACHE_LINE_SIZE , socket); +if (mtb ==NULL ) {RTE_LOG (ERR ,IP_RSMBL ,"%s() for lcore: %u, port: %u " "failed to allocate %zu bytes\n" , __func__, lcore, port, sz);
@@ -849,8 +849,8 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)uint64_t frag_cycles;char buf[RTE_MEMPOOL_NAMESIZE ]; - socket =rte_lcore_to_socket_id (lcore); -if (socket ==SOCKET_ID_ANY ) + socket =rte_lcore_to_numa_id (lcore); +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ;/* Each table entry holds information about packet fragmentation. 8< */
@@ -920,9 +920,9 @@ init_mem(void)if (rte_lcore_is_enabled (lcore_id) ==0 )continue ; - socket =rte_lcore_to_socket_id (lcore_id); + socket =rte_lcore_to_numa_id (lcore_id); -if (socket ==SOCKET_ID_ANY ) +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ;if (socket_lpm[socket] ==NULL ) {
@@ -1070,8 +1070,8 @@ main(int argc, char **argv) qconf = &lcore_queue_conf[rx_lcore_id]; } - socket =rte_lcore_to_socket_id (portid); -if (socket ==SOCKET_ID_ANY ) + socket =rte_lcore_to_numa_id (portid); +if (socket ==RTE_NUMA_ID_ANY ) socket =0 ; queueid = qconf->n_rx_queue;
@@ -1152,7 +1152,7 @@ main(int argc, char **argv)if (rte_lcore_is_enabled (lcore_id) ==0 )continue ; - socket = (int )rte_lcore_to_socket_id (lcore_id); + socket = (int )rte_lcore_to_numa_id (lcore_id);printf ("txq=%u,%d,%d " , lcore_id, queueid, socket);fflush (stdout);
Signature · 1 line
2.55.0
PATCH 194/227 examples/ipsec-secgw: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ipsec-secgw/event_helper.c | 14 +-- examples/ipsec-secgw/ipsec-secgw.c | 132 ++++++++++++++-------------- examples/ipsec-secgw/ipsec.h | 8 +- examples/ipsec-secgw/ipsec_worker.c | 56 ++++++------ examples/ipsec-secgw/rt.c | 22 ++--- examples/ipsec-secgw/sa.c | 30 +++---- examples/ipsec-secgw/sad.c | 12 +-- examples/ipsec-secgw/sad.h | 2 +- examples/ipsec-secgw/sp4.c | 12 +-- examples/ipsec-secgw/sp6.c | 12 +-- 10 files changed, 150 insertions(+), 150 deletions(-)
examples/ipsec-secgw/event_helper.c +7 -7
@@ -806,7 +806,7 @@ eh_initialize_crypto_adapter(struct eventmode_conf *em_conf)const uint8_t nb_qp_per_cdev =1 ;uint8_t eventdev_id, cdev_id, n;uint32_t cap, nb_elem; -int ret, socket_id; +int ret, numa_id;if (!em_conf->enable_event_crypto_adapter)return 0 ;
@@ -874,12 +874,12 @@ eh_initialize_crypto_adapter(struct eventmode_conf *em_conf)*/ nb_elem = (qp_desc_nb / queue_conf.vector_sz) +1 ; nb_elem *= nb_qp_per_cdev; - socket_id =rte_cryptodev_socket_id (cdev_id); + numa_id =rte_cryptodev_numa_id (cdev_id);snprintf (mp_name,RTE_MEMPOOL_NAMESIZE , -"QP_VEC_%u_%u" , socket_id, cdev_id); +"QP_VEC_%u_%u" , numa_id, cdev_id); queue_conf.vector_mp =rte_event_vector_pool_create ( mp_name, nb_elem,0 , - queue_conf.vector_sz, socket_id); + queue_conf.vector_sz, numa_id);if (queue_conf.vector_mp ==NULL ) {EH_LOG_ERR ("failed to create event vector pool" );return -ENOMEM ;
@@ -990,7 +990,7 @@ eh_rx_adapter_configure(struct eventmode_conf *em_conf,struct rte_event_dev_info evdev_default_conf = {0 };struct rte_event_port_conf port_conf = {0 };struct rx_adapter_connection_info *conn; -uint32_t service_id, socket_id, nb_elem; +uint32_t service_id, numa_id, nb_elem;struct rte_mempool *vector_pool =NULL ;uint32_t lcore_id =rte_lcore_id ();int ret, portid, nb_ports =0 ;
@@ -1012,7 +1012,7 @@ eh_rx_adapter_configure(struct eventmode_conf *em_conf, nb_ports++;if (em_conf->ext_params.event_vector) { - socket_id =rte_lcore_to_socket_id (lcore_id); + numa_id =rte_lcore_to_numa_id (lcore_id);if (em_conf->vector_pool_sz) { nb_elem = em_conf->vector_pool_sz;
@@ -1026,7 +1026,7 @@ eh_rx_adapter_configure(struct eventmode_conf *em_conf, nb_elem +=rte_lcore_count () *32 ; vector_pool =rte_event_vector_pool_create ("vector_pool" , nb_elem,32 , - em_conf->ext_params.vector_size, socket_id); + em_conf->ext_params.vector_size, numa_id);if (vector_pool ==NULL ) {EH_LOG_ERR ("failed to create event vector pool" );return -ENOMEM ;
examples/ipsec-secgw/ipsec-secgw.c +66 -66
319 lines not on this page · raw message
examples/ipsec-secgw/ipsec.h +4 -4
@@ -412,10 +412,10 @@ outbound_sa_lookup(struct sa_ctx *sa_ctx, uint32_t sa_idx[], void *sa[], uint16_t nb_pkts);void -sp4_init (struct socket_ctx *ctx,int32_t socket_id); +sp4_init (struct socket_ctx *ctx,int32_t numa_id);void -sp6_init (struct socket_ctx *ctx,int32_t socket_id); +sp6_init (struct socket_ctx *ctx,int32_t numa_id);/* * Search through SP rules for given SPI.
@@ -438,11 +438,11 @@ int sa_spi_present(struct sa_ctx *sa_ctx, uint32_t spi, int inbound);void -sa_init (struct socket_ctx *ctx,int32_t socket_id, +sa_init (struct socket_ctx *ctx,int32_t numa_id,const struct eventmode_conf *em_conf);void -rt_init (struct socket_ctx *ctx,int32_t socket_id); +rt_init (struct socket_ctx *ctx,int32_t numa_id); int sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads,
examples/ipsec-secgw/ipsec_worker.c +28 -28
125 lines not on this page · raw message
examples/ipsec-secgw/rt.c +11 -11
@@ -122,7 +122,7 @@ parse_rt_tokens(char **tokens, uint32_t n_tokens, }void -rt_init (struct socket_ctx *ctx,int32_t socket_id) +rt_init (struct socket_ctx *ctx,int32_t numa_id) {char name[PATH_MAX ];uint32_t i;
@@ -138,11 +138,11 @@ rt_init(struct socket_ctx *ctx, int32_t socket_id)if (ctx->rt_ip4 !=NULL )rte_exit (EXIT_FAILURE ,"IPv4 Routing Table for socket %u " -"already initialized\n" , socket_id); +"already initialized\n" , numa_id);if (ctx->rt_ip6 !=NULL )rte_exit (EXIT_FAILURE ,"IPv6 Routing Table for socket %u " -"already initialized\n" , socket_id); +"already initialized\n" , numa_id);if (nb_rt_ip4 ==0 && nb_rt_ip6 ==0 )RTE_LOG (WARNING ,IPSEC ,"No Routing rule specified\n" );
@@ -151,13 +151,13 @@ rt_init(struct socket_ctx *ctx, int32_t socket_id) RT_IPV4_MAX_RULES);/* create the LPM table */ -snprintf (name,sizeof (name),"%s_%u" ,"rt_ip4" , socket_id); +snprintf (name,sizeof (name),"%s_%u" ,"rt_ip4" , numa_id); conf.max_rules =RT_IPV4_MAX_RULES ; conf.number_tbl8s =RTE_LPM_TBL8_NUM_ENTRIES ; - lpm =rte_lpm_create (name, socket_id, &conf); + lpm =rte_lpm_create (name, numa_id, &conf);if (lpm ==NULL )rte_exit (EXIT_FAILURE ,"Unable to create %s LPM table " -"on socket %d\n" , name, socket_id); +"on socket %d\n" , name, numa_id);/* populate the LPM table */ for (i =0 ; i < nb_rt_ip4; i++) {
@@ -165,7 +165,7 @@ rt_init(struct socket_ctx *ctx, int32_t socket_id) rt_ip4[i].if_out);if (ret <0 )rte_exit (EXIT_FAILURE ,"Fail to add entry num %u to %s " -"LPM table on socket %d\n" , i, name, socket_id); +"LPM table on socket %d\n" , i, name, numa_id);uint32_t_to_char (rt_ip4[i].ip, &a, &b, &c, &d); printf("LPM: Adding route %hhu.%hhu.%hhu.%hhu/%hhu (%hhu)\n",
@@ -173,13 +173,13 @@ rt_init(struct socket_ctx *ctx, int32_t socket_id) rt_ip4[i].if_out); } -snprintf (name,sizeof (name),"%s_%u" ,"rt_ip6" , socket_id); +snprintf (name,sizeof (name),"%s_%u" ,"rt_ip6" , numa_id); conf6.max_rules =RT_IPV6_MAX_RULES ; conf6.number_tbl8s =RTE_LPM_TBL8_NUM_ENTRIES ; - lpm6 =rte_lpm6_create (name, socket_id, &conf6); + lpm6 =rte_lpm6_create (name, numa_id, &conf6);if (lpm6 ==NULL )rte_exit (EXIT_FAILURE ,"Unable to create %s LPM table " -"on socket %d\n" , name, socket_id); +"on socket %d\n" , name, numa_id);/* populate the LPM table */ for (i =0 ; i < nb_rt_ip6; i++) {
@@ -187,7 +187,7 @@ rt_init(struct socket_ctx *ctx, int32_t socket_id) rt_ip6[i].if_out);if (ret <0 )rte_exit (EXIT_FAILURE ,"Fail to add entry num %u to %s " -"LPM table on socket %d\n" , i, name, socket_id); +"LPM table on socket %d\n" , i, name, numa_id); printf("LPM6: Adding route " " %hx:%hx:%hx:%hx:%hx:%hx:%hx:%hx/%hhx (%hhx)\n",
examples/ipsec-secgw/sa.c +15 -15
@@ -1077,21 +1077,21 @@ print_one_sa_rule(const struct ipsec_sa *sa, int inbound) }static struct sa_ctx * -sa_create (const char *name,int32_t socket_id,uint32_t nb_sa) +sa_create (const char *name,int32_t numa_id,uint32_t nb_sa) {char s[PATH_MAX ];struct sa_ctx *sa_ctx;uint32_t mz_size;const struct rte_memzone *mz; -snprintf (s,sizeof (s),"%s_%u" , name, socket_id); +snprintf (s,sizeof (s),"%s_%u" , name, numa_id);/* Create SA context */ printf ("Creating SA context with %u maximum entries on socket %d\n" , - nb_sa, socket_id); + nb_sa, numa_id); mz_size =sizeof (struct ipsec_xf ) * nb_sa; - mz =rte_memzone_reserve (s, mz_size, socket_id, + mz =rte_memzone_reserve (s, mz_size, numa_id,RTE_MEMZONE_1GB |RTE_MEMZONE_SIZE_HINT_ONLY );if (mz ==NULL ) {printf ("Failed to allocate SA XFORM memory\n" );
@@ -1637,7 +1637,7 @@ ipsec_satbl_init(struct sa_ctx *ctx, uint32_t nb_ent, int32_t socket, tsz = sz * nb_ent; - ctx->satbl =rte_zmalloc_socket (NULL , tsz,RTE_CACHE_LINE_SIZE , socket); + ctx->satbl =rte_zmalloc_numa (NULL , tsz,RTE_CACHE_LINE_SIZE , socket);if (ctx->satbl ==NULL ) { RTE_LOG(ERR, IPSEC, "%s(%p, %u, %d): failed to allocate %zu bytes\n",
@@ -1695,7 +1695,7 @@ sa_spi_present(struct sa_ctx *sa_ctx, uint32_t spi, int inbound) }void -sa_init (struct socket_ctx *ctx,int32_t socket_id, +sa_init (struct socket_ctx *ctx,int32_t numa_id,const struct eventmode_conf *em_conf) {int32_t rc;
@@ -1708,21 +1708,21 @@ sa_init(struct socket_ctx *ctx, int32_t socket_id,if (ctx->sa_in !=NULL )rte_exit (EXIT_FAILURE ,"Inbound SA DB for socket %u already " -"initialized\n" , socket_id); +"initialized\n" , numa_id);if (ctx->sa_out !=NULL )rte_exit (EXIT_FAILURE ,"Outbound SA DB for socket %u already " -"initialized\n" , socket_id); +"initialized\n" , numa_id);if (nb_sa_in >0 ) { name ="sa_in" ; - ctx->sa_in =sa_create (name, socket_id, nb_sa_in); + ctx->sa_in =sa_create (name, numa_id, nb_sa_in);if (ctx->sa_in ==NULL )rte_exit (EXIT_FAILURE ,"Error [%d] creating SA " "context %s in socket %d\n" , rte_errno, - name, socket_id); + name, numa_id); - rc =ipsec_sad_create (name, &ctx->sa_in->sad, socket_id, + rc =ipsec_sad_create (name, &ctx->sa_in->sad, numa_id, &sa_in_cnt);if (rc !=0 )rte_exit (EXIT_FAILURE ,"failed to init SAD\n" );
@@ -1732,7 +1732,7 @@ sa_init(struct socket_ctx *ctx, int32_t socket_id,if (app_sa_prm.enable !=0 ) { rc =ipsec_satbl_init (ctx->sa_in, nb_sa_in, - socket_id, ctx, ipsec_ctx, em_conf); + numa_id, ctx, ipsec_ctx, em_conf);if (rc !=0 )rte_exit (EXIT_FAILURE ,"failed to init inbound SAs\n" );
@@ -1742,11 +1742,11 @@ sa_init(struct socket_ctx *ctx, int32_t socket_id,if (nb_sa_out >0 ) { name ="sa_out" ; - ctx->sa_out =sa_create (name, socket_id, nb_sa_out); + ctx->sa_out =sa_create (name, numa_id, nb_sa_out);if (ctx->sa_out ==NULL )rte_exit (EXIT_FAILURE ,"Error [%d] creating SA " "context %s in socket %d\n" , rte_errno, - name, socket_id); + name, numa_id);RTE_LCORE_FOREACH (lcore_id) ipsec_ctx[lcore_id] = &lcore_conf[lcore_id].outbound;
@@ -1754,7 +1754,7 @@ sa_init(struct socket_ctx *ctx, int32_t socket_id,if (app_sa_prm.enable !=0 ) { rc =ipsec_satbl_init (ctx->sa_out, nb_sa_out, - socket_id, ctx, ipsec_ctx, em_conf); + numa_id, ctx, ipsec_ctx, em_conf);if (rc !=0 )rte_exit (EXIT_FAILURE ,"failed to init outbound SAs\n" );
examples/ipsec-secgw/sad.c +6 -6
@@ -89,13 +89,13 @@ ipsec_sad_lcore_cache_init(uint32_t nb_cache_ent) cache_mem_sz =sizeof (struct ipsec_sa *) * cache_elem;if (cache_mem_sz !=0 ) { - cache->v4 =rte_zmalloc_socket (NULL , cache_mem_sz, -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); + cache->v4 =rte_zmalloc_numa (NULL , cache_mem_sz, +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (cache->v4 ==NULL )return -rte_errno; - cache->v6 =rte_zmalloc_socket (NULL , cache_mem_sz, -RTE_CACHE_LINE_SIZE ,rte_socket_id ()); + cache->v6 =rte_zmalloc_numa (NULL , cache_mem_sz, +RTE_CACHE_LINE_SIZE ,rte_numa_id ());if (cache->v6 ==NULL )return -rte_errno;
@@ -107,7 +107,7 @@ ipsec_sad_lcore_cache_init(uint32_t nb_cache_ent)int ipsec_sad_create (const char *name,struct ipsec_sad *sad, -int socket_id,struct ipsec_sa_cnt *sa_cnt) +int numa_id,struct ipsec_sa_cnt *sa_cnt) {int ret;struct rte_ipsec_sad_conf sad_conf;
@@ -120,7 +120,7 @@ ipsec_sad_create(const char *name, struct ipsec_sad *sad,if (ret <0 || ret >=RTE_IPSEC_SAD_NAMESIZE )return -ENAMETOOLONG ; - sad_conf.socket_id = socket_id; + sad_conf.numa_id = numa_id; sad_conf.flags =0 ;/* Make SAD have extra 25% of required number of entries */ sad_conf.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] = sa_cnt->nb_v4 *5 /4 ;
examples/ipsec-secgw/sad.h +1 -1
@@ -22,7 +22,7 @@ struct ipsec_sad_cache { RTE_DECLARE_PER_LCORE(struct ipsec_sad_cache, sad_cache);int ipsec_sad_create (const char *name,struct ipsec_sad *sad, -int socket_id,struct ipsec_sa_cnt *sa_cnt); +int numa_id,struct ipsec_sa_cnt *sa_cnt);int ipsec_sad_add (struct ipsec_sad *sad,struct ipsec_sa *sa);
examples/ipsec-secgw/sp4.c +6 -6
@@ -488,7 +488,7 @@ acl4_init(const char *name, int32_t socketid, const struct acl4_rules *rules,dump_ip4_rules (rules, rules_nb,1 ); acl_param.name = s; - acl_param.socket_id = socketid; + acl_param.numa_id = socketid; acl_param.rule_size =RTE_ACL_RULE_SZ (RTE_DIM (ip4_defs)); acl_param.max_rule_num = rules_nb;
@@ -552,7 +552,7 @@ check_spi_value(struct sa_ctx *sa_ctx, int inbound) }void -sp4_init (struct socket_ctx *ctx,int32_t socket_id) +sp4_init (struct socket_ctx *ctx,int32_t numa_id) {const char *name;
@@ -561,11 +561,11 @@ sp4_init(struct socket_ctx *ctx, int32_t socket_id)if (ctx->sp_ip4_in !=NULL )rte_exit (EXIT_FAILURE ,"Inbound SP DB for socket %u already " -"initialized\n" , socket_id); +"initialized\n" , numa_id);if (ctx->sp_ip4_out !=NULL )rte_exit (EXIT_FAILURE ,"Outbound SP DB for socket %u already " -"initialized\n" , socket_id); +"initialized\n" , numa_id);if (check_spi_value (ctx->sa_in,1 ) <0 ) rte_exit(EXIT_FAILURE,
@@ -578,7 +578,7 @@ sp4_init(struct socket_ctx *ctx, int32_t socket_id)if (nb_acl4_rules_in >0 ) { name ="sp_ip4_in" ; ctx->sp_ip4_in = (struct sp_ctx *)acl4_init (name, - socket_id, acl4_rules_in, nb_acl4_rules_in); + numa_id, acl4_rules_in, nb_acl4_rules_in); }else RTE_LOG (WARNING ,IPSEC ,"No IPv4 SP Inbound rule " "specified\n" );
@@ -586,7 +586,7 @@ sp4_init(struct socket_ctx *ctx, int32_t socket_id)if (nb_acl4_rules_out >0 ) { name ="sp_ip4_out" ; ctx->sp_ip4_out = (struct sp_ctx *)acl4_init (name, - socket_id, acl4_rules_out, nb_acl4_rules_out); + numa_id, acl4_rules_out, nb_acl4_rules_out); }else RTE_LOG (WARNING ,IPSEC ,"No IPv4 SP Outbound rule " "specified\n" );
examples/ipsec-secgw/sp6.c +6 -6
@@ -633,7 +633,7 @@ acl6_init(const char *name, int32_t socketid, const struct acl6_rules *rules,dump_ip6_rules (rules, rules_nb,1 ); acl_param.name = s; - acl_param.socket_id = socketid; + acl_param.numa_id = socketid; acl_param.rule_size =RTE_ACL_RULE_SZ (RTE_DIM (ip6_defs)); acl_param.max_rule_num = rules_nb;
@@ -697,7 +697,7 @@ check_spi_value(struct sa_ctx *sa_ctx, int inbound) }void -sp6_init (struct socket_ctx *ctx,int32_t socket_id) +sp6_init (struct socket_ctx *ctx,int32_t numa_id) {const char *name;
@@ -706,11 +706,11 @@ sp6_init(struct socket_ctx *ctx, int32_t socket_id)if (ctx->sp_ip6_in !=NULL )rte_exit (EXIT_FAILURE ,"Inbound IPv6 SP DB for socket %u " -"already initialized\n" , socket_id); +"already initialized\n" , numa_id);if (ctx->sp_ip6_out !=NULL )rte_exit (EXIT_FAILURE ,"Outbound IPv6 SP DB for socket %u " -"already initialized\n" , socket_id); +"already initialized\n" , numa_id);if (check_spi_value (ctx->sa_in,1 ) <0 ) rte_exit(EXIT_FAILURE,
@@ -723,7 +723,7 @@ sp6_init(struct socket_ctx *ctx, int32_t socket_id)if (nb_acl6_rules_in >0 ) { name ="sp_ip6_in" ; ctx->sp_ip6_in = (struct sp_ctx *)acl6_init (name, - socket_id, acl6_rules_in, nb_acl6_rules_in); + numa_id, acl6_rules_in, nb_acl6_rules_in); }else RTE_LOG (WARNING ,IPSEC ,"No IPv6 SP Inbound rule " "specified\n" );
@@ -731,7 +731,7 @@ sp6_init(struct socket_ctx *ctx, int32_t socket_id)if (nb_acl6_rules_out >0 ) { name ="sp_ip6_out" ; ctx->sp_ip6_out = (struct sp_ctx *)acl6_init (name, - socket_id, acl6_rules_out, nb_acl6_rules_out); + numa_id, acl6_rules_out, nb_acl6_rules_out); }else RTE_LOG (WARNING ,IPSEC ,"No IPv6 SP Outbound rule " "specified\n" );
Signature · 1 line
2.55.0
PATCH 195/227 examples/ipv4_multicast: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ipv4_multicast/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
examples/ipv4_multicast/main.c +7 -7
@@ -124,7 +124,7 @@ static struct rte_fbk_hash_params mcast_hash_params = { .name = "MCAST_HASH", .entries = 1024, .entries_per_bucket = 4, - .socket_id = 0, + .numa_id = 0, .hash_func = NULL, .init_val = 0, };
@@ -560,7 +560,7 @@ init_mcast_hash(void) {uint32_t i; - mcast_hash_params.socket_id =rte_socket_id (); + mcast_hash_params.numa_id =rte_numa_id (); mcast_hash =rte_fbk_hash_create (&mcast_hash_params);if (mcast_hash ==NULL ){return -1 ;
@@ -665,19 +665,19 @@ main(int argc, char **argv)/* Create the mbuf pools. 8< */ packet_pool =rte_pktmbuf_pool_create ("packet_pool" ,NB_PKT_MBUF ,32 , -0 ,PKT_MBUF_DATA_SIZE ,rte_socket_id ()); +0 ,PKT_MBUF_DATA_SIZE ,rte_numa_id ());if (packet_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init packet mbuf pool\n" ); header_pool =rte_pktmbuf_pool_create ("header_pool" ,NB_HDR_MBUF ,32 , -0 ,HDR_MBUF_DATA_SIZE ,rte_socket_id ()); +0 ,HDR_MBUF_DATA_SIZE ,rte_numa_id ());if (header_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init header mbuf pool\n" ); clone_pool =rte_pktmbuf_pool_create ("clone_pool" ,NB_CLONE_MBUF ,32 , -0 ,0 ,rte_socket_id ()); +0 ,0 ,rte_numa_id ());if (clone_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init clone mbuf pool\n" );
@@ -764,7 +764,7 @@ main(int argc, char **argv) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; ret =rte_eth_rx_queue_setup (portid, queueid, nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, packet_pool);if (ret <0 )
@@ -783,7 +783,7 @@ main(int argc, char **argv) txconf = &dev_info.default_txconf; txconf->offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid, queueid, nb_txd, -rte_lcore_to_socket_id (lcore_id), txconf); +rte_lcore_to_numa_id (lcore_id), txconf);if (ret <0 )rte_exit (EXIT_FAILURE ,"rte_eth_tx_queue_setup: err=%d, " "port=%d\n" , ret, portid);
Signature · 1 line
2.55.0
PATCH 196/227 examples/l2fwd: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
examples/l2fwd/main.c +5 -5
@@ -766,7 +766,7 @@ main(int argc, char **argv)/* Create the mbuf pool. 8< */ l2fwd_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" , nb_mbufs,MEMPOOL_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (l2fwd_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );/* >8 End of create the mbuf pool. */
@@ -825,7 +825,7 @@ main(int argc, char **argv) rxq_conf.offloads = local_port_conf.rxmode.offloads;/* RX queue setup. 8< */ ret =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, l2fwd_pktmbuf_pool);if (ret <0 )
@@ -838,7 +838,7 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
@@ -846,9 +846,9 @@ main(int argc, char **argv)/* >8 End of init one TX queue on each port. */ /* Initialize TX buffers */ - tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , portid);
Signature · 1 line
2.55.0
PATCH 197/227 examples/l2fwd-cat: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-cat/l2fwd-cat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
examples/l2fwd-cat/l2fwd-cat.c +6 -6
@@ -52,7 +52,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 RX queue per Ethernet port. */ for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, nb_rxd, -rte_eth_dev_socket_id (port),NULL , mbuf_pool); +rte_eth_dev_numa_id (port),NULL , mbuf_pool);if (retval <0 )return retval; }
@@ -60,7 +60,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)/* Allocate and set up 1 TX queue per Ethernet port. */ for (q =0 ; q < tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, nb_txd, -rte_eth_dev_socket_id (port),NULL ); +rte_eth_dev_numa_id (port),NULL );if (retval <0 )return retval; }
@@ -102,9 +102,9 @@ lcore_main(void)* for best performance. */ RTE_ETH_FOREACH_DEV(port) - if (rte_eth_dev_socket_id(port) >= 0 && - rte_eth_dev_socket_id(port) != - (int)rte_socket_id()) + if (rte_eth_dev_numa_id(port) >= 0 && + rte_eth_dev_numa_id(port) != + (int)rte_numa_id()) printf("WARNING, port %u is on remote NUMA node to ""polling thread.\n\tPerformance will " "not be optimal.\n", port);
@@ -183,7 +183,7 @@ main(int argc, char *argv[])/* Creates a new mempool in memory to hold the mbufs. */ mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUFS * nb_ports, -MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" );
Signature · 1 line
2.55.0
PATCH 198/227 examples/l2fwd-crypto: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-crypto/main.c | 38 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-)
examples/l2fwd-crypto/main.c +19 -19
@@ -672,12 +672,12 @@ static void * initialize_crypto_session(struct l2fwd_crypto_options *options, uint8_t cdev_id) {struct rte_crypto_sym_xform *first_xform; -int retval =rte_cryptodev_socket_id (cdev_id); +int retval =rte_cryptodev_numa_id (cdev_id);if (retval <0 )return NULL ; -uint8_t socket_id = (uint8_t ) retval; +uint8_t numa_id = (uint8_t ) retval;if (options->xform_chain ==L2FWD_CRYPTO_AEAD ) { first_xform = &options->aead_xform;
@@ -694,7 +694,7 @@ initialize_crypto_session(struct l2fwd_crypto_options *options, uint8_t cdev_id) }return rte_cryptodev_sym_session_create (cdev_id, first_xform, - session_pool_socket[socket_id].sess_mp); + session_pool_socket[numa_id].sess_mp); }/* >8 End of creation of session. */
@@ -2350,18 +2350,18 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports,if (check_capabilities (options, cdev_id) <0 )continue ; - retval =rte_cryptodev_socket_id (cdev_id); + retval =rte_cryptodev_numa_id (cdev_id);if (retval <0 ) {printf ("Invalid crypto device id used\n" );return -1 ; } -uint8_t socket_id = (uint8_t ) retval; +uint8_t numa_id = (uint8_t ) retval;struct rte_cryptodev_config conf = { .nb_queue_pairs =1 , - .socket_id = socket_id, + .numa_id = numa_id, .ff_disable =RTE_CRYPTODEV_FF_SECURITY , };
@@ -2379,23 +2379,23 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, }else sessions_needed = enabled_cdev_count; -if (session_pool_socket[socket_id].sess_mp ==NULL ) { +if (session_pool_socket[numa_id].sess_mp ==NULL ) {char mp_name[RTE_MEMPOOL_NAMESIZE ];snprintf (mp_name,RTE_MEMPOOL_NAMESIZE , -"sess_mp_%u" , socket_id); +"sess_mp_%u" , numa_id); - session_pool_socket[socket_id].sess_mp = + session_pool_socket[numa_id].sess_mp =rte_cryptodev_sym_session_pool_create ( mp_name, sessions_needed, max_sess_sz, -0 ,0 , socket_id); -if (session_pool_socket[socket_id].sess_mp ==NULL ) { +0 ,0 , numa_id); +if (session_pool_socket[numa_id].sess_mp ==NULL ) {printf ("Cannot create pool on socket %d\n" , - socket_id); + numa_id);return -ENOMEM ; }printf ("Allocated pool \"%s\" on socket %d\n" , - mp_name, socket_id); + mp_name, numa_id); }/* Set AEAD parameters */
@@ -2537,10 +2537,10 @@ initialize_cryptodevs(struct l2fwd_crypto_options *options, unsigned nb_ports, } qp_conf.nb_descriptors =2048 ; - qp_conf.mp_session = session_pool_socket[socket_id].sess_mp; + qp_conf.mp_session = session_pool_socket[numa_id].sess_mp; retval =rte_cryptodev_queue_pair_setup (cdev_id,0 , &qp_conf, - socket_id); + numa_id);if (retval <0 ) {printf ("Failed to setup queue pair %u on cryptodev %u" ,0 , cdev_id);
@@ -2619,7 +2619,7 @@ initialize_ports(struct l2fwd_crypto_options *options) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; retval =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, l2fwd_pktmbuf_pool);if (retval <0 ) { printf("rte_eth_rx_queue_setup:err=%d, port=%u\n",
@@ -2632,7 +2632,7 @@ initialize_ports(struct l2fwd_crypto_options *options) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; retval =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (retval <0 ) { printf("rte_eth_tx_queue_setup:err=%d, port=%u\n",
@@ -2766,14 +2766,14 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" ,NB_MBUF ,512 ,RTE_ALIGN (sizeof (struct rte_crypto_op ),RTE_CACHE_LINE_SIZE ), -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (l2fwd_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" );/* create crypto op pool */ l2fwd_crypto_op_pool =rte_crypto_op_pool_create ("crypto_op_pool" ,RTE_CRYPTO_OP_TYPE_SYMMETRIC ,NB_MBUF ,128 ,MAXIMUM_IV_LENGTH , -rte_socket_id ()); +rte_numa_id ());if (l2fwd_crypto_op_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create crypto op pool\n" );
Signature · 1 line
2.55.0
PATCH 199/227 examples/l2fwd-event: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-event/l2fwd_common.c | 4 ++-- examples/l2fwd-event/l2fwd_poll.c | 4 ++-- examples/l2fwd-event/main.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
examples/l2fwd-event/l2fwd_common.c +2 -2
@@ -83,7 +83,7 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc) rxq_conf.offloads = local_port_conf.rxmode.offloads;/* Using lcore to poll one or several ports. 8< */ ret =rte_eth_rx_queue_setup (port_id,0 , nb_rxd, -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &rxq_conf, rsrc->pktmbuf_pool);if (ret <0 )
@@ -97,7 +97,7 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (port_id,0 , nb_txd, -rte_eth_dev_socket_id (port_id), +rte_eth_dev_numa_id (port_id), &txq_conf);if (ret <0 ) rte_panic("rte_eth_tx_queue_setup:err=%d, port=%u\n",
examples/l2fwd-event/l2fwd_poll.c +2 -2
@@ -147,9 +147,9 @@ l2fwd_poll_init_tx_buffers(struct l2fwd_resources *rsrc)RTE_ETH_FOREACH_DEV (port_id) {/* Initialize TX buffers */ - poll_rsrc->tx_buffer[port_id] =rte_zmalloc_socket ("tx_buffer" , + poll_rsrc->tx_buffer[port_id] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (port_id)); +rte_eth_dev_numa_id (port_id));if (poll_rsrc->tx_buffer[port_id] ==NULL )rte_panic ("Cannot allocate buffer for tx on port %u\n" , port_id);
examples/l2fwd-event/main.c +2 -2
@@ -664,7 +664,7 @@ main(int argc, char **argv)/* Create the mbuf pool. 8< */ rsrc->pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" , nb_mbufs,MEMPOOL_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (rsrc->pktmbuf_pool ==NULL )rte_panic ("Cannot init mbuf pool\n" );/* >8 End of creation of mbuf pool. */
@@ -677,7 +677,7 @@ main(int argc, char **argv) nb_vec =RTE_MAX (512U , nb_vec); nb_vec +=rte_lcore_count () *32 ; rsrc->evt_vec_pool =rte_event_vector_pool_create ( -"vector_pool" , nb_vec,32 , vec_size,rte_socket_id ()); +"vector_pool" , nb_vec,32 , vec_size,rte_numa_id ());if (rsrc->evt_vec_pool ==NULL )rte_panic ("Cannot init event vector pool\n" ); }
Signature · 1 line
2.55.0
PATCH 200/227 examples/l2fwd-jobstats: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-jobstats/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
examples/l2fwd-jobstats/main.c +5 -5
@@ -781,7 +781,7 @@ main(int argc, char **argv)/* Create the mbuf pool. 8< */ l2fwd_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" ,NB_MBUF ,32 , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (l2fwd_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );/* >8 End of creation of mbuf pool. */
@@ -897,7 +897,7 @@ main(int argc, char **argv) rxq_conf.offloads = local_port_conf.rxmode.offloads;/* RX queue initialization. 8< */ ret =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, l2fwd_pktmbuf_pool);if (ret <0 )
@@ -910,7 +910,7 @@ main(int argc, char **argv) txq_conf.offloads = local_port_conf.txmode.offloads;fflush (stdout); ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE,
@@ -919,9 +919,9 @@ main(int argc, char **argv)/* >8 End of init one TX queue on each port. */ /* Initialize TX buffers */ - tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , portid);
Signature · 1 line
2.55.0
PATCH 201/227 examples/l2fwd-keepalive: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-keepalive/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
examples/l2fwd-keepalive/main.c +5 -5
@@ -560,7 +560,7 @@ main(int argc, char **argv) l2fwd_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" , total_nb_mbufs,32 ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (l2fwd_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );
@@ -670,7 +670,7 @@ main(int argc, char **argv) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; ret =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, l2fwd_pktmbuf_pool);if (ret <0 )
@@ -683,7 +683,7 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE,
@@ -691,9 +691,9 @@ main(int argc, char **argv) ret, portid);/* Initialize TX buffers */ - tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , portid);
Signature · 1 line
2.55.0
PATCH 202/227 examples/l2fwd-macsec: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l2fwd-macsec/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
examples/l2fwd-macsec/main.c +6 -6
@@ -1379,7 +1379,7 @@ main(int argc, char **argv)/* Create the mbuf pool. 8< */ l2fwd_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" , nb_mbufs,MEMPOOL_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (l2fwd_pktmbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool\n" );/* >8 End of create the mbuf pool. */
@@ -1438,7 +1438,7 @@ main(int argc, char **argv) rxq_conf.offloads = local_port_conf.rxmode.offloads;/* RX queue setup. 8< */ ret =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, l2fwd_pktmbuf_pool);if (ret <0 )
@@ -1451,7 +1451,7 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n",
@@ -1459,9 +1459,9 @@ main(int argc, char **argv)/* >8 End of init one TX queue on each port. */ /* Initialize TX buffers */ - tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , portid);
@@ -1514,7 +1514,7 @@ main(int argc, char **argv) nb_sess, sess_sz,SESSION_POOL_CACHE_SIZE ,0 ,NULL ,NULL ,NULL ,NULL , - SOCKET_ID_ANY, 0); + RTE_NUMA_ID_ANY, 0);if (mcs_port_params[portid].sess_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init sess pool\n" );
Signature · 1 line
2.55.0
PATCH 203/227 examples/l3fwd: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l3fwd/l3fwd_acl.c | 22 +++++++++++----------- examples/l3fwd/l3fwd_em.c | 4 ++-- examples/l3fwd/main.c | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-)
examples/l3fwd/l3fwd_acl.c +11 -11
@@ -692,7 +692,7 @@ app_acl_init(struct rte_acl_rule *route_base, socketid); acl_param.name = name; - acl_param.socket_id = socketid; + acl_param.numa_id = socketid; acl_param.rule_size =RTE_ACL_RULE_SZ (dim); acl_param.max_rule_num =MAX_ACL_RULE_NUM ;
@@ -935,7 +935,7 @@ dump_ipv6_rules(struct acl6_rule *rule, int num, int extra)/* Function to setup acl. */ void -setup_acl (const int socket_id) +setup_acl (const int numa_id) {if (check_acl_config () !=0 )rte_exit (EXIT_FAILURE ,"Failed to get valid ACL options\n" );
@@ -955,24 +955,24 @@ setup_acl(const int socket_id)dump_ipv6_rules ((struct acl6_rule *)acl_base_ipv6, acl_num_ipv6,1 );/* Check sockets a context should be created on */ -if (socket_id >=NB_SOCKETS ) { +if (numa_id >=NB_SOCKETS ) {acl_log ("Socket %d is out " "of range %d\n" , - socket_id,NB_SOCKETS ); + numa_id,NB_SOCKETS );acl_free_routes ();return ; } -rte_acl_free (acl_config.acx_ipv4[socket_id]); -rte_acl_free (acl_config.acx_ipv6[socket_id]); +rte_acl_free (acl_config.acx_ipv4[numa_id]); +rte_acl_free (acl_config.acx_ipv6[numa_id]); - acl_config.acx_ipv4[socket_id] =app_acl_init (route_base_ipv4, + acl_config.acx_ipv4[numa_id] =app_acl_init (route_base_ipv4, acl_base_ipv4, route_num_ipv4, acl_num_ipv4, -0 , socket_id); +0 , numa_id); - acl_config.acx_ipv6[socket_id] =app_acl_init (route_base_ipv6, + acl_config.acx_ipv6[numa_id] =app_acl_init (route_base_ipv6, acl_base_ipv6, route_num_ipv6, acl_num_ipv6, -1 , socket_id); +1 , numa_id);#ifdef L3FWDACL_DEBUG acl_config.rule_ipv4 = (struct acl4_rule *)acl_base_ipv4;
@@ -1091,7 +1091,7 @@ acl_main_loop(__rte_unused void *dummy) prev_tsc =0 ; lcore_id =rte_lcore_id (); qconf = &lcore_conf[lcore_id]; - socketid =rte_lcore_to_socket_id (lcore_id); + socketid =rte_lcore_to_numa_id (lcore_id);if (qconf->n_rx_queue ==0 ) {RTE_LOG (INFO ,L3FWD ,"lcore %u has nothing to do\n" , lcore_id);
examples/l3fwd/l3fwd_em.c +2 -2
@@ -991,7 +991,7 @@ setup_hash(const int socketid)/* create ipv4 hash */ snprintf (s,sizeof (s),"ipv4_l3fwd_hash_%d" , socketid); ipv4_l3fwd_hash_params.name = s; - ipv4_l3fwd_hash_params.socket_id = socketid; + ipv4_l3fwd_hash_params.numa_id = socketid; ipv4_l3fwd_em_lookup_struct[socketid] =rte_hash_create (&ipv4_l3fwd_hash_params);if (ipv4_l3fwd_em_lookup_struct[socketid] ==NULL )
@@ -1002,7 +1002,7 @@ setup_hash(const int socketid)/* create ipv6 hash */ snprintf (s,sizeof (s),"ipv6_l3fwd_hash_%d" , socketid); ipv6_l3fwd_hash_params.name = s; - ipv6_l3fwd_hash_params.socket_id = socketid; + ipv6_l3fwd_hash_params.numa_id = socketid; ipv6_l3fwd_em_lookup_struct[socketid] =rte_hash_create (&ipv6_l3fwd_hash_params);if (ipv6_l3fwd_em_lookup_struct[socketid] ==NULL )
examples/l3fwd/main.c +4 -4
@@ -311,7 +311,7 @@ check_lcore_params(void)return -1 ; } - socketid =rte_lcore_to_socket_id (lcore); + socketid =rte_lcore_to_numa_id (lcore);if (socketid !=0 && numa_on ==0 ) {printf ("warning: lcore %u is on socket %d with numa off\n" , lcore, socketid);
@@ -1133,7 +1133,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)continue ;if (numa_on) - socketid =rte_lcore_to_socket_id (lcore_id); + socketid =rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -1474,7 +1474,7 @@ l3fwd_poll_resource_setup(void)if (numa_on) socketid = - (uint8_t )rte_lcore_to_socket_id (lcore_id); + (uint8_t )rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -1516,7 +1516,7 @@ l3fwd_poll_resource_setup(void)if (numa_on) socketid = - (uint8_t )rte_lcore_to_socket_id (lcore_id); + (uint8_t )rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
Signature · 1 line
2.55.0
PATCH 204/227 examples/l3fwd-graph: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l3fwd-graph/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
examples/l3fwd-graph/main.c +7 -7
@@ -218,7 +218,7 @@ check_lcore_params(void)printf ("Error: lcore %u is main lcore\n" , lcore);return -1 ; } - socketid =rte_lcore_to_socket_id (lcore); + socketid =rte_lcore_to_numa_id (lcore);if ((socketid !=0 ) && (numa_on ==0 )) {printf ("Warning: lcore %u is on socket %d with numa off\n" , lcore, socketid);
@@ -653,7 +653,7 @@ init_mem(uint16_t portid, uint32_t nb_mbuf)continue ;if (numa_on) - socketid =rte_lcore_to_socket_id (lcore_id); + socketid =rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -769,7 +769,7 @@ print_stats(void)/* Prepare stats object */ memset (&s_param,0 ,sizeof (s_param)); s_param.f = stdout; - s_param.socket_id =SOCKET_ID_ANY ; + s_param.numa_id =RTE_NUMA_ID_ANY ; s_param.graph_patterns = &pattern; s_param.nb_graph_patterns =1 ;
@@ -889,7 +889,7 @@ graph_config_mcore_dispatch(struct rte_graph_param graph_conf) } graph_conf.nb_node_patterns = nb_patterns + n_rx_node; - graph_conf.socket_id =rte_lcore_to_socket_id (main_lcore_id); + graph_conf.numa_id =rte_lcore_to_numa_id (main_lcore_id); qconf = &lcore_conf[main_lcore_id]; snprintf(qconf->name, sizeof(qconf->name), "worker_%u",
@@ -972,7 +972,7 @@ graph_config_rtc(struct rte_graph_param graph_conf) qconf->rx_queue_list[i].node_name; } graph_conf.nb_node_patterns = nb_patterns + i; - graph_conf.socket_id =rte_lcore_to_socket_id (lcore_id); + graph_conf.numa_id =rte_lcore_to_numa_id (lcore_id);snprintf (qconf->name,sizeof (qconf->name),"worker_%u" , lcore_id); graph_id =rte_graph_create (qconf->name, &graph_conf);
@@ -1155,7 +1155,7 @@ main(int argc, char **argv) qconf = &lcore_conf[lcore_id];if (numa_on) - socketid = (uint8_t )rte_lcore_to_socket_id ( + socketid = (uint8_t )rte_lcore_to_numa_id ( lcore_id);else socketid =0 ;
@@ -1204,7 +1204,7 @@ main(int argc, char **argv) queueid = qconf->rx_queue_list[queue].queue_id;if (numa_on) - socketid = (uint8_t )rte_lcore_to_socket_id ( + socketid = (uint8_t )rte_lcore_to_numa_id ( lcore_id);else socketid =0 ;
Signature · 1 line
2.55.0
PATCH 205/227 examples/l3fwd-power: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/l3fwd-power/main.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
examples/l3fwd-power/main.c +9 -9
@@ -1414,7 +1414,7 @@ check_lcore_params(void) "mask\n", lcore);return -1 ; } - socketid =rte_lcore_to_socket_id (lcore); + socketid =rte_lcore_to_numa_id (lcore);if (socketid !=0 && numa_on ==0 ) {printf ("warning: lcore %u is on socket %d with numa " "off\n" , lcore, socketid);
@@ -1944,7 +1944,7 @@ setup_hash(int socketid)/* create ipv4 hash */ snprintf (s,sizeof (s),"ipv4_l3fwd_hash_%d" , socketid); ipv4_l3fwd_hash_params.name = s; - ipv4_l3fwd_hash_params.socket_id = socketid; + ipv4_l3fwd_hash_params.numa_id = socketid; ipv4_l3fwd_lookup_struct[socketid] =rte_hash_create (&ipv4_l3fwd_hash_params);if (ipv4_l3fwd_lookup_struct[socketid] ==NULL )
@@ -1954,7 +1954,7 @@ setup_hash(int socketid)/* create ipv6 hash */ snprintf (s,sizeof (s),"ipv6_l3fwd_hash_%d" , socketid); ipv6_l3fwd_hash_params.name = s; - ipv6_l3fwd_hash_params.socket_id = socketid; + ipv6_l3fwd_hash_params.numa_id = socketid; ipv6_l3fwd_lookup_struct[socketid] =rte_hash_create (&ipv6_l3fwd_hash_params);if (ipv6_l3fwd_lookup_struct[socketid] ==NULL )
@@ -2046,7 +2046,7 @@ init_mem(unsigned nb_mbuf)continue ;if (numa_on) - socketid =rte_lcore_to_socket_id (lcore_id); + socketid =rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -2738,9 +2738,9 @@ main(int argc, char **argv)/* Initialize TX buffers */ qconf = &lcore_conf[lcore_id]; - qconf->tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + qconf->tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (qconf->tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Can't allocate tx buffer for port %u\n" , portid);
@@ -2759,7 +2759,7 @@ main(int argc, char **argv)if (numa_on) socketid = \ - (uint8_t )rte_lcore_to_socket_id (lcore_id); + (uint8_t )rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -2811,7 +2811,7 @@ main(int argc, char **argv)if (numa_on) socketid = \ - (uint8_t )rte_lcore_to_socket_id (lcore_id); + (uint8_t )rte_lcore_to_numa_id (lcore_id);else socketid =0 ;
@@ -2918,7 +2918,7 @@ main(int argc, char **argv)unsigned int i;/* Init metrics library */ -rte_metrics_init (rte_socket_id ()); +rte_metrics_init (rte_numa_id ());/** Register stats with metrics library */ for (i =0 ; i <NUM_TELSTATS ; i++) ptr_strings[i] = telstats_strings[i].name;
Signature · 1 line
2.55.0
PATCH 206/227 examples/link_status_interrupt: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/link_status_interrupt/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
examples/link_status_interrupt/main.c +5 -5
@@ -553,7 +553,7 @@ main(int argc, char **argv)/* create the mbuf pool */ lsi_pktmbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" ,NB_MBUF ,32 ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (lsi_pktmbuf_pool ==NULL )rte_panic ("Cannot init mbuf pool\n" );
@@ -673,7 +673,7 @@ main(int argc, char **argv) rxq_conf.offloads = local_port_conf.rxmode.offloads;/* RX queue initialization. 8< */ ret =rte_eth_rx_queue_setup (portid,0 , nb_rxd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &rxq_conf, lsi_pktmbuf_pool);if (ret <0 )
@@ -686,7 +686,7 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , nb_txd, -rte_eth_dev_socket_id (portid), +rte_eth_dev_numa_id (portid), &txq_conf);if (ret <0 ) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d,port=%u\n",
@@ -694,9 +694,9 @@ main(int argc, char **argv)/* >8 End of init one TX queue. */ /* Initialize TX buffers */ - tx_buffer[portid] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[portid] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKT_BURST ),0 , -rte_eth_dev_socket_id (portid)); +rte_eth_dev_numa_id (portid));if (tx_buffer[portid] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , (unsigned ) portid);
Signature · 1 line
2.55.0
PATCH 207/227 examples/multi_process: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- .../client_server_mp/mp_client/client.c | 4 ++-- .../client_server_mp/mp_server/init.c | 14 +++++++------- examples/multi_process/simple_mp/main.c | 6 +++--- examples/multi_process/symmetric_mp/main.c | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-)
examples/multi_process/client_server_mp/mp_client/client.c +2 -2
@@ -135,9 +135,9 @@ configure_tx_buffer(uint16_t port_id, uint16_t size)int ret;/* Initialize TX buffers */ - tx_buffer[port_id] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[port_id] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (size),0 , -rte_eth_dev_socket_id (port_id)); +rte_eth_dev_numa_id (port_id));if (tx_buffer[port_id] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , port_id);
examples/multi_process/client_server_mp/mp_server/init.c +7 -7
@@ -75,7 +75,7 @@ init_mbuf_pools(void)printf ("Creating mbuf pool '%s' [%u mbufs] ...\n" ,PKTMBUF_POOL_NAME , num_mbufs); pktmbuf_pool =rte_pktmbuf_pool_create (PKTMBUF_POOL_NAME , num_mbufs, -MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());return pktmbuf_pool ==NULL ;/* 0 on success */ }
@@ -127,14 +127,14 @@ init_port(uint16_t port_num)for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port_num, q, rx_ring_size, -rte_eth_dev_socket_id (port_num), +rte_eth_dev_numa_id (port_num),NULL , pktmbuf_pool);if (retval <0 )return retval; }for ( q =0 ; q < tx_rings; q ++ ) { retval =rte_eth_tx_queue_setup (port_num, q, tx_ring_size, -rte_eth_dev_socket_id (port_num), +rte_eth_dev_numa_id (port_num),NULL );if (retval <0 )return retval; }
@@ -160,7 +160,7 @@ static intinit_shm_rings (void) {unsigned i; -unsigned socket_id; +unsigned int numa_idconst char * q_name;const unsigned ringsize =CLIENT_QUEUE_RINGSIZE ;
@@ -171,10 +171,10 @@ init_shm_rings(void)for (i =0 ; i < num_clients; i++) {/* Create an RX queue for each client */ - socket_id =rte_socket_id (); + numa_id =rte_numa_id (); q_name =get_rx_queue_name (i); clients[i].rx_q =rte_ring_create (q_name, - ringsize, socket_id, + ringsize, numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ );/* single prod, single cons */ if (clients[i].rx_q ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create rx ring queue for client %u\n" , i);
@@ -263,7 +263,7 @@ init(int argc, char *argv[])/* set up array for port data */ mz =rte_memzone_reserve (MZ_PORT_INFO ,sizeof (*ports), -rte_socket_id (),NO_FLAGS ); +rte_numa_id (),NO_FLAGS );if (mz ==NULL )rte_exit (EXIT_FAILURE ,"Cannot reserve memory zone for port information\n" );memset (mz->addr,0 ,sizeof (*ports));
examples/multi_process/simple_mp/main.c +3 -3
@@ -89,12 +89,12 @@ main(int argc, char **argv)/* Start of ring structure. 8< */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ){ - send_ring =rte_ring_create (_PRI_2_SEC, ring_size,rte_socket_id (), flags); - recv_ring =rte_ring_create (_SEC_2_PRI, ring_size,rte_socket_id (), flags); + send_ring =rte_ring_create (_PRI_2_SEC, ring_size,rte_numa_id (), flags); + recv_ring =rte_ring_create (_SEC_2_PRI, ring_size,rte_numa_id (), flags); message_pool =rte_mempool_create (_MSG_POOL, pool_size,STR_TOKEN_SIZE , pool_cache, priv_data_sz,NULL ,NULL ,NULL ,NULL , -rte_socket_id (), flags); +rte_numa_id (), flags); }else { recv_ring =rte_ring_lookup (_PRI_2_SEC); send_ring =rte_ring_lookup (_SEC_2_PRI);
examples/multi_process/symmetric_mp/main.c +3 -3
@@ -263,7 +263,7 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, rxq_conf.offloads = port_conf.rxmode.offloads;for (q =0 ; q < rx_rings; q ++) { retval =rte_eth_rx_queue_setup (port, q, nb_rxd, -rte_eth_dev_socket_id (port), +rte_eth_dev_numa_id (port), &rxq_conf, mbuf_pool);if (retval <0 )
@@ -274,7 +274,7 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, txq_conf.offloads = port_conf.txmode.offloads;for (q =0 ; q < tx_rings; q ++) { retval =rte_eth_tx_queue_setup (port, q, nb_txd, -rte_eth_dev_socket_id (port), +rte_eth_dev_numa_id (port), &txq_conf);if (retval <0 )return retval;
@@ -470,7 +470,7 @@ main(int argc, char **argv) rte_mempool_lookup(_SMP_MBUF_POOL) : rte_pktmbuf_pool_create(_SMP_MBUF_POOL, NB_MBUFS, MBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, - rte_socket_id()); + rte_numa_id()); if (mp == NULL) rte_exit(EXIT_FAILURE, "Cannot get memory pool for buffers\n");
Signature · 1 line
2.55.0
PATCH 208/227 examples/ntb: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ntb/ntb_fwd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
examples/ntb/ntb_fwd.c +7 -7
@@ -1098,7 +1098,7 @@ static struct rte_mempool * ntb_mbuf_pool_create(uint16_t mbuf_seg_size, uint32_t nb_mbuf, struct ntb_dev_info ntb_info, struct ntb_dev_config *ntb_conf, - unsigned int socket_id) + unsigned int numa_id) { size_t mz_len, total_elt_sz, max_mz_len, left_sz;struct rte_pktmbuf_pool_private mbp_priv;
@@ -1110,12 +1110,12 @@ ntb_mbuf_pool_create(uint16_t mbuf_seg_size, uint32_t nb_mbuf,uint32_t mz_id;int ret; -snprintf (pool_name,sizeof (pool_name),"ntb_mbuf_pool_%u" , socket_id); +snprintf (pool_name,sizeof (pool_name),"ntb_mbuf_pool_%u" , numa_id); mp =rte_mempool_create_empty (pool_name, nb_mbuf, (mbuf_seg_size +sizeof (struct rte_mbuf )),MEMPOOL_CACHE_SIZE ,sizeof (struct rte_pktmbuf_pool_private ), - socket_id,0 ); + numa_id,0 );if (mp ==NULL )return NULL ;
@@ -1161,7 +1161,7 @@ ntb_mbuf_pool_create(uint16_t mbuf_seg_size, uint32_t nb_mbuf,* for a memory window of this length. */ align =rte_pmd_ntb_get_mem_align (dev_id, mz_id, mz_len); - mz =rte_memzone_reserve_aligned (mz_name, mz_len, socket_id, + mz =rte_memzone_reserve_aligned (mz_name, mz_len, numa_id,RTE_MEMZONE_IOVA_CONTIG , align);if (mz ==NULL ) { printf("Cannot allocate %" PRIu64 " aligned memzone"
@@ -1258,7 +1258,7 @@ main(int argc, char **argv) nb_mbuf = nb_desc * num_queues *2 *2 +rte_lcore_count () *MEMPOOL_CACHE_SIZE ; mbuf_pool =ntb_mbuf_pool_create (ntb_buf_size, nb_mbuf, ntb_info, - &ntb_conf,rte_socket_id ()); + &ntb_conf,rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool.\n" );
@@ -1327,13 +1327,13 @@ main(int argc, char **argv)/* Setup ethdev queue if ethdev exists */ for (i =0 ; i < num_queues; i++) { ret =rte_eth_rx_queue_setup (eth_port_id, i, nb_desc, -rte_eth_dev_socket_id (eth_port_id), +rte_eth_dev_numa_id (eth_port_id), ð_rx_conf, mbuf_pool);if (ret <0 )rte_exit (EXIT_FAILURE ,"Failed to setup eth rxq %u.\n" , i); ret =rte_eth_tx_queue_setup (eth_port_id, i, nb_desc, -rte_eth_dev_socket_id (eth_port_id), +rte_eth_dev_numa_id (eth_port_id), ð_tx_conf);if (ret <0 ) rte_exit(EXIT_FAILURE,
Signature · 1 line
2.55.0
PATCH 209/227 examples/packet_ordering: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/packet_ordering/main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
examples/packet_ordering/main.c +8 -8
@@ -254,9 +254,9 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[])continue ;/* Initialize TX buffers */ - tx_buffer[port_id] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[port_id] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (MAX_PKTS_BURST ),0 , -rte_eth_dev_socket_id (port_id)); +rte_eth_dev_numa_id (port_id));if (tx_buffer[port_id] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , port_id);
@@ -309,7 +309,7 @@ configure_eth_port(uint16_t port_id)for (q =0 ; q < rxRings; q++) { ret =rte_eth_rx_queue_setup (port_id, q, nb_rxd, -rte_eth_dev_socket_id (port_id),NULL , +rte_eth_dev_numa_id (port_id),NULL , mbuf_pool);if (ret <0 )return ret;
@@ -319,7 +319,7 @@ configure_eth_port(uint16_t port_id) txconf.offloads = port_conf.txmode.offloads;for (q =0 ; q < txRings; q++) { ret =rte_eth_tx_queue_setup (port_id, q, nb_txd, -rte_eth_dev_socket_id (port_id), &txconf); +rte_eth_dev_numa_id (port_id), &txconf);if (ret <0 )return ret; }
@@ -719,7 +719,7 @@ main(int argc, char **argv) mbuf_pool =rte_pktmbuf_pool_create ("mbuf_pool" ,MBUF_PER_POOL ,MBUF_POOL_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"%s\n" ,rte_strerror (rte_errno));
@@ -747,18 +747,18 @@ main(int argc, char **argv) }/* Create rings for inter core communication */ - rx_to_workers =rte_ring_create ("rx_to_workers" ,RING_SIZE ,rte_socket_id (), + rx_to_workers =rte_ring_create ("rx_to_workers" ,RING_SIZE ,rte_numa_id (),RING_F_SP_ENQ );if (rx_to_workers ==NULL )rte_exit (EXIT_FAILURE ,"%s\n" ,rte_strerror (rte_errno)); - workers_to_tx =rte_ring_create ("workers_to_tx" ,RING_SIZE ,rte_socket_id (), + workers_to_tx =rte_ring_create ("workers_to_tx" ,RING_SIZE ,rte_numa_id (),RING_F_SC_DEQ );if (workers_to_tx ==NULL )rte_exit (EXIT_FAILURE ,"%s\n" ,rte_strerror (rte_errno));if (!disable_reorder) { - send_args.buffer =rte_reorder_create ("PKT_RO" ,rte_socket_id (), + send_args.buffer =rte_reorder_create ("PKT_RO" ,rte_numa_id (),REORDER_BUFFER_SIZE );if (send_args.buffer ==NULL )rte_exit (EXIT_FAILURE ,"%s\n" ,rte_strerror (rte_errno));
Signature · 1 line
2.55.0
PATCH 210/227 examples/pipeline: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/pipeline/obj.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
examples/pipeline/obj.c +6 -6
@@ -125,8 +125,8 @@ ethdev_config(const char *name, struct ethdev_params *params) } } - numa_node =rte_eth_dev_socket_id (port_id); -if (numa_node ==SOCKET_ID_ANY ) + numa_node =rte_eth_dev_numa_id (port_id); +if (numa_node ==RTE_NUMA_ID_ANY ) numa_node =0 ; status = rte_eth_dev_configure(
@@ -205,7 +205,7 @@ cryptodev_config(const char *name, struct cryptodev_params *params)struct rte_cryptodev_config dev_conf;struct rte_cryptodev_qp_conf queue_conf;uint8_t dev_id; -uint32_t socket_id, i; +uint32_t numa_id, i;int status;/* Check input parameters. */
@@ -225,11 +225,11 @@ cryptodev_config(const char *name, struct cryptodev_params *params)if (params->n_queue_pairs > dev_info.max_nb_queue_pairs)return -EINVAL ; - socket_id =rte_cryptodev_socket_id (dev_id); + numa_id =rte_cryptodev_numa_id (dev_id);/* Configure the crypto device. */ memset (&dev_conf,0 ,sizeof (dev_conf)); - dev_conf.socket_id = socket_id; + dev_conf.numa_id = numa_id; dev_conf.nb_queue_pairs = params->n_queue_pairs; dev_conf.ff_disable =0 ;
@@ -243,7 +243,7 @@ cryptodev_config(const char *name, struct cryptodev_params *params) queue_conf.mp_session =NULL ;for (i =0 ; i < params->n_queue_pairs; i++) { - status =rte_cryptodev_queue_pair_setup (dev_id, i, &queue_conf, socket_id); + status =rte_cryptodev_queue_pair_setup (dev_id, i, &queue_conf, numa_id);if (status)return status; }
Signature · 1 line
2.55.0
PATCH 211/227 examples/ptpclient: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ptpclient/ptpclient.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/ptpclient/ptpclient.c +3 -3
@@ -181,7 +181,7 @@ port_init(uint16_t port, struct rte_mempool *mp) rxconf->offloads = port_conf.rxmode.offloads; retval =rte_eth_rx_queue_setup (port, q, nb_rxd, -rte_eth_dev_socket_id (port), rxconf, mp); +rte_eth_dev_numa_id (port), rxconf, mp);if (retval <0 )return retval;
@@ -195,7 +195,7 @@ port_init(uint16_t port, struct rte_mempool *mp) txconf->offloads = port_conf.txmode.offloads; retval =rte_eth_tx_queue_setup (port, q, nb_txd, -rte_eth_dev_socket_id (port), txconf); +rte_eth_dev_numa_id (port), txconf);if (retval <0 )return retval; }
@@ -736,7 +736,7 @@ main(int argc, char *argv[])/* Creates a new mempool in memory to hold the mbufs. 8< */ mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUFS * nb_ports, -MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());/* >8 End of a new mempool in memory to hold the mbufs. */ if (mbuf_pool ==NULL )
Signature · 1 line
2.55.0
PATCH 212/227 examples/ptp_tap_relay_sw: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/ptp_tap_relay_sw/ptp_tap_relay_sw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/ptp_tap_relay_sw/ptp_tap_relay_sw.c +3 -3
@@ -146,12 +146,12 @@ port_init(uint16_t port, struct rte_mempool *mp)return ret; ret =rte_eth_rx_queue_setup (port,0 , nb_rxd, -rte_eth_dev_socket_id (port),NULL , mp); +rte_eth_dev_numa_id (port),NULL , mp);if (ret <0 )return ret; ret =rte_eth_tx_queue_setup (port,0 , nb_txd, -rte_eth_dev_socket_id (port),NULL ); +rte_eth_dev_numa_id (port),NULL );if (ret <0 )return ret;
@@ -393,7 +393,7 @@ main(int argc, char **argv) mp =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUFS * nb_ports,MBUF_CACHE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_socket_id ()); +rte_numa_id ());if (mp ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" );
Signature · 1 line
2.55.0
PATCH 213/227 examples/qos_meter: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/qos_meter/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
examples/qos_meter/main.c +7 -7
@@ -319,7 +319,7 @@ main(int argc, char **argv)/* Buffer pool init */ pool =rte_pktmbuf_pool_create ("pool" ,NB_MBUF ,MEMPOOL_CACHE_SIZE , -0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (pool ==NULL )rte_exit (EXIT_FAILURE ,"Buffer pool creation error\n" );
@@ -359,7 +359,7 @@ main(int argc, char **argv) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = conf.rxmode.offloads; ret =rte_eth_rx_queue_setup (port_rx,NIC_RX_QUEUE , nb_rxd, -rte_eth_dev_socket_id (port_rx), +rte_eth_dev_numa_id (port_rx), &rxq_conf, pool);if (ret <0 )rte_exit (EXIT_FAILURE ,"Port %d RX queue setup error (%d)\n" , port_rx, ret);
@@ -367,7 +367,7 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = conf.txmode.offloads; ret =rte_eth_tx_queue_setup (port_rx,NIC_TX_QUEUE , nb_txd, -rte_eth_dev_socket_id (port_rx), +rte_eth_dev_numa_id (port_rx), &txq_conf);if (ret <0 )rte_exit (EXIT_FAILURE ,"Port %d TX queue setup error (%d)\n" , port_rx, ret);
@@ -409,7 +409,7 @@ main(int argc, char **argv) rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = conf.rxmode.offloads; ret =rte_eth_rx_queue_setup (port_tx,NIC_RX_QUEUE , nb_rxd, -rte_eth_dev_socket_id (port_tx), +rte_eth_dev_numa_id (port_tx),NULL , pool);if (ret <0 )rte_exit (EXIT_FAILURE ,"Port %d RX queue setup error (%d)\n" , port_tx, ret);
@@ -417,14 +417,14 @@ main(int argc, char **argv) txq_conf = dev_info.default_txconf; txq_conf.offloads = conf.txmode.offloads; ret =rte_eth_tx_queue_setup (port_tx,NIC_TX_QUEUE , nb_txd, -rte_eth_dev_socket_id (port_tx), +rte_eth_dev_numa_id (port_tx),NULL );if (ret <0 )rte_exit (EXIT_FAILURE ,"Port %d TX queue setup error (%d)\n" , port_tx, ret); - tx_buffer =rte_zmalloc_socket ("tx_buffer" , + tx_buffer =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (RTE_MBUF_F_TX_BURST_MAX ),0 , -rte_eth_dev_socket_id (port_tx)); +rte_eth_dev_numa_id (port_tx));if (tx_buffer ==NULL )rte_exit (EXIT_FAILURE ,"Port %d TX buffer allocation error\n" , port_tx);
Signature · 1 line
2.55.0
PATCH 214/227 examples/qos_sched: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/qos_sched/args.c | 4 ++-- examples/qos_sched/init.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
examples/qos_sched/args.c +2 -2
@@ -394,8 +394,8 @@ app_parse_args(int argc, char **argv) qos_conf[i].wt_core);return -1 ; } -uint32_t rx_sock =rte_lcore_to_socket_id (qos_conf[i].rx_core); -uint32_t wt_sock =rte_lcore_to_socket_id (qos_conf[i].wt_core); +uint32_t rx_sock =rte_lcore_to_numa_id (qos_conf[i].rx_core); +uint32_t wt_sock =rte_lcore_to_numa_id (qos_conf[i].wt_core);if (rx_sock != wt_sock) {RTE_LOG (ERR ,APP ,"pfc %u: RX and WT must be on the same socket\n" , i +1 );return -1 ;
examples/qos_sched/init.c +4 -4
@@ -127,7 +127,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)fflush (stdout); rx_conf.offloads = local_port_conf.rxmode.offloads; ret =rte_eth_rx_queue_setup (portid,0 , (uint16_t )ring_conf.rx_size, -rte_eth_dev_socket_id (portid), &rx_conf, mp); +rte_eth_dev_numa_id (portid), &rx_conf, mp);if (ret <0 ) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%u\n",
@@ -137,7 +137,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)fflush (stdout); tx_conf.offloads = local_port_conf.txmode.offloads; ret =rte_eth_tx_queue_setup (portid,0 , - (uint16_t )ring_conf.tx_size,rte_eth_dev_socket_id (portid), &tx_conf); + (uint16_t )ring_conf.tx_size,rte_eth_dev_numa_id (portid), &tx_conf);if (ret <0 ) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%u queue=%d\n",
@@ -333,7 +333,7 @@ int app_init(void)/* Initialize each active flow */ for (i =0 ; i < nb_pfc; i++) { -uint32_t socket =rte_lcore_to_socket_id (qos_conf[i].rx_core); +uint32_t socket =rte_lcore_to_numa_id (qos_conf[i].rx_core);struct rte_ring *ring;struct rte_eth_link link;int retry_count =100 , retry_delay =100 ;/* try every 100ms for 10 sec */
@@ -360,7 +360,7 @@ int app_init(void) qos_conf[i].mbuf_pool =rte_pktmbuf_pool_create (pool_name, mp_size, burst_conf.rx_burst *4 ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE , -rte_eth_dev_socket_id (qos_conf[i].rx_port)); +rte_eth_dev_numa_id (qos_conf[i].rx_port));if (qos_conf[i].mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot init mbuf pool for socket %u\n" , i);
Signature · 1 line
2.55.0
PATCH 215/227 examples/rxtx_callbacks: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/rxtx_callbacks/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
examples/rxtx_callbacks/main.c +6 -6
@@ -173,7 +173,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port, q, nb_rxd, -rte_eth_dev_socket_id (port), &rxconf, mbuf_pool); +rte_eth_dev_numa_id (port), &rxconf, mbuf_pool);if (retval <0 )return retval; }
@@ -182,7 +182,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) txconf.offloads = port_conf.txmode.offloads;for (q =0 ; q < tx_rings; q++) { retval =rte_eth_tx_queue_setup (port, q, nb_txd, -rte_eth_dev_socket_id (port), &txconf); +rte_eth_dev_numa_id (port), &txconf);if (retval <0 )return retval; }
@@ -250,9 +250,9 @@ lcore_main(void)uint16_t port; RTE_ETH_FOREACH_DEV(port) - if (rte_eth_dev_socket_id(port) >= 0 && - rte_eth_dev_socket_id(port) != - (int)rte_socket_id()) + if (rte_eth_dev_numa_id(port) >= 0 && + rte_eth_dev_numa_id(port) != + (int)rte_numa_id()) printf("WARNING, port %u is on remote NUMA node to ""polling thread.\n\tPerformance will " "not be optimal.\n", port);
@@ -322,7 +322,7 @@ main(int argc, char *argv[]) mbuf_pool =rte_pktmbuf_pool_create ("MBUF_POOL" ,NUM_MBUFS * nb_ports,MBUF_CACHE_SIZE ,0 , -RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());if (mbuf_pool ==NULL )rte_exit (EXIT_FAILURE ,"Cannot create mbuf pool\n" );
Signature · 1 line
2.55.0
PATCH 216/227 examples/server_node_efd: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, local variables and comments to the NUMA node terminology, and switch calls to the NUMA-named APIs.
--- examples/server_node_efd/efd_node/node.c | 6 +++--- examples/server_node_efd/efd_server/init.c | 22 +++++++++++----------- examples/server_node_efd/efd_server/main.c | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-)
examples/server_node_efd/efd_node/node.c +3 -3
@@ -139,9 +139,9 @@ configure_tx_buffer(uint16_t port_id, uint16_t size)int ret;/* Initialize TX buffers */ - tx_buffer[port_id] =rte_zmalloc_socket ("tx_buffer" , + tx_buffer[port_id] =rte_zmalloc_numa ("tx_buffer" ,RTE_ETH_TX_BUFFER_SIZE (size),0 , -rte_eth_dev_socket_id (port_id)); +rte_eth_dev_numa_id (port_id));if (tx_buffer[port_id] ==NULL )rte_exit (EXIT_FAILURE ,"Cannot allocate buffer for tx on port %u\n" , port_id);
@@ -201,7 +201,7 @@ create_hash_table(const struct shared_info *info)struct rte_hash_parameters hash_params = { .entries = num_flows_node *2 ,/* table load = 50% */ .key_len =sizeof (uint32_t ),/* Store IPv4 dest IP address */ - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .hash_func_init_val =0 , };
examples/server_node_efd/efd_server/init.c +11 -11
@@ -77,7 +77,7 @@ init_mbuf_pools(void)printf ("Creating mbuf pool '%s' [%u mbufs] ...\n" ,PKTMBUF_POOL_NAME , num_mbufs); pktmbuf_pool =rte_pktmbuf_pool_create (PKTMBUF_POOL_NAME , num_mbufs, -MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_socket_id ()); +MBUF_CACHE_SIZE ,0 ,RTE_MBUF_DEFAULT_BUF_SIZE ,rte_numa_id ());return pktmbuf_pool ==NULL ;/* 0 on success */ }
@@ -136,7 +136,7 @@ init_port(uint16_t port_num)for (q =0 ; q < rx_rings; q++) { retval =rte_eth_rx_queue_setup (port_num, q, rx_ring_size, -rte_eth_dev_socket_id (port_num), +rte_eth_dev_numa_id (port_num),NULL , pktmbuf_pool);if (retval <0 )return retval;
@@ -146,7 +146,7 @@ init_port(uint16_t port_num) txconf.offloads = port_conf.txmode.offloads;for (q =0 ; q < tx_rings; q++) { retval =rte_eth_tx_queue_setup (port_num, q, tx_ring_size, -rte_eth_dev_socket_id (port_num), +rte_eth_dev_numa_id (port_num), &txconf);if (retval <0 )return retval;
@@ -174,7 +174,7 @@ static intinit_shm_rings (void) {unsigned int i; -unsigned int socket_id; +unsigned int numa_id;const char *q_name;const unsigned int ringsize =NODE_QUEUE_RINGSIZE ;
@@ -186,10 +186,10 @@ init_shm_rings(void)for (i =0 ; i < num_nodes; i++) {/* Create an RX queue for each node */ - socket_id =rte_socket_id (); + numa_id =rte_numa_id (); q_name =get_rx_queue_name (i); nodes[i].rx_q =rte_ring_create (q_name, - ringsize, socket_id, + ringsize, numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ );if (nodes[i].rx_q ==NULL ) rte_exit(EXIT_FAILURE, "Cannot create rx ring queue "
@@ -207,11 +207,11 @@ init_shm_rings(void)static void create_efd_table (void ) { -uint8_t socket_id =rte_socket_id (); +uint8_t numa_id =rte_numa_id ();/* create table */ efd_table =rte_efd_create ("flow table" , num_flows *2 ,sizeof (uint32_t ), -1 << socket_id, socket_id); +1 << numa_id, numa_id);if (efd_table ==NULL )rte_exit (EXIT_FAILURE ,"Problem creating the flow table\n" );
@@ -223,7 +223,7 @@ populate_efd_table(void)unsigned int i;int32_t ret;uint32_t ip_dst; -uint8_t socket_id =rte_socket_id (); +uint8_t numa_id =rte_numa_id ();uint64_t node_id;/* Add flows in table */
@@ -231,7 +231,7 @@ populate_efd_table(void) node_id = i % num_nodes; ip_dst =rte_cpu_to_be_32 (i); - ret =rte_efd_update (efd_table, socket_id, + ret =rte_efd_update (efd_table, numa_id, (void *)&ip_dst, (efd_value_t )node_id);if (ret <0 ) rte_exit(EXIT_FAILURE, "Unable to add entry %u in "
@@ -325,7 +325,7 @@ init(int argc, char *argv[])/* set up array for port data */ mz =rte_memzone_reserve (MZ_SHARED_INFO ,sizeof (*info), -rte_socket_id (),NO_FLAGS ); +rte_numa_id (),NO_FLAGS );if (mz ==NULL )rte_exit (EXIT_FAILURE ,"Cannot reserve memory zone " "for port information\n" );
examples/server_node_efd/efd_server/main.c +4 -4
@@ -255,7 +255,7 @@ enqueue_rx_packet(uint8_t node, struct rte_mbuf *buf)/* Processing packets. 8< */ static void process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[], -uint16_t rx_count,unsigned int socket_id) +uint16_t rx_count,unsigned int numa_id) {uint16_t i;uint8_t node;
@@ -273,7 +273,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[], key_ptrs[i] = (void *)&ipv4_dst_ip[i]; } -rte_efd_lookup_bulk (efd_table, socket_id, rx_count, +rte_efd_lookup_bulk (efd_table, numa_id, rx_count, (const void **) key_ptrs, data);for (i =0 ; i < rx_count; i++) { node = (uint8_t ) ((uintptr_t )data[i]);
@@ -303,7 +303,7 @@ static voiddo_packet_forwarding (void) {unsigned int port_num =0 ;/* indexes the port[] array */ -unsigned int socket_id =rte_socket_id (); +unsigned int numa_id =rte_numa_id ();for (;;) {struct rte_mbuf *buf[PACKET_READ_SIZE ];
@@ -316,7 +316,7 @@ do_packet_forwarding(void)/* Now process the NIC packets read */ if (likely (rx_count >0 )) -process_packets (port_num, buf, rx_count, socket_id); +process_packets (port_num, buf, rx_count, numa_id);/* move to next port */ if (++port_num == info->num_ports)
Signature · 1 line
2.55.0