use NUMA node terminology across the tree
Subsystems (11)
cover use NUMA node terminology across the tree
From: Chengwen Feng <[email protected]>
The DPDK tree conflates CPU sockets with NUMA memory nodes: public APIs, structure fields and macros are named after "socket" although they actually identify a NUMA node (e.g. rte_socket_id(), the socket_id field of rte_memzone, SOCKET_ID_ANY). This naming misleads application developers and pollutes vendor code that targets NUMA topologies.
This series renames the terminology tree-wide:
Foundation (EAL):
- New NUMA-aware functions are added: rte_numa_id(), rte_numa_count(), rte_numa_id_by_idx(), rte_lcore_to_numa_id(), rte_malloc_heap_numa_is_external(), and friends.
- SOCKET_ID_ANY becomes RTE_NUMA_ID_ANY; SOCKET_ID_ANY is kept as a deprecated macro alias.
- The socket_id fields of the public structures are renamed to numa_id, keeping socket_id as a deprecated union alias (so field offsets, and therefore ABI layout, are unchanged). Affected structures include rte_memzone, rte_memseg, rte_memseg_list, rte_mempool, rte_hash_parameters, rte_graph, rte_service_spec, rte_acl_param, rte_gro_param, rte_ipsec_sad_conf, rte_member_*, rte_bbdev_*, rte_cryptodev_config, rte_compressdev_config, rte_event_*, rte_ml_dev_config, rte_rawdev* -- see doc/guides/rel_notes/deprecation.rst for the full list.
Libraries:
- Library-specific APIs follow the same pattern: ethdev, cryptodev, compressdev, rawdev, mldev, bbdev and eventdev gain NUMA-named device APIs (e.g. rte_event_dev_numa_id()) with the socket variants kept as deprecated aliases.
Drivers, applications, examples and documentation:
- One commit per unit; in-tree users are updated in the same commit as the unit they belong to, moving from libs to drivers and then to app/examples.
- The programming guides and API docs are updated to the new names.
Compatibility notes:
- The deprecated aliases preserve source compatibility for external applications for one release; they will be removed in a future release, as recorded in deprecation.rst.
- No ABI break: the deprecated union alias keeps the layout identical.
- Device arguments and command-line options that literally use the "socket" name (e.g. --socket-mem, --socket-limit, the socket_id= parameter of the bbdev/compressdev vdevs) are intentionally NOT renamed to avoid breaking user scripts; their documentation still describes the existing parameter names. Feedback on whether/how to migrate these user-facing names is welcome.
This series is based on v26.11-rc2 and developped by AI.
Chengwen Feng (227):
eal: add NUMA-aware APIs
mempool: use NUMA node terminology
ring: use NUMA node terminology
hash: use NUMA node terminology
member: use NUMA node terminology
ethdev: rename device socket API to NUMA node API
cryptodev: rename device socket API to NUMA node API
compressdev: rename device socket API to NUMA node API
rawdev: rename device socket API to NUMA node API
mldev: rename device socket API to NUMA node API
bbdev: rename device socket API to NUMA node API
eventdev: rename device socket API to NUMA node API
acl: use NUMA node terminology
ipsec: use NUMA node terminology
graph: use NUMA node terminology
gro: use NUMA node terminology
fib: use NUMA node terminology
rib: use NUMA node terminology
lpm: use NUMA node terminology
efd: use NUMA node terminology
ip_frag: use NUMA node terminology
node: use NUMA node terminology
distributor: use NUMA node terminology
reorder: use NUMA node terminology
stack: use NUMA node terminology
regexdev: use NUMA node terminology
metrics: use NUMA node terminology
mbuf: use NUMA node terminology
timer: use NUMA node terminology
table: use NUMA node terminology
rcu: use NUMA node terminology
pdump: use NUMA node terminology
pdcp: use NUMA node terminology
latencystats: use NUMA node terminology
gpudev: use NUMA node terminology
dmadev: use NUMA node terminology
dispatcher: use NUMA node terminology
vhost: use NUMA node terminology
baseband/acc: use NUMA node terminology baseband/fpga_5gnr_fec: use NUMA node terminology baseband/fpga_lte_fec: use NUMA node terminology baseband/null: use NUMA node terminology baseband/turbo_sw: use NUMA node terminology bus/auxiliary: use NUMA node terminology bus/dpaa: use NUMA node terminology
bus/fslmc: use NUMA node terminology
bus/ifpga: use NUMA node terminology
bus/pci: use NUMA node terminology
bus/platform: use NUMA node terminology bus/vdev: use NUMA node terminology
bus/vmbus: use NUMA node terminology common/cnxk: use NUMA node terminology common/nitrox: use NUMA node terminology common/zsda: use NUMA node terminology compress/isal: use NUMA node terminology compress/mlx5: use NUMA node terminology compress/nitrox: use NUMA node terminology compress/octeontx: use NUMA node terminology compress/uadk: use NUMA node terminology compress/zlib: use NUMA node terminology compress/zsda: use NUMA node terminology crypto/armv8: use NUMA node terminology crypto/bcmfs: use NUMA node terminology crypto/caam_jr: use NUMA node terminology crypto/ccp: use NUMA node terminology crypto/cnxk: use NUMA node terminology crypto/dpaa2_sec: use NUMA node terminology crypto/dpaa_sec: use NUMA node terminology crypto/ionic: use NUMA node terminology crypto/ipsec_mb: use NUMA node terminology crypto/mlx5: use NUMA node terminology crypto/mvsam: use NUMA node terminology crypto/nitrox: use NUMA node terminology crypto/null: use NUMA node terminology crypto/octeontx: use NUMA node terminology crypto/openssl: use NUMA node terminology crypto/scheduler: use NUMA node terminology crypto/uadk: use NUMA node terminology crypto/virtio: use NUMA node terminology crypto/zsda: use NUMA node terminology dma/ae4dma: use NUMA node terminology
dma/cnxk: use NUMA node terminology
dma/dpaa: use NUMA node terminology
dma/dpaa2: use NUMA node terminology dma/hisi_acc: use NUMA node terminology dma/idxd: use NUMA node terminology dma/imx_edma5: use NUMA node terminology dma/odm: use NUMA node terminology
dma/skeleton: use NUMA node terminology event/cnxk: use NUMA node terminology event/dlb2: use NUMA node terminology event/dpaa: use NUMA node terminology event/dpaa2: use NUMA node terminology event/dsw: use NUMA node terminology event/octeontx: use NUMA node terminology event/opdl: use NUMA node terminology event/skeleton: use NUMA node terminology event/sw: use NUMA node terminology mempool/bucket: use NUMA node terminology mempool/cnxk: use NUMA node terminology
ml/cnxk: use NUMA node terminology net/af_packet: use NUMA node terminology net/af_xdp: use NUMA node terminology
net/ark: use NUMA node terminology
net/atlantic: use NUMA node terminology
net/avp: use NUMA node terminology
net/axgbe: use NUMA node terminology
net/bnx2x: use NUMA node terminology
net/bnxt: use NUMA node terminology
net/bonding: use NUMA node terminology
net/cnxk: use NUMA node terminology
net/cxgbe: use NUMA node terminology
net/dpaa: use NUMA node terminology
net/dpaa2: use NUMA node terminology
net/ena: use NUMA node terminology
net/enetc: use NUMA node terminology net/enetfec: use NUMA node terminology
net/enic: use NUMA node terminology net/failsafe: use NUMA node terminology
net/gve: use NUMA node terminology
net/hinic: use NUMA node terminology
net/hinic3: use NUMA node terminology
net/hns3: use NUMA node terminology
net/intel: use NUMA node terminology
net/ionic: use NUMA node terminology
net/mana: use NUMA node terminology
net/memif: use NUMA node terminology
net/mlx4: use NUMA node terminology
net/mvneta: use NUMA node terminology
net/mvpp2: use NUMA node terminology
net/nbl: use NUMA node terminology
net/netvsc: use NUMA node terminology
net/nfb: use NUMA node terminology
net/nfp: use NUMA node terminology
net/ngbe: use NUMA node terminology
net/ntnic: use NUMA node terminology
net/null: use NUMA node terminology net/octeon_ep: use NUMA node terminology net/octeontx: use NUMA node terminology net/pcap: use NUMA node terminology
net/pfe: use NUMA node terminology
net/qede: use NUMA node terminology
net/r8169: use NUMA node terminology
net/ring: use NUMA node terminology
net/rnp: use NUMA node terminology
net/sfc: use NUMA node terminology
net/softnic: use NUMA node terminology
net/sxe2: use NUMA node terminology
net/tap: use NUMA node terminology
net/thunderx: use NUMA node terminology net/txgbe: use NUMA node terminology
net/vhost: use NUMA node terminology
net/virtio: use NUMA node terminology net/vmxnet3: use NUMA node terminology
net/xsc: use NUMA node terminology
net/zxdh: use NUMA node terminology raw/cnxk_bphy: use NUMA node terminology raw/cnxk_gpio: use NUMA node terminology raw/cnxk_rvu_lf: use NUMA node terminology raw/dpaa2_cmdif: use NUMA node terminology raw/gdtc: use NUMA node terminology
raw/ifpga: use NUMA node terminology
raw/ntb: use NUMA node terminology
raw/skeleton: use NUMA node terminology regex/cn9k: use NUMA node terminology regex/mlx5: use NUMA node terminology
vdpa/mlx5: use NUMA node terminology
drivers: use NUMA node terminology
drivers: use NUMA node terminology
test: use NUMA node terminology
app/testpmd: use NUMA node terminology app/proc-info: use NUMA node terminology app/graph: use NUMA node terminology
app/pdump: use NUMA node terminology app/dumpcap: use NUMA node terminology app/test-mldev: use NUMA node terminology app/test-eventdev: use NUMA node terminology app/test-compress-perf: use NUMA node terminology app/test-crypto-perf: use NUMA node terminology app/test-bbdev: use NUMA node terminology app/test-security-perf: use NUMA node terminology app/test-regex: use NUMA node terminology app/test-flow-perf: use NUMA node terminology examples/bbdev_app: use NUMA node terminology examples/bond: use NUMA node terminology examples/distributor: use NUMA node terminology examples/dma: use NUMA node terminology examples/ethtool: use NUMA node terminology examples/eventdev_pipeline: use NUMA node terminology examples/fips_validation: use NUMA node terminology examples/flow_filtering: use NUMA node terminology examples/ip_fragmentation: use NUMA node terminology examples/ip_reassembly: use NUMA node terminology examples/ipsec-secgw: use NUMA node terminology examples/ipv4_multicast: use NUMA node terminology examples/l2fwd: use NUMA node terminology examples/l2fwd-cat: use NUMA node terminology examples/l2fwd-crypto: use NUMA node terminology examples/l2fwd-event: use NUMA node terminology examples/l2fwd-jobstats: use NUMA node terminology examples/l2fwd-keepalive: use NUMA node terminology examples/l2fwd-macsec: use NUMA node terminology examples/l3fwd: use NUMA node terminology examples/l3fwd-graph: use NUMA node terminology examples/l3fwd-power: use NUMA node terminology examples/link_status_interrupt: use NUMA node terminology examples/multi_process: use NUMA node terminology examples/ntb: use NUMA node terminology examples/packet_ordering: use NUMA node terminology examples/pipeline: use NUMA node terminology examples/ptpclient: use NUMA node terminology examples/ptp_tap_relay_sw: use NUMA node terminology examples/qos_meter: use NUMA node terminology examples/qos_sched: use NUMA node terminology examples/rxtx_callbacks: use NUMA node terminology examples/server_node_efd: use NUMA node terminology examples/skeleton: use NUMA node terminology examples/vhost: use NUMA node terminology examples/vhost_crypto: use NUMA node terminology examples/vm_power_manager: use NUMA node terminology examples/vmdq: use NUMA node terminology examples/vmdq_dcb: use NUMA node terminology
eal: deprecate legacy socket API aliases
doc: use NUMA node terminology
test-dma-perf: use NUMA node terminology test/memzone: fix NUMA node terminology rename
examples: fix NUMA node terminology residue
app/dumpcap/main.c | 4 +- app/graph/ethdev.c | 4 +- app/graph/graph.c | 4 +- app/graph/l2fwd.c | 2 +- app/graph/l3fwd.c | 10 +- app/pdump/main.c | 12 +- app/proc-info/main.c | 10 +- app/test-acl/main.c | 6 +- app/test-bbdev/test_bbdev.c | 38 ++-- app/test-bbdev/test_bbdev_perf.c | 96 ++++---- .../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 +- app/test-crypto-perf/cperf_test_common.c | 6 +- app/test-crypto-perf/main.c | 54 ++--- app/test-dma-perf/benchmark.c | 8 +- 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 | 36 +-- app/test-eventdev/test_pipeline_common.c | 14 +- app/test-flow-perf/main.c | 10 +- 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 +- app/test-pmd/cmdline.c | 26 +-- app/test-pmd/config.c | 10 +- app/test-pmd/noisy_vnf.c | 2 +- app/test-pmd/parameters.c | 46 ++-- app/test-pmd/testpmd.c | 122 +++++----- app/test-pmd/testpmd.h | 20 +- app/test-regex/main.c | 6 +- app/test-sad/main.c | 2 +- app/test-security-perf/test_security_perf.c | 10 +- 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 | 12 +- 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 | 18 +- app/test/test_fib.c | 48 ++-- app/test/test_fib6.c | 66 +++--- app/test/test_fib6_perf.c | 2 +- app/test/test_fib_perf.c | 2 +- app/test/test_func_reentrancy.c | 16 +- app/test/test_graph.c | 6 +- app/test/test_graph_feature_arc.c | 2 +- app/test/test_graph_perf.c | 6 +- app/test/test_hash.c | 72 +++--- app/test/test_hash_multiwriter.c | 2 +- app/test/test_hash_perf.c | 4 +- app/test/test_hash_readwrite.c | 2 +- app/test/test_hash_readwrite_lf_perf.c | 2 +- app/test/test_ipfrag.c | 6 +- app/test/test_ipsec.c | 12 +- app/test/test_ipsec_perf.c | 12 +- app/test/test_ipsec_sad.c | 24 +- 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 | 152 ++++++------- app/test/test_malloc_perf.c | 2 +- app/test/test_mbuf.c | 18 +- app/test/test_member.c | 6 +- app/test/test_member_perf.c | 6 +- app/test/test_mempool.c | 40 ++-- app/test/test_mempool_perf.c | 10 +- app/test/test_memzone.c | 121 +++++----- 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_rcu_qsbr.c | 2 +- app/test/test_rcu_qsbr_perf.c | 2 +- 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 +- doc/api/doxy-api.conf.in | 1 + doc/guides/prog_guide/bbdev.rst | 14 +- doc/guides/prog_guide/compressdev.rst | 4 +- .../prog_guide/env_abstraction_layer.rst | 32 +-- .../eventdev/event_timer_adapter.rst | 2 +- .../eventdev/event_vector_adapter.rst | 2 +- doc/guides/prog_guide/eventdev/eventdev.rst | 2 +- doc/guides/prog_guide/gpudev.rst | 2 +- doc/guides/prog_guide/ptr_compress_lib.rst | 2 +- doc/guides/rel_notes/deprecation.rst | 27 +++ doc/guides/rel_notes/release_26_11.rst | 25 ++- drivers/baseband/acc/acc_common.h | 4 +- drivers/baseband/acc/rte_acc100_pmd.c | 44 ++-- drivers/baseband/acc/rte_vrb_pmd.c | 46 ++-- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 24 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 24 +- drivers/baseband/la12xx/bbdev_la12xx.c | 2 +- drivers/baseband/null/bbdev_null.c | 26 +-- .../baseband/turbo_sw/bbdev_turbo_software.c | 54 ++--- drivers/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/linux/auxiliary.c | 2 +- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/fslmc/fslmc_bus.c | 2 +- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci.c | 2 +- drivers/bus/pci/pci_common.c | 2 +- drivers/bus/pci/windows/pci.c | 2 +- drivers/bus/platform/platform.c | 2 +- drivers/bus/vdev/vdev.c | 4 +- drivers/bus/vmbus/linux/vmbus_bus.c | 2 +- drivers/bus/vmbus/vmbus_channel.c | 2 +- drivers/bus/vmbus/vmbus_common.c | 2 +- drivers/common/cnxk/roc_platform.c | 2 +- drivers/common/cnxk/roc_platform.h | 2 +- .../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/common/nitrox/nitrox_device.c | 2 +- drivers/common/nitrox/nitrox_qp.c | 16 +- drivers/common/nitrox/nitrox_qp.h | 2 +- drivers/common/qat/qat_device.c | 2 +- drivers/common/qat/qat_qp.c | 22 +- drivers/common/qat/qat_qp.h | 2 +- drivers/common/zsda/zsda_device.c | 4 +- drivers/common/zsda/zsda_qp.c | 18 +- drivers/common/zsda/zsda_qp.h | 4 +- drivers/compress/isal/isal_compress_pmd.c | 4 +- drivers/compress/isal/isal_compress_pmd_ops.c | 26 +-- drivers/compress/mlx5/mlx5_compress.c | 22 +- drivers/compress/nitrox/nitrox_comp.c | 22 +- drivers/compress/nitrox/nitrox_comp_reqmgr.c | 22 +- drivers/compress/nitrox/nitrox_comp_reqmgr.h | 2 +- drivers/compress/octeontx/otx_zip_pmd.c | 18 +- drivers/compress/qat/qat_comp.c | 14 +- drivers/compress/qat/qat_comp.h | 2 +- drivers/compress/qat/qat_comp_pmd.c | 36 +-- drivers/compress/qat/qat_comp_pmd.h | 2 +- drivers/compress/uadk/uadk_compress_pmd.c | 14 +- drivers/compress/zlib/zlib_pmd.c | 2 +- drivers/compress/zlib/zlib_pmd_ops.c | 16 +- drivers/compress/zsda/zsda_comp_pmd.c | 14 +- drivers/crypto/armv8/rte_armv8_pmd.c | 6 +- drivers/crypto/armv8/rte_armv8_pmd_ops.c | 12 +- drivers/crypto/bcmfs/bcmfs_qp.c | 16 +- drivers/crypto/bcmfs/bcmfs_qp.h | 2 +- drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 12 +- drivers/crypto/caam_jr/caam_jr.c | 8 +- drivers/crypto/ccp/ccp_dev.c | 14 +- drivers/crypto/ccp/ccp_pmd_ops.c | 14 +- drivers/crypto/ccp/rte_ccp_pmd.c | 10 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn20k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 12 +- drivers/crypto/cnxk/cnxk_cryptodev_ops.h | 4 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 8 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 8 +- drivers/crypto/ionic/ionic_crypto.h | 6 +- drivers/crypto/ionic/ionic_crypto_main.c | 42 ++-- drivers/crypto/ionic/ionic_crypto_ops.c | 8 +- drivers/crypto/ionic/ionic_crypto_vdev.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_ops.c | 22 +- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 4 +- drivers/crypto/ipsec_mb/pmd_aesni_gcm.c | 6 +- drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 2 +- drivers/crypto/ipsec_mb/pmd_zuc.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/mlx5/mlx5_crypto_gcm.c | 18 +- drivers/crypto/mlx5/mlx5_crypto_xts.c | 12 +- drivers/crypto/mvsam/rte_mrvl_pmd.c | 8 +- drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 8 +- drivers/crypto/nitrox/nitrox_sym.c | 12 +- drivers/crypto/nitrox/nitrox_sym_reqmgr.c | 4 +- drivers/crypto/nitrox/nitrox_sym_reqmgr.h | 2 +- drivers/crypto/null/null_crypto_pmd.c | 4 +- drivers/crypto/null/null_crypto_pmd_ops.c | 12 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- .../crypto/octeontx/otx_cryptodev_hw_access.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 6 +- drivers/crypto/openssl/rte_openssl_pmd.c | 4 +- drivers/crypto/openssl/rte_openssl_pmd_ops.c | 12 +- 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 +- .../scheduler/rte_cryptodev_scheduler.c | 16 +- drivers/crypto/scheduler/scheduler_failover.c | 4 +- .../crypto/scheduler/scheduler_multicore.c | 12 +- .../scheduler/scheduler_pkt_size_distr.c | 8 +- drivers/crypto/scheduler/scheduler_pmd.c | 24 +- drivers/crypto/scheduler/scheduler_pmd_ops.c | 10 +- .../crypto/scheduler/scheduler_roundrobin.c | 4 +- drivers/crypto/uadk/uadk_crypto_pmd.c | 12 +- drivers/crypto/virtio/virtio_cryptodev.c | 14 +- drivers/crypto/virtio/virtio_cryptodev.h | 2 +- drivers/crypto/virtio/virtio_user_cryptodev.c | 2 +- drivers/crypto/virtio/virtqueue.c | 2 +- drivers/crypto/zsda/zsda_crypto_pmd.c | 12 +- drivers/dma/ae4dma/ae4dma_dmadev.c | 6 +- drivers/dma/cnxk/cnxk_dmadev.c | 2 +- drivers/dma/dpaa/dpaa_qdma.c | 2 +- drivers/dma/dpaa2/dpaa2_qdma.c | 4 +- drivers/dma/hisi_acc/hisi_acc_dmadev.c | 2 +- drivers/dma/idxd/idxd_bus.c | 2 +- drivers/dma/idxd/idxd_common.c | 2 +- drivers/dma/imx_edma5/imx_edma5_dmadev.c | 8 +- drivers/dma/odm/odm.c | 4 +- drivers/dma/skeleton/skeleton_dmadev.c | 26 +-- drivers/dma/skeleton/skeleton_dmadev.h | 2 +- drivers/event/cnxk/cn10k_eventdev.c | 4 +- drivers/event/cnxk/cn20k_eventdev.c | 4 +- drivers/event/cnxk/cn9k_eventdev.c | 8 +- drivers/event/cnxk/cnxk_eventdev.c | 2 +- drivers/event/cnxk/cnxk_eventdev_adptr.c | 2 +- drivers/event/cnxk/cnxk_eventdev_selftest.c | 2 +- drivers/event/cnxk/cnxk_tim_evdev.c | 4 +- drivers/event/dlb2/dlb2.c | 8 +- drivers/event/dlb2/dlb2_priv.h | 4 +- drivers/event/dlb2/dlb2_selftest.c | 2 +- drivers/event/dlb2/dlb2_xstats.c | 8 +- drivers/event/dlb2/pf/dlb2_pf.c | 14 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +- drivers/event/dsw/dsw_evdev.c | 6 +- drivers/event/octeontx/ssovf_evdev.c | 6 +- drivers/event/octeontx/ssovf_evdev_selftest.c | 2 +- drivers/event/octeontx/ssovf_worker.c | 2 +- drivers/event/octeontx/timvf_evdev.c | 2 +- drivers/event/opdl/opdl_evdev.c | 16 +- drivers/event/opdl/opdl_ring.c | 6 +- drivers/event/opdl/opdl_ring.h | 2 +- drivers/event/opdl/opdl_test.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 18 +- drivers/event/sw/event_ring.h | 4 +- drivers/event/sw/sw_evdev.c | 32 +-- drivers/event/sw/sw_evdev_selftest.c | 2 +- drivers/event/sw/sw_evdev_xstats.c | 4 +- drivers/mempool/bucket/rte_mempool_bucket.c | 14 +- drivers/mempool/cnxk/cn10k_mempool_ops.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- .../mempool/octeontx/rte_mempool_octeontx.c | 4 +- drivers/mempool/ring/rte_mempool_ring.c | 2 +- drivers/mempool/stack/rte_mempool_stack.c | 2 +- drivers/ml/cnxk/cn10k_ml_dev.c | 2 +- drivers/ml/cnxk/cnxk_ml_ops.c | 12 +- drivers/ml/cnxk/mvtvm_ml_dev.c | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 22 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 34 +-- drivers/net/ark/ark_ethdev.c | 4 +- drivers/net/ark/ark_ethdev_rx.c | 14 +- drivers/net/ark/ark_ethdev_rx.h | 2 +- drivers/net/ark/ark_ethdev_tx.c | 14 +- drivers/net/ark/ark_ethdev_tx.h | 2 +- drivers/net/atlantic/atl_ethdev.h | 4 +- drivers/net/atlantic/atl_rxtx.c | 24 +- drivers/net/avp/avp_ethdev.c | 16 +- drivers/net/axgbe/axgbe_rxtx.c | 16 +- drivers/net/axgbe/axgbe_rxtx.h | 4 +- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_rxtx.c | 22 +- drivers/net/bnx2x/bnx2x_rxtx.h | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 6 +- drivers/net/bnxt/bnxt_mpc.c | 38 ++-- drivers/net/bnxt/bnxt_reps.c | 32 +-- drivers/net/bnxt/bnxt_reps.h | 4 +- drivers/net/bnxt/bnxt_ring.c | 12 +- drivers/net/bnxt/bnxt_ring.h | 2 +- drivers/net/bnxt/bnxt_rxq.c | 10 +- drivers/net/bnxt/bnxt_rxq.h | 2 +- drivers/net/bnxt/bnxt_rxr.c | 22 +- drivers/net/bnxt/bnxt_rxr.h | 2 +- drivers/net/bnxt/bnxt_txq.c | 14 +- drivers/net/bnxt/bnxt_txq.h | 2 +- drivers/net/bnxt/bnxt_txr.c | 18 +- drivers/net/bnxt/bnxt_txr.h | 2 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/tf_core/v3/tfc_tbl_scope.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_matcher.c | 4 +- drivers/net/bonding/eth_bond_private.h | 2 +- drivers/net/bonding/rte_eth_bond.h | 4 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 14 +- drivers/net/bonding/rte_eth_bond_alb.c | 4 +- drivers/net/bonding/rte_eth_bond_api.c | 4 +- drivers/net/bonding/rte_eth_bond_args.c | 14 +- drivers/net/bonding/rte_eth_bond_flow.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 36 +-- drivers/net/cnxk/cnxk_eswitch.c | 2 +- drivers/net/cnxk/cnxk_ethdev_sec.c | 6 +- drivers/net/cnxk/cnxk_lookup.c | 2 +- drivers/net/cnxk/cnxk_rep.h | 4 +- drivers/net/cnxk/cnxk_rep_ops.c | 8 +- drivers/net/cxgbe/base/adapter.h | 6 +- drivers/net/cxgbe/cxgbe_ethdev.c | 16 +- drivers/net/cxgbe/cxgbe_main.c | 18 +- drivers/net/cxgbe/cxgbe_pfvf.h | 4 +- drivers/net/cxgbe/cxgbevf_main.c | 4 +- drivers/net/cxgbe/sge.c | 28 +-- drivers/net/dpaa/dpaa_ethdev.c | 6 +- drivers/net/dpaa2/dpaa2_ethdev.c | 6 +- drivers/net/dpaa2/dpaa2_tm.c | 6 +- drivers/net/ena/base/ena_plat_dpdk.h | 6 +- drivers/net/ena/ena_ethdev.c | 42 ++-- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enetc/enetc.h | 4 +- drivers/net/enetc/enetc4_ethdev.c | 4 +- drivers/net/enetc/enetc_ethdev.c | 4 +- drivers/net/enetfec/enet_ethdev.c | 4 +- drivers/net/enic/base/vnic_cq.c | 8 +- drivers/net/enic/base/vnic_cq.h | 4 +- drivers/net/enic/base/vnic_dev.c | 4 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/base/vnic_rq.c | 6 +- drivers/net/enic/base/vnic_rq.h | 2 +- drivers/net/enic/base/vnic_wq.c | 8 +- drivers/net/enic/base/vnic_wq.h | 2 +- drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_ethdev.c | 8 +- drivers/net/enic/enic_fm_flow.c | 2 +- drivers/net/enic/enic_main.c | 32 +-- drivers/net/enic/enic_sriov.c | 10 +- drivers/net/enic/enic_vf_representor.c | 8 +- drivers/net/failsafe/failsafe.c | 6 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/failsafe/failsafe_intr.c | 2 +- drivers/net/failsafe/failsafe_ops.c | 12 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/gve/base/gve_osdep.h | 2 +- drivers/net/gve/gve_ethdev.c | 14 +- drivers/net/gve/gve_ethdev.h | 8 +- drivers/net/gve/gve_rx.c | 16 +- drivers/net/gve/gve_rx_dqo.c | 24 +- drivers/net/gve/gve_tx.c | 18 +- drivers/net/gve/gve_tx_dqo.c | 16 +- drivers/net/hinic/base/hinic_compat.h | 6 +- drivers/net/hinic/base/hinic_pmd_api_cmd.c | 6 +- drivers/net/hinic/base/hinic_pmd_eqs.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 20 +- drivers/net/hinic/base/hinic_pmd_mbox.c | 2 +- drivers/net/hinic/base/hinic_pmd_wq.c | 10 +- drivers/net/hinic/base/hinic_pmd_wq.h | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 26 +-- drivers/net/hinic/hinic_pmd_rx.c | 16 +- drivers/net/hinic/hinic_pmd_rx.h | 4 +- drivers/net/hinic/hinic_pmd_tx.c | 8 +- drivers/net/hinic/hinic_pmd_tx.h | 4 +- drivers/net/hinic3/base/hinic3_cmdq.c | 2 +- drivers/net/hinic3/base/hinic3_eqs.c | 2 +- drivers/net/hinic3/base/hinic3_hwdev.c | 4 +- drivers/net/hinic3/base/hinic3_hwdev.h | 2 +- drivers/net/hinic3/base/hinic3_mbox.c | 4 +- drivers/net/hinic3/base/hinic3_wq.c | 2 +- drivers/net/hinic3/hinic3_ethdev.c | 38 ++-- drivers/net/hns3/hns3_cmd.c | 2 +- drivers/net/hns3/hns3_fdir.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 44 ++-- drivers/net/hns3/hns3_rxtx.h | 6 +- drivers/net/intel/cpfl/cpfl_ethdev.c | 4 +- drivers/net/intel/cpfl/cpfl_representor.c | 4 +- drivers/net/intel/cpfl/cpfl_rxtx.c | 74 +++---- drivers/net/intel/cpfl/cpfl_rxtx.h | 4 +- drivers/net/intel/e1000/e1000_ethdev.h | 8 +- drivers/net/intel/e1000/em_rxtx.c | 8 +- drivers/net/intel/e1000/igb_rxtx.c | 8 +- drivers/net/intel/e1000/igc_txrx.c | 8 +- drivers/net/intel/e1000/igc_txrx.h | 4 +- drivers/net/intel/fm10k/fm10k_ethdev.c | 28 +-- drivers/net/intel/i40e/i40e_ethdev.c | 4 +- drivers/net/intel/i40e/i40e_ethdev.h | 2 +- drivers/net/intel/i40e/i40e_fdir.c | 8 +- drivers/net/intel/i40e/i40e_flow_ethertype.c | 2 +- drivers/net/intel/i40e/i40e_rxtx.c | 44 ++-- drivers/net/intel/i40e/i40e_rxtx.h | 4 +- drivers/net/intel/i40e/i40e_vf_representor.c | 4 +- drivers/net/intel/iavf/iavf_osdep.c | 2 +- drivers/net/intel/iavf/iavf_rxtx.c | 32 +-- drivers/net/intel/iavf/iavf_rxtx.h | 4 +- .../net/intel/ice/ice_dcf_vf_representor.c | 4 +- drivers/net/intel/ice/ice_fdir_filter.c | 8 +- drivers/net/intel/ice/ice_osdep.h | 2 +- drivers/net/intel/ice/ice_rxtx.c | 46 ++-- drivers/net/intel/ice/ice_rxtx.h | 4 +- drivers/net/intel/idpf/idpf_common_rxtx.c | 6 +- drivers/net/intel/idpf/idpf_common_rxtx.h | 2 +- drivers/net/intel/idpf/idpf_osdep.h | 2 +- drivers/net/intel/idpf/idpf_rxtx.c | 60 ++--- drivers/net/intel/idpf/idpf_rxtx.h | 4 +- drivers/net/intel/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/intel/ipn3ke/ipn3ke_representor.c | 4 +- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ethdev.h | 4 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 32 +-- .../net/intel/ixgbe/ixgbe_vf_representor.c | 4 +- drivers/net/ionic/ionic_lif.c | 38 ++-- drivers/net/ionic/ionic_lif.h | 4 +- drivers/net/ionic/ionic_main.c | 6 +- drivers/net/ionic/ionic_rxtx.c | 12 +- drivers/net/ionic/ionic_rxtx.h | 4 +- drivers/net/mana/mana.c | 54 ++--- drivers/net/mana/mr.c | 4 +- drivers/net/memif/memif_socket.c | 2 +- drivers/net/memif/rte_eth_memif.c | 4 +- drivers/net/mlx4/mlx4.c | 8 +- drivers/net/mlx4/mlx4_mr.c | 14 +- drivers/net/mlx4/mlx4_utils.c | 14 +- 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 | 29 +-- 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 | 24 +- 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_txq.c | 13 +- drivers/net/mlx5/mlx5_utils.c | 30 +-- drivers/net/mlx5/windows/mlx5_flow_os.c | 4 +- drivers/net/mlx5/windows/mlx5_os.c | 8 +- drivers/net/mvneta/mvneta_ethdev.c | 2 +- drivers/net/mvneta/mvneta_rxtx.c | 4 +- drivers/net/mvpp2/mrvl_ethdev.c | 6 +- drivers/net/mvpp2/mrvl_flow.c | 8 +- drivers/net/mvpp2/mrvl_mtr.c | 4 +- drivers/net/mvpp2/mrvl_qos.c | 4 +- drivers/net/mvpp2/mrvl_tm.c | 6 +- drivers/net/nbl/nbl_common/nbl_common.c | 2 +- drivers/net/nbl/nbl_dev/nbl_dev.c | 8 +- drivers/net/nbl/nbl_dev/nbl_dev.h | 4 +- drivers/net/nbl/nbl_hw/nbl_txrx.c | 14 +- drivers/net/nbl/nbl_include/nbl_include.h | 4 +- drivers/net/netvsc/hn_ethdev.c | 6 +- drivers/net/netvsc/hn_rxtx.c | 30 +-- drivers/net/netvsc/hn_var.h | 10 +- drivers/net/netvsc/hn_vf.c | 8 +- drivers/net/nfb/nfb_ethdev.c | 2 +- drivers/net/nfb/nfb_rx.c | 8 +- drivers/net/nfb/nfb_rx.h | 2 +- drivers/net/nfb/nfb_tx.c | 8 +- drivers/net/nfb/nfb_tx.h | 2 +- drivers/net/nfp/flower/nfp_conntrack.c | 2 +- drivers/net/nfp/flower/nfp_flower.c | 16 +- drivers/net/nfp/flower/nfp_flower_flow.c | 10 +- .../net/nfp/flower/nfp_flower_representor.c | 20 +- drivers/net/nfp/nfd3/nfp_nfd3.h | 2 +- drivers/net/nfp/nfd3/nfp_nfd3_dp.c | 12 +- drivers/net/nfp/nfdk/nfp_nfdk.h | 2 +- drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 12 +- drivers/net/nfp/nfp_net_common.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/nfp/nfp_rxtx.c | 18 +- drivers/net/nfp/nfp_rxtx.h | 4 +- drivers/net/nfp/nfpcore/nfp_sync.c | 2 +- drivers/net/ngbe/ngbe_ethdev.c | 2 +- drivers/net/ngbe/ngbe_ethdev.h | 4 +- drivers/net/ngbe/ngbe_rxtx.c | 28 +-- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 4 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 2 +- .../link_agx_100g/nt4ga_agx_link_100g.c | 2 +- .../flow_api/profile_inline/flm_age_queue.c | 2 +- .../flow_api/profile_inline/flm_evt_queue.c | 2 +- .../flow_api/profile_inline/flm_lrn_queue.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 24 +- drivers/net/ntnic/ntutil/nt_util.c | 4 +- drivers/net/null/rte_eth_null.c | 14 +- drivers/net/octeon_ep/otx_ep_common.h | 4 +- drivers/net/octeon_ep/otx_ep_ethdev.c | 12 +- drivers/net/octeon_ep/otx_ep_rxtx.c | 32 +-- drivers/net/octeontx/octeontx_ethdev.c | 40 ++-- drivers/net/pcap/pcap_ethdev.c | 14 +- drivers/net/pfe/pfe_ethdev.c | 4 +- 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 +- drivers/net/r8169/r8169_ethdev.h | 4 +- drivers/net/r8169/r8169_hw.c | 2 +- drivers/net/r8169/r8169_rxtx.c | 16 +- drivers/net/ring/rte_eth_ring.c | 20 +- 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 +- 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_tbl_meta_cache.c | 2 +- drivers/net/sfc/sfc_tso.c | 6 +- drivers/net/sfc/sfc_tx.c | 28 +-- drivers/net/sfc/sfc_tx.h | 4 +- drivers/net/softnic/rte_eth_softnic.c | 6 +- drivers/net/softnic/rte_eth_softnic_thread.c | 4 +- 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 +- drivers/net/tap/rte_eth_tap.c | 22 +- drivers/net/thunderx/nicvf_ethdev.c | 24 +- drivers/net/txgbe/txgbe_ethdev.c | 6 +- drivers/net/txgbe/txgbe_ethdev.h | 4 +- drivers/net/txgbe/txgbe_rxtx.c | 34 +-- drivers/net/vhost/rte_eth_vhost.c | 28 +-- drivers/net/virtio/virtio_ethdev.c | 4 +- drivers/net/virtio/virtio_ethdev.h | 4 +- drivers/net/virtio/virtio_rxtx.c | 6 +- .../net/virtio/virtio_user/virtio_user_dev.c | 2 +- drivers/net/virtio/virtqueue.c | 6 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 14 +- drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 8 +- 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 +- drivers/net/zxdh/zxdh_ethdev.c | 18 +- drivers/net/zxdh/zxdh_queue.c | 4 +- drivers/net/zxdh/zxdh_queue.h | 4 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_gpio/cnxk_gpio.c | 4 +- drivers/raw/cnxk_rvu_lf/cnxk_rvu_lf.c | 2 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 10 +- drivers/raw/gdtc/gdtc_rawdev.c | 6 +- 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 +- drivers/raw/ntb/ntb.c | 26 +-- drivers/raw/skeleton/skeleton_rawdev.c | 10 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 14 +- drivers/regex/cn9k/cn9k_regexdev.c | 6 +- drivers/regex/mlx5/mlx5_regex_control.c | 6 +- drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 4 +- examples/bbdev_app/main.c | 18 +- examples/bond/main.c | 12 +- examples/distributor/main.c | 30 +-- examples/dma/dmafwd.c | 8 +- examples/ethtool/ethtool-app/main.c | 6 +- examples/ethtool/lib/rte_ethtool.c | 4 +- .../pipeline_worker_generic.c | 6 +- .../eventdev_pipeline/pipeline_worker_tx.c | 6 +- examples/fips_validation/fips_dev_self_test.c | 10 +- examples/fips_validation/main.c | 14 +- examples/flow_filtering/main.c | 6 +- examples/ip_fragmentation/main.c | 10 +- examples/ip_reassembly/main.c | 18 +- examples/ipsec-secgw/event_helper.c | 14 +- examples/ipsec-secgw/ipsec-secgw.c | 132 +++++------ examples/ipsec-secgw/ipsec-secgw.h | 2 +- examples/ipsec-secgw/ipsec.h | 10 +- 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 +- examples/ipv4_multicast/main.c | 14 +- examples/l2fwd-cat/l2fwd-cat.c | 12 +- examples/l2fwd-crypto/main.c | 38 ++-- examples/l2fwd-event/l2fwd_common.c | 4 +- examples/l2fwd-event/l2fwd_poll.c | 4 +- examples/l2fwd-event/main.c | 4 +- examples/l2fwd-jobstats/main.c | 10 +- examples/l2fwd-keepalive/main.c | 10 +- examples/l2fwd-macsec/main.c | 12 +- examples/l2fwd/main.c | 10 +- examples/l3fwd-graph/main.c | 24 +- examples/l3fwd-power/main.c | 32 +-- examples/l3fwd/l3fwd.h | 2 +- examples/l3fwd/l3fwd_acl.c | 26 +-- examples/l3fwd/l3fwd_em.c | 8 +- examples/l3fwd/l3fwd_event.h | 2 +- examples/l3fwd/l3fwd_fib.c | 4 +- examples/l3fwd/l3fwd_lpm.c | 4 +- examples/l3fwd/main.c | 16 +- examples/link_status_interrupt/main.c | 10 +- .../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 +- examples/ntb/ntb_fwd.c | 14 +- examples/packet_ordering/main.c | 16 +- examples/pipeline/obj.c | 12 +- examples/ptp_tap_relay_sw/ptp_tap_relay_sw.c | 6 +- examples/ptpclient/ptpclient.c | 6 +- examples/qos_meter/main.c | 14 +- examples/qos_sched/args.c | 4 +- examples/qos_sched/init.c | 8 +- examples/rxtx_callbacks/main.c | 12 +- 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 +- examples/skeleton/basicfwd.c | 12 +- examples/vhost/main.c | 6 +- examples/vhost_crypto/main.c | 26 +-- examples/vm_power_manager/main.c | 6 +- examples/vmdq/main.c | 6 +- examples/vmdq_dcb/main.c | 6 +- lib/acl/acl.h | 4 +- lib/acl/acl_gen.c | 10 +- lib/acl/rte_acl.c | 14 +- lib/acl/rte_acl.h | 14 +- lib/bbdev/bbdev_trace.h | 4 +- lib/bbdev/rte_bbdev.c | 26 +-- lib/bbdev/rte_bbdev.h | 36 ++- lib/bbdev/rte_bbdev_op.h | 6 +- lib/bbdev/rte_bbdev_pmd.h | 2 +- lib/compressdev/rte_comp.c | 4 +- lib/compressdev/rte_comp.h | 4 +- lib/compressdev/rte_compressdev.c | 35 +-- lib/compressdev/rte_compressdev.h | 35 ++- lib/compressdev/rte_compressdev_internal.h | 2 +- lib/compressdev/rte_compressdev_pmd.c | 10 +- lib/compressdev/rte_compressdev_pmd.h | 12 +- lib/cryptodev/cryptodev_pmd.c | 14 +- lib/cryptodev/cryptodev_pmd.h | 24 +- lib/cryptodev/cryptodev_trace.h | 18 +- lib/cryptodev/cryptodev_trace_points.c | 4 +- lib/cryptodev/rte_crypto.h | 4 +- lib/cryptodev/rte_cryptodev.c | 63 +++--- lib/cryptodev/rte_cryptodev.h | 56 +++-- lib/dispatcher/rte_dispatcher.c | 12 +- lib/distributor/rte_distributor.c | 6 +- lib/distributor/rte_distributor.h | 4 +- lib/distributor/rte_distributor_single.c | 4 +- lib/distributor/rte_distributor_single.h | 4 +- lib/dmadev/rte_dmadev.c | 4 +- lib/eal/common/eal_common_dynmem.c | 174 +++++++-------- lib/eal/common/eal_common_lcore.c | 85 ++++--- lib/eal/common/eal_common_memalloc.c | 38 ++-- lib/eal/common/eal_common_memory.c | 52 ++--- lib/eal/common/eal_common_memzone.c | 38 ++-- lib/eal/common/eal_common_options.c | 12 +- lib/eal/common/eal_common_thread.c | 34 +-- lib/eal/common/eal_hugepages.h | 2 +- lib/eal/common/eal_internal_cfg.h | 2 +- lib/eal/common/eal_memalloc.h | 10 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/eal_private.h | 12 +- lib/eal/common/eal_thread.h | 6 +- lib/eal/common/malloc_heap.c | 204 +++++++++-------- lib/eal/common/malloc_heap.h | 12 +- lib/eal/common/malloc_mp.c | 10 +- lib/eal/common/malloc_mp.h | 4 +- lib/eal/common/rte_malloc.c | 156 ++++++++----- lib/eal/freebsd/eal.c | 12 +- lib/eal/freebsd/eal_lcore.c | 2 +- lib/eal/freebsd/eal_memalloc.c | 4 +- lib/eal/freebsd/eal_memory.c | 2 +- lib/eal/include/eal_trace_internal.h | 16 +- lib/eal/include/rte_lcore.h | 71 +++++- lib/eal/include/rte_malloc.h | 208 ++++++++++++++++-- lib/eal/include/rte_memory.h | 30 ++- lib/eal/include/rte_memzone.h | 22 +- lib/eal/include/rte_service_component.h | 12 +- lib/eal/linux/eal.c | 16 +- lib/eal/linux/eal_hugepage_info.c | 40 ++-- lib/eal/linux/eal_lcore.c | 2 +- lib/eal/linux/eal_memalloc.c | 40 ++-- lib/eal/linux/eal_memory.c | 78 +++---- lib/eal/windows/eal_hugepages.c | 12 +- lib/eal/windows/eal_lcore.c | 42 ++-- lib/eal/windows/eal_memalloc.c | 40 ++-- lib/eal/windows/eal_memory.c | 10 +- lib/eal/windows/eal_windows.h | 18 +- lib/efd/rte_efd.c | 104 ++++----- lib/efd/rte_efd.h | 38 ++-- lib/ethdev/ethdev_driver.c | 10 +- lib/ethdev/ethdev_driver.h | 10 +- lib/ethdev/ethdev_pci.h | 8 +- lib/ethdev/ethdev_private.c | 2 +- lib/ethdev/ethdev_trace.h | 6 +- lib/ethdev/ethdev_trace_points.c | 4 +- lib/ethdev/ethdev_vdev.h | 2 +- lib/ethdev/rte_ethdev.c | 31 ++- lib/ethdev/rte_ethdev.h | 39 +++- lib/ethdev/rte_ethdev_telemetry.c | 2 +- lib/eventdev/event_timer_adapter_pmd.h | 4 +- lib/eventdev/event_vector_adapter_pmd.h | 4 +- lib/eventdev/eventdev_pmd.h | 10 +- lib/eventdev/eventdev_pmd_pci.h | 4 +- lib/eventdev/eventdev_pmd_vdev.h | 12 +- lib/eventdev/eventdev_trace.h | 14 +- lib/eventdev/eventdev_trace_points.c | 4 +- lib/eventdev/rte_event_crypto_adapter.c | 30 +-- lib/eventdev/rte_event_dma_adapter.c | 38 ++-- lib/eventdev/rte_event_eth_rx_adapter.c | 68 +++--- lib/eventdev/rte_event_eth_tx_adapter.c | 30 +-- lib/eventdev/rte_event_ring.c | 6 +- lib/eventdev/rte_event_ring.h | 8 +- lib/eventdev/rte_event_timer_adapter.c | 16 +- lib/eventdev/rte_event_timer_adapter.h | 11 +- lib/eventdev/rte_event_vector_adapter.c | 12 +- lib/eventdev/rte_event_vector_adapter.h | 11 +- lib/eventdev/rte_eventdev.c | 33 +-- lib/eventdev/rte_eventdev.h | 25 ++- lib/fib/dir24_8.c | 14 +- lib/fib/dir24_8.h | 2 +- lib/fib/rte_fib.c | 14 +- lib/fib/rte_fib.h | 6 +- lib/fib/rte_fib6.c | 14 +- lib/fib/rte_fib6.h | 6 +- lib/fib/trie.c | 14 +- lib/fib/trie.h | 2 +- lib/gpudev/gpudev.c | 2 +- lib/graph/graph.c | 14 +- lib/graph/graph_debug.c | 2 +- lib/graph/graph_feature_arc.c | 4 +- lib/graph/graph_pcap.c | 2 +- lib/graph/graph_populate.c | 4 +- lib/graph/graph_private.h | 4 +- lib/graph/graph_stats.c | 18 +- lib/graph/rte_graph.h | 21 +- lib/graph/rte_graph_model_mcore_dispatch.c | 4 +- lib/graph/rte_graph_worker_common.h | 10 +- lib/gro/gro_tcp4.c | 14 +- lib/gro/gro_tcp4.h | 6 +- lib/gro/gro_tcp6.c | 14 +- lib/gro/gro_tcp6.h | 6 +- lib/gro/gro_udp4.c | 14 +- lib/gro/gro_udp4.h | 6 +- lib/gro/gro_vxlan_tcp4.c | 14 +- lib/gro/gro_vxlan_tcp4.h | 6 +- lib/gro/gro_vxlan_udp4.c | 14 +- lib/gro/gro_vxlan_udp4.h | 6 +- lib/gro/rte_gro.c | 8 +- lib/gro/rte_gro.h | 17 +- lib/hash/rte_cuckoo_hash.c | 28 +-- lib/hash/rte_fbk_hash.c | 2 +- lib/hash/rte_fbk_hash.h | 10 +- lib/hash/rte_hash.h | 10 +- lib/ip_frag/rte_ip_frag.h | 8 +- lib/ip_frag/rte_ip_frag_common.c | 12 +- lib/ipsec/ipsec_sad.c | 6 +- lib/ipsec/rte_ipsec_sad.h | 11 +- lib/latencystats/rte_latencystats.c | 2 +- lib/lpm/rte_lpm.c | 16 +- lib/lpm/rte_lpm.h | 6 +- lib/lpm/rte_lpm6.c | 10 +- lib/lpm/rte_lpm6.h | 6 +- lib/mbuf/rte_mbuf.c | 12 +- lib/mbuf/rte_mbuf.h | 18 +- lib/mbuf/rte_mbuf_dyn.c | 2 +- lib/mbuf/rte_mbuf_pool_ops.c | 4 +- lib/member/rte_member.c | 8 +- lib/member/rte_member.h | 20 +- lib/member/rte_member_heap.h | 18 +- lib/member/rte_member_ht.c | 4 +- lib/member/rte_member_sketch.c | 24 +- lib/member/rte_member_vbf.c | 4 +- lib/mempool/mempool_trace.h | 4 +- lib/mempool/rte_mempool.c | 60 ++--- lib/mempool/rte_mempool.h | 38 ++-- lib/metrics/rte_metrics.c | 4 +- lib/metrics/rte_metrics.h | 4 +- lib/metrics/rte_metrics_telemetry.c | 4 +- lib/mldev/rte_mldev.c | 24 +- lib/mldev/rte_mldev.h | 33 +-- lib/mldev/rte_mldev_core.h | 10 +- lib/mldev/rte_mldev_pmd.c | 10 +- lib/mldev/rte_mldev_pmd.h | 10 +- lib/node/ip4_lookup.c | 4 +- lib/node/ip4_lookup_fib.c | 10 +- lib/node/ip6_lookup.c | 4 +- lib/node/ip6_lookup_fib.c | 10 +- lib/node/kernel_rx.c | 4 +- lib/node/node_mbuf_dynfield.c | 2 +- lib/node/udp4_input.c | 8 +- lib/pdcp/rte_pdcp.c | 4 +- lib/pdump/rte_pdump.c | 2 +- lib/rawdev/rte_rawdev.c | 25 ++- lib/rawdev/rte_rawdev.h | 38 +++- lib/rawdev/rte_rawdev_pmd.h | 8 +- lib/rcu/rte_rcu_qsbr.c | 2 +- lib/regexdev/rte_regexdev.c | 2 +- lib/reorder/rte_reorder.c | 4 +- lib/reorder/rte_reorder.h | 4 +- lib/rib/rte_rib.c | 8 +- lib/rib/rte_rib.h | 6 +- lib/rib/rte_rib6.c | 8 +- lib/rib/rte_rib6.h | 6 +- lib/ring/rte_ring.c | 12 +- lib/ring/rte_ring.h | 8 +- lib/ring/rte_ring_elem.h | 8 +- lib/stack/rte_stack.c | 4 +- lib/stack/rte_stack.h | 8 +- lib/table/rte_swx_table_em.c | 2 +- lib/table/rte_swx_table_learner.c | 2 +- lib/table/rte_swx_table_selector.c | 2 +- lib/table/rte_swx_table_wm.c | 4 +- lib/timer/rte_timer.c | 2 +- lib/vhost/iotlb.c | 2 +- lib/vhost/rte_vhost_crypto.h | 4 +- lib/vhost/vhost.c | 4 +- lib/vhost/vhost_crypto.c | 16 +- lib/vhost/vhost_user.c | 22 +- 905 files changed, 6113 insertions(+), 5439 deletions(-)
Signature · 1 line
2.55.0
PATCH 1/227 eal: add NUMA-aware APIs
From: Chengwen Feng <[email protected]>
DPDK has long used socket_id terminology for NUMA allocation, which conflates CPU sockets with NUMA memory nodes.
Add NUMA-named APIs while keeping the legacy socket-named ones as functional aliases (to be deprecated once the in-tree migration completes):
- rte_numa_id(), rte_numa_count(), rte_numa_id_by_idx()
- rte_lcore_to_numa_id()
- rte_cpu_numa_id() (renamed from experimental rte_cpu_socket_id())
- rte_malloc_numa(), rte_zmalloc_numa(), rte_calloc_numa(), rte_realloc_numa()
- rte_malloc_get_numa_stats() and struct rte_malloc_numa_stats
- rte_malloc_heap_get_numa_id(), rte_malloc_heap_numa_is_external()
- RTE_NUMA_ID_ANY constant (legacy SOCKET_ID_ANY kept as alias)
Convert EAL internals, comments, log messages and telemetry keys to the NUMA node terminology, and update the EAL programmer guide accordingly.
--- app/test-flow-perf/main.c | 4 +- app/test-pmd/cmdline.c | 4 +- app/test-pmd/testpmd.c | 4 +- app/test/test_external_mem.c | 6 +- app/test/test_malloc.c | 22 +- app/test/test_memzone.c | 4 +- .../prog_guide/env_abstraction_layer.rst | 32 +-- doc/guides/rel_notes/release_26_11.rst | 16 +- lib/eal/common/eal_common_dynmem.c | 172 +++++++-------- lib/eal/common/eal_common_lcore.c | 85 +++++--- lib/eal/common/eal_common_memalloc.c | 38 ++-- lib/eal/common/eal_common_memory.c | 44 ++-- lib/eal/common/eal_common_memzone.c | 34 +-- lib/eal/common/eal_common_options.c | 12 +- lib/eal/common/eal_common_thread.c | 34 +-- lib/eal/common/eal_hugepages.h | 2 +- lib/eal/common/eal_internal_cfg.h | 2 +- lib/eal/common/eal_memalloc.h | 10 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/eal_private.h | 12 +- lib/eal/common/eal_thread.h | 6 +- lib/eal/common/malloc_heap.c | 200 +++++++++-------- lib/eal/common/malloc_heap.h | 12 +- lib/eal/common/malloc_mp.c | 10 +- lib/eal/common/malloc_mp.h | 4 +- lib/eal/common/rte_malloc.c | 156 +++++++++----- lib/eal/freebsd/eal.c | 12 +- lib/eal/freebsd/eal_lcore.c | 2 +- lib/eal/freebsd/eal_memalloc.c | 4 +- lib/eal/freebsd/eal_memory.c | 2 +- lib/eal/include/eal_trace_internal.h | 16 +- lib/eal/include/rte_lcore.h | 66 +++++- lib/eal/include/rte_malloc.h | 201 ++++++++++++++++-- lib/eal/include/rte_memory.h | 8 +- lib/eal/include/rte_memzone.h | 12 +- lib/eal/linux/eal.c | 16 +- lib/eal/linux/eal_hugepage_info.c | 40 ++-- lib/eal/linux/eal_lcore.c | 2 +- lib/eal/linux/eal_memalloc.c | 38 ++-- lib/eal/linux/eal_memory.c | 76 +++---- lib/eal/windows/eal_hugepages.c | 12 +- lib/eal/windows/eal_lcore.c | 42 ++-- lib/eal/windows/eal_memalloc.c | 38 ++-- lib/eal/windows/eal_memory.c | 10 +- lib/eal/windows/eal_windows.h | 18 +- 45 files changed, 927 insertions(+), 615 deletions(-)
app/test-flow-perf/main.c +2 -2
@@ -1006,7 +1006,7 @@ args_parse(int argc, char **argv)static size_t dump_socket_mem (FILE *f) { -struct rte_malloc_socket_stats socket_stats; +struct rte_malloc_numa_stats socket_stats;unsigned int i =0 ;size_t total =0 ;size_t alloc =0 ;
@@ -1017,7 +1017,7 @@ dump_socket_mem(FILE *f)for (i =0 ; i <RTE_MAX_NUMA_NODES ; i++) { -if (rte_malloc_get_socket_stats (i, &socket_stats) || +if (rte_malloc_get_numa_stats (i, &socket_stats) || !socket_stats.heap_totalsz_bytes)continue ; active_nodes = true;
app/test-pmd/cmdline.c +2 -2
@@ -9367,7 +9367,7 @@ dump_struct_sizes(void)static void dump_socket_mem (FILE *f) { -struct rte_malloc_socket_stats socket_stats; +struct rte_malloc_numa_stats socket_stats;unsigned int i;size_t total =0 ;size_t alloc =0 ;
@@ -9378,7 +9378,7 @@ dump_socket_mem(FILE *f)static size_t last_total;for (i =0 ; i <RTE_MAX_NUMA_NODES ; i++) { -if (rte_malloc_get_socket_stats (i, &socket_stats) || +if (rte_malloc_get_numa_stats (i, &socket_stats) || !socket_stats.heap_totalsz_bytes)continue ; total += socket_stats.heap_totalsz_bytes;
app/test-pmd/testpmd.c +2 -2
@@ -1086,7 +1086,7 @@ setup_extmem(uint32_t nb_mbufs, uint32_t mbuf_sz, bool huge)memset (¶m,0 ,sizeof (param));/* check if our heap exists */ - socket_id =rte_malloc_heap_get_socket (EXTMEM_HEAP_NAME ); + socket_id =rte_malloc_heap_get_numa_id (EXTMEM_HEAP_NAME );if (socket_id <0 ) {/* create our heap */ ret =rte_malloc_heap_create (EXTMEM_HEAP_NAME );
@@ -1327,7 +1327,7 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,rte_exit (EXIT_FAILURE ,"Could not create external memory\n" ); heap_socket = -rte_malloc_heap_get_socket (EXTMEM_HEAP_NAME ); +rte_malloc_heap_get_numa_id (EXTMEM_HEAP_NAME );if (heap_socket <0 )rte_exit (EXIT_FAILURE ,"Could not get external memory socket ID\n" );
app/test/test_external_mem.c +3 -3
@@ -103,7 +103,7 @@ test_malloc_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, goto fail; } -if (rte_malloc_heap_get_socket (name) >=0 || +if (rte_malloc_heap_get_numa_id (name) >=0 || rte_errno !=EINVAL ) {printf ("%s():%i: Found socket for heap with invalid name\n" , __func__, __LINE__);
@@ -145,7 +145,7 @@ test_malloc_invalid_param(void *addr, size_t len, size_t pgsz, rte_iova_t *iova, __func__, __LINE__); goto fail; } -if (rte_malloc_heap_get_socket (valid_name) >=0 || +if (rte_malloc_heap_get_numa_id (valid_name) >=0 || rte_errno !=ENOENT ) {printf ("%s():%i: Found socket for heap with invalid name\n" , __func__, __LINE__);
@@ -296,7 +296,7 @@ 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_socket (heap_name); + socket_id =rte_malloc_heap_get_numa_id (heap_name);if (socket_id <0 ) {printf ("%s():%i: cannot find socket for external heap\n" , __func__, __LINE__);
app/test/test_malloc.c +11 -11
@@ -278,7 +278,7 @@ test_multi_alloc_statistics(void) {int ret =-1 ;/* default return is error, cleared at end on success */ int socket =0 ; -struct rte_malloc_socket_stats pre_stats, post_stats ,first_stats, second_stats; +struct rte_malloc_numa_stats pre_stats, post_stats, first_stats, second_stats;size_t size =2048 ;int align =1024 ;int overhead =0 ;
@@ -313,7 +313,7 @@ test_multi_alloc_statistics(void)printf ("Failed to add memory to heap\n" ); goto cleanup_allocated_memory; } - socket =rte_malloc_heap_get_socket (__func__); + socket =rte_malloc_heap_get_numa_id (__func__);if (socket <0 ) {printf ("Failed to get socket for test malloc heap.\n" ); goto cleanup_all;
@@ -322,13 +322,13 @@ test_multi_alloc_statistics(void)/* Dynamically calculate the overhead by allocating one cacheline and * then comparing what was allocated from the heap. */ -rte_malloc_get_socket_stats (socket, &pre_stats); +rte_malloc_get_numa_stats (socket, &pre_stats);void *dummy =rte_malloc_socket (NULL ,RTE_CACHE_LINE_SIZE ,0 , socket);if (dummy ==NULL ) goto cleanup_all; -rte_malloc_get_socket_stats (socket, &post_stats); +rte_malloc_get_numa_stats (socket, &post_stats);/* after subtracting cache line, remainder is overhead */ overhead = post_stats.heap_allocsz_bytes - pre_stats.heap_allocsz_bytes;
@@ -337,7 +337,7 @@ test_multi_alloc_statistics(void)rte_free (dummy);/* Now start the real tests */ -rte_malloc_get_socket_stats (socket, &pre_stats); +rte_malloc_get_numa_stats (socket, &pre_stats);void *p1 =rte_malloc_socket ("stats" , size , align, socket);if (!p1)
@@ -346,7 +346,7 @@ test_multi_alloc_statistics(void)rte_free (p1);rte_malloc_dump_stats (stdout,"stats" ); -rte_malloc_get_socket_stats (socket,&post_stats); +rte_malloc_get_numa_stats (socket, &post_stats);/* Check statistics reported are correct */ /* All post stats should be equal to pre stats after alloc freed */ if ((post_stats.heap_totalsz_bytes != pre_stats.heap_totalsz_bytes) ||
@@ -360,23 +360,23 @@ test_multi_alloc_statistics(void)/* Check two consecutive allocations */ size =1024 ; align =0 ; -rte_malloc_get_socket_stats (socket,&pre_stats); +rte_malloc_get_numa_stats (socket, &pre_stats);void *p2 =rte_malloc_socket ("add" , size ,align, socket);if (!p2) goto cleanup_all; -rte_malloc_get_socket_stats (socket,&first_stats); +rte_malloc_get_numa_stats (socket, &first_stats);void *p3 =rte_malloc_socket ("add2" , size,align, socket);if (!p3) goto cleanup_all; -rte_malloc_get_socket_stats (socket,&second_stats); +rte_malloc_get_numa_stats (socket, &second_stats);rte_free (p2);rte_free (p3);/* After freeing both allocations check stats return to original */ -rte_malloc_get_socket_stats (socket, &post_stats); +rte_malloc_get_numa_stats (socket, &post_stats);if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {printf ("Incorrect heap statistics: Total size \n" );
@@ -704,7 +704,7 @@ test_realloc(void) ret =-1 ; goto end; } - realloc_heap_socket =rte_malloc_heap_get_socket (heap_name); + realloc_heap_socket =rte_malloc_heap_get_numa_id (heap_name); mem =mmap (NULL , mem_sz,PROT_READ |PROT_WRITE ,MAP_PRIVATE |MAP_ANONYMOUS ,-1 ,0 );
app/test/test_memzone.c +2 -2
@@ -493,10 +493,10 @@ test_memzone_reserve_flags(void)static size_t find_max_block_free_size (unsigned int align,unsigned int socket_id) { -struct rte_malloc_socket_stats stats; +struct rte_malloc_numa_stats stats;size_t len, overhead; -if (rte_malloc_get_socket_stats (socket_id, &stats) <0 ) +if (rte_malloc_get_numa_stats (socket_id, &stats) <0 )return 0 ; len = stats.greatest_free_size;
doc/guides/prog_guide/env_abstraction_layer.rst +16 -16
@@ -374,10 +374,10 @@ manual memory management. Using a set of malloc heap API's is the recommended way to use externally allocated memory in DPDK. In this way, support for externally allocated memory -is implemented through overloading the socket ID - externally allocated heaps -will have socket ID's that would be considered invalid under normal +is implemented through overloading the NUMA node ID - externally allocated heaps +will have NUMA node IDs that would be considered invalid under normal circumstances. Requesting an allocation to take place from a specified -externally allocated memory is a matter of supplying the correct socket ID to +externally allocated memory is a matter of supplying the correct NUMA node ID to DPDK allocator, either directly (e.g. through a call to ``rte_malloc``) or indirectly (through data structure-specific allocation API's such as ``rte_ring_create``). Using these API's also ensures that mapping of externally
@@ -399,12 +399,12 @@ The expected workflow is as follows: - If IOVA table is not specified, IOVA addresses will be assumed to be unavailable, and DMA mappings will not be performed - Other processes must attach to the memory area before they can use it -* Get socket ID used for the heap -* Use normal DPDK allocation procedures, using supplied socket ID +* Get NUMA node ID used for the heap +* Use normal DPDK allocation procedures, using supplied NUMA node ID * If memory area is no longer needed, it can be removed from the heap - Other processes must detach from this memory area before it can be removed * If heap is no longer needed, remove it - - Socket ID will become invalid and will not be reused + - NUMA node ID will become invalid and will not be reused For more information, please refer to ``rte_malloc`` API documentation, specifically the ``rte_malloc_heap_*`` family of function calls.
@@ -790,11 +790,11 @@ Public Thread API There are two public APIs ``rte_thread_set_affinity()`` and ``rte_thread_get_affinity()`` introduced for threads. When they're used in any pthread context, the Thread Local Storage(TLS) will be set/get. -Those TLS include *_cpuset* and *_socket_id*: +Those TLS include *_cpuset* and *_numa_id*: * *_cpuset* stores the CPUs bitmap to which the pthread is affinitized. -* *_socket_id* stores the NUMA node of the CPU set. If the CPUs in CPU set belong to different NUMA node, the *_socket_id* will be set to SOCKET_ID_ANY. +* *_numa_id* stores the NUMA node of the CPU set. If the CPUs in CPU set belong to different NUMA node, the *_numa_id* will be set to RTE_NUMA_ID_ANY. Control Thread API
@@ -948,16 +948,16 @@ Signal Safety rte_lcore_index rte_lcore_is_enabled rte_lcore_to_cpu_id - rte_lcore_to_socket_id + rte_lcore_to_numa_id rte_log_get_global_level rte_log_get_level rte_memory_get_nchannel rte_memory_get_nrank + rte_numa_count + rte_numa_id + rte_numa_id_by_idx rte_reciprocal_value rte_reciprocal_value_u64 - rte_socket_count - rte_socket_id - rte_socket_id_by_idx rte_strerror rte_strscpy rte_strsplit
@@ -1018,9 +1018,9 @@ The rte_malloc() takes an align argument that can be used to request a memory area that is aligned on a multiple of this value (which must be a power of two). On systems with NUMA support, a call to the rte_malloc() function will return -memory that has been allocated on the NUMA socket of the core which made the call. +memory that has been allocated on the NUMA node of the core which made the call. A set of APIs is also provided, to allow memory to be explicitly allocated on a -NUMA socket directly, or by allocated on the NUMA socket where another core is +NUMA node directly, or by allocated on the NUMA node where another core is located, in the case where the memory is to be used by a logical core other than on the one doing the memory allocation.
@@ -1041,7 +1041,7 @@ Data Structures There are two data structure types used internally in the malloc library: -* struct malloc_heap - used to track free space on a per-socket basis +* struct malloc_heap - used to track free space on a per-NUMA-node basis * struct malloc_elem - the basic element of allocation and free-space tracking inside the library.
@@ -1049,7 +1049,7 @@ There are two data structure types used internally in the malloc library: Structure: malloc_heap """""""""""""""""""""" -The malloc_heap structure is used to manage free space on a per-socket basis. +The malloc_heap structure is used to manage free space on a per-NUMA-node basis. Internally, there is one heap structure per NUMA node, which allows us to allocate memory to a thread based on the NUMA node on which this thread runs. While this does not guarantee that the memory will be used on that NUMA node,
doc/guides/rel_notes/release_26_11.rst +13 -3
@@ -68,10 +68,20 @@ New Features and use pointer arithmetic instead of integer casts to enable compiler optimizations. See API changes below. -* **Added API to get CPU socket ID.** +* **Added NUMA-aware APIs.** - Added the experimental ``rte_cpu_socket_id()`` function - to map an OS logical CPU ID to the NUMA socket containing that CPU. + Introduced NUMA terminology APIs to replace the socket-named ones: + ``rte_numa_id()``, ``rte_numa_count()``, ``rte_numa_id_by_idx()``, + ``rte_lcore_to_numa_id()``, the experimental ``rte_cpu_numa_id()``, + ``rte_malloc_numa()`` with the ``rte_zmalloc_numa()``, + ``rte_calloc_numa()`` and ``rte_realloc_numa()`` variants, + and the ``RTE_NUMA_ID_ANY`` constant. + The legacy socket-named APIs are kept as aliases pending deprecation. + +* **Added API to get CPU NUMA node ID.** + + Added the experimental ``rte_cpu_numa_id()`` function + to map an OS logical CPU ID to the NUMA node containing that CPU. * **Added pile stack and mempool driver.**
lib/eal/common/eal_common_dynmem.c +86 -86
382 lines not on this page · raw message
lib/eal/common/eal_common_lcore.c +53 -32
171 lines not on this page · raw message
lib/eal/common/eal_common_memalloc.c +19 -19
@@ -25,7 +25,7 @@ struct mem_alloc_validator_entry {TAILQ_ENTRY (mem_alloc_validator_entry) next;char name[RTE_MEM_ALLOC_VALIDATOR_NAME_LEN ];rte_mem_alloc_validator_t clb; -int socket_id; +int numa_id;size_t limit; };
@@ -54,12 +54,12 @@ find_mem_event_callback(const char *name, void *arg) }static struct mem_alloc_validator_entry * -find_mem_alloc_validator (const char *name,int socket_id) +find_mem_alloc_validator (const char *name,int numa_id) {struct mem_alloc_validator_entry *r; TAILQ_FOREACH(r, &mem_alloc_validator_list, next) { -if (!strcmp (r->name, name) && r->socket_id == socket_id) +if (!strcmp (r->name, name) && r->numa_id == numa_id)break ; }return r;
@@ -252,11 +252,11 @@ eal_memalloc_mem_event_notify(enum rte_mem_event event, const void *start,int eal_memalloc_mem_alloc_validator_register (const char *name, -rte_mem_alloc_validator_t clb,int socket_id,size_t limit) +rte_mem_alloc_validator_t clb,int numa_id,size_t limit) {struct mem_alloc_validator_entry *entry;int ret, len; -if (name ==NULL || clb ==NULL || socket_id <0 ) { +if (name ==NULL || clb ==NULL || numa_id <0 ) { rte_errno =EINVAL ;return -1 ; }
@@ -270,7 +270,7 @@ eal_memalloc_mem_alloc_validator_register(const char *name, }rte_rwlock_write_lock (&mem_alloc_validator_rwlock); - entry =find_mem_alloc_validator (name, socket_id); + entry =find_mem_alloc_validator (name, numa_id);if (entry !=NULL ) { rte_errno =EEXIST ; ret =-1 ;
@@ -286,15 +286,15 @@ eal_memalloc_mem_alloc_validator_register(const char *name,/* callback successfully created and is valid, add it to the list */ entry->clb = clb; - entry->socket_id = socket_id; + entry->numa_id = numa_id; entry->limit = limit;strlcpy (entry->name, name,RTE_MEM_ALLOC_VALIDATOR_NAME_LEN );TAILQ_INSERT_TAIL (&mem_alloc_validator_list, entry, next); ret =0 ; -EAL_LOG (DEBUG ,"Mem alloc validator '%s' on socket %i with limit %zu registered" , - name, socket_id, limit); +EAL_LOG (DEBUG ,"Mem alloc validator '%s' on NUMA node %i with limit %zu registered" , + name, numa_id, limit); unlock:rte_rwlock_write_unlock (&mem_alloc_validator_rwlock);
@@ -302,12 +302,12 @@ eal_memalloc_mem_alloc_validator_register(const char *name, }int -eal_memalloc_mem_alloc_validator_unregister (const char *name,int socket_id) +eal_memalloc_mem_alloc_validator_unregister (const char *name,int numa_id) {struct mem_alloc_validator_entry *entry;int ret, len; -if (name ==NULL || socket_id <0 ) { +if (name ==NULL || numa_id <0 ) { rte_errno =EINVAL ;return -1 ; }
@@ -321,7 +321,7 @@ eal_memalloc_mem_alloc_validator_unregister(const char *name, int socket_id) }rte_rwlock_write_lock (&mem_alloc_validator_rwlock); - entry =find_mem_alloc_validator (name, socket_id); + entry =find_mem_alloc_validator (name, numa_id);if (entry ==NULL ) { rte_errno =ENOENT ; ret =-1 ;
@@ -332,8 +332,8 @@ eal_memalloc_mem_alloc_validator_unregister(const char *name, int socket_id) ret =0 ; -EAL_LOG (DEBUG ,"Mem alloc validator '%s' on socket %i unregistered" , - name, socket_id); +EAL_LOG (DEBUG ,"Mem alloc validator '%s' on NUMA node %i unregistered" , + name, numa_id); unlock:rte_rwlock_write_unlock (&mem_alloc_validator_rwlock);
@@ -341,7 +341,7 @@ eal_memalloc_mem_alloc_validator_unregister(const char *name, int socket_id) }int -eal_memalloc_mem_alloc_validate (int socket_id,size_t new_len) +eal_memalloc_mem_alloc_validate (int numa_id,size_t new_len) {struct mem_alloc_validator_entry *entry;int ret =0 ;
@@ -349,11 +349,11 @@ eal_memalloc_mem_alloc_validate(int socket_id, size_t new_len)rte_rwlock_read_lock (&mem_alloc_validator_rwlock); TAILQ_FOREACH(entry, &mem_alloc_validator_list, next) { -if (entry->socket_id != socket_id || entry->limit > new_len) +if (entry->numa_id != numa_id || entry->limit > new_len)continue ; -EAL_LOG (DEBUG ,"Calling mem alloc validator '%s' on socket %i" , - entry->name, entry->socket_id); -if (entry->clb (socket_id, entry->limit, new_len) <0 ) +EAL_LOG (DEBUG ,"Calling mem alloc validator '%s' on NUMA node %i" , + entry->name, entry->numa_id); +if (entry->clb (numa_id, entry->limit, new_len) <0 ) ret =-1 ; }
lib/eal/common/eal_common_memory.c +22 -22
133 lines not on this page · raw message
lib/eal/common/eal_common_memzone.c +17 -17
@@ -102,7 +102,7 @@ memzone_lookup_thread_unsafe(const char *name)static const struct rte_memzone *memzone_reserve_aligned_thread_unsafe (const char *name,size_t len, -int socket_id,unsigned int flags,unsigned int align, +int numa_id,unsigned int flags,unsigned int align,unsigned int bound) {struct rte_memzone *mz;
@@ -171,7 +171,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,return NULL ; } -if ((socket_id !=SOCKET_ID_ANY ) && socket_id <0 ) { +if ((numa_id !=RTE_NUMA_ID_ANY ) && numa_id <0 ) { rte_errno =EINVAL ;return NULL ; }
@@ -181,11 +181,11 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,return NULL ; } -/* only set socket to SOCKET_ID_ANY if we aren't allocating for an +/* only set NUMA node to RTE_NUMA_ID_ANY if we are not allocating for an * external heap. */ -if (!rte_eal_has_hugepages () && socket_id <RTE_MAX_NUMA_NODES ) - socket_id =SOCKET_ID_ANY ; +if (!rte_eal_has_hugepages () && numa_id <RTE_MAX_NUMA_NODES ) + numa_id =RTE_NUMA_ID_ANY ; contig = (flags &RTE_MEMZONE_IOVA_CONTIG ) !=0 ;/* malloc only cares about size flags, remove contig flag from flags */
@@ -194,12 +194,12 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,if (len ==0 && bound ==0 ) {/* no size constraints were placed, so use malloc elem len */ requested_len =0 ; - mz_addr =malloc_heap_alloc_biggest (socket_id, flags, align, contig); + mz_addr =malloc_heap_alloc_biggest (numa_id, flags, align, contig); }else {if (len ==0 ) requested_len = bound;/* allocate memory on heap */ - mz_addr =malloc_heap_alloc (requested_len, socket_id, flags, align, bound, contig); + mz_addr =malloc_heap_alloc (requested_len, numa_id, flags, align, bound, contig); }if (mz_addr ==NULL ) { rte_errno =ENOMEM ;
@@ -239,7 +239,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len, }static const struct rte_memzone * -rte_memzone_reserve_thread_safe (const char *name,size_t len,int socket_id, +rte_memzone_reserve_thread_safe (const char *name,size_t len,int numa_id,unsigned int flags,unsigned int align,unsigned int bound) {struct rte_mem_config *mcfg;
@@ -251,9 +251,9 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len, int socket_id,rte_rwlock_write_lock (&mcfg->mlock); mz =memzone_reserve_aligned_thread_unsafe ( - name, len, socket_id, flags, align, bound); + name, len, numa_id, flags, align, bound); -rte_eal_trace_memzone_reserve (name, len, socket_id, flags, align, +rte_eal_trace_memzone_reserve (name, len, numa_id, flags, align, bound, mz);rte_rwlock_write_unlock (&mcfg->mlock);
@@ -268,10 +268,10 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len, int socket_id,*/ RTE_EXPORT_SYMBOL (rte_memzone_reserve_bounded) const struct rte_memzone * -rte_memzone_reserve_bounded (const char *name,size_t len,int socket_id, +rte_memzone_reserve_bounded (const char *name,size_t len,int numa_id,unsigned flags,unsigned align,unsigned bound) { -return rte_memzone_reserve_thread_safe (name, len, socket_id, flags, +return rte_memzone_reserve_thread_safe (name, len, numa_id, flags, align, bound); }
@@ -281,10 +281,10 @@ rte_memzone_reserve_bounded(const char *name, size_t len, int socket_id,*/ RTE_EXPORT_SYMBOL (rte_memzone_reserve_aligned) const struct rte_memzone * -rte_memzone_reserve_aligned (const char *name,size_t len,int socket_id, +rte_memzone_reserve_aligned (const char *name,size_t len,int numa_id,unsigned flags,unsigned align) { -return rte_memzone_reserve_thread_safe (name, len, socket_id, flags, +return rte_memzone_reserve_thread_safe (name, len, numa_id, flags, align,0 ); }
@@ -294,10 +294,10 @@ rte_memzone_reserve_aligned(const char *name, size_t len, int socket_id,*/ RTE_EXPORT_SYMBOL (rte_memzone_reserve) const struct rte_memzone * -rte_memzone_reserve (const char *name,size_t len,int socket_id, +rte_memzone_reserve (const char *name,size_t len,int numa_id,unsigned flags) { -return rte_memzone_reserve_thread_safe (name, len, socket_id, +return rte_memzone_reserve_thread_safe (name, len, numa_id, flags,RTE_CACHE_LINE_SIZE ,0 ); }
@@ -388,7 +388,7 @@ dump_memzone(const struct rte_memzone *mz, void *arg) info->total_size += mz->len; fprintf(f, "Zone %u: name:<%s>, len:0x%zx, virt:%p, " - "socket_id:%"PRId32", flags:%"PRIx32"\n", + "numa_id:%"PRId32", flags:%"PRIx32"\n", mz_idx, mz->name, mz->len,
lib/eal/common/eal_common_options.c +6 -6
@@ -1855,7 +1855,7 @@ eal_parse_log_options(void) }static int -eal_parse_socket_arg (char *strval,volatile uint64_t *socket_arg) +eal_parse_numa_arg (char *strval,volatile uint64_t *numa_arg) {char *arg[RTE_MAX_NUMA_NODES ];char *end;
@@ -1871,7 +1871,7 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)if (!isdigit (strval[len-1 ]))return -1 ; -/* split the optarg into separate socket values */ +/* split the optarg into separate NUMA node values */ arg_num =rte_strsplit (strval, len, arg,RTE_MAX_NUMA_NODES ,',' );
@@ -1879,7 +1879,7 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg)if (arg_num <=0 )return -1 ; -/* parse each defined socket option */ +/* parse each defined NUMA node option */ errno =0 ;for (i =0 ; i < arg_num; i++) {uint64_t val;
@@ -1891,7 +1891,7 @@ eal_parse_socket_arg(char *strval, volatile uint64_t *socket_arg) (arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))return -1 ; val <<=20 ; - socket_arg[i] = val; + numa_arg[i] = val; }return 0 ;
@@ -2282,14 +2282,14 @@ eal_parse_args(void) } }if (args.numa_mem !=NULL ) { -if (eal_parse_socket_arg (args.numa_mem, int_cfg->numa_mem) <0 ) { +if (eal_parse_numa_arg (args.numa_mem, int_cfg->numa_mem) <0 ) {EAL_LOG (ERR ,"invalid numa-mem parameter: '%s'" , args.numa_mem);return -1 ; } int_cfg->force_numa =1 ; }if (args.numa_limit !=NULL ) { -if (eal_parse_socket_arg (args.numa_limit, int_cfg->numa_limit) <0 ) { +if (eal_parse_numa_arg (args.numa_limit, int_cfg->numa_limit) <0 ) {EAL_LOG (ERR ,"invalid numa-limit parameter: '%s'" , args.numa_limit);return -1 ; }
lib/eal/common/eal_common_thread.c +20 -14
@@ -28,41 +28,47 @@ RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) = LCORE_ID_ANY;RTE_EXPORT_SYMBOL (per_lcore__thread_id)RTE_DEFINE_PER_LCORE (int ,_thread_id ) =-1 ; static RTE_DEFINE_PER_LCORE(unsigned int, _numa_id) = - (unsigned int )SOCKET_ID_ANY ; + (unsigned int )RTE_NUMA_ID_ANY ; static RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); +RTE_EXPORT_SYMBOL (rte_numa_id ) +unsigned intrte_numa_id (void) +{ +return RTE_PER_LCORE (_numa_id); +} +RTE_EXPORT_SYMBOL (rte_socket_id) unsigned rte_socket_id(void) { -return RTE_PER_LCORE (_numa_id); +return rte_numa_id (); }static int -eal_cpuset_socket_id (rte_cpuset_t *cpusetp) +eal_cpuset_numa_id (rte_cpuset_t *cpusetp) {unsigned cpu =0 ; -int socket_id =SOCKET_ID_ANY ; +int numa_id =RTE_NUMA_ID_ANY ;int sid;if (cpusetp ==NULL ) -return SOCKET_ID_ANY ; +return RTE_NUMA_ID_ANY ;do {if (!CPU_ISSET (cpu, cpusetp))continue ; -if (socket_id ==SOCKET_ID_ANY ) - socket_id =eal_cpu_socket_id (cpu); +if (numa_id ==RTE_NUMA_ID_ANY ) + numa_id =eal_cpu_numa_id (cpu); - sid =eal_cpu_socket_id (cpu); -if (socket_id != sid) { - socket_id =SOCKET_ID_ANY ; + sid =eal_cpu_numa_id (cpu); +if (numa_id != sid) { + numa_id =RTE_NUMA_ID_ANY ;break ; } }while (++cpu <CPU_SETSIZE ); -return socket_id; +return numa_id; } static void
@@ -72,7 +78,7 @@ thread_update_affinity(rte_cpuset_t *cpusetp)/* store numa_id in TLS for quick access */ RTE_PER_LCORE (_numa_id) = -eal_cpuset_socket_id (cpusetp); +eal_cpuset_numa_id (cpusetp);/* store cpuset in TLS for quick access */ memmove(&RTE_PER_LCORE(_cpuset), cpusetp,
@@ -240,10 +246,10 @@ static int control_thread_init(void *arg)struct control_thread_params *params = arg;__rte_thread_init (rte_lcore_id (), cpuset); -/* Set control thread socket ID to SOCKET_ID_ANY +/* Set control thread NUMA node ID to RTE_NUMA_ID_ANY * as control threads may be scheduled on any NUMA node. */ -RTE_PER_LCORE (_numa_id) =SOCKET_ID_ANY ; +RTE_PER_LCORE (_numa_id) =RTE_NUMA_ID_ANY ; params->ret =rte_thread_set_affinity_by_id (rte_thread_self (), cpuset);if (params->ret !=0 ) { rte_atomic_store_explicit(¶ms->status,
lib/eal/common/eal_hugepages.h +1 -1
@@ -20,7 +20,7 @@ struct hugepage_file {void *final_va;/**< virtual addr of 2nd mmap() */ uint64_t physaddr;/**< physical addr */ size_t size;/**< the page size */ -int socket_id;/**< NUMA socket ID */ +int numa_id;/**< NUMA node ID */ int file_id;/**< the '%d' in HUGEFILE_FMT */ char filepath[MAX_HUGEPAGE_PATH ];/**< path to backing file on filesystem */ };
lib/eal/common/eal_internal_cfg.h +1 -1
@@ -30,7 +30,7 @@ struct hugepage_info {uint64_t hugepage_sz;/**< size of a huge page */ char hugedir[PATH_MAX ];/**< dir where hugetlbfs is mounted */ uint32_t num_pages[RTE_MAX_NUMA_NODES ]; -/**< number of hugepages of that size on each socket */ +/**< number of hugepages of that size on each NUMA node */ int lock_descriptor;/**< file descriptor for hugepage dir */ };
lib/eal/common/eal_memalloc.h +5 -5
@@ -13,7 +13,7 @@* Allocate segment of specified page size. */ struct rte_memseg * -eal_memalloc_alloc_seg (size_t page_sz,int socket); +eal_memalloc_alloc_seg (size_t page_sz,int numa_id);/* * Allocate `n_segs` segments.
@@ -26,7 +26,7 @@ eal_memalloc_alloc_seg(size_t page_sz, int socket);*/ int eal_memalloc_alloc_seg_bulk (struct rte_memseg **ms,int n_segs,size_t page_sz, -int socket,bool exact); +int numa_id,bool exact);/* * Deallocate segment
@@ -67,13 +67,13 @@ eal_memalloc_mem_event_notify(enum rte_mem_event event, const void *start,int eal_memalloc_mem_alloc_validator_register (const char *name, -rte_mem_alloc_validator_t clb,int socket_id,size_t limit); +rte_mem_alloc_validator_t clb,int numa_id,size_t limit);int -eal_memalloc_mem_alloc_validator_unregister (const char *name,int socket_id); +eal_memalloc_mem_alloc_validator_unregister (const char *name,int numa_id);int -eal_memalloc_mem_alloc_validate (int socket_id,size_t new_len); +eal_memalloc_mem_alloc_validate (int numa_id,size_t new_len);/* returns fd or -errno */ int
lib/eal/common/eal_memcfg.h +1 -1
@@ -62,7 +62,7 @@ struct rte_mem_config {struct malloc_heap malloc_heaps[RTE_MAX_HEAPS ];/**< DPDK malloc heaps */ -int next_socket_id;/**< Next socket ID for external malloc heap */ +int next_numa_id;/**< Next NUMA node ID for external malloc heap */ /* rte_mem_config has to be mapped at the exact same address in all * processes, so we need to store it.
lib/eal/common/eal_private.h +6 -6
@@ -32,7 +32,7 @@ struct lcore_config {volatile RTE_ATOMIC (enum rte_lcore_state_t ) state;/**< lcore state */ unsigned int numa_id;/**< NUMA node ID for this lcore */ -unsigned int core_id;/**< core number on socket for this lcore */ +unsigned int core_id;/**< core number on NUMA node for this lcore */ int core_index;/**< relative index, starting from 0 */ uint8_t core_role;/**< role of core eg: OFF, RTE, SERVICE */
@@ -273,8 +273,8 @@ eal_get_virtual_area(void *requested_addr, size_t *size,* Size of segment pages in the MSL. * @param n_segs * Number of segments. -* @param socket_id -* Socket ID. Must not be SOCKET_ID_ANY. +* @param numa_id +* Socket ID. Must not be RTE_NUMA_ID_ANY. * @param heap * Mark MSL as pointing to a heap. * @return
@@ -282,7 +282,7 @@ eal_get_virtual_area(void *requested_addr, size_t *size,*/ int eal_memseg_list_init_named (struct rte_memseg_list *msl,const char *name, -uint64_t page_sz,int n_segs,int socket_id,bool heap); +uint64_t page_sz,int n_segs,int numa_id,bool heap);/** * Initialize memory segment list and create its backing storage
@@ -295,7 +295,7 @@ eal_memseg_list_init_named(struct rte_memseg_list *msl, const char *name,*/ int eal_memseg_list_init (struct rte_memseg_list *msl,uint64_t page_sz, -int n_segs,int socket_id,int msl_idx,bool heap); +int n_segs,int numa_id,int msl_idx,bool heap);/** * Reserve VA space for a memory segment list
@@ -372,7 +372,7 @@ eal_dynmem_hugepage_init(void);* 0 on success, (-1) on failure. */ int -eal_dynmem_calc_num_pages_per_socket ( +eal_dynmem_calc_num_pages_per_numa_node (uint64_t *memory,struct hugepage_info *hp_info,struct hugepage_info *hp_used,unsigned int num_hp_info);
lib/eal/common/eal_thread.h +3 -3
@@ -17,15 +17,15 @@ __rte_noreturn uint32_t eal_thread_loop(void *arg);/** -* Get the NUMA socket id from cpu id. +* Get the NUMA node ID from CPU ID. * This function is private to EAL. * * @param cpu_id * The logical process id. * @return -* socket_id or SOCKET_ID_ANY +* numa_id or RTE_NUMA_ID_ANY */ -unsigned eal_cpu_socket_id (unsigned cpu_id); +unsigned int eal_cpu_numa_id (unsigned int cpu_id);/** * Default buffer size to use with eal_thread_dump_affinity()
lib/eal/common/malloc_heap.c +98 -102
476 lines not on this page · raw message
lib/eal/common/malloc_heap.h +6 -6
@@ -28,17 +28,17 @@ struct __rte_cache_aligned malloc_heap {struct malloc_elem *volatile last;unsigned int alloc_count; -unsigned int socket_id; +unsigned int numa_id;size_t total_size;char name[RTE_HEAP_NAME_MAX_LEN ]; };void * -malloc_heap_alloc (size_t size,int socket,unsigned int flags,size_t align, +malloc_heap_alloc (size_t size,int numa_id,unsigned int flags,size_t align,size_t bound,bool contig);void * -malloc_heap_alloc_biggest (int socket,unsigned int flags,size_t align,bool contig); +malloc_heap_alloc_biggest (int numa_id,unsigned int flags,size_t align,bool contig);int malloc_heap_create (struct malloc_heap *heap,const char *heap_name);
@@ -49,7 +49,7 @@ malloc_heap_destroy(struct malloc_heap *heap);struct rte_memseg_list *malloc_heap_create_external_seg (void *va_addr,rte_iova_t iova_addrs[],unsigned int n_pages,size_t page_sz,const char *seg_name, -unsigned int socket_id); +unsigned int numa_id);struct rte_memseg_list *malloc_heap_find_external_seg (void *va_addr,size_t len);
@@ -73,13 +73,13 @@ malloc_heap_resize(struct malloc_elem *elem, size_t size);int malloc_heap_get_stats (struct malloc_heap *heap, -struct rte_malloc_socket_stats *socket_stats); +struct rte_malloc_numa_stats *numa_stats);void malloc_heap_dump (struct malloc_heap *heap,FILE *f);int -malloc_socket_to_heap_id (unsigned int socket_id); +malloc_numa_to_heap_id (unsigned int numa_id);int rte_eal_malloc_heap_init (void );
lib/eal/common/malloc_mp.c +5 -5
@@ -232,7 +232,7 @@ handle_alloc_request(const struct malloc_mp_req *m,return -1 ; } -/* heap idx is index into the heap array, not socket ID */ +/* heap idx is index into the heap array, not NUMA node ID */ if (ar->malloc_heap_idx >=RTE_MAX_HEAPS ) {EAL_LOG (ERR ,"Attempting to allocate from invalid heap" );return -1 ;
@@ -242,11 +242,11 @@ handle_alloc_request(const struct malloc_mp_req *m,/* * for allocations, we must only use internal heaps, but since the -* rte_malloc_heap_socket_is_external() is thread-safe and we're already +* rte_malloc_heap_numa_is_external() is thread-safe and we're already * read-locked, we'll have to take advantage of the fact that internal -* socket ID's are always lower than RTE_MAX_NUMA_NODES. +* NUMA node IDs are always lower than RTE_MAX_NUMA_NODES. */ -if (heap->socket_id >=RTE_MAX_NUMA_NODES ) { +if (heap->numa_id >=RTE_MAX_NUMA_NODES ) {EAL_LOG (ERR ,"Attempting to allocate from external heap" );return -1 ; }
@@ -263,7 +263,7 @@ handle_alloc_request(const struct malloc_mp_req *m, }memset (ms,0 ,sizeof (*ms) * n_segs); - elem =alloc_pages_on_heap (heap, ar->page_sz, ar->elt_size, ar->socket, + elem =alloc_pages_on_heap (heap, ar->page_sz, ar->elt_size, ar->numa_id, ar->flags, ar->align, ar->bound, ar->contig, ms, n_segs);
lib/eal/common/malloc_mp.h +2 -2
@@ -31,7 +31,7 @@ struct malloc_req_alloc {uint32_t malloc_heap_idx;uint64_t page_sz;size_t elt_size; -int socket; +int numa_id;unsigned int flags;size_t align;size_t bound;
@@ -75,7 +75,7 @@ malloc_heap_free_pages(void *aligned_start, size_t aligned_len);struct malloc_elem *alloc_pages_on_heap (struct malloc_heap *heap,uint64_t pg_sz,size_t elt_size, -int socket,unsigned int flags,size_t align,size_t bound, +int numa_id,unsigned int flags,size_t align,size_t bound,bool contig,struct rte_memseg **ms,int n_segs);void
lib/eal/common/rte_malloc.c +103 -53
365 lines not on this page · raw message
lib/eal/freebsd/eal.c +6 -6
@@ -351,12 +351,12 @@ eal_get_hugepage_mem_size(void)static int check_socket (const struct rte_memseg_list *msl,void *arg) { -int *socket_id = arg; +int *numa_id = arg;if (msl->external)return 0 ; -if (msl->socket_id == *socket_id && msl->memseg_arr.count !=0 ) +if (msl->socket_id == *numa_id && msl->memseg_arr.count !=0 )return 1 ;return 0 ;
@@ -365,13 +365,13 @@ check_socket(const struct rte_memseg_list *msl, void *arg)static void eal_check_mem_on_local_socket (void ) { -int socket_id; +int numa_id;const struct rte_config *config =rte_eal_get_configuration (); - socket_id =rte_lcore_to_socket_id (config->main_lcore); + numa_id =rte_lcore_to_numa_id (config->main_lcore); -if (rte_memseg_list_walk (check_socket, &socket_id) ==0 ) -EAL_LOG (WARNING ,"WARNING: Main core has no memory on local socket!" ); +if (rte_memseg_list_walk (check_socket, &numa_id) ==0 ) +EAL_LOG (WARNING ,"WARNING: Main lcore has no memory on local NUMA node!" ); }
lib/eal/freebsd/eal_lcore.c +1 -1
@@ -36,7 +36,7 @@ eal_get_ncpus(void) }unsigned -eal_cpu_socket_id (__rte_unused unsigned cpu_id) +eal_cpu_numa_id(__rte_unused unsigned int cpu_id) {return 0 ; }
lib/eal/freebsd/eal_memalloc.c +2 -2
@@ -14,14 +14,14 @@int eal_memalloc_alloc_seg_bulk(struct rte_memseg **ms __rte_unused, int __rte_unused n_segs, size_t __rte_unused page_sz, - int __rte_unused socket, bool __rte_unused exact) + int __rte_unused numa_id, bool __rte_unused exact) {EAL_LOG (ERR ,"Memory hotplug not supported on FreeBSD" );return -1 ; }struct rte_memseg * -eal_memalloc_alloc_seg(size_t __rte_unused page_sz, int __rte_unused socket) +eal_memalloc_alloc_seg(size_t __rte_unused page_sz, int __rte_unused numa_id) {EAL_LOG (ERR ,"Memory hotplug not supported on FreeBSD" );return NULL ;
lib/eal/freebsd/eal_memory.c +1 -1
@@ -238,7 +238,7 @@ rte_eal_hugepage_init(void) seg->len = page_sz; seg->nchannel = mcfg->nchannel; seg->nrank = mcfg->nrank; - seg->socket_id =0 ; + seg->numa_id =0 ;rte_fbarray_set_used (arr, ms_idx);
lib/eal/include/eal_trace_internal.h +8 -8
@@ -93,32 +93,32 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_eal_trace_mem_zmalloc, RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align, - int socket, void *ptr), + int numa_id, void *ptr), rte_trace_point_emit_string(type);rte_trace_point_emit_size_t (size);rte_trace_point_emit_u32 (align); -rte_trace_point_emit_int (socket); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_ptr (ptr); )RTE_TRACE_POINT ( rte_eal_trace_mem_malloc, RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align, - int socket, void *ptr), + int numa_id, void *ptr), rte_trace_point_emit_string(type);rte_trace_point_emit_size_t (size);rte_trace_point_emit_u32 (align); -rte_trace_point_emit_int (socket); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_ptr (ptr); )RTE_TRACE_POINT ( rte_eal_trace_mem_realloc, - RTE_TRACE_POINT_ARGS(size_t size, unsigned int align, int socket, + RTE_TRACE_POINT_ARGS(size_t size, unsigned int align, int numa_id, void *ptr), rte_trace_point_emit_size_t(size);rte_trace_point_emit_u32 (align); -rte_trace_point_emit_int (socket); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_ptr (ptr); )
@@ -131,12 +131,12 @@ RTE_TRACE_POINT(/* Memzone */ RTE_TRACE_POINT ( rte_eal_trace_memzone_reserve, - RTE_TRACE_POINT_ARGS(const char *name, size_t len, int socket_id, + RTE_TRACE_POINT_ARGS(const char *name, size_t len, int numa_id, unsigned int flags, unsigned int align, unsigned int bound, const void *mz), rte_trace_point_emit_string(name);rte_trace_point_emit_size_t (len); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_u32 (flags);rte_trace_point_emit_u32 (align);rte_trace_point_emit_u32 (bound);
lib/eal/include/rte_lcore.h +59 -7
112 lines not on this page · raw message
lib/eal/include/rte_malloc.h +186 -15
312 lines not on this page · raw message
lib/eal/include/rte_memory.h +7 -1
@@ -36,7 +36,13 @@ extern "C" {#define RTE_PGSIZE_4G (1ULL << 32)#define RTE_PGSIZE_16G (1ULL << 34) -#define SOCKET_ID_ANY -1/**< Any NUMA socket. */ +/** Any NUMA node ID. */ +#define RTE_NUMA_ID_ANY -1 + +/** +* Legacy alias of RTE_NUMA_ID_ANY. +*/ +#define SOCKET_ID_ANY RTE_NUMA_ID_ANY/** Prevent this segment from being freed back to the OS. */ #define RTE_MEMSEG_FLAG_DO_NOT_FREE RTE_BIT32(0)
lib/eal/include/rte_memzone.h +6 -6
@@ -98,7 +98,7 @@ size_t rte_memzone_max_get(void);* new allocations. * * @note: When reserving memzones with len set to 0, it is preferable to also -* set a valid socket_id. Setting socket_id to SOCKET_ID_ANY is supported, but +* set a valid socket_id. Setting socket_id to RTE_NUMA_ID_ANY is supported, but * will likely not yield expected results. Specifically, the resulting memzone * may not necessarily be the biggest memzone available, but rather biggest * memzone available on socket id corresponding to an lcore from which
@@ -112,7 +112,7 @@ size_t rte_memzone_max_get(void);* is 0, the biggest contiguous zone will be reserved. * @param socket_id * The socket identifier in the case of -* NUMA. The value can be SOCKET_ID_ANY if there is no NUMA +* NUMA. The value can be RTE_NUMA_ID_ANY if there is no NUMA * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be
@@ -161,7 +161,7 @@ const struct rte_memzone *rte_memzone_reserve(const char *name,* new allocations. * * @note: When reserving memzones with len set to 0, it is preferable to also -* set a valid socket_id. Setting socket_id to SOCKET_ID_ANY is supported, but +* set a valid socket_id. Setting socket_id to RTE_NUMA_ID_ANY is supported, but * will likely not yield expected results. Specifically, the resulting memzone * may not necessarily be the biggest memzone available, but rather biggest * memzone available on socket id corresponding to an lcore from which
@@ -175,7 +175,7 @@ const struct rte_memzone *rte_memzone_reserve(const char *name,* is 0, the biggest contiguous zone will be reserved. * @param socket_id * The socket identifier in the case of -* NUMA. The value can be SOCKET_ID_ANY if there is no NUMA +* NUMA. The value can be RTE_NUMA_ID_ANY if there is no NUMA * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be
@@ -229,7 +229,7 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name,* new allocations. * * @note: When reserving memzones with len set to 0, it is preferable to also -* set a valid socket_id. Setting socket_id to SOCKET_ID_ANY is supported, but +* set a valid socket_id. Setting socket_id to RTE_NUMA_ID_ANY is supported, but * will likely not yield expected results. Specifically, the resulting memzone * may not necessarily be the biggest memzone available, but rather biggest * memzone available on socket id corresponding to an lcore from which
@@ -243,7 +243,7 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name,* is 0, the biggest contiguous zone will be reserved. * @param socket_id * The socket identifier in the case of -* NUMA. The value can be SOCKET_ID_ANY if there is no NUMA +* NUMA. The value can be RTE_NUMA_ID_ANY if there is no NUMA * constraint for the reserved zone. * @param flags * The flags parameter is used to request memzones to be
lib/eal/linux/eal.c +8 -8
@@ -434,24 +434,24 @@ eal_hugedirs_unlock(void)static int check_socket (const struct rte_memseg_list *msl,void *arg) { -int *socket_id = arg; +int *numa_id = arg;if (msl->external)return 0 ; -return *socket_id == msl->socket_id; +return *numa_id == msl->socket_id; }static void eal_check_mem_on_local_socket (void ) { -int socket_id; +int numa_id;const struct rte_config *config =rte_eal_get_configuration (); - socket_id =rte_lcore_to_socket_id (config->main_lcore); + numa_id =rte_lcore_to_numa_id (config->main_lcore); -if (rte_memseg_list_walk (check_socket, &socket_id) ==0 ) -EAL_LOG (WARNING ,"WARNING: Main core has no memory on local socket!" ); +if (rte_memseg_list_walk (check_socket, &numa_id) ==0 ) +EAL_LOG (WARNING ,"WARNING: Main lcore has no memory on local NUMA node!" ); } static int
@@ -526,8 +526,8 @@ eal_worker_thread_create(unsigned int lcore_id) stack_size =eal_get_internal_configuration ()->huge_worker_stack_size;if (stack_size !=0 ) {/* Allocate NUMA aware stack memory and set pthread attributes */ - stack_ptr =rte_zmalloc_socket ("lcore_stack" , stack_size, -RTE_CACHE_LINE_SIZE ,rte_lcore_to_socket_id (lcore_id)); + stack_ptr =rte_zmalloc_numa ("lcore_stack" , stack_size, +RTE_CACHE_LINE_SIZE ,rte_lcore_to_numa_id (lcore_id));if (stack_ptr ==NULL ) {rte_eal_init_alert ("Cannot allocate worker lcore stack memory" ); rte_errno =ENOMEM ;
lib/eal/linux/eal_hugepage_info.c +20 -20
@@ -136,29 +136,29 @@ get_num_hugepages(const char *subdir, size_t sz, unsigned int reusable_pages) }
Lines of this file are not shown. View the raw message.
lib/eal/linux/eal_memory.c +38 -38
76 lines not on this page · raw message
lib/eal/windows/eal_lcore.c +21 -21
42 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.
Re: [PATCH 001/227] eal: add NUMA-aware APIs
Quoted 18 lines · On Tue, 3 Nov 2026 22:49:19 +0800 Chengwen Feng <[email protected]>…
From: Chengwen Feng <[email protected]>
DPDK has long used
socket_idterminology for NUMA allocation, which conflates CPU sockets with NUMA memory nodes.Add NUMA-named APIs while keeping the legacy socket-named ones as functional aliases (to be deprecated once the in-tree migration completes):
-
rte_numa_id(),rte_numa_count(),rte_numa_id_by_idx()
-rte_lcore_to_numa_id()
-rte_cpu_numa_id()(renamed from experimentalrte_cpu_socket_id())
-rte_malloc_numa(),rte_zmalloc_numa(),rte_calloc_numa(),rte_realloc_numa()
-rte_malloc_get_numa_stats()and structrte_malloc_numa_stats
-rte_malloc_heap_get_numa_id(),rte_malloc_heap_numa_is_external()
-RTE_NUMA_ID_ANYconstant (legacySOCKET_ID_ANYkept as alias)
Quoted 5 lines
Convert EAL internals, comments, log messages and telemetry keys to the NUMA node terminology, and update the EAL programmer guide accordingly.
Signed-off-by Chengwen Feng <[email protected]>
Getting rid of socket as terminology looks like a good thing. One important step would to make sure DPDK usage matches other libraries like libnuma. It would be good to avoid NIH as much as possible
Re: [PATCH 001/227] eal: add NUMA-aware APIs
Quoted 25 lines · Stephen Hemminger
Quoted 22 lines · On Tue, 3 Nov 2026 22:49:19 +0800 Chengwen Feng <[email protected]>…
From: Chengwen Feng <[email protected]>
DPDK has long used
socket_idterminology for NUMA allocation, which conflates CPU sockets with NUMA memory nodes.Add NUMA-named APIs while keeping the legacy socket-named ones as functional aliases (to be deprecated once the in-tree migration completes):
-
rte_numa_id(),rte_numa_count(),rte_numa_id_by_idx()
-rte_lcore_to_numa_id()
-rte_cpu_numa_id()(renamed from experimentalrte_cpu_socket_id())
-rte_malloc_numa(),rte_zmalloc_numa(),rte_calloc_numa(),rte_realloc_numa()
-rte_malloc_get_numa_stats()and structrte_malloc_numa_stats
-rte_malloc_heap_get_numa_id(),rte_malloc_heap_numa_is_external()
-RTE_NUMA_ID_ANYconstant (legacySOCKET_ID_ANYkept as alias)Convert EAL internals, comments, log messages and telemetry keys to the NUMA node terminology, and update the EAL programmer guide accordingly.
Quoted 5 lines
Quoted 1 line
Signed-off-by Chengwen Feng <[email protected]>Getting rid of socket as terminology looks like a good thing. One important step would to make sure DPDK usage matches other libraries like libnuma. It would be good to avoid NIH as much as possible
Thanks for your feedback. I agree that aligning with libnuma conventions is important and will help avoid NIH patterns.
I will check the semantics and naming of these new NUMA APIs against libnuma, and adjust where needed to follow existing Linux NUMA practice.
PATCH 2/227 mempool: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, trace arguments, internal variables, comments and telemetry keys to the NUMA node terminology, and switch internal calls to the NUMA-named APIs (rte_zmalloc_numa(), rte_malloc_heap_numa_is_external(), RTE_NUMA_ID_ANY).
No functional change.
--- app/proc-info/main.c | 2 +- doc/guides/rel_notes/deprecation.rst | 10 ++++ drivers/compress/nitrox/nitrox_comp_reqmgr.c | 8 +-- drivers/event/cnxk/cnxk_tim_evdev.c | 2 +- drivers/mempool/bucket/rte_mempool_bucket.c | 10 ++-- .../mempool/octeontx/rte_mempool_octeontx.c | 4 +- drivers/mempool/ring/rte_mempool_ring.c | 2 +- drivers/mempool/stack/rte_mempool_stack.c | 2 +- drivers/net/mlx4/mlx4_mr.c | 2 +- lib/ethdev/rte_ethdev_telemetry.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- lib/mempool/mempool_trace.h | 4 +- lib/mempool/rte_mempool.c | 60 +++++++++---------- lib/mempool/rte_mempool.h | 38 +++++++----- 14 files changed, 83 insertions(+), 65 deletions(-)
app/proc-info/main.c +1 -1
@@ -1121,7 +1121,7 @@ show_port(void)printf (" mempool %s socket %d" , queue_info.mp->name, - queue_info.mp->socket_id); + queue_info.mp->numa_id);if (queue_info.conf.offloads !=0 )show_offloads (queue_info.conf.offloads, rte_eth_dev_rx_offload_name);
doc/guides/rel_notes/deprecation.rst +10 -0
@@ -16,6 +16,16 @@ Other API and ABI deprecation notices are to be posted below. Deprecation Notices ------------------- +* lib: The public structures use ``socket_id`` to refer to a NUMA node, + which conflates CPU sockets with NUMA memory nodes. + The field is renamed to ``numa_id``, keeping ``socket_id`` + as a deprecated union alias. + The following structures are affected: ``rte_hash_parameters``, + ``rte_fbk_hash_params``, ``rte_member_parameters`` / + ``rte_member_setsum`` and ``rte_mempool`` + (more structures will follow in this release). + Applications should switch to ``numa_id``. + * kvargs: The function ``rte_kvargs_process`` will get a new parameter for returning key match count. It will ease handling of no-match case.
drivers/compress/nitrox/nitrox_comp_reqmgr.c +4 -4
@@ -620,7 +620,7 @@ static int softreq_init(struct nitrox_softreq *sr, err =create_sglist_from_mbuf (&sr->src, sr->op->m_src, sr->op->src.offset, - sr->op->src.length,0 , mp->socket_id); + sr->op->src.length,0 , mp->numa_id);if (unlikely (err))return err;
@@ -630,7 +630,7 @@ static int softreq_init(struct nitrox_softreq *sr, sr->op->dst.offset,rte_pktmbuf_pkt_len (sr->op->m_dst) - sr->op->dst.offset, need_decomp_threshold ?1 :0 , - mp->socket_id); + mp->numa_id);if (unlikely (err))return err;
@@ -1161,10 +1161,10 @@ static void req_pool_obj_init(struct rte_mempool *mp, void *arg, void *obj, sr = obj; sr->src.sgl =rte_zmalloc_socket (NULL ,sizeof (*sr->src.sgl) *NITROX_ZIP_SGL_COUNT , -8 , mp->socket_id); +8 , mp->numa_id); sr->dst.sgl =rte_zmalloc_socket (NULL ,sizeof (*sr->dst.sgl) *NITROX_ZIP_SGL_COUNT , -8 , mp->socket_id); +8 , mp->numa_id);if (sr->src.sgl ==NULL || sr->dst.sgl ==NULL ) {NITROX_LOG_LINE (ERR ,"Failed to allocate zip_sgl memory" ); *err = -ENOMEM ;
drivers/event/cnxk/cnxk_tim_evdev.c +1 -1
@@ -37,7 +37,7 @@ cnxk_tim_chnk_pool_populate_aligned(struct rte_mempool *mp, size_t align) stride = (size_t )mp->header_size + mp->elt_size + mp->trailer_size; len = stride * mp->size; - mem =rte_zmalloc_socket ("cnxk_tim_chunks" , len, align, mp->socket_id); + mem =rte_zmalloc_socket ("cnxk_tim_chunks" , len, align, mp->numa_id);if (mem ==NULL )return -ENOMEM ;
drivers/mempool/bucket/rte_mempool_bucket.c +5 -5
@@ -67,7 +67,7 @@ bucket_stack_create(const struct rte_mempool *mp, unsigned int n_elts)sizeof (struct bucket_stack ) + n_elts *sizeof (void *),RTE_CACHE_LINE_SIZE , - mp->socket_id); + mp->numa_id);if (stack ==NULL )return NULL ; stack->limit = n_elts;
@@ -429,7 +429,7 @@ bucket_init_per_lcore(unsigned int lcore_id, void *arg)if (mp->flags &RTE_MEMPOOL_F_SP_PUT ) rg_flags |=RING_F_SP_ENQ ; bd->adoption_buffer_rings[lcore_id] =rte_ring_create (rg_name, -rte_align32pow2 (mp->size +1 ), mp->socket_id, rg_flags); +rte_align32pow2 (mp->size +1 ), mp->numa_id, rg_flags);if (bd->adoption_buffer_rings[lcore_id] ==NULL ) goto error;
@@ -466,7 +466,7 @@ bucket_alloc(struct rte_mempool *mp)return rc; bd =rte_zmalloc_socket ("bucket_pool" ,sizeof (*bd), -RTE_CACHE_LINE_SIZE , mp->socket_id); +RTE_CACHE_LINE_SIZE , mp->numa_id);if (bd ==NULL ) { rc = -ENOMEM ; goto no_mem_for_data;
@@ -506,7 +506,7 @@ bucket_alloc(struct rte_mempool *mp) } bd->shared_orphan_ring =rte_ring_create (rg_name,rte_align32pow2 (mp->size +1 ), - mp->socket_id, rg_flags); + mp->numa_id, rg_flags);if (bd->shared_orphan_ring ==NULL ) { rc = -rte_errno; goto cannot_create_shared_orphan_ring;
@@ -522,7 +522,7 @@ bucket_alloc(struct rte_mempool *mp)rte_ring_create (rg_name,rte_align32pow2 ((mp->size +1 ) / bd->obj_per_bucket), - mp->socket_id, rg_flags); + mp->numa_id, rg_flags);if (bd->shared_bucket_ring ==NULL ) { rc = -rte_errno; goto cannot_create_shared_bucket_ring;
drivers/mempool/octeontx/rte_mempool_octeontx.c +2 -2
@@ -21,7 +21,7 @@ octeontx_fpavf_alloc(struct rte_mempool *mp) pool =octeontx_fpa_bufpool_create (object_size, memseg_count,OCTEONTX_FPAVF_BUF_OFFSET , - mp->socket_id); + mp->numa_id); rc =octeontx_fpa_bufpool_block_size (pool);if (rc <0 ) goto _end;
@@ -48,7 +48,7 @@ octeontx_fpavf_free(struct rte_mempool *mp)uintptr_t pool; pool = (uintptr_t )mp->pool_id; -octeontx_fpa_bufpool_destroy (pool, mp->socket_id); +octeontx_fpa_bufpool_destroy (pool, mp->numa_id); } static __rte_always_inline void *
drivers/mempool/ring/rte_mempool_ring.c +1 -1
@@ -96,7 +96,7 @@ ring_alloc(struct rte_mempool *mp, uint32_t rg_flags)* in this function for that condition. */ r =rte_ring_create (rg_name,rte_align32pow2 (mp->size +1 ), - mp->socket_id, rg_flags); + mp->numa_id, rg_flags);if (r ==NULL )return -rte_errno;
drivers/mempool/stack/rte_mempool_stack.c +1 -1
@@ -20,7 +20,7 @@ __stack_alloc(struct rte_mempool *mp, uint32_t flags)return -rte_errno; } - s =rte_stack_create (name, mp->size, mp->socket_id, flags); + s =rte_stack_create (name, mp->size, mp->numa_id, flags);if (s ==NULL )return -rte_errno;
drivers/net/mlx4/mlx4_mr.c +1 -1
@@ -1226,7 +1226,7 @@ mlx4_mr_update_ext_mp_cb(struct rte_mempool *mp, void *opaque, mr =rte_zmalloc_socket (NULL ,RTE_ALIGN_CEIL (sizeof (*mr),RTE_CACHE_LINE_SIZE ), -RTE_CACHE_LINE_SIZE , mp->socket_id); +RTE_CACHE_LINE_SIZE , mp->numa_id);if (mr ==NULL ) { WARN("port %u unable to allocate memory for a new MR of" " mempool (%s).",
lib/ethdev/rte_ethdev_telemetry.c +1 -1
@@ -537,7 +537,7 @@ eth_dev_handle_port_rxq(const char *cmd __rte_unused,rte_tel_data_start_dict (d);rte_tel_data_add_dict_string (d,"mempool_name" , qinfo.mp->name); -rte_tel_data_add_dict_uint (d,"socket_id" , qinfo.mp->socket_id); +rte_tel_data_add_dict_uint (d,"socket_id" , qinfo.mp->numa_id); rx_thresh = &qinfo.conf.rx_thresh;rte_tel_data_add_dict_uint (d,"host_threshold" , rx_thresh->hthresh);
lib/eventdev/rte_eventdev.c +1 -1
@@ -1513,7 +1513,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n,if (ret <0 ) goto err; -rte_eventdev_trace_vector_pool_create (mp, mp->name, mp->socket_id, +rte_eventdev_trace_vector_pool_create (mp, mp->name, mp->numa_id, mp->size, mp->cache_size, mp->elt_size);return mp;
lib/mempool/mempool_trace.h +2 -2
@@ -113,10 +113,10 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_mempool_trace_cache_create, - RTE_TRACE_POINT_ARGS(uint32_t size, int socket_id, + RTE_TRACE_POINT_ARGS(uint32_t size, int numa_id, struct rte_mempool_cache *cache), rte_trace_point_emit_u32(size); -rte_trace_point_emit_i32 (socket_id); +rte_trace_point_emit_i32 (numa_id);rte_trace_point_emit_ptr (cache);rte_trace_point_emit_u32 (cache->len); )
lib/mempool/rte_mempool.c +30 -30
167 lines not on this page · raw message
lib/mempool/rte_mempool.h +23 -15
@@ -245,7 +245,15 @@ struct __rte_cache_aligned rte_mempool {void *pool_config;/**< optional args for ops alloc. */ const struct rte_memzone *mz;/**< Memzone where pool is alloc'd. */ unsigned int flags;/**< Flags of the mempool. */ -int socket_id;/**< Socket id passed at create. */ +union { +/** NUMA node ID passed at create. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint32_t size;/**< Max size of the mempool. */ uint32_t cache_size;/**< Size of per-lcore default local cache. */
@@ -1084,9 +1092,9 @@ rte_mempool_free(struct rte_mempool *mp);* @param obj_init_arg * An opaque pointer to data that can be used as an argument for * each call to the object constructor function. -* @param socket_id -* The *socket_id* argument is the socket identifier in the case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the NUMA node ID in the case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * The *flags* arguments is an OR of following flags:
@@ -1117,11 +1125,11 @@ rte_mempool_free(struct rte_mempool *mp);* - ENOMEM - no appropriate memory area found in which to create memzone */ struct rte_mempool * -rte_mempool_create (const char *name,unsigned n,unsigned elt_size, -unsigned cache_size,unsigned private_data_size, +rte_mempool_create (const char *name,unsigned int n,unsigned int elt_size, +unsigned int cache_size,unsigned int private_data_size,rte_mempool_ctor_t *mp_init,void *mp_init_arg,rte_mempool_obj_cb_t *obj_init,void *obj_init_arg, -int socket_id,unsigned int flags) +int numa_id,unsigned int flags) __rte_malloc__rte_dealloc (rte_mempool_free,1 );/**
@@ -1145,9 +1153,9 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,* The size of the private data appended after the mempool * structure. This is useful for storing some private data after the * mempool structure, as is done for rte_mbuf_pool for example. -* @param socket_id -* The *socket_id* argument is the socket identifier in the case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the socket identifier in the case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * Flags controlling the behavior of the mempool. See
@@ -1159,7 +1167,7 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,struct rte_mempool *rte_mempool_create_empty (const char *name,unsigned int n,unsigned int elt_size,unsigned int cache_size,unsigned int private_data_size, -int socket_id,unsigned int flags) +int numa_id,unsigned int flags) __rte_malloc__rte_dealloc (rte_mempool_free,1 );/**
@@ -1351,12 +1359,12 @@ rte_mempool_cache_free(struct rte_mempool_cache *cache);* The size of the mempool cache. See rte_mempool_create()'s cache_size * parameter description for more information. The same limits and * considerations apply here too. -* @param socket_id -* The socket identifier in the case of NUMA. The value can be -* SOCKET_ID_ANY if there is no NUMA constraint for the reserved zone. +* @param numa_id +* The NUMA node ID in the case of NUMA. The value can be +* RTE_NUMA_ID_ANY if there is no NUMA constraint for the reserved zone. */ struct rte_mempool_cache * -rte_mempool_cache_create (uint32_t size,int socket_id) +rte_mempool_cache_create (uint32_t size,int numa_id) __rte_malloc__rte_dealloc (rte_mempool_cache_free,1 );/**
Signature · 1 line
2.55.0
PATCH 3/227 ring: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters and comments to numa_id, and update telemetry keys to the NUMA node terminology.
No functional change.
--- lib/ring/rte_ring.c | 12 ++++++------ lib/ring/rte_ring.h | 8 ++++---- lib/ring/rte_ring_elem.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-)
lib/ring/rte_ring.c +6 -6
@@ -256,7 +256,7 @@ rte_ring_init(struct rte_ring *r, const char *name, unsigned int count,RTE_EXPORT_SYMBOL (rte_ring_create_elem) struct rte_ring *rte_ring_create_elem (const char *name,unsigned int esize,unsigned int count, -int socket_id,unsigned int flags) +int numa_id,unsigned int flags) {char mz_name[RTE_MEMZONE_NAMESIZE ];struct rte_ring *r;
@@ -300,7 +300,7 @@ rte_ring_create_elem(const char *name, unsigned int esize, unsigned int count,* we are secondary process, the memzone_reserve function will set * rte_errno for us appropriately - hence no check in this function */ - mz =rte_memzone_reserve_aligned (mz_name, ring_size, socket_id, + mz =rte_memzone_reserve_aligned (mz_name, ring_size, numa_id, mz_flags, alignof(typeof(*r)));if (mz !=NULL ) { r = mz->addr;
@@ -325,10 +325,10 @@ rte_ring_create_elem(const char *name, unsigned int esize, unsigned int count,/* create the ring */ RTE_EXPORT_SYMBOL (rte_ring_create) struct rte_ring * -rte_ring_create (const char *name,unsigned int count,int socket_id, +rte_ring_create (const char *name,unsigned int count,int numa_id,unsigned int flags) { -return rte_ring_create_elem (name,sizeof (void *), count, socket_id, +return rte_ring_create_elem (name,sizeof (void *), count, numa_id, flags); }
@@ -605,7 +605,7 @@ ring_info_cb(struct rte_ring *r, void *arg)return ;rte_tel_data_add_dict_string (d,"name" , r->name); -rte_tel_data_add_dict_int (d,"socket" , r->memzone->socket_id); +rte_tel_data_add_dict_int (d,"numa_id" , r->memzone->socket_id);rte_tel_data_add_dict_int (d,"flags" , r->flags);rte_tel_data_add_dict_string (d,"producer_type" ,ring_prod_sync_type_to_name (r));
@@ -622,7 +622,7 @@ ring_info_cb(struct rte_ring *r, void *arg)rte_tel_data_add_dict_string (d,"mz_name" , mz->name);rte_tel_data_add_dict_uint (d,"mz_len" , mz->len);rte_tel_data_add_dict_uint (d,"mz_hugepage_sz" , mz->hugepage_sz); -rte_tel_data_add_dict_int (d,"mz_socket_id" , mz->socket_id); +rte_tel_data_add_dict_int (d,"mz_numa_id" , mz->socket_id);rte_tel_data_add_dict_uint_hex (d,"mz_flags" , mz->flags,0 ); }
lib/ring/rte_ring.h +4 -4
@@ -146,9 +146,9 @@ void rte_ring_free(struct rte_ring *r);* @param count * The size of the ring (must be a power of 2, * unless RING_F_EXACT_SZ is set in flags). -* @param socket_id -* The *socket_id* argument is the socket identifier in case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * An OR of the following:
@@ -193,7 +193,7 @@ void rte_ring_free(struct rte_ring *r);* - ENOMEM - no appropriate memory area found in which to create memzone */ struct rte_ring *rte_ring_create (const char *name,unsigned int count, -int socket_id,unsigned int flags) +int numa_id,unsigned int flags) __rte_malloc__rte_dealloc (rte_ring_free,1 );/**
lib/ring/rte_ring_elem.h +4 -4
@@ -58,9 +58,9 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize, unsigned int count);* The size of ring element, in bytes. It must be a multiple of 4. * @param count * The number of elements in the ring (must be a power of 2). -* @param socket_id -* The *socket_id* argument is the socket identifier in case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * An OR of the following:
@@ -99,7 +99,7 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize, unsigned int count);* - ENOMEM - no appropriate memory area found in which to create memzone */ struct rte_ring *rte_ring_create_elem (const char *name,unsigned int esize, -unsigned int count,int socket_id,unsigned int flags); +unsigned int count,int numa_id,unsigned int flags);/** * Enqueue several objects on the ring (multi-producers safe).
Signature · 1 line
2.55.0
PATCH 4/227 hash: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id field of rte_hash_parameters and rte_fbk_hash_params (was socket_id), and update in-tree users accordingly.
Also rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to the NUMA-named APIs (rte_zmalloc_numa(), RTE_NUMA_ID_ANY).
No functional change.
--- app/test/test_func_reentrancy.c | 4 +- app/test/test_hash.c | 52 ++++++++++---------- app/test/test_hash_multiwriter.c | 2 +- app/test/test_hash_perf.c | 4 +- app/test/test_hash_readwrite.c | 2 +- app/test/test_hash_readwrite_lf_perf.c | 2 +- app/test/test_rcu_qsbr.c | 2 +- app/test/test_rcu_qsbr_perf.c | 2 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_matcher.c | 4 +- drivers/net/enic/enic_fm_flow.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hns3/hns3_fdir.c | 2 +- drivers/net/intel/cpfl/cpfl_ethdev.c | 4 +- drivers/net/intel/i40e/i40e_ethdev.c | 2 +- drivers/net/intel/i40e/i40e_fdir.c | 2 +- drivers/net/intel/i40e/i40e_flow_ethertype.c | 2 +- drivers/net/intel/ice/ice_fdir_filter.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/memif/memif_socket.c | 2 +- drivers/net/nfp/flower/nfp_conntrack.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 10 ++-- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/sfc/sfc_tbl_meta_cache.c | 2 +- drivers/net/txgbe/txgbe_ethdev.c | 4 +- lib/hash/rte_cuckoo_hash.c | 28 +++++------ lib/hash/rte_fbk_hash.c | 2 +- lib/hash/rte_fbk_hash.h | 10 +++- lib/hash/rte_hash.h | 10 +++- lib/ipsec/ipsec_sad.c | 2 +- lib/lpm/rte_lpm6.c | 2 +- lib/node/udp4_input.c | 4 +- lib/vhost/vhost_crypto.c | 2 +- 33 files changed, 97 insertions(+), 81 deletions(-)
app/test/test_func_reentrancy.c +2 -2
@@ -238,7 +238,7 @@ hash_create_free(__rte_unused void *arg) .key_len = 4, .hash_func = (rte_hash_function)rte_jhash_32b, .hash_func_init_val = 0, - .socket_id = 0, + .numa_id = 0, };WAIT_SYNCHRO_FOR_WORKERS ();
@@ -303,7 +303,7 @@ fbk_create_free(__rte_unused void *arg) .name = NULL, .entries = 4, .entries_per_bucket = 4, - .socket_id = 0, + .numa_id = 0, .hash_func = rte_jhash_1word, .init_val = RTE_FBK_HASH_INIT_VAL_DEFAULT, };
app/test/test_hash.c +26 -26
208 lines not on this page · raw message
app/test/test_hash_multiwriter.c +1 -1
@@ -119,7 +119,7 @@ test_hash_multiwriter(void) .key_len = sizeof(uint32_t), .hash_func = rte_jhash, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };if (use_htm) hash_params.extra_flag =
app/test/test_hash_perf.c +2 -2
@@ -104,7 +104,7 @@ create_table(unsigned int with_data, unsigned int table_index, ut_params.name = name; ut_params.key_len = hashtest_key_lens[table_index]; - ut_params.socket_id =rte_socket_id (); + ut_params.numa_id =rte_numa_id (); h[table_index] =rte_hash_find_existing (name);rte_hash_free (h[table_index]); h[table_index] =rte_hash_create (&ut_params);
@@ -653,7 +653,7 @@ fbk_hash_perf_test(void) .name = "fbk_hash_test", .entries = ENTRIES, .entries_per_bucket = 4, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };struct rte_fbk_hash_table *handle =NULL ;uint32_t *keys =NULL ;
app/test/test_hash_readwrite.c +1 -1
@@ -149,7 +149,7 @@ init_params(int use_ext, int use_htm, int rw_lf, int use_jhash, bool perf) .entries = TOTAL_ENTRY * (perf ? PERF_MULTIPLIER : 1), .key_len = sizeof(uint32_t), .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };if (use_jhash) hash_params.hash_func = rte_jhash;
app/test/test_hash_readwrite_lf_perf.c +1 -1
@@ -154,7 +154,7 @@ init_params(int rwc_lf, int use_jhash, int htm, int ext_bkt) .entries = TOTAL_ENTRY, .key_len = sizeof(uint32_t), .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };if (use_jhash)
app/test/test_rcu_qsbr.c +1 -1
@@ -1050,7 +1050,7 @@ init_hash(int hash_id) .entries = TOTAL_ENTRY, .key_len = sizeof(uint32_t), .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .hash_func = rte_hash_crc, .extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF,
app/test/test_rcu_qsbr_perf.c +1 -1
@@ -339,7 +339,7 @@ static struct rte_hash *init_hash(void) .entries = TOTAL_ENTRY, .key_len = sizeof(uint32_t), .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .hash_func = rte_hash_crc, .extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF,
drivers/net/bnxt/bnxt_vnic.c +1 -1
@@ -998,7 +998,7 @@ int32_t bnxt_vnic_queue_db_init(struct bnxt *bp) hash_tbl_params.entries =RTE_HASH_BUCKET_ENTRIES ; hash_tbl_params.key_len =BNXT_VNIC_MAX_QUEUE_SZ_IN_8BITS ; - hash_tbl_params.socket_id =rte_socket_id (); + hash_tbl_params.numa_id =rte_numa_id (); bp->vnic_queue_db.rss_q_db =rte_hash_create (&hash_tbl_params);if (bp->vnic_queue_db.rss_q_db ==NULL ) {PMD_DRV_LOG_LINE (ERR ,"Failed to create rss hash tbl" );
drivers/net/bnxt/tf_ulp/ulp_matcher.c +2 -2
@@ -358,7 +358,7 @@ int32_t ulp_matcher_init(struct bnxt_ulp_context *ulp_ctx)RTE_HASH_BUCKET_ENTRIES ; hash_tbl_params.key_len =sizeof (struct ulp_matcher_hash_db_key ); - hash_tbl_params.socket_id =rte_socket_id (); + hash_tbl_params.numa_id =rte_numa_id (); data->class_matcher_db =rte_hash_create (&hash_tbl_params);if (data->class_matcher_db ==NULL ) {BNXT_DRV_DBG (ERR ,"Failed to create class matcher hash tbl\n" );
@@ -380,7 +380,7 @@ int32_t ulp_matcher_init(struct bnxt_ulp_context *ulp_ctx)/* The hash list size set to max support and not dependent on template*/ hash_tbl_params.entries =BNXT_ULP_ACT_HASH_LIST_SIZE ; hash_tbl_params.key_len =sizeof (struct ulp_matcher_action_hash_db_key ); - hash_tbl_params.socket_id =rte_socket_id (); + hash_tbl_params.numa_id =rte_numa_id (); data->action_matcher_db =rte_hash_create (&hash_tbl_params);if (data->action_matcher_db ==NULL ) {BNXT_DRV_DBG (ERR ,"Failed to create action matcher hash tbl\n" );
drivers/net/enic/enic_fm_flow.c +1 -1
@@ -3144,7 +3144,7 @@ enic_fm_init_actions(struct enic_flowman *fm) .key_len = sizeof(struct fm_action), .hash_func = rte_jhash, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };ENICPMD_FUNC_TRACE ();
drivers/net/hinic/base/hinic_pmd_hwdev.c +1 -1
@@ -341,7 +341,7 @@ int hinic_osdep_init(struct hinic_hwdev *hwdev) dh_params.key_len =HINIC_HASH_KEY_LEN ; dh_params.hash_func =HINIC_HASH_FUNC ; dh_params.hash_func_init_val =HINIC_HASH_FUNC_INIT_VAL ; - dh_params.socket_id =SOCKET_ID_ANY ; + dh_params.numa_id =RTE_NUMA_ID_ANY ; paddr_hash =rte_hash_find_existing (dh_params.name);if (paddr_hash ==NULL ) {
drivers/net/hns3/hns3_fdir.c +1 -1
@@ -911,7 +911,7 @@ int hns3_fdir_filter_init(struct hns3_adapter *hns)return ret; } - fdir_hash_params.socket_id =rte_socket_id (); + fdir_hash_params.numa_id =rte_numa_id ();TAILQ_INIT (&fdir_info->fdir_list);snprintf (fdir_hash_name,RTE_HASH_NAMESIZE ,"%s" , hns->hw.data->name); fdir_info->hash_handle =rte_hash_create (&fdir_hash_params);
drivers/net/intel/cpfl/cpfl_ethdev.c +2 -2
@@ -2517,7 +2517,7 @@ cpfl_vport_map_init(struct cpfl_adapter_ext *adapter) .entries = CPFL_VPORT_MAP_HASH_ENTRY_NUM, .key_len = sizeof(struct cpfl_vport_id), .hash_func = rte_hash_crc, - .socket_id = SOCKET_ID_ANY, + .numa_id = RTE_NUMA_ID_ANY, }; adapter->vport_map_hash =rte_hash_create (¶ms);
@@ -2559,7 +2559,7 @@ cpfl_repr_allowlist_init(struct cpfl_adapter_ext *adapter) .entries = CPFL_REPR_HASH_ENTRY_NUM, .key_len = sizeof(struct cpfl_repr_id), .hash_func = rte_hash_crc, - .socket_id = SOCKET_ID_ANY, + .numa_id = RTE_NUMA_ID_ANY, }; adapter->repr_allowlist_hash =rte_hash_create (¶ms);
drivers/net/intel/i40e/i40e_ethdev.c +1 -1
@@ -1000,7 +1000,7 @@ i40e_tunnel_state_attach(struct rte_eth_dev_data *dev_data) .key_len = sizeof(struct i40e_tunnel_filter_match_key), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };snprintf (tunnel_hash_name,RTE_HASH_NAMESIZE ,"tunnel_%s" , dev_data->name);
drivers/net/intel/i40e/i40e_fdir.c +1 -1
@@ -1078,7 +1078,7 @@ i40e_fdir_tmpl_store_init(struct rte_eth_dev *dev) .key_len = sizeof(struct i40e_fdir_tmpl_key), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };if (tmpls->hash_table !=NULL )
drivers/net/intel/i40e/i40e_flow_ethertype.c +1 -1
@@ -306,7 +306,7 @@ i40e_flow_ethertype_engine_init(const struct ci_flow_engine *engine __rte_unused .key_len = sizeof(struct i40e_ethertype_key), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };snprintf (ethertype_hash_name,RTE_HASH_NAMESIZE ,"etype_%s" , dev_data->name);
drivers/net/intel/ice/ice_fdir_filter.c +1 -1
@@ -395,7 +395,7 @@ ice_fdir_init_filter_list(struct ice_pf *pf) .key_len = sizeof(struct ice_fdir_fltr_pattern), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .extra_flag = RTE_HASH_EXTRA_FLAGS_EXT_TABLE, };
drivers/net/intel/ixgbe/ixgbe_ethdev.c +1 -1
@@ -1330,7 +1330,7 @@ ixgbe_fdir_state_attach(struct rte_eth_dev_data *dev_data) .key_len = sizeof(union ixgbe_atr_input), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), }; snprintf(fdir_hash_name, RTE_HASH_NAMESIZE, "fdir_%s",
drivers/net/memif/memif_socket.c +1 -1
@@ -1088,7 +1088,7 @@ memif_create_socket_hash(void) params.key_len =MEMIF_SOCKET_UN_SIZE ; params.hash_func = rte_jhash; params.hash_func_init_val =0 ; - params.socket_id =SOCKET_ID_ANY ; + params.numa_id =RTE_NUMA_ID_ANY ;return rte_hash_create (¶ms); }
drivers/net/nfp/flower/nfp_conntrack.c +1 -1
@@ -865,7 +865,7 @@ nfp_ct_zone_entry_init(struct nfp_ct_zone_entry *ze,struct rte_hash_parameters ct_merge_hash_params = { .entries =1000 , .hash_func = rte_jhash, - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .key_len =sizeof (uint32_t ), .extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY , };
drivers/net/nfp/flower/nfp_flower_flow.c +5 -5
@@ -5468,7 +5468,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) .name = mask_name, .entries = NFP_MASK_TABLE_ENTRIES, .hash_func = rte_jhash, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .key_len = sizeof(uint32_t), .extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY, };
@@ -5476,7 +5476,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)struct rte_hash_parameters flow_hash_params = { .name = flow_name, .hash_func = rte_jhash, - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .key_len =sizeof (uint32_t ), .extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY , };
@@ -5485,7 +5485,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) .name = pretun_name, .entries = 32, .hash_func = rte_jhash, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .key_len = sizeof(uint32_t), .extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY, };
@@ -5494,7 +5494,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) .name = ct_zone_table_name, .entries = 65536, .hash_func = rte_jhash, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .key_len = sizeof(uint32_t), .extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY, };
@@ -5502,7 +5502,7 @@ nfp_flow_priv_init(struct nfp_pf_dev *pf_dev)struct rte_hash_parameters ct_map_hash_params = { .name = ct_map_table_name, .hash_func = rte_jhash, - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .key_len =sizeof (uint32_t ), .extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY , };
drivers/net/nfp/nfp_net_flow.c +1 -1
@@ -1082,7 +1082,7 @@ nfp_net_flow_priv_init(struct nfp_pf_dev *pf_dev,struct rte_hash_parameters flow_hash_params = { .name = flow_name, .hash_func = rte_jhash, - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .key_len =sizeof (uint32_t ), .extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY , };
drivers/net/sfc/sfc_tbl_meta_cache.c +1 -1
@@ -22,7 +22,7 @@ sfc_tbl_meta_cache_ctor(struct rte_hash **ref_cache) .name = "meta_hash_table", .hash_func = rte_jhash, .entries = cache_size, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), .key_len = sizeof(efx_table_id_t), };
drivers/net/txgbe/txgbe_ethdev.c +2 -2
@@ -992,7 +992,7 @@ int txgbe_fdir_filter_init(struct rte_eth_dev *eth_dev) .key_len = sizeof(struct txgbe_atr_input), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };TAILQ_INIT (&fdir_info->fdir_list);
@@ -1028,7 +1028,7 @@ static int txgbe_l2_tn_filter_init(struct rte_eth_dev *eth_dev) .key_len = sizeof(struct txgbe_l2_tn_key), .hash_func = rte_hash_crc, .hash_func_init_val = 0, - .socket_id = rte_socket_id(), + .numa_id = rte_numa_id(), };TAILQ_INIT (&l2_tn_info->l2_tn_list);
lib/hash/rte_cuckoo_hash.c +14 -14
@@ -537,7 +537,7 @@ rte_hash_create(const struct rte_hash_parameters *params)/* Create ring (Dummy slot index is not enqueued) */ r =rte_ring_create_elem (ring_name,sizeof (uint32_t ), -rte_align32pow2 (num_key_slots), params->socket_id,0 ); +rte_align32pow2 (num_key_slots), params->numa_id,0 );if (r ==NULL ) {HASH_LOG (ERR ,"ring creation failed: %s" ,rte_strerror (rte_errno)); goto err;
@@ -556,7 +556,7 @@ rte_hash_create(const struct rte_hash_parameters *params) r_ext =rte_ring_create_elem (ext_ring_name,sizeof (uint32_t ),rte_align32pow2 (num_buckets +1 ), - params->socket_id,0 ); + params->numa_id,0 );if (r_ext ==NULL ) {HASH_LOG (ERR ,"ext buckets ring create failed: %s" ,rte_strerror (rte_errno));
@@ -590,17 +590,17 @@ rte_hash_create(const struct rte_hash_parameters *params) goto err_unlock; } - h = (struct rte_hash *)rte_zmalloc_socket (hash_name,sizeof (struct rte_hash ), -RTE_CACHE_LINE_SIZE , params->socket_id); + h = (struct rte_hash *)rte_zmalloc_numa (hash_name,sizeof (struct rte_hash ), +RTE_CACHE_LINE_SIZE , params->numa_id);if (h ==NULL ) {HASH_LOG (ERR ,"memory allocation failed" ); goto err_unlock; } - buckets =rte_zmalloc_socket (NULL , + buckets =rte_zmalloc_numa (NULL , num_buckets *sizeof (struct rte_hash_bucket ), -RTE_CACHE_LINE_SIZE , params->socket_id); +RTE_CACHE_LINE_SIZE , params->numa_id);if (buckets ==NULL ) {HASH_LOG (ERR ,"buckets memory allocation failed" );
@@ -609,9 +609,9 @@ rte_hash_create(const struct rte_hash_parameters *params)/* Allocate same number of extendable buckets */ if (ext_table_support) { - buckets_ext =rte_zmalloc_socket (NULL , + buckets_ext =rte_zmalloc_numa (NULL , num_buckets *sizeof (struct rte_hash_bucket ), -RTE_CACHE_LINE_SIZE , params->socket_id); +RTE_CACHE_LINE_SIZE , params->numa_id);if (buckets_ext ==NULL ) {HASH_LOG (ERR ,"ext buckets memory allocation " "failed" );
@@ -641,16 +641,16 @@ rte_hash_create(const struct rte_hash_parameters *params) KEY_ALIGNMENT);const uint64_t key_tbl_size = (uint64_t ) key_entry_size * num_key_slots; - k =rte_zmalloc_socket (NULL , key_tbl_size, -RTE_CACHE_LINE_SIZE , params->socket_id); + k =rte_zmalloc_numa (NULL , key_tbl_size, +RTE_CACHE_LINE_SIZE , params->numa_id);if (k ==NULL ) {HASH_LOG (ERR ,"memory allocation failed" ); goto err_unlock; } - tbl_chng_cnt =rte_zmalloc_socket (NULL ,sizeof (uint32_t ), -RTE_CACHE_LINE_SIZE , params->socket_id); + tbl_chng_cnt =rte_zmalloc_numa (NULL ,sizeof (uint32_t ), +RTE_CACHE_LINE_SIZE , params->numa_id);if (tbl_chng_cnt ==NULL ) {HASH_LOG (ERR ,"memory allocation failed" );
@@ -669,9 +669,9 @@ rte_hash_create(const struct rte_hash_parameters *params) }if (use_local_cache) { - local_free_slots =rte_zmalloc_socket (NULL , + local_free_slots =rte_zmalloc_numa (NULL ,sizeof (struct lcore_cache ) *RTE_MAX_LCORE , -RTE_CACHE_LINE_SIZE , params->socket_id); +RTE_CACHE_LINE_SIZE , params->numa_id);if (local_free_slots ==NULL ) {HASH_LOG (ERR ,"local free slots memory allocation failed" ); goto err_unlock;
lib/hash/rte_fbk_hash.c +1 -1
@@ -135,7 +135,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params) }/* Allocate memory for table. */ - ht =rte_zmalloc_socket (hash_name, mem_size,0 , params->socket_id); + ht =rte_zmalloc_numa (hash_name, mem_size,0 , params->numa_id);if (ht ==NULL ) {HASH_LOG (ERR ,"Failed to allocate fbk hash table" );rte_free (te);
lib/hash/rte_fbk_hash.h +9 -1
@@ -50,7 +50,15 @@ struct rte_fbk_hash_params {const char *name;/**< Name of the hash table. */ uint32_t entries;/**< Total number of entries. */ uint32_t entries_per_bucket;/**< Number of entries in a bucket. */ -int socket_id;/**< Socket to allocate memory on. */ +union { +/** NUMA node ID to allocate memory on. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };rte_fbk_hash_fn hash_func;/**< The hash function. */ uint32_t init_val;/**< For initialising hash function. */ };
lib/hash/rte_hash.h +9 -1
@@ -86,7 +86,15 @@ struct rte_hash_parameters {uint32_t key_len;/**< Length of hash key. */ rte_hash_function hash_func;/**< Primary Hash function used to calculate hash. */ uint32_t hash_func_init_val;/**< Init value used by hash_func. */ -int socket_id;/**< NUMA Socket ID for memory. */ +union { +/** NUMA node ID for memory. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint8_t extra_flag;/**< Indicate if additional parameters are present. */ };
lib/ipsec/ipsec_sad.c +1 -1
@@ -302,7 +302,7 @@ rte_ipsec_sad_create(const char *name, const struct rte_ipsec_sad_conf *conf) hash_params.hash_func =DEFAULT_HASH_FUNC ; hash_params.hash_func_init_val =rte_rand (); sad->init_val = hash_params.hash_func_init_val; - hash_params.socket_id = conf->socket_id; + hash_params.numa_id = conf->socket_id; hash_params.name = hash_name;if (conf->flags &RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY ) hash_params.extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY ;
lib/lpm/rte_lpm6.c +1 -1
@@ -246,7 +246,7 @@ rte_lpm6_create(const char *name, int socket_id, .hash_func_init_val = 0, .name = mem_name, .reserved = 0, - .socket_id = socket_id, + .numa_id = socket_id, .extra_flag = 0 };
lib/node/udp4_input.c +2 -2
@@ -53,7 +53,7 @@ static struct rte_hash_parameters udp4_params = { .key_len = sizeof(uint32_t), .hash_func = rte_jhash, .hash_func_init_val = 0, - .socket_id = 0, + .numa_id = 0, };RTE_EXPORT_EXPERIMENTAL_SYMBOL (rte_node_udp4_dst_port_add,23.11 )
@@ -109,7 +109,7 @@ setup_udp4_dstprt_hash(struct udp4_input_node_main *nm, int socket)/* create Hash table */ snprintf (s,sizeof (s),"UDP4_INPUT_HASH_%d" , socket); hash_udp4->name = s; - hash_udp4->socket_id = socket; + hash_udp4->numa_id = socket; nm->hash_tbl[socket] =rte_hash_create (hash_udp4);if (nm->hash_tbl[socket] ==NULL )return -rte_errno;
lib/vhost/vhost_crypto.c +1 -1
@@ -1837,7 +1837,7 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id, params.entries =VHOST_CRYPTO_SESSION_MAP_ENTRIES ; params.hash_func = rte_jhash; params.key_len =sizeof (uint64_t ); - params.socket_id = socket_id; + params.numa_id = socket_id; vcrypto->session_map =rte_hash_create (¶ms);if (!vcrypto->session_map) {VC_LOG_ERR ("Failed to creath session map" );
Signature · 1 line
2.55.0
PATCH 5/227 member: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id fields of rte_member_parameters and rte_member_setsum to numa_id, keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename socket parameters and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa().
No functional change.
--- app/test/test_member.c | 6 +++--- app/test/test_member_perf.c | 4 ++-- lib/member/rte_member.c | 8 ++++---- lib/member/rte_member.h | 20 ++++++++++++++++++-- lib/member/rte_member_heap.h | 18 +++++++++--------- lib/member/rte_member_ht.c | 4 ++-- lib/member/rte_member_sketch.c | 24 ++++++++++++------------ lib/member/rte_member_vbf.c | 4 ++-- 8 files changed, 52 insertions(+), 36 deletions(-)
app/test/test_member.c +3 -3
@@ -107,7 +107,7 @@ static struct rte_member_parameters params = { .false_positive_rate = 0.03, .prim_hash_seed = 1, .sec_hash_seed = 11, - .socket_id = 0 /* NUMA Socket ID for memory. */ + .numa_id = 0 /* NUMA Socket ID for memory. */ };/* for sketch definitions */
@@ -146,7 +146,7 @@ test_member_find_existing(void) .false_positive_rate = 0.03, .prim_hash_seed = 1, .sec_hash_seed = 11, - .socket_id = 0 /* NUMA Socket ID for memory. */ + .numa_id = 0 /* NUMA Socket ID for memory. */ };/* Create */
@@ -182,7 +182,7 @@ test_member_create_bad_param(void) .false_positive_rate = 0.03, .prim_hash_seed = 1, .sec_hash_seed = 11, - .socket_id = 0 /* NUMA Socket ID for memory. */ + .numa_id = 0 /* NUMA Socket ID for memory. */ };printf ("Expected error section begin...\n" );
app/test/test_member_perf.c +2 -2
@@ -140,7 +140,7 @@ struct rte_member_parameters member_params = { .false_positive_rate = 0.03, .prim_hash_seed = 0, .sec_hash_seed = 1, - .socket_id = 0, /* NUMA Socket ID for memory. */ + .numa_id = 0, /* NUMA Socket ID for memory. */ }; static int
@@ -220,7 +220,7 @@ setup_keys_and_data(struct member_perf_params *params, unsigned int cycle, } member_params.false_positive_rate =VBF_FALSE_RATE ; member_params.key_len = params->key_size; - member_params.socket_id = test_socket_id; + member_params.numa_id = test_socket_id; member_params.num_keys = entry_cnt; member_params.name ="test_member_ht" ; member_params.is_cache =0 ;
lib/member/rte_member.c +4 -4
@@ -115,7 +115,7 @@ rte_member_create(const struct rte_member_parameters *params)if (params->type ==RTE_MEMBER_TYPE_SKETCH ) {snprintf (ring_name,sizeof (ring_name),"SK_%s" , params->name); sketch_key_ring =rte_ring_create_elem (ring_name,sizeof (uint32_t ), -rte_align32pow2 (params->top_k), params->socket_id,0 ); +rte_align32pow2 (params->top_k), params->numa_id,0 );if (sketch_key_ring ==NULL ) {MEMBER_LOG (ERR ,"Sketch Ring Memory allocation failed" );return NULL ;
@@ -145,16 +145,16 @@ rte_member_create(const struct rte_member_parameters *params) }/* Create a new setsum structure */ - setsum =rte_zmalloc_socket (params->name, + setsum =rte_zmalloc_numa (params->name,sizeof (struct rte_member_setsum ),RTE_CACHE_LINE_SIZE , - params->socket_id); + params->numa_id);if (setsum ==NULL ) {MEMBER_LOG (ERR ,"Create setsummary failed" ); goto error_unlock_exit; }strlcpy (setsum->name, params->name,sizeof (setsum->name)); setsum->type = params->type; - setsum->socket_id = params->socket_id; + setsum->numa_id = params->numa_id; setsum->key_len = params->key_len; setsum->num_set = params->num_set; setsum->prim_hash_seed = params->prim_hash_seed;
lib/member/rte_member.h +18 -2
@@ -171,7 +171,15 @@ struct __rte_cache_aligned rte_member_setsum {/* Second cache line should start here. */ -uint32_t socket_id;/* NUMA Socket ID for memory. */ +union { +/** NUMA node ID for memory. */ +uint32_t numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + uint32_t socket_id; + };char name[RTE_MEMBER_NAMESIZE ];/* Name of this set summary. */ #ifdef RTE_ARCH_X86 bool use_avx512;
@@ -316,7 +324,15 @@ struct __rte_cache_aligned rte_member_parameters {*/ uint32_t extra_flag; -int socket_id;/**< NUMA Socket ID for memory. */ +union { +/** NUMA node ID for memory. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + }; };/**
lib/member/rte_member_heap.h +9 -9
@@ -38,7 +38,7 @@ struct node {struct minheap {uint32_t key_len;uint32_t size; -uint32_t socket; +uint32_t numa_id;struct hash *hashtable;struct node *elem; };
@@ -134,9 +134,9 @@ resize_hash_table(struct minheap *hp) hp->hashtable->num_item / ((float)hp->hashtable->bkt_cnt * HASH_BKT_SIZE));MEMBER_LOG (ERR ,"Sketch Minheap HT resize happen!" );rte_free (hp->hashtable); - hp->hashtable =rte_zmalloc_socket (NULL ,sizeof (struct hash ) + + hp->hashtable =rte_zmalloc_numa (NULL ,sizeof (struct hash ) + new_bkt_cnt *sizeof (struct hash_bkt ), -RTE_CACHE_LINE_SIZE , hp->socket); +RTE_CACHE_LINE_SIZE , hp->numa_id);if (hp->hashtable ==NULL ) {MEMBER_LOG (ERR ,"Sketch Minheap HT allocation failed" );
@@ -170,10 +170,10 @@ rte_member_minheap_find(struct minheap *hp, const void *key)static int rte_member_minheap_init (struct minheap *heap,int size, -uint32_t socket,uint32_t seed) +uint32_t numa_id,uint32_t seed) { - heap->elem =rte_zmalloc_socket (NULL ,sizeof (struct node ) * size, -RTE_CACHE_LINE_SIZE , socket); + heap->elem =rte_zmalloc_numa (NULL ,sizeof (struct node ) * size, +RTE_CACHE_LINE_SIZE , numa_id);if (heap->elem ==NULL ) {MEMBER_LOG (ERR ,"Sketch Minheap elem allocation failed" );return -ENOMEM ;
@@ -184,9 +184,9 @@ rte_member_minheap_init(struct minheap *heap, int size,if (hash_bkt_cnt ==0 ) hash_bkt_cnt =1 ; - heap->hashtable =rte_zmalloc_socket (NULL ,sizeof (struct hash ) + + heap->hashtable =rte_zmalloc_numa (NULL ,sizeof (struct hash ) + hash_bkt_cnt *sizeof (struct hash_bkt ), -RTE_CACHE_LINE_SIZE , socket); +RTE_CACHE_LINE_SIZE , numa_id);if (heap->hashtable ==NULL ) {MEMBER_LOG (ERR ,"Sketch Minheap HT allocation failed" );
@@ -196,7 +196,7 @@ rte_member_minheap_init(struct minheap *heap, int size, heap->hashtable->seed = seed; heap->hashtable->bkt_cnt = hash_bkt_cnt; - heap->socket = socket; + heap->numa_id = numa_id;return 0 ; }
lib/member/rte_member_ht.c +2 -2
@@ -95,9 +95,9 @@ rte_member_create_ht(struct rte_member_setsum *ss, size_bucket_t =sizeof (struct member_ht_bucket ); -struct member_ht_bucket *buckets =rte_zmalloc_socket (NULL , +struct member_ht_bucket *buckets =rte_zmalloc_numa (NULL , num_buckets * size_bucket_t, -RTE_CACHE_LINE_SIZE , ss->socket_id); +RTE_CACHE_LINE_SIZE , ss->numa_id);if (buckets ==NULL ) { MEMBER_LOG(ERR, "memory allocation failed for HT "
lib/member/rte_member_sketch.c +12 -12
@@ -160,7 +160,7 @@ rte_member_create_sketch(struct rte_member_setsum *ss, ss->sketch_delete = sketch_delete_scalar; } - ss->socket_id = params->socket_id; + ss->numa_id = params->numa_id;if (ss->count_byte ==0 ) num_col =4.0 / params->error_rate / params->sample_rate;
@@ -171,23 +171,23 @@ rte_member_create_sketch(struct rte_member_setsum *ss,else num_col =4.0 / params->error_rate; - ss->table =rte_zmalloc_socket (NULL , + ss->table =rte_zmalloc_numa (NULL ,sizeof (uint64_t ) * num_col * ss->num_row, -RTE_CACHE_LINE_SIZE , ss->socket_id); +RTE_CACHE_LINE_SIZE , ss->numa_id);if (ss->table ==NULL ) {MEMBER_LOG (ERR ,"Sketch Table memory allocation failed" );return -ENOMEM ; } - ss->hash_seeds =rte_zmalloc_socket (NULL ,sizeof (uint64_t ) * ss->num_row, -RTE_CACHE_LINE_SIZE , ss->socket_id); + ss->hash_seeds =rte_zmalloc_numa (NULL ,sizeof (uint64_t ) * ss->num_row, +RTE_CACHE_LINE_SIZE , ss->numa_id);if (ss->hash_seeds ==NULL ) {MEMBER_LOG (ERR ,"Sketch Hashseeds memory allocation failed" );return -ENOMEM ; } - ss->runtime_var =rte_zmalloc_socket (NULL ,sizeof (struct sketch_runtime ), -RTE_CACHE_LINE_SIZE , ss->socket_id); + ss->runtime_var =rte_zmalloc_numa (NULL ,sizeof (struct sketch_runtime ), +RTE_CACHE_LINE_SIZE , ss->numa_id);if (ss->runtime_var ==NULL ) {MEMBER_LOG (ERR ,"Sketch Runtime memory allocation failed" );rte_free (ss);
@@ -204,8 +204,8 @@ rte_member_create_sketch(struct rte_member_setsum *ss, ss->key_len = params->key_len; runtime->heap.key_len = ss->key_len; - runtime->key_slots =rte_zmalloc_socket (NULL , ss->key_len * ss->topk, -RTE_CACHE_LINE_SIZE , ss->socket_id); + runtime->key_slots =rte_zmalloc_numa (NULL , ss->key_len * ss->topk, +RTE_CACHE_LINE_SIZE , ss->numa_id);if (runtime->key_slots ==NULL ) {MEMBER_LOG (ERR ,"Sketch Key Slots allocation failed" ); goto error;
@@ -217,13 +217,13 @@ rte_member_create_sketch(struct rte_member_setsum *ss, &i, sizeof(uint32_t));if (rte_member_minheap_init (&(runtime->heap), params->top_k, - ss->socket_id, params->prim_hash_seed) <0 ) { + ss->numa_id, params->prim_hash_seed) <0 ) {MEMBER_LOG (ERR ,"Sketch Minheap allocation failed" ); goto error_runtime; } - runtime->report_array =rte_zmalloc_socket (NULL ,sizeof (struct node ) * ss->topk, -RTE_CACHE_LINE_SIZE , ss->socket_id); + runtime->report_array =rte_zmalloc_numa (NULL ,sizeof (struct node ) * ss->topk, +RTE_CACHE_LINE_SIZE , ss->numa_id);if (runtime->report_array ==NULL ) {MEMBER_LOG (ERR ,"Sketch Runtime Report Array allocation failed" ); goto error_runtime;
lib/member/rte_member_vbf.c +2 -2
@@ -118,8 +118,8 @@ rte_member_create_vbf(struct rte_member_setsum *ss,"The new calculated vBF false positive rate is %.5f" , num_keys_per_bf, ss->bits, ss->num_hashes, fp_one_bf, new_fp); - ss->table =rte_zmalloc_socket (NULL , ss->num_set * (ss->bits >>3 ), -RTE_CACHE_LINE_SIZE , ss->socket_id); + ss->table =rte_zmalloc_numa (NULL , ss->num_set * (ss->bits >>3 ), +RTE_CACHE_LINE_SIZE , ss->numa_id);if (ss->table ==NULL )return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 6/227 ethdev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the exported function rte_eth_dev_socket_id() to rte_eth_dev_numa_id(), keeping the old name as a functional alias to be deprecated once the in-tree migration completes.
Rename socket_id parameters, trace point name and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa() and RTE_NUMA_ID_ANY.
--- lib/ethdev/ethdev_driver.c | 10 ++++---- lib/ethdev/ethdev_driver.h | 10 ++++---- lib/ethdev/ethdev_pci.h | 8 +++---- lib/ethdev/ethdev_private.c | 2 +- lib/ethdev/ethdev_trace.h | 6 ++--- lib/ethdev/ethdev_trace_points.c | 4 ++-- lib/ethdev/ethdev_vdev.h | 2 +- lib/ethdev/rte_ethdev.c | 31 +++++++++++++++---------- lib/ethdev/rte_ethdev.h | 38 ++++++++++++++++++++++--------- lib/ethdev/rte_ethdev_telemetry.c | 2 +- 10 files changed, 68 insertions(+), 45 deletions(-)
lib/ethdev/ethdev_driver.c +5 -5
@@ -327,11 +327,11 @@ rte_eth_dev_create(struct rte_device *device, const char *name,if (priv_data_size) {/* try alloc private data on device-local node. */ - ethdev->data->dev_private =rte_zmalloc_socket ( + ethdev->data->dev_private =rte_zmalloc_numa ( name, priv_data_size,RTE_CACHE_LINE_SIZE , device->numa_node); -/* fall back to alloc on any socket on failure */ +/* fall back to alloc on any NUMA node on failure */ if (ethdev->data->dev_private ==NULL ) { ethdev->data->dev_private =rte_zmalloc (name, priv_data_size,RTE_CACHE_LINE_SIZE );
@@ -741,7 +741,7 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_eth_dma_zone_reserve)const struct rte_memzone *rte_eth_dma_zone_reserve (const struct rte_eth_dev *dev,const char *ring_name,uint16_t queue_id,size_t size,unsigned int align, -int socket_id) +int numa_id) {char z_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *mz;
@@ -757,7 +757,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name, mz =rte_memzone_lookup (z_name);if (mz) { -if ((socket_id !=SOCKET_ID_ANY && socket_id != mz->socket_id) || +if ((numa_id !=RTE_NUMA_ID_ANY && numa_id != mz->socket_id) || size > mz->len || ((uintptr_t )mz->addr & (align -1 )) !=0 ) { RTE_ETHDEV_LOG_LINE(ERR,
@@ -769,7 +769,7 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,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); }
lib/ethdev/ethdev_driver.h +5 -5
@@ -616,7 +616,7 @@ typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,typedef int (*eth_rx_queue_setup_t )(struct rte_eth_dev *dev,uint16_t rx_queue_id,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);
@@ -624,7 +624,7 @@ typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,typedef int (*eth_tx_queue_setup_t )(struct rte_eth_dev *dev,uint16_t tx_queue_id,uint16_t nb_tx_desc, -unsigned int socket_id, +unsigned int numa_id,const struct rte_eth_txconf *tx_conf);/** @internal Enable interrupt of a receive queue of an Ethernet device. */
@@ -1813,14 +1813,14 @@ void rte_eth_dev_probing_finish(struct rte_eth_dev *dev);* The sizeof of the memory area * @param align * Alignment for resulting memzone. Must be a power of 2. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of NUMA. +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of NUMA. */ __rte_internal const struct rte_memzone *rte_eth_dma_zone_reserve (const struct rte_eth_dev *eth_dev,const char *name,uint16_t queue_id,size_t size, -unsigned align,int socket_id); +unsigned int align,int numa_id);/** * Free previously allocated memzone for HW rings.
lib/ethdev/ethdev_pci.h +4 -4
@@ -96,13 +96,13 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size)return NULL ;if (private_data_size) { -/* Try and alloc the private-data structure on socket local to the device */ - eth_dev->data->dev_private =rte_zmalloc_socket (name, +/* Try and alloc private-data on the device NUMA node */ + eth_dev->data->dev_private =rte_zmalloc_numa (name, private_data_size,RTE_CACHE_LINE_SIZE , dev->device.numa_node); -/* if cannot allocate memory on the socket local to the device -* use rte_malloc to allocate memory on some other socket, if available. +/* if cannot allocate memory on the NUMA node local to the device +* use rte_malloc to allocate memory on some other NUMA node, if available. */ if (eth_dev->data->dev_private ==NULL ) { eth_dev->data->dev_private = rte_zmalloc(name,
lib/ethdev/ethdev_private.c +1 -1
@@ -359,7 +359,7 @@ eth_dev_shared_data_prepare(void)/* Allocate port data and ownership shared memory. */ mz =rte_memzone_reserve (MZ_RTE_ETH_DEV_DATA ,sizeof (*eth_dev_shared_data), -SOCKET_ID_ANY , flags); +RTE_NUMA_ID_ANY , flags);if (mz ==NULL ) {RTE_ETHDEV_LOG_LINE (ERR ,"Cannot allocate ethdev shared data" ); goto out;
lib/ethdev/ethdev_trace.h +3 -3
@@ -143,10 +143,10 @@ RTE_TRACE_POINT( )RTE_TRACE_POINT ( - rte_ethdev_trace_socket_id, - RTE_TRACE_POINT_ARGS(uint16_t port_id, int socket_id), + rte_ethdev_trace_numa_id, + RTE_TRACE_POINT_ARGS(uint16_t port_id, int numa_id), rte_trace_point_emit_u16(port_id); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id); ) RTE_TRACE_POINT(
lib/ethdev/ethdev_trace_points.c +2 -2
@@ -92,8 +92,8 @@ RTE_TRACE_POINT_REGISTER(rte_ethdev_trace_owner_delete,RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_owner_get, lib.ethdev.owner_get) -RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_socket_id, - lib.ethdev.socket_id) +RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_numa_id, + lib.ethdev.numa_id)RTE_TRACE_POINT_REGISTER (rte_ethdev_trace_get_sec_ctx, lib.ethdev.get_sec_ctx)
lib/ethdev/ethdev_vdev.h +1 -1
@@ -40,7 +40,7 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)return NULL ;if (private_data_size) { - eth_dev->data->dev_private =rte_zmalloc_socket (name, + eth_dev->data->dev_private =rte_zmalloc_numa (name, private_data_size,RTE_CACHE_LINE_SIZE , dev->device.numa_node);if (!eth_dev->data->dev_private) {
lib/ethdev/rte_ethdev.c +19 -12
@@ -642,30 +642,37 @@ rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)return ret; } -RTE_EXPORT_SYMBOL (rte_eth_dev_socket_id) +RTE_EXPORT_SYMBOL (rte_eth_dev_numa_id) int -rte_eth_dev_socket_id (uint16_t port_id) +rte_eth_dev_numa_id (uint16_t port_id) { -int socket_id =SOCKET_ID_ANY ; +int numa_id =RTE_NUMA_ID_ANY ;struct rte_eth_dev *ethdev;if (port_id >=RTE_MAX_ETHPORTS ) { rte_errno =EINVAL ; -return socket_id; +return numa_id; } ethdev = &rte_eth_devices[port_id];if (!eth_dev_is_allocated (ethdev)) { rte_errno =EINVAL ; }else { - socket_id = rte_eth_devices[port_id].data->numa_node; -if (socket_id ==SOCKET_ID_ANY ) + numa_id = rte_eth_devices[port_id].data->numa_node; +if (numa_id ==RTE_NUMA_ID_ANY ) rte_errno =0 ; } -rte_ethdev_trace_socket_id (port_id, socket_id); +rte_ethdev_trace_numa_id (port_id, numa_id); + +return numa_id; +} -return socket_id; +RTE_EXPORT_SYMBOL (rte_eth_dev_socket_id) +int +rte_eth_dev_socket_id (uint16_t port_id) +{ +return rte_eth_dev_numa_id (port_id); }RTE_EXPORT_SYMBOL (rte_eth_dev_get_sec_ctx)
@@ -2344,7 +2351,7 @@ rte_eth_rx_queue_check_mempools(struct rte_mempool **rx_mempools,RTE_EXPORT_SYMBOL (rte_eth_rx_queue_setup) intrte_eth_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,const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mp) {
@@ -2554,7 +2561,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, } ret = dev->dev_ops->rx_queue_setup (dev, rx_queue_id, nb_rx_desc, - socket_id, &local_conf, mp); + numa_id, &local_conf, mp);if (!ret) {if (!dev->data->min_rx_buf_size || dev->data->min_rx_buf_size > mbp_buf_size)
@@ -2675,7 +2682,7 @@ rte_eth_rx_hairpin_queue_setup(uint16_t port_id, uint16_t rx_queue_id,RTE_EXPORT_SYMBOL (rte_eth_tx_queue_setup) intrte_eth_tx_queue_setup (uint16_t port_id,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 rte_eth_dev *dev;
@@ -2781,7 +2788,7 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id,rte_ethdev_trace_txq_setup (port_id, tx_queue_id, nb_tx_desc, tx_conf);return eth_err (port_id, dev->dev_ops->tx_queue_setup (dev, - tx_queue_id, nb_tx_desc, socket_id, &local_conf)); + tx_queue_id, nb_tx_desc, numa_id, &local_conf)); }RTE_EXPORT_SYMBOL (rte_eth_tx_hairpin_queue_setup)
lib/ethdev/rte_ethdev.h +27 -11
@@ -2424,7 +2424,7 @@ rte_eth_dev_is_removed(uint16_t port_id);* Allocate and set up a receive queue for an Ethernet device. * * The function allocates a contiguous block of memory for *nb_rx_desc* -* receive descriptors from a memory zone associated with *socket_id* +* receive descriptors from a memory zone associated with *numa_id* * and initializes each receive descriptor with a network buffer allocated * from the memory pool *mb_pool*. *
@@ -2436,9 +2436,9 @@ rte_eth_dev_is_removed(uint16_t port_id);* to rte_eth_dev_configure(). * @param nb_rx_desc * The number of receive descriptors to allocate for the receive ring. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of NUMA. -* The value can be *SOCKET_ID_ANY* if there is no NUMA constraint for +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of NUMA. +* The value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for * the DMA memory allocated for the receive descriptors of the ring. * @param rx_conf * The pointer to the configuration data to be used for the receive queue.
@@ -2483,7 +2483,7 @@ rte_eth_dev_is_removed(uint16_t port_id);* initializing receive descriptors. */ int rte_eth_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,const struct rte_eth_rxconf *rx_conf,struct rte_mempool *mb_pool);
@@ -2526,9 +2526,9 @@ int rte_eth_rx_hairpin_queue_setup* to rte_eth_dev_configure(). * @param nb_tx_desc * The number of transmit descriptors to allocate for the transmit ring. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of NUMA. -* Its value can be *SOCKET_ID_ANY* if there is no NUMA constraint for +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of NUMA. +* Its value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for * the DMA memory allocated for the transmit descriptors of the ring. * @param tx_conf * The pointer to the configuration data to be used for the transmit queue.
@@ -2564,7 +2564,7 @@ int rte_eth_rx_hairpin_queue_setup* - -ENOMEM: Unable to allocate the transmit ring descriptors. */ int rte_eth_tx_queue_setup (uint16_t port_id,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);/**
@@ -2704,14 +2704,30 @@ int rte_eth_dev_count_aggr_ports(uint16_t port_id);int rte_eth_dev_map_aggr_tx_affinity (uint16_t port_id,uint16_t tx_queue_id,uint8_t affinity); +/** +* Return the NUMA node to which an Ethernet device is connected +* +* @param port_id +* The port identifier of the Ethernet device +* @return +* - The NUMA node ID which the Ethernet device is connected to. +* - RTE_NUMA_ID_ANY if the NUMA node could not be +* determined. rte_errno is then set to: +* - EINVAL is the port_id is invalid, +* - 0 is the NUMA node could not be determined, +*/ +int rte_eth_dev_numa_id (uint16_t port_id); +/** * Return the NUMA socket to which an Ethernet device is connected * +* This is a legacy alias of rte_eth_dev_numa_id(). +* * @param port_id * The port identifier of the Ethernet device * @return * - The NUMA socket ID which the Ethernet device is connected to. -* - -1 (which translates to SOCKET_ID_ANY) if the socket could not be +* - -1 (which translates to RTE_NUMA_ID_ANY) if the socket could not be * determined. rte_errno is then set to: * - EINVAL is the port_id is invalid, * - 0 is the socket could not be determined,
@@ -4064,7 +4080,7 @@ enum rte_eth_event_type {/** * The port is being probed, i.e. allocated and not yet available. * It is too early to check validity, query infos, and configure -* the port. But some functions, like rte_eth_dev_socket_id() and +* the port. But some functions, like rte_eth_dev_numa_id() and * rte_eth_dev_owner_*() are available to the application. */ RTE_ETH_EVENT_NEW,
lib/ethdev/rte_ethdev_telemetry.c +1 -1
@@ -537,7 +537,7 @@ eth_dev_handle_port_rxq(const char *cmd __rte_unused,rte_tel_data_start_dict (d);rte_tel_data_add_dict_string (d,"mempool_name" , qinfo.mp->name); -rte_tel_data_add_dict_uint (d,"socket_id" , qinfo.mp->numa_id); +rte_tel_data_add_dict_uint (d,"numa_id" , qinfo.mp->numa_id); rx_thresh = &qinfo.conf.rx_thresh;rte_tel_data_add_dict_uint (d,"host_threshold" , rx_thresh->hthresh);
Signature · 1 line
2.55.0
PATCH 7/227 cryptodev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the exported function rte_cryptodev_socket_id() to rte_cryptodev_numa_id(), keeping the old name as a functional alias to be deprecated once the in-tree migration completes.
Rename the numa_id field of rte_cryptodev_config (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename internal parameters, the device data field, trace points and comments to the NUMA node terminology. The legacy devarg key value is kept unchanged for CLI compatibility.
--- app/test/test_cryptodev.c | 4 +- app/test/test_cryptodev_asym.c | 4 +- app/test/test_cryptodev_crosscheck.c | 2 +- drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn20k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +- drivers/crypto/mlx5/mlx5_crypto_gcm.c | 2 +- drivers/crypto/mlx5/mlx5_crypto_xts.c | 2 +- drivers/crypto/mvsam/rte_mrvl_pmd.c | 4 +- drivers/crypto/nitrox/nitrox_sym.c | 2 +- drivers/crypto/scheduler/scheduler_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_user_cryptodev.c | 2 +- drivers/crypto/zsda/zsda_crypto_pmd.c | 2 +- lib/cryptodev/cryptodev_pmd.c | 14 ++--- lib/cryptodev/cryptodev_pmd.h | 24 +++---- lib/cryptodev/cryptodev_trace.h | 18 +++--- lib/cryptodev/cryptodev_trace_points.c | 4 +- lib/cryptodev/rte_crypto.h | 4 +- lib/cryptodev/rte_cryptodev.c | 63 ++++++++++--------- lib/cryptodev/rte_cryptodev.h | 55 +++++++++++----- 26 files changed, 128 insertions(+), 98 deletions(-)
app/test/test_cryptodev.c +2 -2
@@ -716,7 +716,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 =SOCKET_ID_ANY ; ts_params->conf.ff_disable =RTE_CRYPTODEV_FF_SECURITY ; unsigned int session_size =
@@ -1512,7 +1512,7 @@ dev_configure_and_start(uint64_t ff_disable)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 =SOCKET_ID_ANY ; ts_params->conf.ff_disable = ff_disable; ts_params->qp_conf.nb_descriptors =MAX_NUM_OPS_INFLIGHT ; ts_params->qp_conf.mp_session = ts_params->session_mpool;
app/test/test_cryptodev_asym.c +2 -2
@@ -1185,7 +1185,7 @@ testsuite_setup(void)/* configure device with num qp */ 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_SECURITY |RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO ; TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id,
@@ -1251,7 +1251,7 @@ ut_setup_asym(void) );/* Reconfigure device to default parameters */ - ts_params->conf.socket_id =SOCKET_ID_ANY ; + ts_params->conf.numa_id =RTE_NUMA_ID_ANY ; TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0], &ts_params->conf),
app/test/test_cryptodev_crosscheck.c +1 -1
@@ -425,7 +425,7 @@ crosscheck_init(void)/* Setup queue pair conf params */ ts_params->conf.nb_queue_pairs = nb_queue_pairs; - ts_params->conf.socket_id =SOCKET_ID_ANY ; + ts_params->conf.numa_id =SOCKET_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;
drivers/crypto/bcmfs/bcmfs_sym_pmd.c +1 -1
@@ -355,7 +355,7 @@ bcmfs_sym_dev_create(struct bcmfs_device *fsdev) {struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct bcmfs_sym_dev_private ) };char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -288,7 +288,7 @@ cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused, init_params.def_p.max_nb_queue_pairs =CCP_PMD_MAX_QUEUE_PAIRS ;CCP_LOG_INFO ("Initialising %s on NUMA node %d" , name, - init_params.def_p.socket_id); + init_params.def_p.numa_id);CCP_LOG_INFO ("Max number of queue pairs = %d" , init_params.def_p.max_nb_queue_pairs); CCP_LOG_INFO("Authentication offload to %s",
drivers/crypto/cnxk/cn10k_cryptodev.c +1 -1
@@ -34,7 +34,7 @@ cn10k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, {struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct cnxk_cpt_vf ) };char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/crypto/cnxk/cn20k_cryptodev.c +1 -1
@@ -31,7 +31,7 @@ static int cn20k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_pci_device *pci_dev) {struct rte_cryptodev_pmd_init_params init_params = {.name ="" , - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct cnxk_cpt_vf )};char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/crypto/cnxk/cn9k_cryptodev.c +1 -1
@@ -39,7 +39,7 @@ cn9k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, {struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct cnxk_cpt_vf ) };char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +1 -1
@@ -4551,7 +4551,7 @@ cryptodev_dpaa2_sec_probe(struct rte_dpaa2_driver *dpaa2_drv __rte_unused,struct rte_cryptodev_pmd_init_params init_params = { .name ="" , .private_data_size =sizeof (struct dpaa2_sec_dev_private ), - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .max_nb_queue_pairs =RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS ,/* setting default, will be updated in init. */
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -3777,7 +3777,7 @@ cryptodev_dpaa_sec_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,struct rte_cryptodev_pmd_init_params init_params = { .name ="" , .private_data_size =sizeof (struct dpaa_sec_dev_private ), - .socket_id =rte_socket_id (), + .numa_id =rte_numa_id (), .max_nb_queue_pairs =RTE_DPAA_MAX_NB_SEC_QPS , };
drivers/crypto/ipsec_mb/ipsec_mb_private.c +1 -1
@@ -101,7 +101,7 @@ ipsec_mb_create(struct rte_vdev_device *vdev, pmd_data->internals_priv_size; init_params.max_nb_queue_pairs =RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS ; - init_params.socket_id =rte_socket_id (); + init_params.numa_id =rte_socket_id (); name =rte_vdev_device_name (vdev);if (name ==NULL )
drivers/crypto/mlx5/mlx5_crypto_gcm.c +1 -1
@@ -342,7 +342,7 @@ mlx5_crypto_gcm_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id, qp->priv = priv; qp->entries_n = entries;if (mlx5_mr_ctrl_init (&qp->mr_ctrl, &priv->cdev->mr_scache.dev_gen, - priv->dev_config.socket_id)) { + priv->dev_config.numa_id)) {DRV_LOG (ERR ,"Cannot allocate MR Btree for qp %u." , (uint32_t )qp_id); rte_errno =ENOMEM ;
drivers/crypto/mlx5/mlx5_crypto_xts.c +1 -1
@@ -515,7 +515,7 @@ mlx5_crypto_xts_queue_pair_setup(struct rte_cryptodev *dev, uint16_t qp_id, goto error; }if (mlx5_mr_ctrl_init (&qp->mr_ctrl, &priv->cdev->mr_scache.dev_gen, - priv->dev_config.socket_id) !=0 ) { + priv->dev_config.numa_id) !=0 ) {DRV_LOG (ERR ,"Cannot allocate MR Btree for qp %u." , (uint32_t )qp_id); rte_errno =ENOMEM ;
drivers/crypto/mvsam/rte_mrvl_pmd.c +2 -2
@@ -1178,7 +1178,7 @@ mrvl_pmd_parse_input_args(struct mrvl_pmd_init_params *params, ret =rte_kvargs_process (kvlist,RTE_CRYPTODEV_PMD_SOCKET_ID_ARG , &parse_integer_arg, - ¶ms->common.socket_id); + ¶ms->common.numa_id);if (ret <0 ) goto free_kvlist;
@@ -1219,7 +1219,7 @@ cryptodev_mrvl_crypto_init(struct rte_vdev_device *vdev) sizeof(struct mrvl_crypto_private), .max_nb_queue_pairs = sam_get_num_inst() * sam_get_num_cios(0), - .socket_id =rte_socket_id () + .numa_id =rte_numa_id () }, .max_nb_sessions =MRVL_PMD_DEFAULT_MAX_NB_SESSIONS };
drivers/crypto/nitrox/nitrox_sym.c +1 -1
@@ -749,7 +749,7 @@ nitrox_sym_pmd_create(struct nitrox_device *ndev)char name[RTE_CRYPTODEV_NAME_MAX_LEN ];struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id = ndev->pdev->device.numa_node, + .numa_id = ndev->pdev->device.numa_node, .private_data_size =sizeof (struct nitrox_sym_device ) };struct rte_cryptodev *cdev;
drivers/crypto/scheduler/scheduler_pmd.c +1 -1
@@ -533,7 +533,7 @@ scheduler_parse_init_params(struct scheduler_init_params *params, ret =rte_kvargs_process (kvlist,RTE_CRYPTODEV_VDEV_SOCKET_ID , &parse_integer_arg, - ¶ms->def_p.socket_id); + ¶ms->def_p.numa_id);if (ret <0 ) goto free_kvlist;
drivers/crypto/virtio/virtio_cryptodev.c +1 -1
@@ -1691,7 +1691,7 @@ crypto_virtio_pci_probe( {struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id = pci_dev->device.numa_node, + .numa_id = pci_dev->device.numa_node, .private_data_size =sizeof (struct virtio_crypto_hw ) };char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
drivers/crypto/virtio/virtio_user_cryptodev.c +1 -1
@@ -374,7 +374,7 @@ virtio_user_cryptodev_alloc(struct rte_vdev_device *vdev)struct virtio_user_dev *dev;struct virtio_crypto_hw *hw; - init_params.socket_id = vdev->device.numa_node; + init_params.numa_id = vdev->device.numa_node; init_params.private_data_size =sizeof (struct virtio_user_dev ); cryptodev =rte_cryptodev_pmd_create (vdev->device.name, &vdev->device, &init_params);if (cryptodev ==NULL ) {
drivers/crypto/zsda/zsda_crypto_pmd.c +1 -1
@@ -260,7 +260,7 @@ zsda_crypto_dev_create(struct zsda_pci_device *zsda_pci_dev)struct rte_cryptodev_pmd_init_params init_params = { .name ="" , - .socket_id = (int )rte_socket_id (), + .numa_id = (int )rte_numa_id (), .private_data_size =sizeof (struct zsda_crypto_dev_private ) };
lib/cryptodev/cryptodev_pmd.c +7 -7
@@ -81,9 +81,9 @@ rte_cryptodev_pmd_parse_input_args( goto free_kvlist; ret =rte_kvargs_process (kvlist, -RTE_CRYPTODEV_PMD_SOCKET_ID_ARG , +RTE_CRYPTODEV_PMD_NUMA_ID_ARG , &rte_cryptodev_pmd_parse_uint_arg, - ¶ms->socket_id); + ¶ms->numa_id);if (ret <0 ) goto free_kvlist;
@@ -116,11 +116,11 @@ rte_cryptodev_pmd_create(const char *name,CDEV_LOG_INFO ("Creating cryptodev %s" , name);CDEV_LOG_INFO ("Initialisation parameters - name: %s," -"socket id: %d, max queue pairs: %u" , - name, params->socket_id, params->max_nb_queue_pairs); +"NUMA node id: %d, max queue pairs: %u" , + name, params->numa_id, params->max_nb_queue_pairs);/* allocate device structure */ - cryptodev =rte_cryptodev_pmd_allocate (name, params->socket_id); + cryptodev =rte_cryptodev_pmd_allocate (name, params->numa_id);if (cryptodev ==NULL ) {CDEV_LOG_ERR ("Failed to allocate crypto device for %s" , name);return NULL ;
@@ -129,10 +129,10 @@ rte_cryptodev_pmd_create(const char *name,/* allocate private device structure */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { cryptodev->data->dev_private = -rte_zmalloc_socket ("cryptodev device private" , +rte_zmalloc_numa ("cryptodev device private" , params->private_data_size,RTE_CACHE_LINE_SIZE , - params->socket_id); + params->numa_id);if (cryptodev->data->dev_private ==NULL ) { CDEV_LOG_ERR("Cannot allocate memory for cryptodev %s"
lib/cryptodev/cryptodev_pmd.h +12 -12
@@ -33,13 +33,13 @@ extern "C" {#define RTE_CRYPTODEV_PMD_NAME_ARG ("name")#define RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG ("max_nb_queue_pairs") -#define RTE_CRYPTODEV_PMD_SOCKET_ID_ARG ("socket_id") +#define RTE_CRYPTODEV_PMD_NUMA_ID_ARG ("numa_id")static const char *const cryptodev_pmd_valid_params[] = {RTE_CRYPTODEV_PMD_NAME_ARG ,RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG , -RTE_CRYPTODEV_PMD_SOCKET_ID_ARG , +RTE_CRYPTODEV_PMD_NUMA_ID_ARG ,NULL };
@@ -50,7 +50,7 @@ static const char * const cryptodev_pmd_valid_params[] = {struct rte_cryptodev_pmd_init_params {char name[RTE_CRYPTODEV_NAME_MAX_LEN ];size_t private_data_size; -int socket_id; +int numa_id;unsigned int max_nb_queue_pairs; };
@@ -65,7 +65,7 @@ struct __rte_cache_aligned rte_cryptodev_data {/** Device ID for this instance */ uint8_t dev_id;/** Socket ID where memory is allocated */ -int socket_id; +int numa_id;/** Unique identifier name */ char name[RTE_CRYPTODEV_NAME_MAX_LEN ];
@@ -269,13 +269,13 @@ typedef void (*cryptodev_info_get_t)(struct rte_cryptodev *dev,* @param dev Crypto device pointer * @param qp_id Queue Pair Index * @param qp_conf Queue configuration structure -* @param socket_id Socket Index +* @param numa_id Socket Index * * @return Returns 0 on success. */ typedef int (*cryptodev_queue_pair_setup_t )(struct rte_cryptodev *dev,uint16_t qp_id,const struct rte_cryptodev_qp_conf *qp_conf, -int socket_id); +int numa_id);/** * Release memory resources allocated by given queue pair.
@@ -296,7 +296,7 @@ typedef int (*cryptodev_queue_pair_release_t)(struct rte_cryptodev *dev,* @param dev Crypto device pointer * @param qp_id Queue pair index * @param qp_conf Queue configuration structure -* @param socket_id Socket index +* @param numa_id Socket index * * @return * - 0: on success.
@@ -304,7 +304,7 @@ typedef int (*cryptodev_queue_pair_release_t)(struct rte_cryptodev *dev,*/ typedef int (*cryptodev_queue_pair_reset_t )(struct rte_cryptodev *dev,uint16_t qp_id,const struct rte_cryptodev_qp_conf *qp_conf, -int socket_id); +int numa_id);/** * Create a session mempool to allocate sessions from
@@ -312,7 +312,7 @@ typedef int (*cryptodev_queue_pair_reset_t)(struct rte_cryptodev *dev,* @param dev Crypto device pointer * @param nb_objs number of sessions objects in mempool * @param obj_cache_size l-core object cache size, see *rte_ring_create* -* @param socket_id Socket Id to allocate mempool on. +* @param numa_id Socket Id to allocate mempool on. * * @return * - On success returns a pointer to a rte_mempool
@@ -320,7 +320,7 @@ typedef int (*cryptodev_queue_pair_reset_t)(struct rte_cryptodev *dev,*/ typedef int (*cryptodev_sym_create_session_pool_t )(struct rte_cryptodev *dev,unsigned nb_objs, -unsigned obj_cache_size,int socket_id); +unsigned int obj_cache_size,int numa_id);/**
@@ -534,13 +534,13 @@ struct rte_cryptodev_ops {* to that slot for the driver to use. * * @param name Unique identifier name for each device -* @param socket_id Socket to allocate resources on. +* @param numa_id Socket to allocate resources on. * @return * - Slot in the rte_dev_devices array for a new device; */ __rte_internal struct rte_cryptodev * -rte_cryptodev_pmd_allocate (const char *name,int socket_id); +rte_cryptodev_pmd_allocate (const char *name,int numa_id);/** * Function for internal use by dummy drivers primarily, e.g. ring-based
lib/cryptodev/cryptodev_trace.h +9 -9
@@ -61,11 +61,11 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_cryptodev_trace_queue_pair_reset, RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id, - const struct rte_cryptodev_qp_conf *conf, int socket_id), + const struct rte_cryptodev_qp_conf *conf, int numa_id), rte_trace_point_emit_u8(dev_id);rte_trace_point_emit_u16 (queue_pair_id);rte_trace_point_emit_u32 (conf->nb_descriptors); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id); ) RTE_TRACE_POINT(
@@ -267,20 +267,20 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_cryptodev_trace_queue_pair_count, RTE_TRACE_POINT_ARGS(const void *dev, const char *name, - uint8_t socket_id, uint8_t dev_id, uint16_t nb_queue_pairs), + uint8_t numa_id, uint8_t dev_id, uint16_t nb_queue_pairs), rte_trace_point_emit_ptr(dev);rte_trace_point_emit_string (name); -rte_trace_point_emit_u8 (socket_id); +rte_trace_point_emit_u8 (numa_id);rte_trace_point_emit_u8 (dev_id);rte_trace_point_emit_u16 (nb_queue_pairs); )RTE_TRACE_POINT ( - rte_cryptodev_trace_socket_id, - RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int socket_id), + rte_cryptodev_trace_numa_id, + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int numa_id), rte_trace_point_emit_u8(dev_id);rte_trace_point_emit_string (name); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id); ) RTE_TRACE_POINT(
@@ -512,10 +512,10 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_cryptodev_trace_op_pool_create, - RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type, + RTE_TRACE_POINT_ARGS(const char *name, int numa_id, int type, uint32_t nb_elts, const void *mp), rte_trace_point_emit_string(name); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_int (type);rte_trace_point_emit_u32 (nb_elts);rte_trace_point_emit_ptr (mp);
lib/cryptodev/cryptodev_trace_points.c +2 -2
@@ -108,8 +108,8 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,RTE_TRACE_POINT_REGISTER (rte_cryptodev_trace_queue_pair_count, lib.cryptodev.queue.pair.count) -RTE_TRACE_POINT_REGISTER (rte_cryptodev_trace_socket_id, - lib.cryptodev.socket.id) +RTE_TRACE_POINT_REGISTER (rte_cryptodev_trace_numa_id, + lib.cryptodev.numa_id)RTE_TRACE_POINT_REGISTER (rte_cryptodev_trace_stats_get, lib.cryptodev.stats.get)
lib/cryptodev/rte_crypto.h +2 -2
@@ -254,7 +254,7 @@ __rte_crypto_op_get_priv_data_size(struct rte_mempool *mempool)* cache size * @param priv_size Size of private data to allocate with each * operation -* @param socket_id Socket to allocate memory on +* @param numa_id Socket to allocate memory on * * @return * - On success pointer to mempool
@@ -263,7 +263,7 @@ __rte_crypto_op_get_priv_data_size(struct rte_mempool *mempool)struct rte_mempool *rte_crypto_op_pool_create (const char *name,enum rte_crypto_op_type type,unsigned nb_elts,unsigned cache_size,uint16_t priv_size, -int socket_id); +int numa_id);/** * Bulk allocate raw element from mempool and return as crypto operations
lib/cryptodev/rte_cryptodev.c +35 -28
203 lines not on this page · raw message
lib/cryptodev/rte_cryptodev.h +39 -16
117 lines not on this page · raw message
Signature · 1 line
2.55.0
PATCH 8/227 compressdev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the exported function rte_compressdev_socket_id() to rte_compressdev_numa_id(), keeping the old name as a functional alias to be deprecated once the in-tree migration completes.
Rename the numa_id field of rte_compressdev_config (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename internal parameters and comments to the NUMA node terminology.
--- doc/guides/rel_notes/deprecation.rst | 2 +- drivers/compress/isal/isal_compress_pmd_ops.c | 2 +- drivers/compress/mlx5/mlx5_compress.c | 4 +-- drivers/compress/nitrox/nitrox_comp.c | 8 ++--- drivers/compress/qat/qat_comp_pmd.c | 16 ++++----- drivers/compress/zlib/zlib_pmd_ops.c | 4 +-- drivers/compress/zsda/zsda_comp_pmd.c | 4 +-- lib/compressdev/rte_comp.c | 4 +-- lib/compressdev/rte_comp.h | 4 +-- lib/compressdev/rte_compressdev.c | 35 +++++++++++-------- lib/compressdev/rte_compressdev.h | 34 ++++++++++++++---- lib/compressdev/rte_compressdev_internal.h | 2 +- lib/compressdev/rte_compressdev_pmd.c | 10 +++--- lib/compressdev/rte_compressdev_pmd.h | 12 +++---- 14 files changed, 85 insertions(+), 56 deletions(-)
doc/guides/rel_notes/deprecation.rst +1 -1
@@ -22,7 +22,7 @@ Deprecation Notices as a deprecated union alias. The following structures are affected: ``rte_hash_parameters``, ``rte_fbk_hash_params``, ``rte_member_parameters`` / - ``rte_member_setsum`` and ``rte_mempool`` + ``rte_member_setsum``, ``rte_mempool`` and ``rte_compressdev_config`` (more structures will follow in this release). Applications should switch to ``numa_id``.
drivers/compress/isal/isal_compress_pmd_ops.c +1 -1
@@ -73,7 +73,7 @@ isal_comp_pmd_config(struct rte_compressdev *dev,NULL ,/* obj initialization constructor arg */ NULL ,/**< obj constructor*/ NULL ,/* obj constructor arg */ - config->socket_id,/* socket id */ + config->numa_id,/* socket id */ 0); /* flags */ }
drivers/compress/mlx5/mlx5_compress.c +2 -2
@@ -179,7 +179,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, } dev->data->queue_pairs[qp_id] = qp;if (mlx5_mr_ctrl_init (&qp->mr_ctrl, &priv->cdev->mr_scache.dev_gen, - priv->dev_config.socket_id)) { + priv->dev_config.numa_id)) {DRV_LOG (ERR ,"Cannot allocate MR Btree for qp %u." , (uint32_t )qp_id); rte_errno =ENOMEM ;
@@ -369,7 +369,7 @@ mlx5_compress_xform_create(struct rte_compressdev *dev,if (ret <0 )return ret; xfrm =rte_zmalloc_socket (__func__,sizeof (*xfrm),0 , - priv->dev_config.socket_id); + priv->dev_config.numa_id);if (xfrm ==NULL )return -ENOMEM ; xfrm->opcode =MLX5_OPCODE_MMO ;
drivers/compress/nitrox/nitrox_comp.c +4 -4
@@ -68,7 +68,7 @@ static int nitrox_comp_dev_configure(struct rte_compressdev *dev, comp_dev->xform_pool =rte_mempool_create (name, xform_cnt,sizeof (struct nitrox_comp_xform ),0 ,0 ,NULL ,NULL ,NULL ,NULL , - config->socket_id,0 ); + config->numa_id,0 );if (comp_dev->xform_pool ==NULL ) {NITROX_LOG_LINE (ERR ,"Failed to create xform pool, err %d" , rte_errno);
@@ -411,7 +411,7 @@ static int nitrox_comp_stream_create(struct rte_compressdev *dev, } nxform->history_window =rte_zmalloc_socket (NULL , nxform->window_size, -8 , comp_dev->xform_pool->socket_id); +8 , comp_dev->xform_pool->numa_id);if (unlikely (nxform->history_window ==NULL )) { err = -ENOMEM ; goto err_exit;
@@ -422,7 +422,7 @@ static int nitrox_comp_stream_create(struct rte_compressdev *dev, nxform->context =rte_zmalloc_socket (NULL ,NITROX_DECOMP_CTX_SIZE ,8 , - comp_dev->xform_pool->socket_id); + comp_dev->xform_pool->numa_id);if (unlikely (nxform->context ==NULL )) { err = -ENOMEM ; goto err_exit;
@@ -553,7 +553,7 @@ nitrox_comp_pmd_create(struct nitrox_device *ndev)char name[RTE_COMPRESSDEV_NAME_MAX_LEN ];struct rte_compressdev_pmd_init_params init_params = { .name ="" , - .socket_id = ndev->pdev->device.numa_node, + .numa_id = ndev->pdev->device.numa_node, };struct rte_compressdev *cdev;
drivers/compress/qat/qat_comp_pmd.c +8 -8
@@ -160,13 +160,13 @@ qat_comp_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,sizeof (struct qat_sgl ) +sizeof (struct qat_flat_buf ) *QAT_PMD_COMP_SGL_DEF_SEGMENTS , - 64, dev->data->socket_id); + 64, dev->data->numa_id); cookie->qat_sgl_dst_d =rte_zmalloc_socket (NULL ,sizeof (struct qat_sgl ) +sizeof (struct qat_flat_buf ) *QAT_PMD_COMP_SGL_DEF_SEGMENTS , -64 , dev->data->socket_id); +64 , dev->data->numa_id);if (cookie->qat_sgl_src_d ==NULL || cookie->qat_sgl_dst_d ==NULL ) {
@@ -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->socket_id; + cookie->socket_id = dev->data->numa_id; cookie->error =0 ; }
@@ -240,7 +240,7 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev, memzone =rte_memzone_reserve_aligned (inter_buff_mz_name, size_of_ptr_array, - comp_dev->compressdev->data->socket_id, + comp_dev->compressdev->data->numa_id,RTE_MEMZONE_IOVA_CONTIG ,QAT_64_BYTE_ALIGN );if (memzone ==NULL ) { QAT_LOG(ERR,
@@ -268,7 +268,7 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,if (mz ==NULL ) { mz =rte_memzone_reserve_aligned (inter_buff_mz_name, full_size, - comp_dev->compressdev->data->socket_id, + comp_dev->compressdev->data->numa_id,RTE_MEMZONE_IOVA_CONTIG ,QAT_64_BYTE_ALIGN );if (mz ==NULL ) {
@@ -355,7 +355,7 @@ qat_comp_create_xform_pool(struct qat_comp_dev_private *comp_dev, mp =rte_mempool_create (xform_pool_name, num_elements,qat_comp_xform_size (),0 ,0 , -NULL ,NULL ,NULL ,NULL , config->socket_id, +NULL ,NULL ,NULL ,NULL , config->numa_id,0 );if (mp ==NULL ) { QAT_LOG(ERR, "Err creating mempool %s w %d elements of size %d",
@@ -534,7 +534,7 @@ qat_comp_dev_config(struct rte_compressdev *dev,if (config->max_nb_streams) { comp_dev->streampool =qat_comp_create_stream_pool (comp_dev, - config->socket_id, config->max_nb_streams); + config->numa_id, config->max_nb_streams);if (comp_dev->streampool ==NULL ) { ret = -ENOMEM ; goto error_out;
@@ -678,7 +678,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev) &qat_pci_devs[qat_pci_dev->qat_dev_id];struct rte_compressdev_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, };char name[RTE_COMPRESSDEV_NAME_MAX_LEN ];char capa_memz_name[RTE_COMPRESSDEV_NAME_MAX_LEN ];
drivers/compress/zlib/zlib_pmd_ops.c +2 -2
@@ -45,11 +45,11 @@ zlib_pmd_config(struct rte_compressdev *dev, config->max_nb_streams,sizeof (struct zlib_priv_xform ),0 ,0 ,NULL ,NULL ,NULL , -NULL , config->socket_id, +NULL , config->numa_id, 0);if (mp ==NULL ) {ZLIB_PMD_ERR ("Cannot create private xform pool on socket %d" , - config->socket_id); + config->numa_id);return -ENOMEM ; } internals->mp = mp;
drivers/compress/zsda/zsda_comp_pmd.c +2 -2
@@ -55,7 +55,7 @@ zsda_comp_xform_pool_create(struct zsda_comp_dev_private *comp_dev, }else { mp =rte_mempool_create (xform_pool_name, num_elements,zsda_comp_xform_size (),0 ,0 ,NULL , -NULL ,NULL ,NULL , config->socket_id,0 ); +NULL ,NULL ,NULL , config->numa_id,0 );if (mp ==NULL ) {ZSDA_LOG (ERR ,"Failed! mp is NULL" );return NULL ;
@@ -332,7 +332,7 @@ zsda_comp_dev_create(struct zsda_pci_device *zsda_pci_dev)struct rte_compressdev_pmd_init_params init_params = { .name ="" , - .socket_id = (int )rte_socket_id (), + .numa_id = (int )rte_numa_id (), };char name[RTE_COMPRESSDEV_NAME_MAX_LEN ];
lib/compressdev/rte_comp.c +2 -2
@@ -129,7 +129,7 @@ RTE_EXPORT_SYMBOL(rte_comp_op_pool_create)struct rte_mempool *rte_comp_op_pool_create (const char *name,unsigned int nb_elts,unsigned int cache_size, -uint16_t user_size,int socket_id) +uint16_t user_size,int numa_id) {struct rte_comp_op_pool_private *priv;
@@ -165,7 +165,7 @@ rte_comp_op_pool_create(const char *name,NULL , rte_comp_op_init,NULL , - socket_id, + numa_id, 0);if (mp ==NULL ) {
lib/compressdev/rte_comp.h +2 -2
@@ -527,7 +527,7 @@ rte_comp_op_free(struct rte_comp_op *op);* *rte_mempool_create* for further details about cache size * @param user_size * Size of private data to allocate for user with each operation -* @param socket_id +* @param numa_id * Socket to identifier allocate memory on * @return * - On success pointer to mempool
@@ -536,7 +536,7 @@ rte_comp_op_free(struct rte_comp_op *op);struct rte_mempool *rte_comp_op_pool_create (const char *name,unsigned int nb_elts,unsigned int cache_size, -uint16_t user_size,int socket_id) +uint16_t user_size,int numa_id) __rte_malloc__rte_dealloc (rte_comp_op_free,1 );/**
lib/compressdev/rte_compressdev.c +21 -14
@@ -184,9 +184,9 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,return count; } -RTE_EXPORT_SYMBOL (rte_compressdev_socket_id) +RTE_EXPORT_SYMBOL (rte_compressdev_numa_id) int -rte_compressdev_socket_id (uint8_t dev_id) +rte_compressdev_numa_id (uint8_t dev_id) {struct rte_compressdev *dev;
@@ -195,12 +195,19 @@ rte_compressdev_socket_id(uint8_t dev_id) dev =rte_compressdev_get_dev (dev_id); -return dev->data->socket_id; +return dev->data->numa_id; +} + +RTE_EXPORT_SYMBOL (rte_compressdev_socket_id) +int +rte_compressdev_socket_id (uint8_t dev_id) +{ +return rte_compressdev_numa_id (dev_id); }static inline int rte_compressdev_data_alloc (uint8_t dev_id,struct rte_compressdev_data **data, -int socket_id) +int numa_id) {char mz_name[RTE_COMPRESSDEV_NAME_MAX_LEN ];const struct rte_memzone *mz;
@@ -215,7 +222,7 @@ rte_compressdev_data_alloc(uint8_t dev_id, struct rte_compressdev_data **data,if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { mz =rte_memzone_reserve (mz_name,sizeof (struct rte_compressdev_data ), - socket_id,0 ); + numa_id,0 ); }else mz =rte_memzone_lookup (mz_name);
@@ -244,7 +251,7 @@ rte_compressdev_find_free_device_index(void)RTE_EXPORT_SYMBOL (rte_compressdev_pmd_allocate) struct rte_compressdev * -rte_compressdev_pmd_allocate (const char *name,int socket_id) +rte_compressdev_pmd_allocate (const char *name,int numa_id) {struct rte_compressdev *compressdev;uint8_t dev_id;
@@ -267,7 +274,7 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id) compressdev_globals.data[dev_id];int retval =rte_compressdev_data_alloc (dev_id, - &compressdev_data, socket_id); + &compressdev_data, numa_id);if (retval <0 || compressdev_data ==NULL )return NULL ;
@@ -278,7 +285,7 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id) RTE_COMPRESSDEV_NAME_MAX_LEN); compressdev->data->dev_id = dev_id; - compressdev->data->socket_id = socket_id; + compressdev->data->numa_id = numa_id; compressdev->data->dev_started =0 ; compressdev->attached =RTE_COMPRESSDEV_ATTACHED ;
@@ -322,7 +329,7 @@ rte_compressdev_queue_pair_count(uint8_t dev_id)static int rte_compressdev_queue_pairs_config (struct rte_compressdev *dev, -uint16_t nb_qpairs,int socket_id) +uint16_t nb_qpairs,int numa_id) {struct rte_compressdev_info dev_info;void **qp;
@@ -351,10 +358,10 @@ rte_compressdev_queue_pairs_config(struct rte_compressdev *dev, }if (dev->data->queue_pairs ==NULL ) {/* first time configuration */ - dev->data->queue_pairs =rte_zmalloc_socket ( + dev->data->queue_pairs =rte_zmalloc_numa ("compressdev->queue_pairs" ,sizeof (dev->data->queue_pairs[0 ]) * nb_qpairs, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dev->data->queue_pairs ==NULL ) { dev->data->nb_queue_pairs =0 ;
@@ -461,7 +468,7 @@ rte_compressdev_configure(uint8_t dev_id, struct rte_compressdev_config *config)/* Setup new number of queue pairs and reconfigure device. */ diag =rte_compressdev_queue_pairs_config (dev, config->nb_queue_pairs, - config->socket_id); + config->numa_id);if (diag !=0 ) { COMPRESSDEV_LOG(ERR, "dev%d rte_comp_dev_queue_pairs_config = %d",
@@ -572,7 +579,7 @@ rte_compressdev_close(uint8_t dev_id)RTE_EXPORT_SYMBOL (rte_compressdev_queue_pair_setup) intrte_compressdev_queue_pair_setup (uint8_t dev_id,uint16_t queue_pair_id, -uint32_t max_inflight_ops,int socket_id) +uint32_t max_inflight_ops,int numa_id) {struct rte_compressdev *dev;
@@ -602,7 +609,7 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,if (dev->dev_ops->queue_pair_setup ==NULL )return -ENOTSUP ; -return dev->dev_ops->queue_pair_setup (dev, queue_pair_id, max_inflight_ops, socket_id); +return dev->dev_ops->queue_pair_setup (dev, queue_pair_id, max_inflight_ops, numa_id); }RTE_EXPORT_SYMBOL (rte_compressdev_dequeue_burst)
lib/compressdev/rte_compressdev.h +28 -6
@@ -169,8 +169,23 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices, uint8_t nb_devices);/* +* Return the NUMA node to which a device is connected. +* +* @param dev_id +* Compress device identifier +* @return +* The NUMA node ID to which the device is connected or +* a default of zero if the NUMA node could not be determined. +* -1 if returned is the dev_id value is out of range. +*/ +int +rte_compressdev_numa_id (uint8_t dev_id); + +/** * Return the NUMA socket to which a device is connected. * +* This is a legacy alias of rte_compressdev_numa_id(). +* * @param dev_id * Compress device identifier * @return
@@ -183,8 +198,15 @@ rte_compressdev_socket_id(uint8_t dev_id);/** Compress device configuration structure */ struct rte_compressdev_config { -int socket_id; -/**< Socket on which to allocate resources */ +union { +/** NUMA node on which to allocate resources */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint16_t nb_queue_pairs;/**< Total number of queue pairs to configure on a device */ uint16_t max_nb_priv_xforms;
@@ -270,9 +292,9 @@ rte_compressdev_close(uint8_t dev_id);* @param max_inflight_ops * Max number of ops which the qp will have to * accommodate simultaneously -* @param socket_id -* The *socket_id* argument is the socket identifier -* in case of NUMA. The value can be *SOCKET_ID_ANY* +* @param numa_id +* The *numa_id* argument is the NUMA node ID +* in case of NUMA. The value can be *RTE_NUMA_ID_ANY* * if there is no NUMA constraint for the DMA memory * allocated for the receive queue pair * @return
@@ -281,7 +303,7 @@ rte_compressdev_close(uint8_t dev_id);*/ int rte_compressdev_queue_pair_setup (uint8_t dev_id,uint16_t queue_pair_id, -uint32_t max_inflight_ops,int socket_id); +uint32_t max_inflight_ops,int numa_id);/** * Get the number of queue pairs on a specific comp device
lib/compressdev/rte_compressdev_internal.h +1 -1
@@ -99,7 +99,7 @@ struct __rte_cache_aligned rte_compressdev {struct __rte_cache_aligned rte_compressdev_data {uint8_t dev_id;/**< Compress device identifier */ -int socket_id; +int numa_id;/**< Socket identifier where memory is allocated */ char name[RTE_COMPRESSDEV_NAME_MAX_LEN ];/**< Unique identifier name */
lib/compressdev/rte_compressdev_pmd.c +5 -5
@@ -76,7 +76,7 @@ rte_compressdev_pmd_parse_input_args( ret =rte_kvargs_process (kvlist,RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG , &rte_compressdev_pmd_parse_uint_arg, - ¶ms->socket_id); + ¶ms->numa_id);if (ret <0 ) goto free_kvlist;
@@ -111,10 +111,10 @@ rte_compressdev_pmd_create(const char *name,COMPRESSDEV_LOG (INFO ,"Creating compressdev %s" , name);COMPRESSDEV_LOG (INFO ,"Init parameters - name: %s, socket id: %d" , - name, params->socket_id); + name, params->numa_id);/* allocate device structure */ - compressdev =rte_compressdev_pmd_allocate (name, params->socket_id); + compressdev =rte_compressdev_pmd_allocate (name, params->numa_id);if (compressdev ==NULL ) {COMPRESSDEV_LOG (ERR ,"Failed to allocate comp device %s" , name);return NULL ;
@@ -123,10 +123,10 @@ rte_compressdev_pmd_create(const char *name,/* allocate private device structure */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { compressdev->data->dev_private = -rte_zmalloc_socket ("compressdev device private" , +rte_zmalloc_numa ("compressdev device private" , private_data_size,RTE_CACHE_LINE_SIZE , - params->socket_id); + params->numa_id);if (compressdev->data->dev_private ==NULL ) { COMPRESSDEV_LOG(ERR,
lib/compressdev/rte_compressdev_pmd.h +6 -6
@@ -25,7 +25,7 @@ extern "C" {#endif #define RTE_COMPRESSDEV_PMD_NAME_ARG ("name") -#define RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG ("socket_id") +#define RTE_COMPRESSDEV_PMD_SOCKET_ID_ARG ("numa_id")static const char *const compressdev_pmd_valid_params[] = {RTE_COMPRESSDEV_PMD_NAME_ARG ,
@@ -38,7 +38,7 @@ static const char * const compressdev_pmd_valid_params[] = {*/ struct rte_compressdev_pmd_init_params {char name[RTE_COMPRESSDEV_NAME_MAX_LEN ]; -int socket_id; +int numa_id; };/** Global structure used for maintaining state of allocated comp devices */
@@ -151,13 +151,13 @@ typedef void (*compressdev_info_get_t)(struct rte_compressdev *dev,* Queue pair identifier * @param max_inflight_ops * Max inflight ops which qp must accommodate -* @param socket_id +* @param numa_id * Socket identifier * @return * Returns 0 on success. */ typedef int (*compressdev_queue_pair_setup_t )(struct rte_compressdev *dev, -uint16_t qp_id,uint32_t max_inflight_ops,int socket_id); +uint16_t qp_id,uint32_t max_inflight_ops,int numa_id);/** * Release memory resources allocated by given queue pair.
@@ -285,13 +285,13 @@ struct rte_compressdev_ops {* * @param name * Unique identifier name for each device -* @param socket_id +* @param numa_id * Socket to allocate resources on * @return * - Slot in the rte_dev_devices array for a new device; */ struct rte_compressdev * -rte_compressdev_pmd_allocate (const char *name,int socket_id); +rte_compressdev_pmd_allocate (const char *name,int numa_id);/** * @internal
Signature · 1 line
2.55.0
PATCH 9/227 rawdev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the exported function rte_rawdev_socket_id() to rte_rawdev_numa_id(), keeping the old name as a functional alias to be deprecated once the in-tree migration completes.
Rename the numa_id fields of rte_rawdev and rte_rawdev_info (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename internal parameters and comments to the NUMA node terminology.
--- drivers/raw/ntb/ntb.c | 8 ++++---- lib/rawdev/rte_rawdev.c | 25 ++++++++++++++++--------- lib/rawdev/rte_rawdev.h | 37 +++++++++++++++++++++++++++++++++---- lib/rawdev/rte_rawdev_pmd.h | 8 ++++---- 4 files changed, 57 insertions(+), 21 deletions(-)
drivers/raw/ntb/ntb.c +4 -4
@@ -190,7 +190,7 @@ ntb_rxq_setup(struct rte_rawdev *dev, rxq =rte_zmalloc_socket ("ntb rx queue" ,sizeof (struct ntb_rx_queue ),RTE_CACHE_LINE_SIZE , - dev->socket_id); + dev->numa_id);if (!rxq) {NTB_LOG (ERR ,"Failed to allocate memory for " "rx queue data structure." );
@@ -213,7 +213,7 @@ ntb_rxq_setup(struct rte_rawdev *dev,sizeof (struct ntb_rx_entry ) * rxq->nb_rx_desc,RTE_CACHE_LINE_SIZE , - dev->socket_id); + dev->numa_id);if (!rxq->sw_ring) {ntb_rxq_release (rxq); rxq =NULL ;
@@ -276,7 +276,7 @@ ntb_txq_setup(struct rte_rawdev *dev, txq =rte_zmalloc_socket ("ntb tx queue" ,sizeof (struct ntb_tx_queue ),RTE_CACHE_LINE_SIZE , - dev->socket_id); + dev->numa_id);if (!txq) {NTB_LOG (ERR ,"Failed to allocate memory for " "tx queue structure" );
@@ -294,7 +294,7 @@ ntb_txq_setup(struct rte_rawdev *dev,sizeof (struct ntb_tx_entry ) * txq->nb_tx_desc,RTE_CACHE_LINE_SIZE , - dev->socket_id); + dev->numa_id);if (!txq->sw_ring) {ntb_txq_release (txq); txq =NULL ;
lib/rawdev/rte_rawdev.c +16 -9
@@ -56,16 +56,23 @@ rte_rawdev_get_dev_id(const char *name)return -ENODEV ; } -RTE_EXPORT_SYMBOL (rte_rawdev_socket_id) +RTE_EXPORT_SYMBOL (rte_rawdev_numa_id) int -rte_rawdev_socket_id (uint16_t dev_id) +rte_rawdev_numa_id (uint16_t dev_id) {struct rte_rawdev *dev;RTE_RAWDEV_VALID_DEVID_OR_ERR_RET (dev_id, -EINVAL ); dev = &rte_rawdevs[dev_id]; -return dev->socket_id; +return dev->numa_id; +} + +RTE_EXPORT_SYMBOL (rte_rawdev_socket_id) +int +rte_rawdev_socket_id (uint16_t dev_id) +{ +return rte_rawdev_numa_id (dev_id); }RTE_EXPORT_SYMBOL (rte_rawdev_info_get)
@@ -92,7 +99,7 @@ rte_rawdev_info_get(uint16_t dev_id, struct rte_rawdev_info *dev_info, dev_info->driver_name = rawdev->driver_name; dev_info->device = rawdev->device; - dev_info->socket_id = rawdev->socket_id; + dev_info->numa_id = rawdev->numa_id;return ret; }
@@ -526,7 +533,7 @@ rte_rawdev_find_free_device_index(void)RTE_EXPORT_SYMBOL (rte_rawdev_pmd_allocate) struct rte_rawdev * -rte_rawdev_pmd_allocate (const char *name,size_t dev_priv_size,int socket_id) +rte_rawdev_pmd_allocate (const char *name,size_t dev_priv_size,int numa_id) {struct rte_rawdev *rawdev;uint16_t dev_id;
@@ -545,10 +552,10 @@ rte_rawdev_pmd_allocate(const char *name, size_t dev_priv_size, int socket_id) rawdev = &rte_rawdevs[dev_id];if (dev_priv_size >0 ) { - rawdev->dev_private =rte_zmalloc_socket ("rawdev private" , + rawdev->dev_private =rte_zmalloc_numa ("rawdev private" , dev_priv_size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (!rawdev->dev_private) {RTE_RDEV_ERR ("Unable to allocate memory for rawdev" );return NULL ;
@@ -556,7 +563,7 @@ rte_rawdev_pmd_allocate(const char *name, size_t dev_priv_size, int socket_id) } rawdev->dev_id = dev_id; - rawdev->socket_id = socket_id; + rawdev->numa_id = numa_id; rawdev->started =0 ;strlcpy (rawdev->name, name,RTE_RAWDEV_NAME_MAX_LEN );
@@ -583,7 +590,7 @@ rte_rawdev_pmd_release(struct rte_rawdev *rawdev) rawdev_globals.nb_devs--; rawdev->dev_id =0 ; - rawdev->socket_id =0 ; + rawdev->numa_id =0 ; rawdev->dev_ops =NULL ;if (rawdev->dev_private) {rte_free (rawdev->dev_private);
lib/rawdev/rte_rawdev.h +33 -4
@@ -47,9 +47,24 @@ rte_rawdev_count(void);int rte_rawdev_get_dev_id (const char *name); +/** +* Return the NUMA node to which a device is connected. +* +* @param dev_id +* The identifier of the device. +* @return +* The NUMA node ID to which the device is connected or +* a default of zero if the NUMA node could not be determined. +* -(-EINVAL) dev_id value is out of range. +*/ +int +rte_rawdev_numa_id (uint16_t dev_id); +/** * Return the NUMA socket to which a device is connected. * +* This is a legacy alias of rte_rawdev_numa_id(). +* * @param dev_id * The identifier of the device. * @return
@@ -280,8 +295,15 @@ rte_rawdev_reset(uint16_t dev_id);* related to framework. */ struct __rte_cache_aligned rte_rawdev { -/**< Socket ID where memory is allocated */ -int socket_id; +union { +/** NUMA node ID where memory is allocated */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };/**< Device ID for this instance */ uint16_t dev_id;/**< Functions exported by PMD */
@@ -311,8 +333,15 @@ struct rte_rawdev_info {const char *driver_name;/**< Device encapsulation */ struct rte_device *device; -/**< Socket ID where memory is allocated */ -int socket_id; +union { +/** NUMA node ID where memory is allocated */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };/**< PMD-specific private data */ rte_rawdev_obj_t dev_private; };
lib/rawdev/rte_rawdev_pmd.h +4 -4
@@ -604,14 +604,14 @@ struct rte_rawdev_ops {* Size of private data memory allocated within rte_rawdev object. * Set to 0 to disable internal memory allocation and allow for * self-allocation. -* @param socket_id +* @param numa_id * Socket to allocate resources on. * @return * - Slot in the rte_dev_devices array for a new device; */ struct rte_rawdev *rte_rawdev_pmd_allocate (const char *name,size_t dev_private_size, -int socket_id); +int numa_id);/** * Release the specified rawdev device.
@@ -631,7 +631,7 @@ rte_rawdev_pmd_release(struct rte_rawdev *rawdev);* Pointer to a character array containing name of the device * @param dev_private_size * Size of raw PMDs private data -* @param socket_id +* @param numa_id * Socket to allocate resources on. * * @return
@@ -640,7 +640,7 @@ rte_rawdev_pmd_release(struct rte_rawdev *rawdev);*/ struct rte_rawdev *rte_rawdev_pmd_init (const char *name,size_t dev_private_size, -int socket_id); +int numa_id);/** * Destroy a raw device
Signature · 1 line
2.55.0
PATCH 10/227 mldev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the experimental function rte_ml_dev_socket_id() to rte_ml_dev_numa_id() (experimental API may change without compatibility alias), and rename the device data field to numa_id.
Rename the numa_id field of rte_ml_dev_config (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename internal parameters and comments to the NUMA node terminology.
--- app/test-mldev/test_common.c | 4 ++-- app/test-mldev/test_device_ops.c | 2 +- drivers/ml/cnxk/cn10k_ml_dev.c | 2 +- drivers/ml/cnxk/mvtvm_ml_dev.c | 2 +- lib/mldev/rte_mldev.c | 24 +++++++++++------------ lib/mldev/rte_mldev.h | 33 +++++++++++++++++++------------- lib/mldev/rte_mldev_core.h | 10 +++++----- lib/mldev/rte_mldev_pmd.c | 10 +++++----- lib/mldev/rte_mldev_pmd.h | 10 +++++----- 9 files changed, 52 insertions(+), 45 deletions(-)
app/test-mldev/test_common.c +2 -2
@@ -101,7 +101,7 @@ ml_test_opt_check(struct ml_options *opt)return -EINVAL ; } - socket_id =rte_ml_dev_socket_id (opt->dev_id); + 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);return -EINVAL ;
@@ -140,7 +140,7 @@ ml_test_device_configure(struct ml_test *test, struct ml_options *opt) }/* configure device */ - dev_config.socket_id = opt->socket_id; + dev_config.numa_id = opt->socket_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 +1 -1
@@ -128,7 +128,7 @@ test_device_reconfigure(struct ml_test *test, struct ml_options *opt) }/* reconfigure device based on dev_info */ - dev_config.socket_id = opt->socket_id; + dev_config.numa_id = opt->socket_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);
drivers/ml/cnxk/cn10k_ml_dev.c +1 -1
@@ -324,7 +324,7 @@ cn10k_ml_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_de } init_params = (struct rte_ml_dev_pmd_init_params ){ - .socket_id =rte_socket_id (), .private_data_size =sizeof (struct cnxk_ml_dev )}; + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct cnxk_ml_dev )}; ret =roc_plt_init ();if (ret <0 ) {
drivers/ml/cnxk/mvtvm_ml_dev.c +1 -1
@@ -131,7 +131,7 @@ mvtvm_ml_vdev_probe(struct rte_vdev_device *vdev) } init_params = (struct rte_ml_dev_pmd_init_params ){ - .socket_id =rte_socket_id (), .private_data_size =sizeof (struct cnxk_ml_dev )}; + .numa_id =rte_numa_id (), .private_data_size =sizeof (struct cnxk_ml_dev )}; name =rte_vdev_device_name (vdev);if (name ==NULL )
lib/mldev/rte_mldev.c +12 -12
@@ -51,7 +51,7 @@ rte_ml_dev_pmd_get_named_dev(const char *name)RTE_EXPORT_INTERNAL_SYMBOL (rte_ml_dev_pmd_allocate) struct rte_ml_dev * -rte_ml_dev_pmd_allocate (const char *name,uint8_t socket_id) +rte_ml_dev_pmd_allocate (const char *name,uint8_t numa_id) {char mz_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *mz;
@@ -85,7 +85,7 @@ rte_ml_dev_pmd_allocate(const char *name, uint8_t socket_id)/* Reserve memzone name */ sprintf (mz_name,"rte_ml_dev_data_%d" , dev_id);if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { - mz =rte_memzone_reserve (mz_name,sizeof (struct rte_ml_dev_data ), socket_id, + mz =rte_memzone_reserve (mz_name,sizeof (struct rte_ml_dev_data ), numa_id,0 );RTE_MLDEV_LOG (DEBUG ,"PRIMARY: reserved memzone for %s (%p)" , mz_name, mz); }else {
@@ -105,13 +105,13 @@ rte_ml_dev_pmd_allocate(const char *name, uint8_t socket_id)if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) {strlcpy (dev->data->name, name,RTE_ML_STR_MAX ); dev->data->dev_id = dev_id; - dev->data->socket_id = socket_id; + dev->data->numa_id = numa_id; dev->data->dev_started =0 ;RTE_MLDEV_LOG (DEBUG ,"PRIMARY: init mldev data" ); } -RTE_MLDEV_LOG (DEBUG ,"Data for %s: dev_id %d, socket %u" , dev->data->name, - dev->data->dev_id, dev->data->socket_id); +RTE_MLDEV_LOG (DEBUG ,"Data for %s: dev_id %d, numa node %u" , dev->data->name, + dev->data->dev_id, dev->data->numa_id); dev->attached =ML_DEV_ATTACHED ; ml_dev_globals.nb_devs++;
@@ -218,9 +218,9 @@ rte_ml_dev_is_valid_dev(int16_t dev_id)return 1 ; } -RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_ml_dev_socket_id, 22.11) +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_ml_dev_numa_id, 22.11)int -rte_ml_dev_socket_id (int16_t dev_id) +rte_ml_dev_numa_id (int16_t dev_id) {struct rte_ml_dev *dev;
@@ -231,7 +231,7 @@ rte_ml_dev_socket_id(int16_t dev_id) dev =rte_ml_dev_pmd_get_dev (dev_id); -return dev->data->socket_id; +return dev->data->numa_id; }RTE_EXPORT_EXPERIMENTAL_SYMBOL (rte_ml_dev_info_get,22.11 )
@@ -397,7 +397,7 @@ rte_ml_dev_queue_pair_count(int16_t dev_id) RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_ml_dev_queue_pair_setup, 22.11)int rte_ml_dev_queue_pair_setup (int16_t dev_id,uint16_t queue_pair_id, -const struct rte_ml_dev_qp_conf *qp_conf,int socket_id) +const struct rte_ml_dev_qp_conf *qp_conf,int numa_id) {struct rte_ml_dev *dev;
@@ -425,7 +425,7 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id,return -EBUSY ; } -return dev->dev_ops->dev_queue_pair_setup (dev, queue_pair_id, qp_conf, socket_id); +return dev->dev_ops->dev_queue_pair_setup (dev, queue_pair_id, qp_conf, numa_id); }RTE_EXPORT_EXPERIMENTAL_SYMBOL (rte_ml_dev_stats_get,22.11 )
@@ -808,7 +808,7 @@ ml_op_init(struct rte_mempool *mempool, __rte_unused void *opaque_arg, void *_op RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_ml_op_pool_create, 22.11)struct rte_mempool *rte_ml_op_pool_create (const char *name,unsigned int nb_elts,unsigned int cache_size, -uint16_t user_size,int socket_id) +uint16_t user_size,int numa_id) {struct rte_ml_op_pool_private *priv;struct rte_mempool *mp;
@@ -833,7 +833,7 @@ rte_ml_op_pool_create(const char *name, unsigned int nb_elts, unsigned int cache mp =rte_mempool_create (name, nb_elts, elt_size, cache_size,sizeof (struct rte_ml_op_pool_private ),NULL ,NULL , ml_op_init,NULL , - socket_id,0 ); + numa_id,0 );if (mp ==NULL ) {RTE_MLDEV_LOG (ERR ,"Failed to create mempool %s" , name);return NULL ;
lib/mldev/rte_mldev.h +20 -13
@@ -199,19 +199,19 @@ int rte_ml_dev_is_valid_dev(int16_t dev_id);/** -* Return the NUMA socket to which a device is connected. +* Return the NUMA node to which a device is connected. * * @param dev_id * The identifier of the device. * * @return -* - The NUMA socket id to which the device is connected -* - 0 If the socket could not be determined. +* - The NUMA node ID to which the device is connected +* - 0 If the NUMA node could not be determined. * - -EINVAL: if the dev_id value is not valid. */ __rte_experimental int -rte_ml_dev_socket_id (int16_t dev_id); +rte_ml_dev_numa_id (int16_t dev_id);/** ML device information */ struct rte_ml_dev_info {
@@ -257,8 +257,15 @@ rte_ml_dev_info_get(int16_t dev_id, struct rte_ml_dev_info *dev_info);/** ML device configuration structure */ struct rte_ml_dev_config { -int socket_id; -/**< Socket to allocate resources on. */ +union { +/** NUMA node to allocate resources on. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint16_t nb_models;/**< Number of models to be loaded on the device. * This value cannot exceed the max_models which is previously provided in
@@ -340,9 +347,9 @@ rte_ml_dev_queue_pair_count(int16_t dev_id);* previously supplied to rte_ml_dev_configure(). * @param qp_conf * The pointer to the configuration data to be used for the queue pair. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of NUMA. -* The value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the memory allocated +* @param numa_id +* The *numa_id* argument is the socket identifier in case of NUMA. +* The value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for the memory allocated * for the queue pair. * * @return
@@ -352,7 +359,7 @@ rte_ml_dev_queue_pair_count(int16_t dev_id);__rte_experimental intrte_ml_dev_queue_pair_setup (int16_t dev_id,uint16_t queue_pair_id, -const struct rte_ml_dev_qp_conf *qp_conf,int socket_id); +const struct rte_ml_dev_qp_conf *qp_conf,int numa_id);/** * Start an ML device.
@@ -1555,8 +1562,8 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg ** *rte_mempool_create* for further details about cache size * @param user_size * Size of private data to allocate for user with each operation -* @param socket_id -* Socket to identifier allocate memory on +* @param numa_id +* NUMA node ID to allocate memory on * @return * - On success pointer to mempool * - On failure NULL
@@ -1564,7 +1571,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg *__rte_experimental struct rte_mempool *rte_ml_op_pool_create (const char *name,unsigned int nb_elts,unsigned int cache_size, -uint16_t user_size,int socket_id); +uint16_t user_size,int numa_id);/** * Free an ML operation pool
lib/mldev/rte_mldev_core.h +5 -5
@@ -179,8 +179,8 @@ typedef int (*mldev_stop_t)(struct rte_ml_dev *dev);* Queue pair index. * @param queue_pair_conf * Queue pair configuration structure. -* @param socket_id -* Socket index. +* @param numa_id +* NUMA node index. * * @return * - 0 on success.
@@ -188,7 +188,7 @@ typedef int (*mldev_stop_t)(struct rte_ml_dev *dev);*/ typedef int (*mldev_queue_pair_setup_t )(struct rte_ml_dev *dev,uint16_t queue_pair_id,const struct rte_ml_dev_qp_conf *queue_pair_conf, -int socket_id); +int numa_id);/** * @internal
@@ -592,8 +592,8 @@ struct rte_ml_dev_data {/** Device ID for this instance. */ int16_t dev_id; -/** Socket ID where memory is allocated. */ -int16_t socket_id; +/** NUMA node ID where memory is allocated. */ +int16_t numa_id;/** Device state: STOPPED(0) / STARTED(1) */ __extension__ uint8_t dev_started : 1;
lib/mldev/rte_mldev_pmd.c +5 -5
@@ -16,11 +16,11 @@ rte_ml_dev_pmd_create(const char *name, struct rte_device *device, {struct rte_ml_dev *dev; -RTE_MLDEV_LOG (INFO ,"ML device initialisation - name: %s, socket_id: %u" , name, - params->socket_id); +RTE_MLDEV_LOG (INFO ,"ML device initialisation - name: %s, numa_id: %u" , name, + params->numa_id);/* Allocate device structure */ - dev =rte_ml_dev_pmd_allocate (name, params->socket_id); + dev =rte_ml_dev_pmd_allocate (name, params->numa_id);if (dev ==NULL ) {RTE_MLDEV_LOG (ERR ,"Failed to allocate ML device for %s" , name);return NULL ;
@@ -29,8 +29,8 @@ rte_ml_dev_pmd_create(const char *name, struct rte_device *device,/* Allocate private device structure */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { dev->data->dev_private = -rte_zmalloc_socket ("ml_dev_private" , params->private_data_size, -RTE_CACHE_LINE_SIZE , params->socket_id); +rte_zmalloc_numa ("ml_dev_private" , params->private_data_size, +RTE_CACHE_LINE_SIZE , params->numa_id);if (dev->data->dev_private ==NULL ) { RTE_MLDEV_LOG(ERR, "Cannot allocate memory for mldev %s private data",
lib/mldev/rte_mldev_pmd.h +5 -5
@@ -31,8 +31,8 @@ extern "C" {* Initialisation parameters for ML devices. */ struct rte_ml_dev_pmd_init_params { -/** Socket to use for memory allocation. */ -uint8_t socket_id; +/** NUMA node to use for memory allocation. */ +uint8_t numa_id;/** Size of device private data. */ uint64_t private_data_size;
@@ -78,15 +78,15 @@ rte_ml_dev_pmd_get_named_dev(const char *name);* * @param name * Unique identifier name for each device. -* @param socket_id -* Socket to allocate resources. +* @param numa_id +* NUMA node to allocate resources. * * @return * Slot in the rte_ml_dev_devices array for a new device. */ __rte_internal struct rte_ml_dev * -rte_ml_dev_pmd_allocate (const char *name,uint8_t socket_id); +rte_ml_dev_pmd_allocate (const char *name,uint8_t numa_id);/** * @internal
Signature · 1 line
2.55.0
PATCH 11/227 bbdev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id fields of rte_bbdev_info, rte_bbdev_data and rte_bbdev_queue_conf (were socket_id and socket), keeping the old names as deprecated union aliases, and update in-tree users accordingly.
Also rename socket_id parameters, trace arguments, internal variables, log messages and comments to the NUMA node terminology, and switch internal calls to rte_calloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- app/test-bbdev/test_bbdev.c | 12 +++---- app/test-bbdev/test_bbdev_perf.c | 6 ++-- drivers/baseband/acc/rte_acc100_pmd.c | 8 ++--- drivers/baseband/acc/rte_vrb_pmd.c | 8 ++--- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 +-- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 4 +-- drivers/baseband/la12xx/bbdev_la12xx.c | 2 +- drivers/baseband/null/bbdev_null.c | 4 +-- .../baseband/turbo_sw/bbdev_turbo_software.c | 4 +-- examples/bbdev_app/main.c | 4 +-- lib/bbdev/bbdev_trace.h | 4 +-- lib/bbdev/rte_bbdev.c | 26 +++++++------- lib/bbdev/rte_bbdev.h | 36 +++++++++++++++---- lib/bbdev/rte_bbdev_op.h | 6 ++-- lib/bbdev/rte_bbdev_pmd.h | 2 +- 15 files changed, 77 insertions(+), 53 deletions(-)
app/test-bbdev/test_bbdev.c +6 -6
@@ -66,7 +66,7 @@ ut_setup(void)/* Valid queue configuration */ ts_params->qconf.priority =0 ; - ts_params->qconf.socket =SOCKET_ID_ANY ; + ts_params->qconf.numa_id =RTE_NUMA_ID_ANY ; ts_params->qconf.deferred_start =1 ; num_queues =1 ;
@@ -316,9 +316,9 @@ test_bbdev_configure_stop_queue(void)"invalid return value from " "rte_bbdev_queue_info_get function: %i", return_value); -TEST_ASSERT (qinfo.conf.socket == ts_params->qconf.socket, +TEST_ASSERT (qinfo.conf.numa_id == ts_params->qconf.numa_id,"Failed test for rte_bbdev_queue_info_get: " -"invalid queue_size:%u" , qinfo.conf.socket); +"invalid queue_size:%u" , qinfo.conf.numa_id);TEST_ASSERT (qinfo.conf.queue_size == ts_params->qconf.queue_size, "Failed test for rte_bbdev_queue_info_get: "
@@ -426,13 +426,13 @@ test_bbdev_configure_invalid_queue_configure(void)"Failed test for rte_bbdev_queue_configure: " "NULL qconf structure "); - ts_params->qconf.socket =RTE_MAX_NUMA_NODES ; + ts_params->qconf.numa_id =RTE_MAX_NUMA_NODES ;TEST_ASSERT_FAIL (rte_bbdev_queue_configure (dev_id, queue_id, &ts_params->qconf),"Failed test for rte_bbdev_queue_configure: " "invalid socket number " ); - ts_params->qconf.socket =SOCKET_ID_ANY ; + ts_params->qconf.numa_id =RTE_NUMA_ID_ANY ;TEST_ASSERT_SUCCESS (rte_bbdev_queue_configure (dev_id, queue_id, &ts_params->qconf), "Failed test for rte_bbdev_queue_configure: "
@@ -1125,7 +1125,7 @@ test_bbdev_invalid_driver(void) "NULL queue_release "); dev2->dev_ops = dev1.dev_ops; - dev2->data->socket_id =SOCKET_ID_ANY ; + 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);
app/test-bbdev/test_bbdev_perf.c +3 -3
@@ -897,10 +897,10 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info, nb_queues =RTE_MIN (nb_queues, (unsigned int )MAX_QUEUES );/* setup device */ - ret =rte_bbdev_setup_queues (dev_id, nb_queues, info->socket_id); + ret =rte_bbdev_setup_queues (dev_id, nb_queues, info->numa_id);if (ret <0 ) {printf ("rte_bbdev_setup_queues(%u, %u, %d) ret %i\n" , - dev_id, nb_queues, info->socket_id, ret); + dev_id, nb_queues, info->numa_id, ret);return TEST_FAILED ; }
@@ -915,7 +915,7 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info, }/* setup device queues */ - qconf.socket = info->socket_id; + qconf.numa_id = info->numa_id; qconf.queue_size = info->drv.default_queue_conf.queue_size; qconf.priority =0 ; qconf.deferred_start =0 ;
drivers/baseband/acc/rte_acc100_pmd.c +4 -4
@@ -413,7 +413,7 @@ allocate_info_ring(struct rte_bbdev *dev) d->info_ring =rte_zmalloc_socket ("Info Ring" ,ACC_INFO_RING_NUM_ENTRIES *sizeof (*d->info_ring),RTE_CACHE_LINE_SIZE , - dev->data->socket_id); + dev->data->numa_id);if (d->info_ring ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate Info Ring for %s:%u",
@@ -543,7 +543,7 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)if (d->harq_layout ==NULL ) d->harq_layout =rte_zmalloc_socket ("HARQ Layout" ,ACC_HARQ_LAYOUT *sizeof (*d->harq_layout), -RTE_CACHE_LINE_SIZE , dev->data->socket_id); +RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->harq_layout ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate harq_layout for %s:%u", dev->device->driver->name,
@@ -978,7 +978,7 @@ acc100_dev_info_get(struct rte_bbdev *dev, };static struct rte_bbdev_queue_conf default_queue_conf; - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; default_queue_conf.queue_size =ACC_MAX_QUEUE_DEPTH ; dev_info->driver_name = dev->device->driver->name;
@@ -4058,7 +4058,7 @@ static int acc100_pci_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; bbdev->intr_handle = pci_dev->intr_handle; - bbdev->data->socket_id = pci_dev->device.numa_node; + bbdev->data->numa_id = pci_dev->device.numa_node;/* Invoke ACC100 device initialization function */ acc100_bbdev_init (bbdev, pci_drv);
drivers/baseband/acc/rte_vrb_pmd.c +4 -4
@@ -513,7 +513,7 @@ allocate_info_ring(struct rte_bbdev *dev)/* Allocate InfoRing */ d->info_ring =rte_zmalloc_socket ("Info Ring" ,ACC_INFO_RING_NUM_ENTRIES * -sizeof (*d->info_ring),RTE_CACHE_LINE_SIZE , dev->data->socket_id); +sizeof (*d->info_ring),RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->info_ring ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate Info Ring for %s:%u",
@@ -721,7 +721,7 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)if (d->harq_layout ==NULL ) d->harq_layout =rte_zmalloc_socket ("HARQ Layout" ,ACC_HARQ_LAYOUT *sizeof (*d->harq_layout), -RTE_CACHE_LINE_SIZE , dev->data->socket_id); +RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->harq_layout ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate harq_layout for %s:%u", dev->device->driver->name,
@@ -1429,7 +1429,7 @@ vrb_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) };static struct rte_bbdev_queue_conf default_queue_conf; - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; default_queue_conf.queue_size =ACC_MAX_QUEUE_DEPTH ; dev_info->driver_name = dev->device->driver->name;
@@ -4436,7 +4436,7 @@ static int vrb_pci_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure. */ bbdev->device = &pci_dev->device; bbdev->intr_handle = pci_dev->intr_handle; - bbdev->data->socket_id = pci_dev->device.numa_node; + bbdev->data->numa_id = pci_dev->device.numa_node;/* Invoke device initialization function. */ vrb_bbdev_init (bbdev, pci_drv);
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +2 -2
@@ -589,7 +589,7 @@ fpga_5gnr_dev_info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_ FPGA_5GNR_FEC_HARQ_BUF_SIZE_REGS);static struct rte_bbdev_queue_conf default_queue_conf; - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; default_queue_conf.queue_size =FPGA_5GNR_RING_MAX_SIZE ; dev_info->driver_name = dev->device->driver->name;
@@ -2949,7 +2949,7 @@ fpga_5gnr_fec_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; bbdev->intr_handle = pci_dev->intr_handle; - bbdev->data->socket_id = pci_dev->device.numa_node; + bbdev->data->numa_id = pci_dev->device.numa_node;/* Invoke FPGA 5GNR FEC device initialization function */ fpga_5gnr_fec_init (bbdev, pci_drv);
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +2 -2
@@ -631,7 +631,7 @@ fpga_dev_info_get(struct rte_bbdev *dev, };static struct rte_bbdev_queue_conf default_queue_conf; - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; default_queue_conf.queue_size =FPGA_RING_MAX_SIZE ;
@@ -2372,7 +2372,7 @@ fpga_lte_fec_probe(struct rte_pci_driver *pci_drv,/* Fill HW specific part of device structure */ bbdev->device = &pci_dev->device; bbdev->intr_handle = pci_dev->intr_handle; - bbdev->data->socket_id = pci_dev->device.numa_node; + bbdev->data->numa_id = pci_dev->device.numa_node;/* Invoke FEC FPGA device initialization function */ fpga_lte_fec_init (bbdev, pci_drv);
drivers/baseband/la12xx/bbdev_la12xx.c +1 -1
@@ -1037,7 +1037,7 @@ la12xx_bbdev_create(struct rte_vdev_device *vdev, } bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; - bbdev->data->socket_id =0 ; + bbdev->data->numa_id =0 ; bbdev->intr_handle =NULL ;/* register rx/tx burst functions for data path */
drivers/baseband/null/bbdev_null.c +2 -2
@@ -66,7 +66,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info) .queue_size = RTE_BBDEV_QUEUE_SIZE_LIMIT, }; - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; dev_info->driver_name =RTE_STR (DRIVER_NAME ); dev_info->max_num_queues = internals->max_nb_queues;
@@ -280,7 +280,7 @@ null_bbdev_create(struct rte_vdev_device *vdev, bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; - bbdev->data->socket_id = init_params->socket_id; + bbdev->data->numa_id = init_params->socket_id; bbdev->intr_handle =NULL ;/* register rx/tx burst functions for data path */
drivers/baseband/turbo_sw/bbdev_turbo_software.c +2 -2
@@ -244,7 +244,7 @@ info_get(struct rte_bbdev *dev, struct rte_bbdev_driver_info *dev_info)#else dev_info->cpu_flag_reqs =NULL ;#endif - default_queue_conf.socket = dev->data->socket_id; + default_queue_conf.numa_id = dev->data->numa_id; dev_info->driver_name =RTE_STR (DRIVER_NAME ); dev_info->max_num_queues = internals->max_nb_queues;
@@ -1912,7 +1912,7 @@ turbo_sw_bbdev_create(struct rte_vdev_device *vdev, bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; - bbdev->data->socket_id = init_params->socket_id; + bbdev->data->numa_id = init_params->socket_id; bbdev->intr_handle =NULL ;/* register rx/tx burst functions for data path */
examples/bbdev_app/main.c +2 -2
@@ -941,14 +941,14 @@ prepare_bbdev_device(unsigned int dev_id, struct rte_bbdev_info *info,uint16_t enc_qs_nb = app_params->num_enc_cores;uint16_t tot_qs = dec_qs_nb + enc_qs_nb; - ret =rte_bbdev_setup_queues (dev_id, tot_qs, info->socket_id); + ret =rte_bbdev_setup_queues (dev_id, tot_qs, info->numa_id);if (ret <0 )rte_exit (EXIT_FAILURE ,"ERROR(%d): BBDEV %u not configured properly\n" , ret, dev_id);/* setup device DEC queues */ - qconf.socket = info->socket_id; + qconf.numa_id = info->numa_id; qconf.queue_size = info->drv.queue_size_lim; qconf.op_type =RTE_BBDEV_OP_TURBO_DEC ;
lib/bbdev/bbdev_trace.h +2 -2
@@ -21,10 +21,10 @@ extern "C" {RTE_TRACE_POINT ( rte_bbdev_trace_setup_queues, - RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t num_queues, int socket_id), + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t num_queues, int numa_id), rte_trace_point_emit_u8(dev_id);rte_trace_point_emit_u16 (num_queues); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id); ) RTE_TRACE_POINT( rte_bbdev_trace_queue_configure,
lib/bbdev/rte_bbdev.c +13 -13
@@ -124,7 +124,7 @@ rte_bbdev_data_alloc(void)if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { mz =rte_memzone_reserve (MZ_RTE_BBDEV_DATA ,RTE_BBDEV_MAX_DEVS *sizeof (*rte_bbdev_data), -rte_socket_id (), flags); +rte_numa_id (), flags); }else mz =rte_memzone_lookup (MZ_RTE_BBDEV_DATA );if (mz ==NULL ) {
@@ -322,7 +322,7 @@ rte_bbdev_find_next(uint16_t dev_id)RTE_EXPORT_SYMBOL (rte_bbdev_setup_queues) int -rte_bbdev_setup_queues (uint16_t dev_id,uint16_t num_queues,int socket_id) +rte_bbdev_setup_queues (uint16_t dev_id,uint16_t num_queues,int numa_id) {unsigned int i;int ret;
@@ -332,7 +332,7 @@ rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id)VALID_DEV_OPS_OR_RET_ERR (dev, dev_id); -rte_bbdev_trace_setup_queues (dev_id, num_queues, socket_id); +rte_bbdev_trace_setup_queues (dev_id, num_queues, numa_id);if (dev->data->started) { rte_bbdev_log(ERR,
@@ -379,13 +379,13 @@ rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id) }/* Allocate queue pointers */ - dev->data->queues =rte_calloc_socket (DEV_NAME , num_queues, + dev->data->queues =rte_calloc_numa (DEV_NAME , num_queues,sizeof (dev->data->queues[0 ]),RTE_CACHE_LINE_SIZE , - dev->data->socket_id); + dev->data->numa_id);if (dev->data->queues ==NULL ) {rte_bbdev_log (ERR , -"calloc of %u queues for device %u on socket %i failed" , - num_queues, dev_id, dev->data->socket_id); +"calloc of %u queues for device %u on NUMA node %i failed" , + num_queues, dev_id, dev->data->numa_id);return -ENOMEM ; }
@@ -393,7 +393,7 @@ rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id)/* Call optional device configuration */ if (dev->dev_ops->setup_queues) { - ret = dev->dev_ops->setup_queues (dev, num_queues, socket_id); + ret = dev->dev_ops->setup_queues (dev, num_queues, numa_id);if (ret <0 ) { rte_bbdev_log(ERR, "Device %u memory configuration failed",
@@ -854,7 +854,7 @@ rte_bbdev_info_get(uint16_t dev_id, struct rte_bbdev_info *dev_info) dev_info->dev_name = dev->data->name; dev_info->num_queues = dev->data->num_queues; dev_info->device = dev->device; - dev_info->socket_id = dev->data->socket_id; + dev_info->numa_id = dev->data->numa_id; dev_info->started = dev->data->started;/* Copy data maintained by device driver layer */
@@ -955,7 +955,7 @@ RTE_EXPORT_SYMBOL(rte_bbdev_op_pool_create)struct rte_mempool *rte_bbdev_op_pool_create (const char *name,enum rte_bbdev_op_type type,unsigned int num_elements,unsigned int cache_size, -int socket_id) +int numa_id) {struct rte_bbdev_op_pool_private *priv;struct rte_mempool *mp;
@@ -975,7 +975,7 @@ rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type, mp =rte_mempool_create (name, num_elements,get_bbdev_op_size (type), cache_size,sizeof (struct rte_bbdev_op_pool_private ), -NULL ,NULL , bbdev_op_init, &type, socket_id,0 ); +NULL ,NULL , bbdev_op_init, &type, numa_id,0 );if (mp ==NULL ) { rte_bbdev_log(ERR, "Failed to create op pool %s (num ops=%u, op size=%u) with error: %s",
@@ -989,8 +989,8 @@ rte_bbdev_op_pool_create(const char *name, enum rte_bbdev_op_type type,return NULL ;rte_bbdev_log_debug ( -"Op pool %s created for %u ops (type=%s, cache=%u, socket=%u, size=%u)" , - name, num_elements, op_type_str, cache_size, socket_id, +"Op pool %s created for %u ops (type=%s, cache=%u, numa node=%u, size=%u)" , + name, num_elements, op_type_str, cache_size, numa_id,get_bbdev_op_size (type)); priv = (struct rte_bbdev_op_pool_private *)rte_mempool_get_priv (mp);
lib/bbdev/rte_bbdev.h +30 -6
@@ -101,8 +101,8 @@ rte_bbdev_find_next(uint16_t dev_id);* The identifier of the device. * @param num_queues * Number of queues to configure on device. -* @param socket_id -* ID of a socket which will be used to allocate memory. +* @param numa_id +* ID of a NUMA node which will be used to allocate memory. * * @return * - 0 on success
@@ -112,7 +112,7 @@ rte_bbdev_find_next(uint16_t dev_id);* - -ENOMEM if unable to allocate memory */ int -rte_bbdev_setup_queues (uint16_t dev_id,uint16_t num_queues,int socket_id); +rte_bbdev_setup_queues (uint16_t dev_id,uint16_t num_queues,int numa_id);/** * Enable interrupts.
@@ -133,7 +133,15 @@ rte_bbdev_intr_enable(uint16_t dev_id);/** Device queue configuration structure */ struct rte_bbdev_queue_conf { -int socket;/**< NUMA socket used for memory allocation */ +union { +/** NUMA node used for memory allocation */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket; + };uint32_t queue_size;/**< Size of queue */ uint8_t priority;/**< Queue priority */ bool deferred_start;/**< Do not start queue when device is started. */
@@ -391,7 +399,15 @@ struct rte_bbdev_driver_info {/* Structure rte_bbdev_info 8< */ struct rte_bbdev_info { -int socket_id;/**< NUMA socket that device is on */ +union { +/** NUMA node that device is on */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };const char *dev_name;/**< Unique device name */ const struct rte_device *device;/**< Device Information */ uint16_t num_queues;/**< Number of queues currently configured */
@@ -510,7 +526,15 @@ struct rte_bbdev_data {uint16_t num_queues;/**< Number of currently configured queues */ struct rte_bbdev_queue_data *queues;/**< Queue structures */ uint16_t dev_id;/**< Device ID */ -int socket_id;/**< NUMA socket that device is on */ +union { +/** NUMA node that device is on */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };bool started;/**< Device run-time state */ RTE_ATOMIC (uint16_t ) process_cnt;/** Counter of processes using the device */ };
lib/bbdev/rte_bbdev_op.h +3 -3
@@ -1046,8 +1046,8 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type);* @param cache_size * Number of elements to cache on an lcore, see rte_mempool_create() for * further details about cache size. -* @param socket_id -* Socket to allocate memory on. +* @param numa_id +* NUMA node ID to allocate memory on. * * @return * - Pointer to a mempool on success,
@@ -1056,7 +1056,7 @@ rte_bbdev_op_type_str(enum rte_bbdev_op_type op_type);struct rte_mempool *rte_bbdev_op_pool_create (const char *name,enum rte_bbdev_op_type type,unsigned int num_elements,unsigned int cache_size, -int socket_id); +int numa_id);/** * Bulk allocate encode operations from a mempool with parameter defaults reset.
lib/bbdev/rte_bbdev_pmd.h +1 -1
@@ -76,7 +76,7 @@ rte_bbdev_get_named_dev(const char *name);/** @internal Function used to configure device memory. */ typedef int (*rte_bbdev_setup_queues_t )(struct rte_bbdev *dev, -uint16_t num_queues,int socket_id); +uint16_t num_queues,int numa_id);/** @internal Function used to configure interrupts for a device. */ typedef int (*rte_bbdev_intr_enable_t )(struct rte_bbdev *dev);
Signature · 1 line
2.55.0
PATCH 12/227 eventdev: rename device socket API to NUMA node API
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the exported function rte_event_dev_socket_id() to rte_event_dev_numa_id(), keeping the old name as a functional alias to be deprecated once the in-tree migration completes.
Rename the numa_id fields of the timer and vector adapter configuration structures (were socket_id), keeping socket_id as a deprecated union alias, and the eventdev data field to numa_id, and update in-tree users accordingly.
Also rename socket_id parameters, trace points, internal variables, log messages and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- app/test-eventdev/test_perf_common.c | 4 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/dsw/dsw_evdev.c | 4 +- drivers/event/octeontx/ssovf_evdev.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 4 +- drivers/event/sw/sw_evdev.c | 8 +-- drivers/event/sw/sw_evdev_xstats.c | 2 +- lib/eventdev/event_timer_adapter_pmd.h | 4 +- lib/eventdev/event_vector_adapter_pmd.h | 4 +- lib/eventdev/eventdev_pmd.h | 10 ++-- lib/eventdev/eventdev_pmd_pci.h | 4 +- lib/eventdev/eventdev_pmd_vdev.h | 12 ++-- lib/eventdev/eventdev_trace.h | 14 ++--- lib/eventdev/eventdev_trace_points.c | 4 +- lib/eventdev/rte_event_crypto_adapter.c | 30 +++++----- lib/eventdev/rte_event_dma_adapter.c | 38 ++++++------ lib/eventdev/rte_event_eth_rx_adapter.c | 68 +++++++++++----------- lib/eventdev/rte_event_eth_tx_adapter.c | 30 +++++----- lib/eventdev/rte_event_ring.c | 6 +- lib/eventdev/rte_event_ring.h | 8 +-- lib/eventdev/rte_event_timer_adapter.c | 16 ++--- lib/eventdev/rte_event_timer_adapter.h | 11 +++- lib/eventdev/rte_event_vector_adapter.c | 12 ++-- lib/eventdev/rte_event_vector_adapter.h | 11 +++- lib/eventdev/rte_eventdev.c | 31 ++++++---- lib/eventdev/rte_eventdev.h | 24 ++++++-- 26 files changed, 200 insertions(+), 163 deletions(-)
app/test-eventdev/test_perf_common.c +2 -2
@@ -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.socket_id = opt->socket_id; + conf.numa_id = opt->socket_id; conf.vector_mp = t->pool; conf.ev.sched_type = opt->sched_type_list[0 ];
@@ -2082,7 +2082,7 @@ perf_cryptodev_setup(struct evt_test *test, struct evt_options *opt) } conf.nb_queue_pairs = nb_qps; - conf.socket_id =SOCKET_ID_ANY ; + conf.numa_id =RTE_NUMA_ID_ANY ; conf.ff_disable =RTE_CRYPTODEV_FF_SECURITY ; ret =rte_cryptodev_configure (cdev_id, &conf);
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -777,7 +777,7 @@ dlb2_eventdev_pci_init(struct rte_eventdev *eventdev)const void *probe_args =NULL ;DLB2_LOG_LINE_DBG ("Enter with dev_id=%d socket_id=%d" , - eventdev->data->dev_id, eventdev->data->socket_id); + eventdev->data->dev_id, eventdev->data->numa_id);for (q =0 ; q <DLB2_MAX_NUM_PORTS_ALL ; q++) dlb2_args.port_cos.cos_id[q] =DLB2_COS_DEFAULT ;
drivers/event/dsw/dsw_evdev.c +2 -2
@@ -43,7 +43,7 @@ dsw_port_setup(struct rte_eventdev *dev, uint8_t port_id, port_id); in_ring =rte_event_ring_create (ring_name,DSW_IN_RING_SIZE , - dev->data->socket_id, + dev->data->numa_id,RING_F_SC_DEQ |RING_F_EXACT_SZ );if (in_ring ==NULL )
@@ -55,7 +55,7 @@ dsw_port_setup(struct rte_eventdev *dev, uint8_t port_id, ctl_in_ring =rte_ring_create_elem (ring_name,sizeof (struct dsw_ctl_msg ),DSW_CTL_IN_RING_SIZE , - dev->data->socket_id, + dev->data->numa_id,RING_F_SC_DEQ |RING_F_EXACT_SZ );if (ctl_in_ring ==NULL ) {
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -256,7 +256,7 @@ ssovf_port_setup(struct rte_eventdev *dev, uint8_t port_id,/* Allocate event port memory */ ws =rte_zmalloc_socket ("eventdev ssows" ,sizeof (struct ssows ),RTE_CACHE_LINE_SIZE , - dev->data->socket_id); + dev->data->numa_id);if (ws ==NULL ) {ssovf_log_err ("Failed to alloc memory for port=%d" , port_id);return -ENOMEM ;
drivers/event/skeleton/skeleton_eventdev.c +2 -2
@@ -222,7 +222,7 @@ skeleton_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id,/* Allocate event port memory */ sp =rte_zmalloc_socket ("eventdev port" ,sizeof (struct skeleton_port ),RTE_CACHE_LINE_SIZE , - dev->data->socket_id); + dev->data->numa_id);if (sp ==NULL ) {PMD_DRV_ERR ("Failed to allocate sp port_id=%d" , port_id);return -ENOMEM ;
@@ -352,7 +352,7 @@ skeleton_eventdev_init(struct rte_eventdev *eventdev) pci_dev->addr.devid, pci_dev->addr.function);PMD_DRV_LOG (INFO ,"dev_id=%d socket_id=%d (%x:%x)" , - eventdev->data->dev_id, eventdev->data->socket_id, + eventdev->data->dev_id, eventdev->data->numa_id, skel->vendor_id, skel->device_id); fail:
drivers/event/sw/sw_evdev.c +4 -4
@@ -178,7 +178,7 @@ sw_port_setup(struct rte_eventdev *dev, uint8_t port_id,rte_event_ring_free (existing_ring); p->rx_worker_ring =rte_event_ring_create (buf,MAX_SW_PROD_Q_DEPTH , - dev->data->socket_id, + dev->data->numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ |RING_F_EXACT_SZ );if (p->rx_worker_ring ==NULL ) { SW_LOG_ERR("Error creating RX worker ring for port %d",
@@ -197,7 +197,7 @@ sw_port_setup(struct rte_eventdev *dev, uint8_t port_id,rte_event_ring_free (existing_ring); p->cq_worker_ring =rte_event_ring_create (buf, conf->dequeue_depth, - dev->data->socket_id, + dev->data->numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ |RING_F_EXACT_SZ );if (p->cq_worker_ring ==NULL ) {rte_event_ring_free (p->rx_worker_ring);
@@ -237,7 +237,7 @@ qid_init(struct sw_evdev *sw, unsigned int idx, int type, const struct rte_event_queue_conf *queue_conf) {unsigned int i; -int socket_id = sw->data->socket_id; +int socket_id = sw->data->numa_id;struct sw_qid *qid = &sw->qids[idx];/* Initialize the FID structures to no pinning (-1), and zero packets */
@@ -537,7 +537,7 @@ sw_dev_configure(const struct rte_eventdev *dev)sizeof (struct sw_queue_chunk ) * num_chunks,0 , - sw->data->socket_id); + sw->data->numa_id);if (!sw->chunks)return -ENOMEM ;
drivers/event/sw/sw_evdev_xstats.c +1 -1
@@ -262,7 +262,7 @@ sw_xstats_init(struct sw_evdev *sw)unsigned int i, port, qid, iq, bkt, stat =0 ; sw->xstats =rte_zmalloc_socket (NULL ,sizeof (sw->xstats[0 ]) * count,0 , - sw->data->socket_id); + sw->data->numa_id);if (sw->xstats ==NULL )return -ENOMEM ;
lib/eventdev/event_timer_adapter_pmd.h +2 -2
@@ -87,8 +87,8 @@ struct __rte_cache_aligned rte_event_timer_adapter_data {/**< Event timer adapter ID */ uint8_t event_dev_id;/**< Event device ID */ -uint32_t socket_id; -/**< Socket ID where memory is allocated */ +uint32_t numa_id; +/**< NUMA node ID where memory is allocated */ uint8_t event_port_id;/**< Optional: event port ID used when the inbuilt port is absent */ const struct rte_memzone *mz;
lib/eventdev/event_vector_adapter_pmd.h +2 -2
@@ -56,8 +56,8 @@ struct __rte_cache_aligned rte_event_vector_adapter_data {/**< Event vector adapter ID */ uint8_t event_dev_id;/**< Event device ID */ -uint32_t socket_id; -/**< Socket ID where memory is allocated */ +uint32_t numa_id; +/**< NUMA node ID where memory is allocated */ uint8_t event_port_id;/**< Optional: event port ID used when the inbuilt port is absent */ const struct rte_memzone *mz;
lib/eventdev/eventdev_pmd.h +5 -5
@@ -110,8 +110,8 @@ struct rte_eventdev_global {* different processes in a multi-process configuration. */ struct __rte_cache_aligned rte_eventdev_data { -int socket_id; -/**< Socket ID where memory is allocated */ +int numa_id; +/**< NUMA node ID where memory is allocated */ uint8_t dev_id;/**< Device ID for this instance */ uint8_t nb_queues;
@@ -1744,14 +1744,14 @@ struct eventdev_ops {* * @param name * Unique identifier name for each device -* @param socket_id -* Socket to allocate resources on. +* @param numa_id +* NUMA node to allocate resources on. * @return * - Slot in the rte_dev_devices array for a new device; */ __rte_internal struct rte_eventdev * -rte_event_pmd_allocate (const char *name,int socket_id); +rte_event_pmd_allocate (const char *name,int numa_id);/** * Release the specified eventdev device.
lib/eventdev/eventdev_pmd_pci.h +2 -2
@@ -57,11 +57,11 @@ rte_event_pmd_pci_probe_named(struct rte_pci_driver *pci_drv,if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { eventdev->data->dev_private = -rte_zmalloc_socket ( +rte_zmalloc_numa ("eventdev private structure" , private_data_size,RTE_CACHE_LINE_SIZE , -rte_socket_id ()); +rte_numa_id ());if (eventdev->data->dev_private ==NULL ) rte_panic("Cannot allocate memzone for private "
lib/eventdev/eventdev_pmd_vdev.h +6 -6
@@ -35,8 +35,8 @@ extern "C" {* PMD type name * @param dev_private_size * Size of event PMDs private data -* @param socket_id -* Socket to allocate resources on. +* @param numa_id +* NUMA node to allocate resources on. * * @return * - Eventdev pointer if device is successfully created.
@@ -45,23 +45,23 @@ extern "C" {__rte_internal static inline struct rte_eventdev *rte_event_pmd_vdev_init (const char *name,size_t dev_private_size, -int socket_id,struct rte_vdev_device *vdev) +int numa_id,struct rte_vdev_device *vdev) {struct rte_eventdev *eventdev;/* Allocate device structure */ - eventdev =rte_event_pmd_allocate (name, socket_id); + eventdev =rte_event_pmd_allocate (name, numa_id);if (eventdev ==NULL )return NULL ;/* Allocate private device structure */ if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { eventdev->data->dev_private = -rte_zmalloc_socket ("eventdev device private" , +rte_zmalloc_numa ("eventdev device private" , dev_private_size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (eventdev->data->dev_private ==NULL ) rte_panic("Cannot allocate memzone for private device"
lib/eventdev/eventdev_trace.h +7 -7
@@ -388,11 +388,11 @@ RTE_TRACE_POINT( )RTE_TRACE_POINT ( - rte_eventdev_trace_socket_id, - RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *dev, int socket_id), + rte_eventdev_trace_numa_id, + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *dev, int numa_id), rte_trace_point_emit_u8(dev_id);rte_trace_point_emit_ptr (dev); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id); ) RTE_TRACE_POINT(
@@ -569,10 +569,10 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_eventdev_trace_ring_create, RTE_TRACE_POINT_ARGS(const char *name, unsigned int count, - int socket_id, unsigned int flags), + int numa_id, unsigned int flags), rte_trace_point_emit_string(name);rte_trace_point_emit_u32 (count); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_u32 (flags); )
@@ -633,11 +633,11 @@ RTE_TRACE_POINT(RTE_TRACE_POINT ( rte_eventdev_trace_vector_pool_create, - RTE_TRACE_POINT_ARGS(const void *mp, const char *name, int socket_id, + RTE_TRACE_POINT_ARGS(const void *mp, const char *name, int numa_id, uint32_t size, uint32_t cache_size, uint32_t elt_size), rte_trace_point_emit_ptr(mp);rte_trace_point_emit_string (name); -rte_trace_point_emit_int (socket_id); +rte_trace_point_emit_int (numa_id);rte_trace_point_emit_u32 (size);rte_trace_point_emit_u32 (cache_size);rte_trace_point_emit_u32 (elt_size);
lib/eventdev/eventdev_trace_points.c +2 -2
@@ -176,8 +176,8 @@ RTE_TRACE_POINT_REGISTER(rte_eventdev_trace_info_get,RTE_TRACE_POINT_REGISTER (rte_eventdev_trace_service_id_get, lib.eventdev.service_id_get) -RTE_TRACE_POINT_REGISTER (rte_eventdev_trace_socket_id, - lib.eventdev.socket.id) +RTE_TRACE_POINT_REGISTER (rte_eventdev_trace_numa_id, + lib.eventdev.numa_id)RTE_TRACE_POINT_REGISTER (rte_eventdev_trace_stop_flush_callback_register, lib.eventdev.stop.flush.callback.register)
lib/eventdev/rte_event_crypto_adapter.c +15 -15
@@ -91,8 +91,8 @@ struct __rte_cache_aligned event_crypto_adapter {uint8_t service_inited;/* Memory allocation name */ char mem_name[CRYPTO_ADAPTER_MEM_NAME_LEN ]; -/* Socket identifier cached from eventdev */ -int socket_id; +/* NUMA node identifier cached from eventdev */ +int numa_id;/* Per adapter EAL service */ uint32_t service_id;/* No. of queue pairs configured */
@@ -180,7 +180,7 @@ eca_init(void) mz =rte_memzone_lookup (ECA_ADAPTER_ARRAY );if (mz ==NULL ) { mz =rte_memzone_reserve_aligned (ECA_ADAPTER_ARRAY , sz, -rte_socket_id (),0 , +rte_numa_id (),0 ,RTE_CACHE_LINE_SIZE );if (mz ==NULL ) { RTE_EDEV_LOG_ERR("failed to reserve memzone err = %"
@@ -372,7 +372,7 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, {struct event_crypto_adapter *adapter;char mem_name[CRYPTO_ADAPTER_NAME_LEN ]; -int socket_id; +int numa_id;uint8_t i;int ret;
@@ -393,12 +393,12 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id,return -EEXIST ; } - socket_id =rte_event_dev_socket_id (dev_id); + numa_id =rte_event_dev_numa_id (dev_id);snprintf (mem_name,CRYPTO_ADAPTER_MEM_NAME_LEN ,"rte_event_crypto_adapter_%d" , id); - adapter =rte_zmalloc_socket (mem_name,sizeof (*adapter), -RTE_CACHE_LINE_SIZE , socket_id); + adapter =rte_zmalloc_numa (mem_name,sizeof (*adapter), +RTE_CACHE_LINE_SIZE , numa_id);if (adapter ==NULL ) {RTE_EDEV_LOG_ERR ("Failed to get mem for event crypto adapter!" );return -ENOMEM ;
@@ -413,15 +413,15 @@ rte_event_crypto_adapter_create_ext(uint8_t id, uint8_t dev_id, } adapter->eventdev_id = dev_id; - adapter->socket_id = socket_id; + adapter->numa_id = numa_id; adapter->conf_cb = conf_cb; adapter->conf_arg = conf_arg; adapter->mode = mode;strcpy (adapter->mem_name, mem_name); - adapter->cdevs =rte_zmalloc_socket (adapter->mem_name, + adapter->cdevs =rte_zmalloc_numa (adapter->mem_name,rte_cryptodev_count () *sizeof (struct crypto_device_info ),0 , - socket_id); + numa_id);if (adapter->cdevs ==NULL ) {RTE_EDEV_LOG_ERR ("Failed to get mem for crypto devices" );eca_circular_buffer_free (&adapter->ebuf);
@@ -920,7 +920,7 @@ eca_init_service(struct event_crypto_adapter *adapter, uint8_t id)memset (&service,0 ,sizeof (service));snprintf (service.name,CRYPTO_ADAPTER_NAME_LEN ,"rte_event_crypto_adapter_%d" , id); - service.socket_id = adapter->socket_id; + service.socket_id = adapter->numa_id; service.callback = eca_service_func; service.callback_userdata = adapter;/* Service function handles locking for queue add/del updates */
@@ -1011,10 +1011,10 @@ eca_add_queue_pair(struct event_crypto_adapter *adapter, uint8_t cdev_id,if (dev_info->qpairs ==NULL ) { dev_info->qpairs = -rte_zmalloc_socket (adapter->mem_name, +rte_zmalloc_numa (adapter->mem_name, dev_info->dev->data->nb_queue_pairs *sizeof (struct crypto_queue_pair_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->qpairs ==NULL )return -ENOMEM ;
@@ -1141,10 +1141,10 @@ rte_event_crypto_adapter_queue_pair_add(uint8_t id,return -ENOTSUP ;if (dev_info->qpairs ==NULL ) { dev_info->qpairs = -rte_zmalloc_socket (adapter->mem_name, +rte_zmalloc_numa (adapter->mem_name, dev_info->dev->data->nb_queue_pairs *sizeof (struct crypto_queue_pair_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->qpairs ==NULL )return -ENOMEM ; }
lib/eventdev/rte_event_dma_adapter.c +19 -19
@@ -97,8 +97,8 @@ struct __rte_cache_aligned event_dma_adapter {/* Memory allocation name */ char mem_name[DMA_ADAPTER_NAME_LEN ]; -/* Socket identifier cached from eventdev */ -int socket_id; +/* NUMA node identifier cached from eventdev */ +int numa_id;/* Lock to serialize config updates with service function */ rte_spinlock_t lock;
@@ -173,7 +173,7 @@ edma_array_init(void) sz =sizeof (struct event_dma_adapter *) *RTE_EVENT_DMA_ADAPTER_MAX_INSTANCE ; sz =RTE_ALIGN (sz,RTE_CACHE_LINE_SIZE ); - mz =rte_memzone_reserve_aligned (DMA_ADAPTER_ARRAY , sz,rte_socket_id (),0 , + mz =rte_memzone_reserve_aligned (DMA_ADAPTER_ARRAY , sz,rte_numa_id (),0 ,RTE_CACHE_LINE_SIZE );if (mz ==NULL ) { RTE_EDEV_LOG_ERR("Failed to reserve memzone : %s, err = %d",
@@ -352,7 +352,7 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id,char name[DMA_ADAPTER_NAME_LEN ];struct rte_dma_info info;uint16_t num_dma_dev; -int socket_id; +int numa_id;uint8_t i;int ret;
@@ -374,10 +374,10 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id,return -EEXIST ; } - socket_id =rte_event_dev_socket_id (evdev_id); + numa_id =rte_event_dev_numa_id (evdev_id);snprintf (name,DMA_ADAPTER_NAME_LEN ,"rte_event_dma_adapter_%d" , id); - adapter =rte_zmalloc_socket (name,sizeof (struct event_dma_adapter ),RTE_CACHE_LINE_SIZE , - socket_id); + adapter =rte_zmalloc_numa (name,sizeof (struct event_dma_adapter ),RTE_CACHE_LINE_SIZE , + numa_id);if (adapter ==NULL ) {RTE_EDEV_LOG_ERR ("Failed to get mem for event ML adapter!" );return -ENOMEM ;
@@ -404,12 +404,12 @@ rte_event_dma_adapter_create_ext(uint8_t id, uint8_t evdev_id, adapter->eventdev_id = evdev_id; adapter->mode = mode;rte_strscpy (adapter->mem_name, name,DMA_ADAPTER_NAME_LEN ); - adapter->socket_id = socket_id; + adapter->numa_id = numa_id; adapter->conf_cb = conf_cb; adapter->conf_arg = conf_arg; - adapter->dma_devs =rte_zmalloc_socket (adapter->mem_name, + adapter->dma_devs =rte_zmalloc_numa (adapter->mem_name, num_dma_dev *sizeof (struct dma_device_info ),0 , - socket_id); + numa_id);if (adapter->dma_devs ==NULL ) {RTE_EDEV_LOG_ERR ("Failed to get memory for DMA devices" );edma_circular_buffer_free (&adapter->ebuf);
@@ -867,7 +867,7 @@ edma_init_service(struct event_dma_adapter *adapter, uint8_t id)memset (&service,0 ,sizeof (service));snprintf (service.name,DMA_ADAPTER_NAME_LEN ,"rte_event_dma_adapter_%d" , id); - service.socket_id = adapter->socket_id; + service.socket_id = adapter->numa_id; service.callback = edma_service_func; service.callback_userdata = adapter;
@@ -946,15 +946,15 @@ edma_add_vchan(struct event_dma_adapter *adapter, int16_t dma_dev_id, uint16_t vif (dev_info->vchanq ==NULL ) { nb_vchans = dev_info->num_dma_dev_vchan; - dev_info->vchanq =rte_zmalloc_socket (adapter->mem_name, + dev_info->vchanq =rte_zmalloc_numa (adapter->mem_name, nb_vchans *sizeof (struct dma_vchan_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->vchanq ==NULL )return -ENOMEM ; - dev_info->tqmap =rte_zmalloc_socket (adapter->mem_name, + dev_info->tqmap =rte_zmalloc_numa (adapter->mem_name, nb_vchans *sizeof (struct dma_vchan_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->tqmap ==NULL )return -ENOMEM ;
@@ -1039,10 +1039,10 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan,if (dev->dev_ops->dma_adapter_vchan_add ==NULL )return -ENOTSUP ;if (dev_info->vchanq ==NULL ) { - dev_info->vchanq =rte_zmalloc_socket (adapter->mem_name, + dev_info->vchanq =rte_zmalloc_numa (adapter->mem_name, dev_info->num_dma_dev_vchan *sizeof (struct dma_vchan_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->vchanq ==NULL ) {RTE_EDEV_LOG_ERR ("Queue pair add not supported" );return -ENOMEM ;
@@ -1050,10 +1050,10 @@ rte_event_dma_adapter_vchan_add(uint8_t id, int16_t dma_dev_id, uint16_t vchan, }if (dev_info->tqmap ==NULL ) { - dev_info->tqmap =rte_zmalloc_socket (adapter->mem_name, + dev_info->tqmap =rte_zmalloc_numa (adapter->mem_name, dev_info->num_dma_dev_vchan *sizeof (struct dma_vchan_info ), -0 , adapter->socket_id); +0 , adapter->numa_id);if (dev_info->tqmap ==NULL ) {RTE_EDEV_LOG_ERR ("tq pair add not supported" );return -ENOMEM ;
lib/eventdev/rte_event_eth_rx_adapter.c +34 -34
205 lines not on this page · raw message
lib/eventdev/rte_event_eth_tx_adapter.c +15 -15
@@ -139,8 +139,8 @@ struct __rte_cache_aligned txa_service_data {rte_event_eth_tx_adapter_conf_cb conf_cb;/* Configuration callback argument */ void *conf_arg; -/* socket id */ -int socket_id; +/* NUMA node id */ +int numa_id;/* Per adapter EAL service */ int64_t service_id;/* Memory allocation name */
@@ -197,7 +197,7 @@ txa_memzone_array_get(const char *name, unsigned int elt_size, int nb_elems) mz =rte_memzone_lookup (name);if (mz ==NULL ) { - mz =rte_memzone_reserve_aligned (name, sz,rte_socket_id (),0 , + mz =rte_memzone_reserve_aligned (name, sz,rte_numa_id (),0 ,RTE_CACHE_LINE_SIZE );if (mz ==NULL ) { RTE_EDEV_LOG_ERR("failed to reserve memzone"
@@ -361,10 +361,10 @@ txa_service_ethdev_alloc(struct txa_service_data *txa)if (txa->txa_ethdev && dev_count == txa->dev_count)return 0 ; - txa_ethdev =rte_zmalloc_socket (txa->mem_name, + txa_ethdev =rte_zmalloc_numa (txa->mem_name, dev_count *sizeof (*txa_ethdev),0 , - txa->socket_id); + txa->numa_id);if (txa_ethdev ==NULL ) {RTE_EDEV_LOG_ERR ("Failed to alloc txa::txa_ethdev " );return -ENOMEM ;
@@ -401,10 +401,10 @@ txa_service_queue_array_alloc(struct txa_service_data *txa,return 0 ; nb_queue = txa->txa_ethdev[port_id].dev->data->nb_tx_queues; - tqi =rte_zmalloc_socket (txa->mem_name, + tqi =rte_zmalloc_numa (txa->mem_name, nb_queue *sizeof (struct txa_service_queue_info ),0 , - txa->socket_id); + txa->numa_id);if (tqi ==NULL )return -ENOMEM ; txa->txa_ethdev[port_id].queues = tqi;
@@ -456,7 +456,7 @@ txa_service_register(struct txa_service_data *txa)memset (&service,0 ,sizeof (service));snprintf (service.name,TXA_SERVICE_NAME_LEN ,"txa_%d" , txa->id); - service.socket_id = txa->socket_id; + service.socket_id = txa->numa_id; service.callback = txa_service_func; service.callback_userdata = txa; service.capabilities =RTE_SERVICE_CAP_MT_SAFE ;
@@ -488,10 +488,10 @@ txa_service_tx_buf_alloc(struct txa_service_data *txa,uint16_t port_id; port_id = dev->data->port_id; - tb =rte_zmalloc_socket (txa->mem_name, + tb =rte_zmalloc_numa (txa->mem_name,RTE_ETH_TX_BUFFER_SIZE (TXA_BATCH_SIZE ),0 , -rte_eth_dev_socket_id (port_id)); +rte_eth_dev_numa_id (port_id));if (tb ==NULL )RTE_EDEV_LOG_ERR ("Failed to allocate memory for tx buffer" );return tb;
@@ -740,14 +740,14 @@ txa_service_adapter_create_ext(uint8_t id, struct rte_eventdev *dev, void *conf_arg) {struct txa_service_data *txa; -int socket_id; +int numa_id;char mem_name[TXA_SERVICE_NAME_LEN ];int ret;if (conf_cb ==NULL )return -EINVAL ; - socket_id = dev->data->socket_id; + numa_id = dev->data->numa_id;snprintf (mem_name,sizeof (mem_name),"rte_event_eth_txa_%d" , id);
@@ -756,9 +756,9 @@ txa_service_adapter_create_ext(uint8_t id, struct rte_eventdev *dev,if (ret !=0 )return ret; - txa =rte_zmalloc_socket (mem_name, + txa =rte_zmalloc_numa (mem_name,sizeof (*txa), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (txa ==NULL ) {RTE_EDEV_LOG_ERR ("failed to get mem for tx adapter" );return -ENOMEM ;
@@ -766,7 +766,7 @@ txa_service_adapter_create_ext(uint8_t id, struct rte_eventdev *dev, txa->id = id; txa->eventdev_id = dev->data->dev_id; - txa->socket_id = socket_id; + txa->numa_id = numa_id;strlcpy (txa->mem_name, mem_name,sizeof (txa->mem_name)); txa->conf_cb = conf_cb; txa->conf_arg = conf_arg;
lib/eventdev/rte_event_ring.c +3 -3
@@ -26,14 +26,14 @@ rte_event_ring_init(struct rte_event_ring *r, const char *name,/* create the ring */ RTE_EXPORT_SYMBOL (rte_event_ring_create) struct rte_event_ring * -rte_event_ring_create (const char *name,unsigned int count,int socket_id, +rte_event_ring_create (const char *name,unsigned int count,int numa_id,unsigned int flags) { -rte_eventdev_trace_ring_create (name, count, socket_id, flags); +rte_eventdev_trace_ring_create (name, count, numa_id, flags);return (struct rte_event_ring *)rte_ring_create_elem (name,sizeof (struct rte_event ), - count, socket_id, flags); + count, numa_id, flags); }
lib/eventdev/rte_event_ring.h +4 -4
@@ -271,9 +271,9 @@ rte_event_ring_free(struct rte_event_ring *r);* usable space in the ring will be ``count - 1`` entries. If the flag * ``RING_F_EXACT_SZ`` is set, the this can be any value up to the ring size * limit - 1, and the usable space will be exactly that requested. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * An OR of the following:
@@ -298,7 +298,7 @@ rte_event_ring_free(struct rte_event_ring *r);* - ENOMEM - no appropriate memory area found in which to create memzone */ struct rte_event_ring * -rte_event_ring_create (const char *name,unsigned int count,int socket_id,unsigned int flags) +rte_event_ring_create (const char *name,unsigned int count,int numa_id,unsigned int flags) __rte_malloc__rte_dealloc (rte_event_ring_free,1 );/**
lib/eventdev/rte_event_timer_adapter.c +8 -8
@@ -201,7 +201,7 @@ rte_event_timer_adapter_create_ext( } mz =rte_memzone_reserve (mz_name,sizeof (struct rte_event_timer_adapter_data ), - conf->socket_id,0 ); + conf->numa_id,0 );if (mz ==NULL )/* rte_errno set by rte_memzone_reserve */ return NULL ;
@@ -212,7 +212,7 @@ rte_event_timer_adapter_create_ext( adapter->data->mz = mz; adapter->data->event_dev_id = conf->event_dev_id; adapter->data->id = adapter_id; - adapter->data->socket_id = conf->socket_id; + adapter->data->numa_id = conf->numa_id; adapter->data->conf = *conf;/* copy conf structure */ /* Query eventdev PMD for timer adapter capabilities and ops */
@@ -931,8 +931,8 @@ swtim_init(struct rte_event_timer_adapter *adapter)char swtim_name[SWTIM_NAMESIZE ];snprintf (swtim_name,SWTIM_NAMESIZE ,"swtim_%" PRIu8, adapter->data->id); - sw =rte_zmalloc_socket (swtim_name,sizeof (*sw),RTE_CACHE_LINE_SIZE , - adapter->data->socket_id); + sw =rte_zmalloc_numa (swtim_name,sizeof (*sw),RTE_CACHE_LINE_SIZE , + adapter->data->numa_id);if (sw ==NULL ) {EVTIM_LOG_ERR ("failed to allocate space for private data" ); rte_errno =ENOMEM ;
@@ -958,7 +958,7 @@ swtim_init(struct rte_event_timer_adapter *adapter) flags =0 ;/* pool is multi-producer, multi-consumer */ sw->tim_pool =rte_mempool_create (pool_name, pool_size,sizeof (struct rte_timer ), cache_size,0 ,NULL ,NULL , -NULL ,NULL , adapter->data->socket_id, flags); +NULL ,NULL , adapter->data->numa_id, flags);if (sw->tim_pool ==NULL ) {EVTIM_LOG_ERR ("failed to create timer object mempool" ); rte_errno =ENOMEM ;
@@ -995,7 +995,7 @@ swtim_init(struct rte_event_timer_adapter *adapter)memset (&service,0 ,sizeof (service));snprintf (service.name,RTE_SERVICE_NAME_MAX ,"swtim_svc_%" PRIu8, adapter->data->id); - service.socket_id = adapter->data->socket_id; + service.socket_id = adapter->data->numa_id; service.callback = swtim_service_func; service.callback_userdata = adapter; service.capabilities &= ~(RTE_SERVICE_CAP_MT_SAFE );
@@ -1429,8 +1429,8 @@ handle_ta_info(const char *cmd __rte_unused, const char *params,rte_tel_data_add_dict_uint (d,"max_tmo_ns" , adapter_info.max_tmo_ns);rte_tel_data_add_dict_uint (d,"event_dev_id" , adapter_info.conf.event_dev_id); -rte_tel_data_add_dict_uint (d,"socket_id" , - adapter_info.conf.socket_id); +rte_tel_data_add_dict_uint (d,"numa_id" , + adapter_info.conf.numa_id);rte_tel_data_add_dict_uint (d,"clk_src" , adapter_info.conf.clk_src);rte_tel_data_add_dict_uint (d,"timer_tick_ns" , adapter_info.conf.timer_tick_ns);
lib/eventdev/rte_event_timer_adapter.h +9 -2
@@ -165,8 +165,15 @@ struct rte_event_timer_adapter_conf {/**< Event device identifier */ uint16_t timer_adapter_id;/**< Event timer adapter identifier */ -uint32_t socket_id; -/**< Identifier of socket from which to allocate memory for adapter */ +union { +/** NUMA node ID from which to allocate memory for adapter */ +uint32_t numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + uint32_t socket_id; + };enum rte_event_timer_adapter_clk_src clk_src;/**< Clock source for timer adapter */ uint64_t timer_tick_ns;
lib/eventdev/rte_event_vector_adapter.c +6 -6
@@ -253,7 +253,7 @@ rte_event_vector_adapter_create_ext(const struct rte_event_vector_adapter_conf * goto error; } mz =rte_memzone_reserve (mz_name,sizeof (struct rte_event_vector_adapter_data ), - conf->socket_id,0 ); + conf->numa_id,0 );if (mz ==NULL ) { adapter->ops =NULL ;EVVEC_LOG_DBG ("failed to reserve memzone for vector adapter" );
@@ -267,7 +267,7 @@ rte_event_vector_adapter_create_ext(const struct rte_event_vector_adapter_conf * adapter->data->mz = mz; adapter->data->event_dev_id = conf->event_dev_id; adapter->data->id = adapter->adapter_id; - adapter->data->socket_id = conf->socket_id; + adapter->data->numa_id = conf->numa_id; adapter->data->conf = *conf;if (!(caps &RTE_EVENT_VECTOR_ADAPTER_CAP_INTERNAL_PORT )) {
@@ -641,7 +641,7 @@ sw_vector_adapter_service_init(struct sw_vector_adapter_data *sw)if (mz ==NULL ) { mz =rte_memzone_reserve (SW_VECTOR_ADAPTER_SERVICE_FMT ,sizeof (struct sw_vector_adapter_service_data ), - sw->adapter->data->socket_id,0 ); + sw->adapter->data->numa_id,0 );if (mz ==NULL ) {EVVEC_LOG_DBG ("failed to reserve memzone for service" );return -ENOMEM ;
@@ -650,7 +650,7 @@ sw_vector_adapter_service_init(struct sw_vector_adapter_data *sw)memset (service_data,0 ,sizeof (*service_data)); ring =rte_ring_create (SW_VECTOR_ADAPTER_SERVICE_FMT ,SERVICE_RING_SZ , - sw->adapter->data->socket_id,0 ); + sw->adapter->data->numa_id,0 );if (ring ==NULL ) {EVVEC_LOG_ERR ("failed to create ring for service" );rte_memzone_free (mz);
@@ -662,7 +662,7 @@ sw_vector_adapter_service_init(struct sw_vector_adapter_data *sw)snprintf (service.name,RTE_SERVICE_NAME_MAX ,"%s" ,SW_VECTOR_ADAPTER_SERVICE_FMT ); service.callback = sw_vector_adapter_service_func; service.callback_userdata = service_data; - service.socket_id = sw->adapter->data->socket_id; + service.socket_id = sw->adapter->data->numa_id; ret =rte_service_component_register (&service, &service_data->service_id);if (ret <0 ) {
@@ -696,7 +696,7 @@ sw_vector_adapter_create(struct rte_event_vector_adapter *adapter)struct rte_event ev;snprintf (name,SW_VECTOR_ADAPTER_NAME ,"sw_vector_%" PRIx32, adapter->data->id); - sw =rte_zmalloc_socket (name,sizeof (*sw),RTE_CACHE_LINE_SIZE , adapter->data->socket_id); + sw =rte_zmalloc_numa (name,sizeof (*sw),RTE_CACHE_LINE_SIZE , adapter->data->numa_id);if (sw ==NULL ) {EVVEC_LOG_ERR ("failed to allocate space for private data" ); rte_errno =ENOMEM ;
lib/eventdev/rte_event_vector_adapter.h +9 -2
@@ -136,8 +136,15 @@ extern "C" {struct rte_event_vector_adapter_conf {uint8_t event_dev_id;/**< Event device identifier */ -uint32_t socket_id; -/**< Identifier of socket from which to allocate memory for adapter */ +union { +/** NUMA node ID from which to allocate memory for adapter */ +uint32_t numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + uint32_t socket_id; + };struct rte_event ev;/**< * The values from the following event fields will be used when
lib/eventdev/rte_eventdev.c +19 -12
@@ -80,18 +80,25 @@ rte_event_dev_get_dev_id(const char *name)return -ENODEV ; } -RTE_EXPORT_SYMBOL (rte_event_dev_socket_id) +RTE_EXPORT_SYMBOL (rte_event_dev_numa_id) int -rte_event_dev_socket_id (uint8_t dev_id) +rte_event_dev_numa_id (uint8_t dev_id) {struct rte_eventdev *dev;RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET (dev_id, -EINVAL ); dev = &rte_eventdevs[dev_id]; -rte_eventdev_trace_socket_id (dev_id, dev, dev->data->socket_id); +rte_eventdev_trace_numa_id (dev_id, dev, dev->data->numa_id); + +return dev->data->numa_id; +} -return dev->data->socket_id; +RTE_EXPORT_SYMBOL (rte_event_dev_socket_id) +int +rte_event_dev_socket_id (uint8_t dev_id) +{ +return rte_event_dev_numa_id (dev_id); }RTE_EXPORT_SYMBOL (rte_event_dev_info_get)
@@ -1481,7 +1488,7 @@ RTE_EXPORT_SYMBOL(rte_event_vector_pool_create)struct rte_mempool *rte_event_vector_pool_create (const char *name,unsigned int n,unsigned int cache_size,uint16_t nb_elem, -int socket_id) +int numa_id) {const char *mp_ops_name;struct rte_mempool *mp;
@@ -1497,7 +1504,7 @@ rte_event_vector_pool_create(const char *name, unsigned int n, elt_sz =sizeof (struct rte_event_vector ) + (nb_elem *sizeof (uintptr_t )); - mp =rte_mempool_create_empty (name, n, elt_sz, cache_size,0 , socket_id, + mp =rte_mempool_create_empty (name, n, elt_sz, cache_size,0 , numa_id,0 );if (mp ==NULL )return NULL ;
@@ -1626,7 +1633,7 @@ rte_event_dev_close(uint8_t dev_id)static inline int eventdev_data_alloc (uint8_t dev_id,struct rte_eventdev_data **data, -int socket_id) +int numa_id) {char mz_name[RTE_EVENTDEV_NAME_MAX_LEN ];const struct rte_memzone *mz;
@@ -1640,7 +1647,7 @@ eventdev_data_alloc(uint8_t dev_id, struct rte_eventdev_data **data,if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { mz =rte_memzone_reserve (mz_name,sizeof (struct rte_eventdev_data ), - socket_id,0 ); + numa_id,0 ); }else mz =rte_memzone_lookup (mz_name);
@@ -1674,7 +1681,7 @@ eventdev_find_free_device_index(void)RTE_EXPORT_INTERNAL_SYMBOL (rte_event_pmd_allocate) struct rte_eventdev * -rte_event_pmd_allocate (const char *name,int socket_id) +rte_event_pmd_allocate (const char *name,int numa_id) {struct rte_eventdev *eventdev;uint8_t dev_id;
@@ -1697,7 +1704,7 @@ rte_event_pmd_allocate(const char *name, int socket_id)struct rte_eventdev_data *eventdev_data =NULL ;int retval = -eventdev_data_alloc (dev_id, &eventdev_data, socket_id); +eventdev_data_alloc (dev_id, &eventdev_data, numa_id);if (retval <0 || eventdev_data ==NULL )return NULL ;
@@ -1710,7 +1717,7 @@ rte_event_pmd_allocate(const char *name, int socket_id) RTE_EVENTDEV_NAME_MAX_LEN); eventdev->data->dev_id = dev_id; - eventdev->data->socket_id = socket_id; + eventdev->data->numa_id = numa_id; eventdev->data->dev_started =0 ; }
@@ -1838,7 +1845,7 @@ handle_dev_info(const char *cmd __rte_unused,rte_tel_data_add_dict_string (d,"dev_driver" , dev->device->driver->name);rte_tel_data_add_dict_string (d,"state" , dev->data->dev_started ?"started" :"stopped" ); -rte_tel_data_add_dict_int (d,"socket_id" , dev->data->socket_id); +rte_tel_data_add_dict_int (d,"numa_id" , dev->data->numa_id);rte_tel_data_add_dict_int (d,"nb_queues" , dev->data->nb_queues);rte_tel_data_add_dict_int (d,"nb_ports" , dev->data->nb_ports); rte_tel_data_add_dict_uint_hex(d, "capabilities", dev->data->event_dev_cap,
lib/eventdev/rte_eventdev.h +20 -4
@@ -580,9 +580,25 @@ rte_event_dev_count(void);int rte_event_dev_get_dev_id (const char *name); +/** +* Return the NUMA node to which a device is connected. +* +* @param dev_id +* The identifier of the device. +* @return +* The NUMA node ID to which the device is connected or +* a default of zero if the NUMA node could not be determined. +* -EINVAL on error, where the given dev_id value does not +* correspond to any event device. +*/ +int +rte_event_dev_numa_id (uint8_t dev_id); +/** * Return the NUMA socket to which a device is connected. * +* This is a legacy alias of rte_event_dev_numa_id(). +* * @param dev_id * The identifier of the device. * @return
@@ -2554,9 +2570,9 @@ int rte_event_dev_selftest(uint8_t dev_id);* details. * @param nb_elem * The number of elements that a single event vector should be able to hold. -* @param socket_id -* The socket identifier where the memory should be allocated. The -* value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the +* @param numa_id +* The NUMA node ID where the memory should be allocated. The +* value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for the * reserved zone * * @return
@@ -2573,7 +2589,7 @@ int rte_event_dev_selftest(uint8_t dev_id);struct rte_mempool *rte_event_vector_pool_create (const char *name,unsigned int n,unsigned int cache_size,uint16_t nb_elem, -int socket_id); +int numa_id);#include <rte_eventdev_core.h>
Signature · 1 line
2.55.0
PATCH 13/227 acl: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id field of rte_acl_param (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename socket_id parameters, the internal context field, memory hook callback parameter, log messages and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- app/test-acl/main.c | 6 +++--- lib/acl/acl.h | 4 ++-- lib/acl/acl_gen.c | 10 +++++----- lib/acl/rte_acl.c | 14 +++++++------- lib/acl/rte_acl.h | 14 +++++++++++--- 5 files changed, 28 insertions(+), 20 deletions(-)
app/test-acl/main.c +3 -3
@@ -138,7 +138,7 @@ static struct {static struct rte_acl_param prm = { .name =APP_NAME , - .socket_id =SOCKET_ID_ANY , + .numa_id =RTE_NUMA_ID_ANY , };/*
@@ -546,8 +546,8 @@ tracef_init(void)struct ipv6_5tuple *w; sz = config.nb_traces * (config.ipv6 ?sizeof (*w) :sizeof (*v)); - config.traces =rte_zmalloc_socket (name, sz,RTE_CACHE_LINE_SIZE , -SOCKET_ID_ANY ); + config.traces =rte_zmalloc_numa (name, sz,RTE_CACHE_LINE_SIZE , +RTE_NUMA_ID_ANY );if (config.traces ==NULL ) rte_exit(EXIT_FAILURE, "Cannot allocate %zu bytes for " "requested %u number of trace records\n",
lib/acl/acl.h +2 -2
@@ -166,8 +166,8 @@ struct rte_acl_bld_trie {struct rte_acl_ctx {char name[RTE_ACL_NAMESIZE ];/** Name of the ACL context. */ -int32_t socket_id; -/** Socket ID to allocate memory from. */ +int32_t numa_id; +/** NUMA node ID to allocate memory from. */ enum rte_acl_classify_alg alg;uint32_t first_load_sz;void *rules;
lib/acl/acl_gen.c +5 -5
@@ -38,14 +38,14 @@ acl_gen_log_stats(const struct rte_acl_ctx *ctx, size_t max_size) { RTE_LOG(DEBUG, ACL, "Gen phase for ACL \"%s\":\n" - "runtime memory footprint on socket %d:\n" + "runtime memory footprint on NUMA node %d:\n" "single nodes/bytes used: %d/%zu\n" "quad nodes/vectors/bytes used: %d/%d/%zu\n" "DFA nodes/group64/bytes used: %d/%d/%zu\n" "match nodes/bytes used: %d/%zu\n" "total: %zu bytes\n" "max limit: %zu bytes\n", - ctx->name, ctx->socket_id, + ctx->name, ctx->numa_id, counts->single, counts->single * sizeof(uint64_t), counts->quad, counts->quad_vectors, (indices->quad_index - indices->dfa_index) * sizeof(uint64_t),
@@ -479,11 +479,11 @@ rte_acl_gen(struct rte_acl_ctx *ctx, struct rte_acl_trie *trie, } mem = ctx->mem_hook.zalloc (ctx->name, total_size, -RTE_CACHE_LINE_SIZE , ctx->socket_id, ctx->mem_hook.udata); +RTE_CACHE_LINE_SIZE , ctx->numa_id, ctx->mem_hook.udata);if (mem ==NULL ) {ACL_LOG (ERR , -"allocation of %zu bytes on socket %d for %s failed" , - total_size, ctx->socket_id, ctx->name); +"allocation of %zu bytes on NUMA node %d for %s failed" , + total_size, ctx->numa_id, ctx->name);return -ENOMEM ; }
lib/acl/rte_acl.c +7 -7
@@ -299,10 +299,10 @@ acl_get_best_alg(void) }static void * -acl_mem_default_zalloc (char *name,size_t size,size_t align,int32_t socket_id,void *udata) +acl_mem_default_zalloc (char *name,size_t size,size_t align,int32_t numa_id,void *udata) {RTE_SET_USED (udata); -return rte_zmalloc_socket (name, size, align, socket_id); +return rte_zmalloc_numa (name, size, align, numa_id); } static void
@@ -458,12 +458,12 @@ rte_acl_create(const struct rte_acl_param *param) goto exit; } - ctx =rte_zmalloc_socket (name, sz,RTE_CACHE_LINE_SIZE , param->socket_id); + ctx =rte_zmalloc_numa (name, sz,RTE_CACHE_LINE_SIZE , param->numa_id);if (ctx ==NULL ) {ACL_LOG (ERR , -"allocation of %zu bytes on socket %d for %s failed" , - sz, param->socket_id, name); +"allocation of %zu bytes on NUMA node %d for %s failed" , + sz, param->numa_id, name);rte_free (te); goto exit; }
@@ -471,7 +471,7 @@ rte_acl_create(const struct rte_acl_param *param) ctx->rules = ctx +1 ; ctx->max_rules = param->max_rule_num; ctx->rule_sz = param->rule_size; - ctx->socket_id = param->socket_id; + ctx->numa_id = param->numa_id; ctx->alg =acl_get_best_alg (); ctx->mem_hook.zalloc = acl_mem_default_zalloc; ctx->mem_hook.free = acl_mem_default_free;
@@ -576,7 +576,7 @@ rte_acl_dump(const struct rte_acl_ctx *ctx)if (!ctx)return ;printf ("acl context <%s>@%p\n" , ctx->name, ctx); -printf (" socket_id=%" PRId32"\n" , ctx->socket_id); +printf (" numa_id=%" PRId32"\n" , ctx->numa_id);printf (" alg=%" PRId32"\n" , ctx->alg);printf (" first_load_sz=%" PRIu32"\n" , ctx->first_load_sz);printf (" max_rules=%" PRIu32"\n" , ctx->max_rules);
lib/acl/rte_acl.h +11 -3
@@ -128,7 +128,15 @@ RTE_ACL_RULE_DEF(rte_acl_rule,);*/ struct rte_acl_param {const char *name;/**< Name of the ACL context. */ -int socket_id;/**< Socket ID to allocate memory for. */ +union { +/** NUMA node ID to allocate memory for. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint32_t rule_size;/**< Size of each rule. */ uint32_t max_rule_num;/**< Maximum number of rules. */ };
@@ -141,7 +149,7 @@ struct rte_acl_ctx;*/ struct rte_acl_mem_hook {/** Allocate zero-initialized memory used during runtime. */ -void *(*zalloc)(char *name,size_t size,size_t align,int32_t socket_id,void *udata); +void *(*zalloc)(char *name,size_t size,size_t align,int32_t numa_id,void *udata);/** Free memory previously allocated by zalloc(). */ void (*free)(void *ptr,void *udata);
@@ -156,7 +164,7 @@ struct rte_acl_mem_hook {* Applications may use these hooks to allocate memory * from custom pools or pre-allocated buffers. * If no memory hook is provided, -* the ACL library uses rte_zmalloc_socket() internally. +* the ACL library uses rte_zmalloc_numa() internally. * * This function must be called **before** rte_acl_build(). * If the hook needs to be changed after a build,
Signature · 1 line
2.55.0
PATCH 14/227 ipsec: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id field of rte_ipsec_sad_conf (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename socket_id parameters and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa() and RTE_NUMA_ID_ANY.
--- app/test-sad/main.c | 2 +- app/test/test_ipsec_sad.c | 24 ++++++++++++------------ lib/ipsec/ipsec_sad.c | 6 +++--- lib/ipsec/rte_ipsec_sad.h | 11 +++++++++-- 4 files changed, 25 insertions(+), 18 deletions(-)
app/test-sad/main.c +1 -1
@@ -638,7 +638,7 @@ main(int argc, char **argv) config.fract_rnd_tuples =0 ; config.nb_tuples_rnd =0 ; } - conf.socket_id =-1 ; + conf.numa_id =-1 ; conf.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] = config.nb_rules_32 *5 /4 ; conf.max_sa[RTE_IPSEC_SAD_SPI_DIP ] = config.nb_rules_64 *5 /4 ; conf.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] = config.nb_rules_96 *5 /4 ;
app/test/test_ipsec_sad.c +12 -12
@@ -56,7 +56,7 @@ test_create_invalid(void) config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;/* name == NULL */
@@ -75,13 +75,13 @@ test_create_invalid(void) config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; -/* socket_id < -1 is invalid */ +/* numa_id < -1 is invalid */ config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; - config.socket_id =-2 ; + config.numa_id =-2 ; sad =rte_ipsec_sad_create (__func__, &config);RTE_TEST_ASSERT (sad ==NULL ,"Call succeeded with invalid parameters\n" ); - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ;return TEST_SUCCESS ; }
@@ -98,7 +98,7 @@ test_find_existing(void)struct rte_ipsec_sad *one, *two, *tmp;struct rte_ipsec_sad_conf config; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =0 ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =0 ;
@@ -136,7 +136,7 @@ test_multiple_create(void)struct rte_ipsec_sad *sad =NULL ;struct rte_ipsec_sad_conf config; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ;
@@ -167,7 +167,7 @@ __test_add_invalid(int ipv6, union rte_ipsec_sad_key *tuple) config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
@@ -240,7 +240,7 @@ __test_delete_invalid(int ipv6, union rte_ipsec_sad_key *tuple) config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
@@ -300,7 +300,7 @@ __test_lookup_invalid(int ipv6, union rte_ipsec_sad_key *tuple) config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
@@ -359,7 +359,7 @@ __test_lookup_basic(int ipv6, union rte_ipsec_sad_key *tuple, config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
@@ -437,7 +437,7 @@ __test_lookup_adv(int ipv6, union rte_ipsec_sad_key *tuple, config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
@@ -702,7 +702,7 @@ __test_lookup_order(int ipv6, union rte_ipsec_sad_key *tuple, config.max_sa[RTE_IPSEC_SAD_SPI_ONLY ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP ] =MAX_SA ; config.max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ] =MAX_SA ; - config.socket_id =SOCKET_ID_ANY ; + config.numa_id =RTE_NUMA_ID_ANY ; config.flags =0 ;if (ipv6) config.flags =RTE_IPSEC_SAD_FLAG_IPV6 ;
lib/ipsec/ipsec_sad.c +3 -3
@@ -290,9 +290,9 @@ rte_ipsec_sad_create(const char *name, const struct rte_ipsec_sad_conf *conf) conf->max_sa[RTE_IPSEC_SAD_SPI_DIP]) +RTE_MAX (MIN_HASH_ENTRIES , conf->max_sa[RTE_IPSEC_SAD_SPI_DIP_SIP ]); - sad =rte_zmalloc_socket (NULL ,sizeof (*sad) + + sad =rte_zmalloc_numa (NULL ,sizeof (*sad) + (sizeof (struct hash_cnt ) * sa_sum), -RTE_CACHE_LINE_SIZE , conf->socket_id); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (sad ==NULL ) { rte_errno =ENOMEM ;return NULL ;
@@ -302,7 +302,7 @@ rte_ipsec_sad_create(const char *name, const struct rte_ipsec_sad_conf *conf) hash_params.hash_func =DEFAULT_HASH_FUNC ; hash_params.hash_func_init_val =rte_rand (); sad->init_val = hash_params.hash_func_init_val; - hash_params.numa_id = conf->socket_id; + hash_params.numa_id = conf->numa_id; hash_params.name = hash_name;if (conf->flags &RTE_IPSEC_SAD_FLAG_RW_CONCURRENCY ) hash_params.extra_flag =RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY ;
lib/ipsec/rte_ipsec_sad.h +9 -2
@@ -56,8 +56,15 @@ union rte_ipsec_sad_key {/** IPsec SAD configuration structure */ struct rte_ipsec_sad_conf { -/** CPU socket ID where rte_ipsec_sad should be allocated */ -int socket_id; +union { +/** NUMA node ID where rte_ipsec_sad should be allocated */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };/** maximum number of SA for each type of key */ uint32_t max_sa[RTE_IPSEC_SAD_KEY_TYPE_MASK ];/** RTE_IPSEC_SAD_FLAG_* flags */
Signature · 1 line
2.55.0
PATCH 15/227 graph: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id fields of rte_graph_param, rte_graph_cluster_stats_param and rte_graph (were socket_id and socket), keeping the old names as deprecated union aliases, and update in-tree users accordingly.
Also rename socket_id parameters, internal variables, dump output and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_realloc_numa(), rte_numa_id(), rte_lcore_to_numa_id() and RTE_NUMA_ID_ANY.
--- app/graph/graph.c | 4 ++-- app/graph/l2fwd.c | 2 +- app/graph/l3fwd.c | 10 +++++----- app/test/test_graph.c | 6 +++--- app/test/test_graph_feature_arc.c | 2 +- lib/graph/graph.c | 14 +++++++------- lib/graph/graph_debug.c | 2 +- lib/graph/graph_feature_arc.c | 4 ++-- lib/graph/graph_pcap.c | 2 +- lib/graph/graph_populate.c | 4 ++-- lib/graph/graph_private.h | 4 ++-- lib/graph/graph_stats.c | 18 +++++++++--------- lib/graph/rte_graph.h | 21 ++++++++++++++++++--- lib/graph/rte_graph_model_mcore_dispatch.c | 4 ++-- lib/graph/rte_graph_worker_common.h | 10 +++++++++- 15 files changed, 65 insertions(+), 42 deletions(-)
app/graph/graph.c +2 -2
@@ -218,7 +218,7 @@ graph_stats_print_to_file(void)memset (&s_param,0 ,sizeof (s_param)); s_param.f = fp; - 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 ;
@@ -372,7 +372,7 @@ graph_stats_print(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 ;
app/graph/l2fwd.c +1 -1
@@ -65,7 +65,7 @@ l2fwd_pattern_configure(void) } 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);
app/graph/l3fwd.c +5 -5
@@ -129,23 +129,23 @@ l3fwd_pattern_configure(void) } 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);if (ip4_lookup_m ==IP4_LOOKUP_FIB ) { - rc =setup_fib (graph_conf.socket_id); + rc =setup_fib (graph_conf.numa_id);if (rc <0 )rte_exit (EXIT_FAILURE ,"Unable to setup fib for socket %u\n" , - graph_conf.socket_id); + graph_conf.numa_id); }if (ip6_lookup_m ==IP6_LOOKUP_FIB ) { - rc =setup_fib6 (graph_conf.socket_id); + rc =setup_fib6 (graph_conf.numa_id);if (rc <0 )rte_exit (EXIT_FAILURE ,"Unable to setup fib6 for socket %u\n" , - graph_conf.socket_id); + graph_conf.numa_id); } graph_id =rte_graph_create (qconf->name, &graph_conf);
app/test/test_graph.c +3 -3
@@ -694,7 +694,7 @@ test_create_graph(void) "test_node00-test_node33", "test_node00-dummy_node", };struct rte_graph_param gconf = { - .socket_id =SOCKET_ID_ANY , + .numa_id =RTE_NUMA_ID_ANY , .nb_node_patterns =6 , .node_patterns = node_patterns_dummy, };
@@ -764,7 +764,7 @@ test_graph_id_collisions(void) {static const char *node_patterns[] = {"test_node_source1" ,"test_node00" };struct rte_graph_param gconf = { - .socket_id =SOCKET_ID_ANY , + .numa_id =RTE_NUMA_ID_ANY , .nb_node_patterns =2 , .node_patterns = node_patterns, };
@@ -1045,7 +1045,7 @@ test_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 ; s_param.fn = graph_cluster_stats_cb_t;
app/test/test_graph_feature_arc.c +1 -1
@@ -787,7 +787,7 @@ static intcreate_graph (void) {struct rte_graph_param gconf = { - .socket_id =SOCKET_ID_ANY , + .numa_id =RTE_NUMA_ID_ANY , .nb_node_patterns =RTE_DIM (node_names_feature_arc), .node_patterns = node_names_feature_arc, };
lib/graph/graph.c +7 -7
@@ -359,7 +359,7 @@ rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore) graph->lcore_id = lcore; graph->graph->dispatch.lcore_id = graph->lcore_id; - graph->socket =rte_lcore_to_socket_id (lcore); + graph->numa_id =rte_lcore_to_numa_id (lcore);/* Rebuild source bitmap with only source nodes bound to this lcore */ graph_src_bitmap_rebuild (graph);
@@ -477,7 +477,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)graph_pcap_enable (prm->pcap_enable);/* Initialize graph object */ - graph->socket = prm->socket_id; + graph->numa_id = prm->numa_id; graph->src_node_count = src_node_count; graph->node_count =graph_nodes_count (graph); graph->id =graph_next_free_id ();
@@ -596,7 +596,7 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param graph->node_count = parent_graph->node_count; graph->parent_id = parent_graph->id; graph->lcore_id = parent_graph->lcore_id; - graph->socket = parent_graph->socket; + graph->numa_id = parent_graph->numa_id; graph->id =graph_next_free_id ();/* Allocate the Graph fast path memory and populate the data */
@@ -737,8 +737,8 @@ __rte_node_stream_alloc(struct rte_graph *graph, struct rte_node *node)RTE_VERIFY (size !=UINT16_MAX );/* Allocate double amount of size to avoid immediate realloc */ size =RTE_MIN (UINT16_MAX ,RTE_MAX (RTE_GRAPH_BURST_SIZE , size *2 )); - node->objs =rte_realloc_socket (node->objs, size *sizeof (void *), -RTE_CACHE_LINE_SIZE , graph->socket); + node->objs =rte_realloc_numa (node->objs, size *sizeof (void *), +RTE_CACHE_LINE_SIZE , graph->numa_id);RTE_VERIFY (node->objs); node->size = size; node->realloc_count++;
@@ -754,8 +754,8 @@ __rte_node_stream_alloc_size(struct rte_graph *graph, struct rte_node *node,RTE_VERIFY (size !=UINT16_MAX );/* Allocate double amount of size to avoid immediate realloc */ size =RTE_MIN (UINT16_MAX ,RTE_MAX (RTE_GRAPH_BURST_SIZE , req_size *2 )); - node->objs =rte_realloc_socket (node->objs, size *sizeof (void *), -RTE_CACHE_LINE_SIZE , graph->socket); + node->objs =rte_realloc_numa (node->objs, size *sizeof (void *), +RTE_CACHE_LINE_SIZE , graph->numa_id);RTE_VERIFY (node->objs); node->size = size; node->realloc_count++;
lib/graph/graph_debug.c +1 -1
@@ -66,7 +66,7 @@ rte_graph_obj_dump(FILE *f, struct rte_graph *g, bool all)fprintf (f," id=%" PRIu32"\n" , g->id);fprintf (f," nb_nodes=%" PRId32"\n" , g->nb_nodes);fprintf (f," nb_sched_words=%" PRIu16"\n" , g->nb_sched_words); -fprintf (f," socket=%d\n" , g->socket); +fprintf (f," numa_id=%d\n" , g->numa_id);fprintf (f," fence=0x%" PRIx64"\n" , g->fence);fprintf (f," nodes_start=0x%" PRIx32"\n" , g->nodes_start);fprintf (f," sched_table=%p\n" , g->sched_table);
lib/graph/graph_feature_arc.c +2 -2
@@ -799,7 +799,7 @@ feature_arc_main_init(rte_graph_feature_arc_main_t **pfl, uint32_t max_feature_a sz =sizeof (rte_graph_feature_arc_main_t) + (sizeof (pm->feature_arcs[0 ]) * max_feature_arcs); - mz =rte_memzone_reserve (FEATURE_ARC_MEMZONE_NAME , sz,SOCKET_ID_ANY ,0 ); + mz =rte_memzone_reserve (FEATURE_ARC_MEMZONE_NAME , sz,RTE_NUMA_ID_ANY ,0 );if (!mz) {graph_err ("memzone reserve failed for feature arc main" );return -1 ;
@@ -1260,7 +1260,7 @@ rte_graph_feature_arc_create(struct rte_graph_feature_arc_register *reg,/* Calculate size of feature arc */ feature_arc_reg_calc_size (reg, &sz, &first_feat_off, &fdata_off, &feat_sz, &num_index); - mz =rte_memzone_reserve (reg->arc_name, sz,SOCKET_ID_ANY ,0 ); + mz =rte_memzone_reserve (reg->arc_name, sz,RTE_NUMA_ID_ANY ,0 );if (!mz) { graph_err("memzone reserve failed for arc: %s of size: %"PRIu64,
lib/graph/graph_pcap.c +1 -1
@@ -147,7 +147,7 @@ graph_pcap_mp_init(void) pkt_mp =rte_pktmbuf_pool_create_by_ops (GRAPH_PCAP_PKT_POOL ,IOV_MAX +RTE_GRAPH_BURST_SIZE ,0 ,0 ,rte_pcapng_mbuf_size (RTE_MBUF_DEFAULT_BUF_SIZE ), -SOCKET_ID_ANY ,"ring_mp_mc" ); +RTE_NUMA_ID_ANY ,"ring_mp_mc" );if (pkt_mp ==NULL ) {graph_err ("Cannot create mempool for graph pcap capture." );return -1 ;
lib/graph/graph_populate.c +2 -2
@@ -74,7 +74,7 @@ graph_header_populate(struct graph *_graph) graph->pending =RTE_PTR_ADD (graph, _graph->pending_off); graph->src_pending =RTE_PTR_ADD (graph, _graph->src_pending_off); graph->nodes_start = _graph->nodes_start; - graph->socket = _graph->socket; + graph->numa_id = _graph->numa_id; graph->id = _graph->id;memcpy (graph->name, _graph->name,RTE_GRAPH_NAMESIZE ); graph->fence =RTE_GRAPH_FENCE ;
@@ -291,7 +291,7 @@ graph_fp_mem_create(struct graph *graph)size_t sz; sz =graph_fp_mem_calc_size (graph); - mz =rte_memzone_reserve (graph->name, sz, graph->socket,0 ); + mz =rte_memzone_reserve (graph->name, sz, graph->numa_id,0 );if (mz ==NULL )SET_ERR_JMP (ENOMEM , fail,"Memzone %s reserve failed" , graph->name);
lib/graph/graph_private.h +2 -2
@@ -124,8 +124,8 @@ struct graph {/**< Lcore identifier where the graph prefer to run on. Used for mcore dispatch model. */ size_t mem_sz;/**< Memory size of the graph. */ -int socket; -/**< Socket identifier where memory is allocated. */ +int numa_id; +/** NUMA node identifier where memory is allocated. */ uint64_t num_pkt_to_capture;/**< Number of packets to be captured per core. */ char pcap_filename[RTE_GRAPH_PCAP_FILE_SZ ];
lib/graph/graph_stats.c +9 -9
@@ -34,7 +34,7 @@ struct __rte_cache_aligned rte_graph_cluster_stats {rte_graph_cluster_stats_cb_t fn;uint32_t cluster_node_size;/* Size of struct cluster_node */ rte_node_t max_nodes; -int socket_id; +int numa_id;bool dispatch;void *cookie;
@@ -219,7 +219,7 @@ stats_mem_init(struct cluster *cluster, {struct rte_graph_cluster_stats *stats;rte_graph_cluster_stats_cb_t fn; -int socket_id = prm->socket_id; +int numa_id = prm->numa_id;uint32_t cluster_node_size;uint32_t max_nodes;
@@ -242,13 +242,13 @@ stats_mem_init(struct cluster *cluster, cluster_node_size += cluster->nb_graphs *sizeof (struct rte_node *); cluster_node_size =RTE_ALIGN (cluster_node_size,RTE_CACHE_LINE_SIZE ); - stats =rte_zmalloc_socket (NULL ,sizeof (struct rte_graph_cluster_stats ) + - max_nodes * cluster_node_size,0 , socket_id); + stats =rte_zmalloc_numa (NULL ,sizeof (struct rte_graph_cluster_stats ) + + max_nodes * cluster_node_size,0 , numa_id);if (stats) { stats->fn = fn; stats->cluster_node_size = cluster_node_size; stats->max_nodes =0 ; - stats->socket_id = socket_id; + stats->numa_id = numa_id; stats->cookie = prm->cookie; }
@@ -294,16 +294,16 @@ stats_mem_populate(struct rte_graph_cluster_stats *stats, cluster->nodes[cluster->nb_nodes++] = node;if (graph_node->node->xstats) { cluster->stat.xstat_cntrs = graph_node->node->xstats->nb_xstats; - cluster->stat.xstat_count =rte_zmalloc_socket (NULL , + cluster->stat.xstat_count =rte_zmalloc_numa (NULL ,sizeof (uint64_t ) * graph_node->node->xstats->nb_xstats, -RTE_CACHE_LINE_SIZE , stats->socket_id); +RTE_CACHE_LINE_SIZE , stats->numa_id);if (cluster->stat.xstat_count ==NULL )SET_ERR_JMP (ENOMEM , err,"Failed to allocate memory node %s graph %s" , graph_node->node->name, graph->name); - cluster->stat.xstat_desc =rte_zmalloc_socket (NULL , + cluster->stat.xstat_desc =rte_zmalloc_numa (NULL ,RTE_NODE_XSTAT_DESC_SIZE * graph_node->node->xstats->nb_xstats, -RTE_CACHE_LINE_SIZE , stats->socket_id); +RTE_CACHE_LINE_SIZE , stats->numa_id);if (cluster->stat.xstat_desc ==NULL ) {rte_free (cluster->stat.xstat_count); SET_ERR_JMP(ENOMEM, err, "Failed to allocate memory node %s graph %s",
lib/graph/rte_graph.h +18 -3
@@ -166,7 +166,15 @@ typedef void (*packets_enqueued_cb)(struct rte_graph *graph, uint64_t cb_priv);* @see rte_graph_create() */ struct rte_graph_param { -int socket_id;/**< Socket id where memory is allocated. */ +union { +/** NUMA node ID where memory is allocated. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };uint16_t nb_node_patterns;/**< Number of node patterns. */ const char **node_patterns;/**< Array of node patterns based on shell pattern. */
@@ -194,8 +202,15 @@ struct rte_graph_param {* @see rte_graph_cluster_stats_create() */ struct rte_graph_cluster_stats_param { -int socket_id; -/**< Socket id where memory is allocated */ +union { +/** NUMA node ID where memory is allocated */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket_id; + };rte_graph_cluster_stats_cb_t fn;/**< Stats print callback function. NULL value allowed, in that case, * default print stat function used.
lib/graph/rte_graph_model_mcore_dispatch.c +2 -2
@@ -25,7 +25,7 @@ graph_sched_wq_create(struct graph *_graph, struct graph *_parent_graph,if (!rte_is_power_of_2 (wq_size)) flags |=RING_F_EXACT_SZ ; - graph->dispatch.wq =rte_ring_create (graph->name, wq_size, graph->socket, + graph->dispatch.wq =rte_ring_create (graph->name, wq_size, graph->numa_id, flags);if (graph->dispatch.wq ==NULL )SET_ERR_JMP (EIO , fail,"Failed to allocate graph WQ" );
@@ -37,7 +37,7 @@ graph_sched_wq_create(struct graph *_graph, struct graph *_parent_graph, graph->dispatch.mp =rte_mempool_create (graph->name, wq_size,sizeof (struct graph_mcore_dispatch_wq_node ),0 ,0 ,NULL ,NULL ,NULL ,NULL , - graph->socket,MEMPOOL_F_SP_PUT ); + graph->numa_id,MEMPOOL_F_SP_PUT );if (graph->dispatch.mp ==NULL )SET_ERR_JMP (EIO , fail_mp,"Failed to allocate graph WQ schedule entry" );
lib/graph/rte_graph_worker_common.h +9 -1
@@ -74,7 +74,15 @@ struct __rte_cache_aligned rte_graph {SLIST_ENTRY (rte_graph) next;/* The next for rte_graph list */ /* End of Fast path area.*/ rte_graph_t id;/**< Graph identifier. */ -int socket;/**< Socket ID where memory is allocated. */ +union { +/** NUMA node ID where memory is allocated. */ +int numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + int socket; + };char name[RTE_GRAPH_NAMESIZE ];/**< Name of the graph. */ bool pcap_enable;/**< Pcap trace enabled. */ /** Number of packets captured per core. */
Signature · 1 line
2.55.0
PATCH 16/227 gro: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename the numa_id field of rte_gro_param (was socket_id), keeping socket_id as a deprecated union alias, and update in-tree users accordingly.
Also rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa() and rte_numa_id().
--- app/test-pmd/testpmd.c | 2 +- lib/gro/gro_tcp4.c | 14 +++++++------- lib/gro/gro_tcp4.h | 6 +++--- lib/gro/gro_tcp6.c | 14 +++++++------- lib/gro/gro_tcp6.h | 6 +++--- lib/gro/gro_udp4.c | 14 +++++++------- lib/gro/gro_udp4.h | 6 +++--- lib/gro/gro_vxlan_tcp4.c | 14 +++++++------- lib/gro/gro_vxlan_tcp4.h | 6 +++--- lib/gro/gro_vxlan_udp4.c | 14 +++++++------- lib/gro/gro_vxlan_udp4.h | 6 +++--- lib/gro/rte_gro.c | 8 ++++---- lib/gro/rte_gro.h | 17 ++++++++++++----- 13 files changed, 67 insertions(+), 60 deletions(-)
app/test-pmd/testpmd.c +1 -1
@@ -1886,7 +1886,7 @@ init_config(void) gro_param.max_flow_num =GRO_MAX_FLUSH_CYCLES ; gro_param.max_item_per_flow =MAX_PKT_BURST ;for (lc_id =0 ; lc_id < nb_lcores; lc_id++) { - gro_param.socket_id =rte_lcore_to_socket_id ( + gro_param.numa_id =rte_lcore_to_numa_id ( fwd_lcores_cpuids[lc_id]); fwd_lcores[lc_id]->gro_ctx =rte_gro_ctx_create (&gro_param);if (fwd_lcores[lc_id]->gro_ctx ==NULL ) {
lib/gro/gro_tcp4.c +7 -7
@@ -10,7 +10,7 @@#include "gro_tcp_internal.h" void * -gro_tcp4_tbl_create (uint16_t socket_id, +gro_tcp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow) {
@@ -24,18 +24,18 @@ gro_tcp4_tbl_create(uint16_t socket_id,if (entries_num ==0 )return NULL ; - tbl =rte_zmalloc_socket (__func__, + tbl =rte_zmalloc_numa (__func__,sizeof (struct gro_tcp4_tbl ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl ==NULL )return NULL ; size =sizeof (struct gro_tcp_item ) * entries_num; - tbl->items =rte_zmalloc_socket (__func__, + tbl->items =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->items ==NULL ) {rte_free (tbl);return NULL ;
@@ -43,10 +43,10 @@ gro_tcp4_tbl_create(uint16_t socket_id, tbl->max_item_num = entries_num; size =sizeof (struct gro_tcp4_flow ) * entries_num; - tbl->flows =rte_zmalloc_socket (__func__, + tbl->flows =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->flows ==NULL ) {rte_free (tbl->items);rte_free (tbl);
lib/gro/gro_tcp4.h +3 -3
@@ -46,8 +46,8 @@ struct gro_tcp4_tbl {/** * This function creates a TCP/IPv4 reassembly table. * -* @param socket_id -* Socket index for allocating the TCP/IPv4 reassemble table +* @param numa_id +* NUMA node index for allocating the TCP/IPv4 reassemble table * @param max_flow_num * The maximum number of flows in the TCP/IPv4 GRO table * @param max_item_per_flow
@@ -57,7 +57,7 @@ struct gro_tcp4_tbl {* - Return the table pointer on success. * - Return NULL on failure. */ -void *gro_tcp4_tbl_create (uint16_t socket_id, +void *gro_tcp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);
lib/gro/gro_tcp6.c +7 -7
@@ -10,7 +10,7 @@#include "gro_tcp_internal.h" void * -gro_tcp6_tbl_create (uint16_t socket_id, +gro_tcp6_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow) {
@@ -24,18 +24,18 @@ gro_tcp6_tbl_create(uint16_t socket_id,if (entries_num ==0 )return NULL ; - tbl =rte_zmalloc_socket (__func__, + tbl =rte_zmalloc_numa (__func__,sizeof (struct gro_tcp6_tbl ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl ==NULL )return NULL ; size =sizeof (struct gro_tcp_item ) * entries_num; - tbl->items =rte_zmalloc_socket (__func__, + tbl->items =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->items ==NULL ) {rte_free (tbl);return NULL ;
@@ -43,10 +43,10 @@ gro_tcp6_tbl_create(uint16_t socket_id, tbl->max_item_num = entries_num; size =sizeof (struct gro_tcp6_flow ) * entries_num; - tbl->flows =rte_zmalloc_socket (__func__, + tbl->flows =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->flows ==NULL ) {rte_free (tbl->items);rte_free (tbl);
lib/gro/gro_tcp6.h +3 -3
@@ -49,8 +49,8 @@ struct gro_tcp6_tbl {/** * This function creates a TCP/IPv6 reassembly table. * -* @param socket_id -* Socket index for allocating the TCP/IPv6 reassemble table +* @param numa_id +* NUMA node index for allocating the TCP/IPv6 reassemble table * @param max_flow_num * The maximum number of flows in the TCP/IPv6 GRO table * @param max_item_per_flow
@@ -60,7 +60,7 @@ struct gro_tcp6_tbl {* - Return the table pointer on success. * - Return NULL on failure. */ -void *gro_tcp6_tbl_create (uint16_t socket_id, +void *gro_tcp6_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);
lib/gro/gro_udp4.c +7 -7
@@ -9,7 +9,7 @@#include "gro_udp4.h" void * -gro_udp4_tbl_create (uint16_t socket_id, +gro_udp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow) {
@@ -23,18 +23,18 @@ gro_udp4_tbl_create(uint16_t socket_id,if (entries_num ==0 )return NULL ; - tbl =rte_zmalloc_socket (__func__, + tbl =rte_zmalloc_numa (__func__,sizeof (struct gro_udp4_tbl ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl ==NULL )return NULL ; size =sizeof (struct gro_udp4_item ) * entries_num; - tbl->items =rte_zmalloc_socket (__func__, + tbl->items =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->items ==NULL ) {rte_free (tbl);return NULL ;
@@ -42,10 +42,10 @@ gro_udp4_tbl_create(uint16_t socket_id, tbl->max_item_num = entries_num; size =sizeof (struct gro_udp4_flow ) * entries_num; - tbl->flows =rte_zmalloc_socket (__func__, + tbl->flows =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->flows ==NULL ) {rte_free (tbl->items);rte_free (tbl);
lib/gro/gro_udp4.h +3 -3
@@ -87,8 +87,8 @@ struct gro_udp4_tbl {/** * This function creates a UDP/IPv4 reassembly table. * -* @param socket_id -* Socket index for allocating the UDP/IPv4 reassemble table +* @param numa_id +* NUMA node index for allocating the UDP/IPv4 reassemble table * @param max_flow_num * The maximum number of flows in the UDP/IPv4 GRO table * @param max_item_per_flow
@@ -98,7 +98,7 @@ struct gro_udp4_tbl {* - Return the table pointer on success. * - Return NULL on failure. */ -void *gro_udp4_tbl_create (uint16_t socket_id, +void *gro_udp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);
lib/gro/gro_vxlan_tcp4.c +7 -7
@@ -10,7 +10,7 @@#include "gro_vxlan_tcp4.h" void * -gro_vxlan_tcp4_tbl_create (uint16_t socket_id, +gro_vxlan_tcp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow) {
@@ -24,18 +24,18 @@ gro_vxlan_tcp4_tbl_create(uint16_t socket_id,if (entries_num ==0 )return NULL ; - tbl =rte_zmalloc_socket (__func__, + tbl =rte_zmalloc_numa (__func__,sizeof (struct gro_vxlan_tcp4_tbl ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl ==NULL )return NULL ; size =sizeof (struct gro_vxlan_tcp4_item ) * entries_num; - tbl->items =rte_zmalloc_socket (__func__, + tbl->items =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->items ==NULL ) {rte_free (tbl);return NULL ;
@@ -43,10 +43,10 @@ gro_vxlan_tcp4_tbl_create(uint16_t socket_id, tbl->max_item_num = entries_num; size =sizeof (struct gro_vxlan_tcp4_flow ) * entries_num; - tbl->flows =rte_zmalloc_socket (__func__, + tbl->flows =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->flows ==NULL ) {rte_free (tbl->items);rte_free (tbl);
lib/gro/gro_vxlan_tcp4.h +3 -3
@@ -66,8 +66,8 @@ struct gro_vxlan_tcp4_tbl {* This function creates a VxLAN reassembly table for VxLAN packets * which have an outer IPv4 header and an inner TCP/IPv4 packet. * -* @param socket_id -* Socket index for allocating the table +* @param numa_id +* NUMA node index for allocating the table * @param max_flow_num * The maximum number of flows in the table * @param max_item_per_flow
@@ -77,7 +77,7 @@ struct gro_vxlan_tcp4_tbl {* - Return the table pointer on success. * - Return NULL on failure. */ -void *gro_vxlan_tcp4_tbl_create (uint16_t socket_id, +void *gro_vxlan_tcp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);
lib/gro/gro_vxlan_udp4.c +7 -7
@@ -10,7 +10,7 @@#include "gro_vxlan_udp4.h" void * -gro_vxlan_udp4_tbl_create (uint16_t socket_id, +gro_vxlan_udp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow) {
@@ -24,18 +24,18 @@ gro_vxlan_udp4_tbl_create(uint16_t socket_id,if (entries_num ==0 )return NULL ; - tbl =rte_zmalloc_socket (__func__, + tbl =rte_zmalloc_numa (__func__,sizeof (struct gro_vxlan_udp4_tbl ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl ==NULL )return NULL ; size =sizeof (struct gro_vxlan_udp4_item ) * entries_num; - tbl->items =rte_zmalloc_socket (__func__, + tbl->items =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->items ==NULL ) {rte_free (tbl);return NULL ;
@@ -43,10 +43,10 @@ gro_vxlan_udp4_tbl_create(uint16_t socket_id, tbl->max_item_num = entries_num; size =sizeof (struct gro_vxlan_udp4_flow ) * entries_num; - tbl->flows =rte_zmalloc_socket (__func__, + tbl->flows =rte_zmalloc_numa (__func__, size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (tbl->flows ==NULL ) {rte_free (tbl->items);rte_free (tbl);
lib/gro/gro_vxlan_udp4.h +3 -3
@@ -67,8 +67,8 @@ struct gro_vxlan_udp4_tbl {* This function creates a VxLAN reassembly table for VxLAN packets * which have an outer IPv4 header and an inner UDP/IPv4 packet. * -* @param socket_id -* Socket index for allocating the table +* @param numa_id +* NUMA node index for allocating the table * @param max_flow_num * The maximum number of flows in the table * @param max_item_per_flow
@@ -78,7 +78,7 @@ struct gro_vxlan_udp4_tbl {* - Return the table pointer on success. * - Return NULL on failure. */ -void *gro_vxlan_udp4_tbl_create (uint16_t socket_id, +void *gro_vxlan_udp4_tbl_create (uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);
lib/gro/rte_gro.c +4 -4
@@ -14,7 +14,7 @@#include "gro_vxlan_tcp4.h" #include "gro_vxlan_udp4.h" -typedef void *(*gro_tbl_create_fn )(uint16_t socket_id, +typedef void *(*gro_tbl_create_fn )(uint16_t numa_id,uint16_t max_flow_num,uint16_t max_item_per_flow);typedef void (*gro_tbl_destroy_fn )(void *tbl);
@@ -99,10 +99,10 @@ rte_gro_ctx_create(const struct rte_gro_param *param)uint64_t gro_types =0 ;uint8_t i; - gro_ctx =rte_zmalloc_socket (__func__, + gro_ctx =rte_zmalloc_numa (__func__,sizeof (struct gro_ctx ),RTE_CACHE_LINE_SIZE , - param->socket_id); + param->numa_id);if (gro_ctx ==NULL )return NULL ;
@@ -115,7 +115,7 @@ rte_gro_ctx_create(const struct rte_gro_param *param)if (create_tbl_fn ==NULL )continue ; - gro_ctx->tbls[i] =create_tbl_fn (param->socket_id, + gro_ctx->tbls[i] =create_tbl_fn (param->numa_id, param->max_flow_num, param->max_item_per_flow);if (gro_ctx->tbls[i] ==NULL ) {
lib/gro/rte_gro.h +12 -5
@@ -53,11 +53,18 @@ struct rte_gro_param {/**< max flow number */ uint16_t max_item_per_flow;/**< max packet number per flow */ -uint16_t socket_id; -/**< socket index for allocating GRO related data structures, -* like reassembly tables. When use rte_gro_reassemble_burst(), -* applications don't need to set this value. -*/ +union { +/** NUMA node index for allocating GRO related data structures, +* like reassembly tables. When use rte_gro_reassemble_burst(), +* applications don't need to set this value. +*/ +uint16_t numa_id; +/** +* Deprecated alias of numa_id. +*/ + __rte_deprecated_msg("use numa_id") + uint16_t socket_id; + }; };/**
Signature · 1 line
2.55.0
PATCH 17/227 fib: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- app/test/test_fib6.c | 10 +++++----- lib/fib/dir24_8.c | 14 +++++++------- lib/fib/dir24_8.h | 2 +- lib/fib/rte_fib.c | 14 +++++++------- lib/fib/rte_fib.h | 6 +++--- lib/fib/rte_fib6.c | 14 +++++++------- lib/fib/rte_fib6.h | 6 +++--- lib/fib/trie.c | 14 +++++++------- lib/fib/trie.h | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-)
app/test/test_fib6.c +5 -5
@@ -955,7 +955,7 @@ test_tbl8_install_peak(void) config.trie.nh_sz =RTE_FIB6_TRIE_2B ; config.trie.num_tbl8 =1 ; - fib =rte_fib6_create ("peak" ,SOCKET_ID_ANY , &config); + fib =rte_fib6_create ("peak" ,RTE_NUMA_ID_ANY , &config);RTE_TEST_ASSERT (fib !=NULL ,"Failed to create FIB\n" ); ret =rte_fib6_add (fib, &aligned,33 ,1 );
@@ -1029,11 +1029,11 @@ test_tbl8_install_peak_dq(void) config.trie.nh_sz =RTE_FIB6_TRIE_2B ; config.trie.num_tbl8 =2 ; - fib =rte_fib6_create ("peak_dq" ,SOCKET_ID_ANY , &config); + fib =rte_fib6_create ("peak_dq" ,RTE_NUMA_ID_ANY , &config);RTE_TEST_ASSERT (fib !=NULL ,"Failed to create FIB\n" ); sz =rte_rcu_qsbr_get_memsize (1 ); - v =rte_zmalloc_socket (NULL , sz,RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + v =rte_zmalloc_socket (NULL , sz,RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RTE_TEST_ASSERT (v !=NULL ,"Can not allocate RCU\n" ); ret =rte_rcu_qsbr_init (v,1 );RTE_TEST_ASSERT (ret ==0 ,"Can not init RCU\n" );
@@ -1102,11 +1102,11 @@ test_tbl8_dq_modify(void) config.trie.nh_sz =RTE_FIB6_TRIE_2B ; config.trie.num_tbl8 =3 ; - fib =rte_fib6_create (__func__,SOCKET_ID_ANY , &config); + fib =rte_fib6_create (__func__,RTE_NUMA_ID_ANY , &config);RTE_TEST_ASSERT (fib !=NULL ,"Failed to create FIB\n" ); sz =rte_rcu_qsbr_get_memsize (1 ); - v =rte_zmalloc_socket (NULL , sz,RTE_CACHE_LINE_SIZE ,SOCKET_ID_ANY ); + v =rte_zmalloc_socket (NULL , sz,RTE_CACHE_LINE_SIZE ,RTE_NUMA_ID_ANY );RTE_TEST_ASSERT (v !=NULL ,"Can not allocate RCU\n" ); ret =rte_rcu_qsbr_init (v,1 );RTE_TEST_ASSERT (ret ==0 ,"Can not init RCU\n" );
lib/fib/dir24_8.c +7 -7
@@ -556,7 +556,7 @@ dir24_8_modify(struct rte_fib *fib, uint32_t ip, uint8_t depth, }void * -dir24_8_create (const char *name,int socket_id,struct rte_fib_conf *fib_conf) +dir24_8_create (const char *name,int numa_id,struct rte_fib_conf *fib_conf) {char mem_name[DIR24_8_NAMESIZE ];struct dir24_8_tbl *dp;
@@ -582,9 +582,9 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf) BITMAP_SLAB_BIT_SIZE);snprintf (mem_name,sizeof (mem_name),"DP_%s" , name); - dp =rte_zmalloc_socket (name,sizeof (struct dir24_8_tbl ) + + dp =rte_zmalloc_numa (name,sizeof (struct dir24_8_tbl ) +DIR24_8_TBL24_NUM_ENT * (1 << nh_sz) +sizeof (uint32_t ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dp ==NULL ) { rte_errno =ENOMEM ;return NULL ;
@@ -596,8 +596,8 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf)snprintf (mem_name,sizeof (mem_name),"TBL8_%p" , dp);uint64_t tbl8_sz =DIR24_8_TBL8_GRP_NUM_ENT * (1ULL << nh_sz) * (num_tbl8 +1 ); - dp->tbl8 =rte_zmalloc_socket (mem_name, tbl8_sz, -RTE_CACHE_LINE_SIZE , socket_id); + dp->tbl8 =rte_zmalloc_numa (mem_name, tbl8_sz, +RTE_CACHE_LINE_SIZE , numa_id);if (dp->tbl8 ==NULL ) { rte_errno =ENOMEM ;rte_free (dp);
@@ -608,9 +608,9 @@ dir24_8_create(const char *name, int socket_id, struct rte_fib_conf *fib_conf) dp->number_tbl8s = num_tbl8;snprintf (mem_name,sizeof (mem_name),"TBL8_idxes_%p" , dp); - dp->tbl8_idxes =rte_zmalloc_socket (mem_name, + dp->tbl8_idxes =rte_zmalloc_numa (mem_name,RTE_ALIGN_CEIL (dp->number_tbl8s,64 ) >>3 , -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dp->tbl8_idxes ==NULL ) { rte_errno =ENOMEM ;rte_free (dp->tbl8);
lib/fib/dir24_8.h +1 -1
@@ -287,7 +287,7 @@ DECLARE_BE_LOOKUP_FN(dir24_8_lookup_bulk_3)DECLARE_BE_LOOKUP_FN (dir24_8_lookup_bulk_uni) void * -dir24_8_create (const char *name,int socket_id,struct rte_fib_conf *conf); +dir24_8_create (const char *name,int numa_id,struct rte_fib_conf *conf);void dir24_8_free (void *p);
lib/fib/rte_fib.c +7 -7
@@ -92,7 +92,7 @@ dummy_modify(struct rte_fib *fib, uint32_t ip, uint8_t depth, }static int -init_dataplane(struct rte_fib *fib, __rte_unused int socket_id, +init_dataplane(struct rte_fib *fib, __rte_unused int numa_id,struct rte_fib_conf *conf) {char dp_name[sizeof (void *)];
@@ -105,7 +105,7 @@ init_dataplane(struct rte_fib *fib, __rte_unused int socket_id, fib->modify = dummy_modify;return 0 ;case RTE_FIB_DIR24_8 : - fib->dp =dir24_8_create (dp_name, socket_id, conf); + fib->dp =dir24_8_create (dp_name, numa_id, conf);if (fib->dp ==NULL )return -rte_errno; fib->lookup = dir24_8_get_lookup_fn(fib->dp,
@@ -152,7 +152,7 @@ rte_fib_lookup_bulk(struct rte_fib *fib, uint32_t *ips,RTE_EXPORT_SYMBOL (rte_fib_create) struct rte_fib * -rte_fib_create (const char *name,int socket_id,struct rte_fib_conf *conf) +rte_fib_create (const char *name,int numa_id,struct rte_fib_conf *conf) {char mem_name[RTE_FIB_NAMESIZE ];int ret;
@@ -173,7 +173,7 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) rib_conf.ext_sz = conf->rib_ext_sz; rib_conf.max_nodes = conf->max_routes *2 ; - rib =rte_rib_create (name, socket_id, &rib_conf); + rib =rte_rib_create (name, numa_id, &rib_conf);if (rib ==NULL ) {FIB_LOG (ERR ,"Can not allocate RIB %s" , name);
@@ -207,8 +207,8 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) }/* Allocate memory to store the FIB data structures. */ - fib =rte_zmalloc_socket (mem_name, -sizeof (struct rte_fib ),RTE_CACHE_LINE_SIZE , socket_id); + fib =rte_zmalloc_numa (mem_name, +sizeof (struct rte_fib ),RTE_CACHE_LINE_SIZE , numa_id);if (fib ==NULL ) {FIB_LOG (ERR ,"FIB %s memory allocation failed" , name); rte_errno =ENOMEM ;
@@ -220,7 +220,7 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf) fib->type = conf->type; fib->flags = conf->flags; fib->def_nh = conf->default_nh; - ret =init_dataplane (fib, socket_id, conf); + ret =init_dataplane (fib, numa_id, conf);if (ret <0 ) {FIB_LOG (ERR , "FIB dataplane struct %s memory allocation failed "
lib/fib/rte_fib.h +3 -3
@@ -147,8 +147,8 @@ rte_fib_free(struct rte_fib *fib);* * @param name * FIB name -* @param socket_id -* NUMA socket ID for FIB table memory allocation +* @param numa_id +* NUMA node ID for FIB table memory allocation * @param conf * Structure containing the configuration * @return
@@ -156,7 +156,7 @@ rte_fib_free(struct rte_fib *fib);* NULL otherwise with rte_errno set to an appropriate values. */ struct rte_fib * -rte_fib_create (const char *name,int socket_id,struct rte_fib_conf *conf) +rte_fib_create (const char *name,int numa_id,struct rte_fib_conf *conf) __rte_malloc__rte_dealloc (rte_fib_free,1 );/**
lib/fib/rte_fib6.c +7 -7
@@ -91,7 +91,7 @@ dummy_modify(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip, }static int -init_dataplane(struct rte_fib6 *fib, __rte_unused int socket_id, +init_dataplane(struct rte_fib6 *fib, __rte_unused int numa_id,struct rte_fib6_conf *conf) {char dp_name[sizeof (void *)];
@@ -104,7 +104,7 @@ init_dataplane(struct rte_fib6 *fib, __rte_unused int socket_id, fib->modify = dummy_modify;return 0 ;case RTE_FIB6_TRIE : - fib->dp =trie_create (dp_name, socket_id, conf); + fib->dp =trie_create (dp_name, numa_id, conf);if (fib->dp ==NULL )return -rte_errno; fib->lookup =trie_get_lookup_fn (fib->dp,RTE_FIB6_LOOKUP_DEFAULT );
@@ -152,7 +152,7 @@ rte_fib6_lookup_bulk(struct rte_fib6 *fib,RTE_EXPORT_SYMBOL (rte_fib6_create) struct rte_fib6 * -rte_fib6_create (const char *name,int socket_id,struct rte_fib6_conf *conf) +rte_fib6_create (const char *name,int numa_id,struct rte_fib6_conf *conf) {char mem_name[RTE_FIB6_NAMESIZE ];int ret;
@@ -172,7 +172,7 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) rib_conf.ext_sz = conf->rib_ext_sz; rib_conf.max_nodes = conf->max_routes *2 ; - rib =rte_rib6_create (name, socket_id, &rib_conf); + rib =rte_rib6_create (name, numa_id, &rib_conf);if (rib ==NULL ) {FIB_LOG (ERR ,"Can not allocate RIB %s" , name);
@@ -206,8 +206,8 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) }/* Allocate memory to store the FIB data structures. */ - fib =rte_zmalloc_socket (mem_name, -sizeof (struct rte_fib6 ),RTE_CACHE_LINE_SIZE , socket_id); + fib =rte_zmalloc_numa (mem_name, +sizeof (struct rte_fib6 ),RTE_CACHE_LINE_SIZE , numa_id);if (fib ==NULL ) {FIB_LOG (ERR ,"FIB %s memory allocation failed" , name); rte_errno =ENOMEM ;
@@ -218,7 +218,7 @@ rte_fib6_create(const char *name, int socket_id, struct rte_fib6_conf *conf) fib->rib = rib; fib->type = conf->type; fib->def_nh = conf->default_nh; - ret =init_dataplane (fib, socket_id, conf); + ret =init_dataplane (fib, numa_id, conf);if (ret <0 ) { FIB_LOG(ERR, "FIB dataplane struct %s memory allocation failed",
lib/fib/rte_fib6.h +3 -3
@@ -129,8 +129,8 @@ rte_fib6_free(struct rte_fib6 *fib);* * @param name * FIB name -* @param socket_id -* NUMA socket ID for FIB table memory allocation +* @param numa_id +* NUMA node ID for FIB table memory allocation * @param conf * Structure containing the configuration * @return
@@ -138,7 +138,7 @@ rte_fib6_free(struct rte_fib6 *fib);* NULL otherwise with rte_errno set to an appropriate values. */ struct rte_fib6 * -rte_fib6_create (const char *name,int socket_id,struct rte_fib6_conf *conf) +rte_fib6_create (const char *name,int numa_id,struct rte_fib6_conf *conf) __rte_malloc__rte_dealloc (rte_fib6_free,1 );/**
lib/fib/trie.c +7 -7
@@ -683,7 +683,7 @@ trie_modify(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip, }void * -trie_create (const char *name,int socket_id, +trie_create (const char *name,int numa_id,struct rte_fib6_conf *conf) {char mem_name[TRIE_NAMESIZE ];
@@ -710,9 +710,9 @@ trie_create(const char *name, int socket_id, num_tbl8 = conf->trie.num_tbl8;snprintf (mem_name,sizeof (mem_name),"DP_%s" , name); - dp =rte_zmalloc_socket (name,sizeof (struct rte_trie_tbl ) + + dp =rte_zmalloc_numa (name,sizeof (struct rte_trie_tbl ) +TRIE_TBL24_NUM_ENT * (1 << nh_sz) +sizeof (uint32_t ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dp ==NULL ) { rte_errno =ENOMEM ;return dp;
@@ -721,9 +721,9 @@ trie_create(const char *name, int socket_id,write_to_dp (&dp->tbl24, (def_nh <<1 ), nh_sz,1 <<24 );snprintf (mem_name,sizeof (mem_name),"TBL8_%p" , dp); - dp->tbl8 =rte_zmalloc_socket (mem_name,TRIE_TBL8_GRP_NUM_ENT * + dp->tbl8 =rte_zmalloc_numa (mem_name,TRIE_TBL8_GRP_NUM_ENT * (1ll << nh_sz) * (num_tbl8 +1 ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dp->tbl8 ==NULL ) { rte_errno =ENOMEM ;rte_free (dp);
@@ -734,9 +734,9 @@ trie_create(const char *name, int socket_id, dp->number_tbl8s = num_tbl8;snprintf (mem_name,sizeof (mem_name),"TBL8_idxes_%p" , dp); - dp->tbl8_pool =rte_zmalloc_socket (mem_name, + dp->tbl8_pool =rte_zmalloc_numa (mem_name,sizeof (uint32_t ) * dp->number_tbl8s, -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dp->tbl8_pool ==NULL ) { rte_errno =ENOMEM ;rte_free (dp->tbl8);
lib/fib/trie.h +1 -1
@@ -137,7 +137,7 @@ voidtrie_free (void *p);void * -trie_create (const char *name,int socket_id,struct rte_fib6_conf *conf) +trie_create (const char *name,int numa_id,struct rte_fib6_conf *conf) __rte_malloc__rte_dealloc (trie_free,1 ); rte_fib6_lookup_fn_t
Signature · 1 line
2.55.0
PATCH 18/227 rib: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/rib/rte_rib.c | 8 ++++---- lib/rib/rte_rib.h | 6 +++--- lib/rib/rte_rib6.c | 8 ++++---- lib/rib/rte_rib6.h | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-)
lib/rib/rte_rib.c +4 -4
@@ -410,7 +410,7 @@ rte_rib_set_nh(struct rte_rib_node *node, uint64_t nh)RTE_EXPORT_SYMBOL (rte_rib_create) struct rte_rib * -rte_rib_create (const char *name,int socket_id,const struct rte_rib_conf *conf) +rte_rib_create (const char *name,int numa_id,const struct rte_rib_conf *conf) {char mem_name[RTE_RIB_NAMESIZE ];struct rte_rib *rib =NULL ;
@@ -427,7 +427,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf)snprintf (mem_name,sizeof (mem_name),"MP_%s" , name); node_pool =rte_mempool_create (mem_name, conf->max_nodes,sizeof (struct rte_rib_node ) + conf->ext_sz,0 ,0 , -NULL ,NULL ,NULL ,NULL , socket_id,0 ); +NULL ,NULL ,NULL ,NULL , numa_id,0 );if (node_pool ==NULL ) { RIB_LOG(ERR,
@@ -462,8 +462,8 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) }/* Allocate memory to store the RIB data structures. */ - rib =rte_zmalloc_socket (mem_name, -sizeof (struct rte_rib ),RTE_CACHE_LINE_SIZE , socket_id); + rib =rte_zmalloc_numa (mem_name, +sizeof (struct rte_rib ),RTE_CACHE_LINE_SIZE , numa_id);if (unlikely (rib ==NULL )) {RIB_LOG (ERR ,"RIB %s memory allocation failed" , name); rte_errno =ENOMEM ;
lib/rib/rte_rib.h +3 -3
@@ -246,8 +246,8 @@ rte_rib_free(struct rte_rib *rib);* * @param name * RIB name -* @param socket_id -* NUMA socket ID for RIB table memory allocation +* @param numa_id +* NUMA node ID for RIB table memory allocation * @param conf * Structure containing the configuration * @return
@@ -255,7 +255,7 @@ rte_rib_free(struct rte_rib *rib);* NULL otherwise with rte_errno indicating reason for failure. */ struct rte_rib * -rte_rib_create (const char *name,int socket_id, +rte_rib_create (const char *name,int numa_id,const struct rte_rib_conf *conf) __rte_malloc__rte_dealloc (rte_rib_free,1 );
lib/rib/rte_rib6.c +4 -4
@@ -472,7 +472,7 @@ rte_rib6_set_nh(struct rte_rib6_node *node, uint64_t nh)RTE_EXPORT_SYMBOL (rte_rib6_create) struct rte_rib6 * -rte_rib6_create (const char *name,int socket_id, +rte_rib6_create (const char *name,int numa_id,const struct rte_rib6_conf *conf) {char mem_name[RTE_RIB6_NAMESIZE ];
@@ -490,7 +490,7 @@ rte_rib6_create(const char *name, int socket_id,snprintf (mem_name,sizeof (mem_name),"MP_%s" , name); node_pool =rte_mempool_create (mem_name, conf->max_nodes,sizeof (struct rte_rib6_node ) + conf->ext_sz,0 ,0 , -NULL ,NULL ,NULL ,NULL , socket_id,0 ); +NULL ,NULL ,NULL ,NULL , numa_id,0 );if (node_pool ==NULL ) { RIB_LOG(ERR,
@@ -525,8 +525,8 @@ rte_rib6_create(const char *name, int socket_id, }/* Allocate memory to store the RIB6 data structures. */ - rib =rte_zmalloc_socket (mem_name, -sizeof (struct rte_rib6 ),RTE_CACHE_LINE_SIZE , socket_id); + rib =rte_zmalloc_numa (mem_name, +sizeof (struct rte_rib6 ),RTE_CACHE_LINE_SIZE , numa_id);if (unlikely (rib ==NULL )) {RIB_LOG (ERR ,"RIB6 %s memory allocation failed" , name); rte_errno =ENOMEM ;
lib/rib/rte_rib6.h +3 -3
@@ -235,8 +235,8 @@ rte_rib6_free(struct rte_rib6 *rib);* * @param name * RIB name -* @param socket_id -* NUMA socket ID for RIB table memory allocation +* @param numa_id +* NUMA node ID for RIB table memory allocation * @param conf * Structure containing the configuration * @return
@@ -244,7 +244,7 @@ rte_rib6_free(struct rte_rib6 *rib);* NULL otherwise with rte_errno indicating reason for failure. */ struct rte_rib6 * -rte_rib6_create (const char *name,int socket_id, +rte_rib6_create (const char *name,int numa_id,const struct rte_rib6_conf *conf) __rte_malloc__rte_dealloc (rte_rib6_free,1 );
Signature · 1 line
2.55.0
PATCH 19/227 lpm: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/lpm/rte_lpm.c | 16 ++++++++-------- lib/lpm/rte_lpm.h | 6 +++--- lib/lpm/rte_lpm6.c | 10 +++++----- lib/lpm/rte_lpm6.h | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-)
lib/lpm/rte_lpm.c +8 -8
@@ -149,7 +149,7 @@ rte_lpm_find_existing(const char *name)*/ RTE_EXPORT_SYMBOL (rte_lpm_create) struct rte_lpm * -rte_lpm_create (const char *name,int socket_id, +rte_lpm_create (const char *name,int numa_id,const struct rte_lpm_config *config) {char mem_name[RTE_LPM_NAMESIZE +sizeof ("LPM_" )];
@@ -164,7 +164,7 @@ rte_lpm_create(const char *name, int socket_id,RTE_BUILD_BUG_ON (sizeof (struct rte_lpm_tbl_entry ) !=4 );/* Check user arguments. */ -if ((name ==NULL ) || (socket_id <-1 ) || (config->max_rules ==0 ) +if ((name ==NULL ) || (numa_id <-1 ) || (config->max_rules ==0 ) || config->number_tbl8s >RTE_LPM_MAX_TBL8_NUM_GROUPS ) { rte_errno =EINVAL ;return NULL ;
@@ -206,8 +206,8 @@ rte_lpm_create(const char *name, int socket_id, }/* Allocate memory to store the LPM data structures. */ - i_lpm =rte_zmalloc_socket (mem_name, mem_size, -RTE_CACHE_LINE_SIZE , socket_id); + i_lpm =rte_zmalloc_numa (mem_name, mem_size, +RTE_CACHE_LINE_SIZE , numa_id);if (i_lpm ==NULL ) {LPM_LOG (ERR ,"LPM memory allocation failed" );rte_free (te);
@@ -215,8 +215,8 @@ rte_lpm_create(const char *name, int socket_id, goto exit; } - i_lpm->rules_tbl =rte_zmalloc_socket (NULL , - (size_t )rules_size,RTE_CACHE_LINE_SIZE , socket_id); + i_lpm->rules_tbl =rte_zmalloc_numa (NULL , + (size_t )rules_size,RTE_CACHE_LINE_SIZE , numa_id);if (i_lpm->rules_tbl ==NULL ) {LPM_LOG (ERR ,"LPM rules_tbl memory allocation failed" );
@@ -227,8 +227,8 @@ rte_lpm_create(const char *name, int socket_id, goto exit; } - i_lpm->lpm.tbl8 =rte_zmalloc_socket (NULL , - (size_t )tbl8s_size,RTE_CACHE_LINE_SIZE , socket_id); + i_lpm->lpm.tbl8 =rte_zmalloc_numa (NULL , + (size_t )tbl8s_size,RTE_CACHE_LINE_SIZE , numa_id);if (i_lpm->lpm.tbl8 ==NULL ) {LPM_LOG (ERR ,"LPM tbl8 memory allocation failed" );
lib/lpm/rte_lpm.h +3 -3
@@ -167,8 +167,8 @@ rte_lpm_free(struct rte_lpm *lpm);* * @param name * LPM object name -* @param socket_id -* NUMA socket ID for LPM table memory allocation +* @param numa_id +* NUMA node ID for LPM table memory allocation * @param config * Structure containing the configuration * @return
@@ -183,7 +183,7 @@ rte_lpm_free(struct rte_lpm *lpm);* - ENAMETOOLONG - LPM object name greater than RTE_LPM_NAMESIZE */ struct rte_lpm * -rte_lpm_create (const char *name,int socket_id, +rte_lpm_create (const char *name,int numa_id,const struct rte_lpm_config *config) __rte_malloc__rte_dealloc (rte_lpm_free,1 );
lib/lpm/rte_lpm6.c +5 -5
@@ -210,7 +210,7 @@ rebuild_lpm(struct rte_lpm6 *lpm)*/ RTE_EXPORT_SYMBOL (rte_lpm6_create) struct rte_lpm6 * -rte_lpm6_create (const char *name,int socket_id, +rte_lpm6_create (const char *name,int numa_id,const struct rte_lpm6_config *config) {char mem_name[RTE_LPM6_NAMESIZE ];
@@ -229,7 +229,7 @@ rte_lpm6_create(const char *name, int socket_id, sizeof(uint32_t) != 0);/* Check user arguments. */ -if ((name ==NULL ) || (socket_id <-1 ) || (config ==NULL ) || +if ((name ==NULL ) || (numa_id <-1 ) || (config ==NULL ) || (config->max_rules ==0 ) || config->number_tbl8s >RTE_LPM6_TBL8_MAX_NUM_GROUPS ) { rte_errno =EINVAL ;
@@ -246,7 +246,7 @@ rte_lpm6_create(const char *name, int socket_id, .hash_func_init_val = 0, .name = mem_name, .reserved = 0, - .numa_id = socket_id, + .numa_id = numa_id, .extra_flag = 0 };
@@ -308,8 +308,8 @@ rte_lpm6_create(const char *name, int socket_id, }/* Allocate memory to store the LPM data structures. */ - lpm =rte_zmalloc_socket (mem_name, (size_t )mem_size, -RTE_CACHE_LINE_SIZE , socket_id); + lpm =rte_zmalloc_numa (mem_name, (size_t )mem_size, +RTE_CACHE_LINE_SIZE , numa_id);if (lpm ==NULL ) {LPM_LOG (ERR ,"LPM memory allocation failed" );
lib/lpm/rte_lpm6.h +3 -3
@@ -45,8 +45,8 @@ rte_lpm6_free(struct rte_lpm6 *lpm);* * @param name * LPM object name -* @param socket_id -* NUMA socket ID for LPM table memory allocation +* @param numa_id +* NUMA node ID for LPM table memory allocation * @param config * Structure containing the configuration * @return
@@ -60,7 +60,7 @@ rte_lpm6_free(struct rte_lpm6 *lpm);* - ENOMEM - no appropriate memory area found in which to create memzone */ struct rte_lpm6 * -rte_lpm6_create (const char *name,int socket_id, +rte_lpm6_create (const char *name,int numa_id,const struct rte_lpm6_config *config) __rte_malloc__rte_dealloc (rte_lpm6_free,1 );
Signature · 1 line
2.55.0
PATCH 20/227 efd: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/efd/rte_efd.c | 104 +++++++++++++++++++++++----------------------- lib/efd/rte_efd.h | 38 ++++++++--------- 2 files changed, 71 insertions(+), 71 deletions(-)
lib/efd/rte_efd.c +52 -52
@@ -307,8 +307,8 @@ efd_get_bin_id(const struct rte_efd_table * const table,* * @param table * EFD table to reference -* @param socket_id -* Socket ID to use to look up existing values (ideally caller's socket id) +* @param numa_id +* NUMA node ID to use to look up existing values (ideally caller's NUMA node) * @param chunk_id * Chunk ID of bin to look up * @param bin_id
@@ -319,10 +319,10 @@ efd_get_bin_id(const struct rte_efd_table * const table,*/ static inline uint8_t efd_get_choice (const struct rte_efd_table *const table, -const unsigned int socket_id,const uint32_t chunk_id, +const unsigned int numa_id,const uint32_t chunk_id,const uint32_t bin_id) { -struct efd_online_chunk *chunk = &table->chunks[socket_id][chunk_id]; +struct efd_online_chunk *chunk = &table->chunks[numa_id][chunk_id];/* * Grab the chunk (byte) that contains the choices
@@ -501,12 +501,12 @@ efd_search_hash(struct rte_efd_table * const table,RTE_EXPORT_SYMBOL (rte_efd_create) struct rte_efd_table *rte_efd_create (const char *name,uint32_t max_num_rules,uint32_t key_len, -uint64_t online_cpu_socket_bitmask,uint8_t offline_cpu_socket) +uint64_t online_cpu_numa_bitmask,uint8_t offline_cpu_numa) {struct rte_efd_table *table =NULL ;uint8_t *key_array =NULL ;uint32_t num_chunks, num_chunks_shift; -uint8_t socket_id; +uint8_t numa_id;struct rte_efd_list *efd_list =NULL ;struct rte_tailq_entry *te;uint64_t offline_table_size;
@@ -516,8 +516,8 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, efd_list =RTE_TAILQ_CAST (rte_efd_tailq.head, rte_efd_list); -if (online_cpu_socket_bitmask ==0 ) { -EFD_LOG (ERR ,"At least one CPU socket must be enabled in the bitmask" ); +if (online_cpu_numa_bitmask ==0 ) { +EFD_LOG (ERR ,"At least one CPU NUMA node must be enabled in the bitmask" ); rte_errno =EINVAL ;return NULL ; }
@@ -574,20 +574,20 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, }/* Create a new EFD table management structure */ - table =rte_zmalloc_socket (NULL , + table =rte_zmalloc_numa (NULL ,sizeof (struct rte_efd_table ),RTE_CACHE_LINE_SIZE , - offline_cpu_socket); + offline_cpu_numa);if (table ==NULL ) {EFD_LOG (ERR ,"Allocating EFD table management structure" -" on socket %u failed" , - offline_cpu_socket); +" on NUMA node %u failed" , + offline_cpu_numa); goto error_unlock_exit; }EFD_LOG (DEBUG ,"Allocated EFD table management structure " -"on socket %u" , offline_cpu_socket); +"on socket %u" , offline_cpu_numa); table->max_num_rules = num_chunks *EFD_TARGET_CHUNK_MAX_NUM_RULES ; table->num_rules =0 ;
@@ -596,14 +596,14 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, table->key_len = key_len;/* key_array */ - key_array =rte_zmalloc_socket (NULL , + key_array =rte_zmalloc_numa (NULL , table->max_num_rules * table->key_len,RTE_CACHE_LINE_SIZE , - offline_cpu_socket); + offline_cpu_numa);if (key_array ==NULL ) {EFD_LOG (ERR ,"Allocating key array" -" on socket %u failed" , - offline_cpu_socket); +" on NUMA node %u failed" , + offline_cpu_numa); goto error_unlock_exit; } table->keys = key_array;
@@ -614,8 +614,8 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, num_chunks, table->max_num_rules);/* Make sure all the allocatable table pointers are NULL initially */ -for (socket_id =0 ; socket_id <RTE_MAX_NUMA_NODES ; socket_id++) - table->chunks[socket_id] =NULL ; +for (numa_id =0 ; numa_id <RTE_MAX_NUMA_NODES ; numa_id++) + table->chunks[numa_id] =NULL ; table->offline_chunks =NULL ;/*
@@ -625,23 +625,23 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,uint64_t online_table_size = num_chunks *sizeof (struct efd_online_chunk ) +EFD_NUM_CHUNK_PADDING_BYTES ; -for (socket_id =0 ; socket_id <RTE_MAX_NUMA_NODES ; socket_id++) { -if ((online_cpu_socket_bitmask >> socket_id) &0x01 ) { +for (numa_id =0 ; numa_id <RTE_MAX_NUMA_NODES ; numa_id++) { +if ((online_cpu_numa_bitmask >> numa_id) &0x01 ) {/* * Allocate all of the EFD table chunks (the online portion) * as a continuous block */ - table->chunks[socket_id] = -rte_zmalloc_socket ( + table->chunks[numa_id] = +rte_zmalloc_numa (NULL , online_table_size,RTE_CACHE_LINE_SIZE , - socket_id); -if (table->chunks[socket_id] ==NULL ) { + numa_id); +if (table->chunks[numa_id] ==NULL ) {EFD_LOG (ERR ,"Allocating EFD online table on " "socket %u failed" , - socket_id); + numa_id); goto error_unlock_exit; } EFD_LOG(DEBUG,
@@ -650,7 +650,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, online_table_size, (float ) online_table_size / (1024.0F *1024.0F ), - socket_id); + numa_id); } }
@@ -685,13 +685,13 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,*/ offline_table_size = num_chunks *sizeof (struct efd_offline_chunk_rules ); table->offline_chunks = -rte_zmalloc_socket (NULL , +rte_zmalloc_numa (NULL , offline_table_size,RTE_CACHE_LINE_SIZE , - offline_cpu_socket); + offline_cpu_numa);if (table->offline_chunks ==NULL ) {EFD_LOG (ERR ,"Allocating EFD offline table on socket %u " -"failed" , offline_cpu_socket); +"failed" , offline_cpu_numa); goto error_unlock_exit; }
@@ -699,7 +699,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,"Allocated EFD offline table of size %" PRIu64" bytes " " (%.2f MB) on socket %u" , offline_table_size, (float ) offline_table_size / (1024.0F *1024.0F ), - offline_cpu_socket); + offline_cpu_numa); te->data = (void *) table;TAILQ_INSERT_TAIL (efd_list, te, next);
@@ -711,7 +711,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,/* Create ring (Dummy slot index is not enqueued) */ r =rte_ring_create (ring_name,rte_align32pow2 (table->max_num_rules), - offline_cpu_socket,0 ); + offline_cpu_numa,0 );if (r ==NULL ) {EFD_LOG (ERR ,"ring creation failed: %s" ,rte_strerror (rte_errno));rte_efd_free (table);
@@ -764,15 +764,15 @@ RTE_EXPORT_SYMBOL(rte_efd_free)void rte_efd_free (struct rte_efd_table *table) { -uint8_t socket_id; +uint8_t numa_id;struct rte_efd_list *efd_list;struct rte_tailq_entry *te, *temp;if (table ==NULL )return ; -for (socket_id =0 ; socket_id <RTE_MAX_NUMA_NODES ; socket_id++) -rte_free (table->chunks[socket_id]); +for (numa_id =0 ; numa_id <RTE_MAX_NUMA_NODES ; numa_id++) +rte_free (table->chunks[numa_id]); efd_list =RTE_TAILQ_CAST (rte_efd_tailq.head, rte_efd_list);rte_mcfg_tailq_write_lock ();
@@ -800,7 +800,7 @@ rte_efd_free(struct rte_efd_table *table)* * @param table * EFD table to reference -* @param socket_id +* @param numa_id * Socket ID to use to lookup existing values (ideally caller's socket id) * @param chunk_id * Chunk index to update
@@ -814,13 +814,13 @@ rte_efd_free(struct rte_efd_table *table)* Previously computed updated chunk/group entry */ static inline void -efd_apply_update (struct rte_efd_table *const table,const unsigned int socket_id, +efd_apply_update (struct rte_efd_table *const table,const unsigned int numa_id,const uint32_t chunk_id,const uint32_t group_id,const uint32_t bin_id,const uint8_t new_bin_choice,const struct efd_online_group_entry *const new_group_entry) {int i; -struct efd_online_chunk *chunk = &table->chunks[socket_id][chunk_id]; +struct efd_online_chunk *chunk = &table->chunks[numa_id][chunk_id];uint8_t bin_index = bin_id /EFD_CHUNK_NUM_BIN_TO_GROUP_SETS ;/*
@@ -939,7 +939,7 @@ revert_groups(struct efd_offline_group_rules *previous_group,* * @param table * EFD table to reference -* @param socket_id +* @param numa_id * Socket ID to use to lookup existing values (ideally caller's socket id) * @param key * Key to insert
@@ -976,7 +976,7 @@ revert_groups(struct efd_offline_group_rules *previous_group,*/ static inline int efd_compute_update(struct rte_efd_table * const table, - const unsigned int socket_id, const void *key, + const unsigned int numa_id, const void *key, const efd_value_t value, uint32_t * const chunk_id, uint32_t * const group_id, uint32_t * const bin_id, uint8_t * const new_bin_choice,
@@ -995,7 +995,7 @@ efd_compute_update(struct rte_efd_table * const table, &table->offline_chunks[*chunk_id];struct efd_offline_group_rules *new_group; -uint8_t current_choice =efd_get_choice (table, socket_id, +uint8_t current_choice =efd_get_choice (table, numa_id, *chunk_id, *bin_id);uint32_t current_group_id = efd_bin_to_group[current_choice][*bin_id]; struct efd_offline_group_rules * const current_group =
@@ -1179,14 +1179,14 @@ efd_compute_update(struct rte_efd_table * const table,RTE_EXPORT_SYMBOL (rte_efd_update) int -rte_efd_update (struct rte_efd_table *const table,const unsigned int socket_id, +rte_efd_update (struct rte_efd_table *const table,const unsigned int numa_id,const void *key,const efd_value_t value) {uint32_t chunk_id =0 , group_id =0 , bin_id =0 ;uint8_t new_bin_choice =0 ;struct efd_online_group_entry entry = {{0 }}; -int status =efd_compute_update (table, socket_id, key, value, +int status =efd_compute_update (table, numa_id, key, value, &chunk_id, &group_id, &bin_id, &new_bin_choice, &entry);
@@ -1196,14 +1196,14 @@ rte_efd_update(struct rte_efd_table * const table, const unsigned int socket_id,if (status ==RTE_EFD_UPDATE_FAILED )return status; -efd_apply_update (table, socket_id, chunk_id, group_id, bin_id, +efd_apply_update (table, numa_id, chunk_id, group_id, bin_id, new_bin_choice, &entry);return status; }RTE_EXPORT_SYMBOL (rte_efd_delete) int -rte_efd_delete (struct rte_efd_table *const table,const unsigned int socket_id, +rte_efd_delete (struct rte_efd_table *const table,const unsigned int numa_id,const void *key,efd_value_t *const prev_value) {unsigned int i;
@@ -1215,7 +1215,7 @@ rte_efd_delete(struct rte_efd_table * const table, const unsigned int socket_id,struct efd_offline_chunk_rules *const chunk = &table->offline_chunks[chunk_id]; -uint8_t current_choice =efd_get_choice (table, socket_id, +uint8_t current_choice =efd_get_choice (table, numa_id, chunk_id, bin_id);uint32_t current_group_id = efd_bin_to_group[current_choice][bin_id]; struct efd_offline_group_rules * const current_group =
@@ -1321,16 +1321,16 @@ efd_lookup_internal(const struct efd_online_group_entry * const group,RTE_EXPORT_SYMBOL (rte_efd_lookup) efd_value_trte_efd_lookup (const struct rte_efd_table *const table, -const unsigned int socket_id,const void *key) +const unsigned int numa_id,const void *key) {uint32_t chunk_id, group_id, bin_id;uint8_t bin_choice;const struct efd_online_group_entry *group; -const struct efd_online_chunk *const chunks = table->chunks[socket_id]; +const struct efd_online_chunk *const chunks = table->chunks[numa_id];/* Determine the chunk and group location for the given key */ efd_compute_ids (table, key, &chunk_id, &bin_id); - bin_choice =efd_get_choice (table, socket_id, chunk_id, bin_id); + bin_choice =efd_get_choice (table, numa_id, chunk_id, bin_id); group_id = efd_bin_to_group[bin_choice][bin_id]; group = &chunks[chunk_id].groups[group_id];
@@ -1342,7 +1342,7 @@ rte_efd_lookup(const struct rte_efd_table * const table,RTE_EXPORT_SYMBOL (rte_efd_lookup_bulk) void rte_efd_lookup_bulk(const struct rte_efd_table * const table, -const unsigned int socket_id,const int num_keys, +const unsigned int numa_id,const int num_keys,const void **key_list,efd_value_t *const value_list) {int i;
@@ -1352,7 +1352,7 @@ void rte_efd_lookup_bulk(const struct rte_efd_table * const table,uint32_t group_id_list[RTE_EFD_BURST_MAX ];struct efd_online_group_entry *group; -struct efd_online_chunk *chunks = table->chunks[socket_id]; +struct efd_online_chunk *chunks = table->chunks[numa_id];for (i =0 ; i < num_keys; i++) { efd_compute_ids(table, key_list[i], &chunk_id_list[i],
@@ -1361,7 +1361,7 @@ void rte_efd_lookup_bulk(const struct rte_efd_table * const table, }for (i =0 ; i < num_keys; i++) { - bin_choice_list[i] =efd_get_choice (table, socket_id, + bin_choice_list[i] =efd_get_choice (table, numa_id, chunk_id_list[i], bin_id_list[i]); group_id_list[i] = efd_bin_to_group[bin_choice_list[i]][bin_id_list[i]];
lib/efd/rte_efd.h +19 -19
@@ -117,7 +117,7 @@ typedef uint16_t efd_lookuptbl_t;typedef uint16_t efd_hashfunc_t ;/** -* Creates an EFD table with a single offline region and multiple per-socket +* Creates an EFD table with a single offline region and multiple per-NUMA-node * internally-managed copies of the online table used for lookups * * @param name
@@ -127,11 +127,11 @@ typedef uint16_t efd_hashfunc_t;* Will be rounded up to the next smallest valid table size * @param key_len * Length of the key -* @param online_cpu_socket_bitmask -* Bitmask specifying which sockets should get a copy of the online table. -* LSB = socket 0, etc. -* @param offline_cpu_socket -* Identifies the socket where the offline table will be allocated +* @param online_cpu_numa_bitmask +* Bitmask specifying which NUMA nodes should get a copy of the online table. +* LSB = NUMA node 0, etc. +* @param offline_cpu_numa +* Identifies the NUMA node where the offline table will be allocated * (and most efficiently accessed in the case of updates/insertions) * * @return
@@ -139,7 +139,7 @@ typedef uint16_t efd_hashfunc_t;*/ struct rte_efd_table *rte_efd_create (const char *name,uint32_t max_num_rules,uint32_t key_len, -uint64_t online_cpu_socket_bitmask,uint8_t offline_cpu_socket); +uint64_t online_cpu_numa_bitmask,uint8_t offline_cpu_numa);/** * Releases the resources from an EFD table
@@ -177,8 +177,8 @@ rte_efd_find_existing(const char *name);* * @param table * EFD table to reference -* @param socket_id -* Socket ID to use to lookup existing value (ideally caller's socket id) +* @param numa_id +* NUMA node ID to use to lookup existing value (ideally caller's NUMA node) * @param key * EFD table key to modify * @param value
@@ -198,7 +198,7 @@ rte_efd_find_existing(const char *name);* 0 - success */ int -rte_efd_update (struct rte_efd_table *table,unsigned int socket_id, +rte_efd_update (struct rte_efd_table *table,unsigned int numa_id,const void *key,efd_value_t value);/**
@@ -208,8 +208,8 @@ rte_efd_update(struct rte_efd_table *table, unsigned int socket_id,* * @param table * EFD table to reference -* @param socket_id -* Socket ID to use to lookup existing value (ideally caller's socket id) +* @param numa_id +* NUMA node ID to use to lookup existing value (ideally caller's NUMA node) * @param key * EFD table key to delete * @param prev_value
@@ -220,7 +220,7 @@ rte_efd_update(struct rte_efd_table *table, unsigned int socket_id,* nonzero otherwise */ int -rte_efd_delete (struct rte_efd_table *table,unsigned int socket_id, +rte_efd_delete (struct rte_efd_table *table,unsigned int numa_id,const void *key,efd_value_t *prev_value);/**
@@ -235,8 +235,8 @@ rte_efd_delete(struct rte_efd_table *table, unsigned int socket_id,* * @param table * EFD table to reference -* @param socket_id -* Socket ID to use to lookup existing value (ideally caller's socket id) +* @param numa_id +* NUMA node ID to use to lookup existing value (ideally caller's NUMA node) * @param key * EFD table key to look up *
@@ -244,7 +244,7 @@ rte_efd_delete(struct rte_efd_table *table, unsigned int socket_id,* Value associated with the key, or random junk if they key was never inserted */ efd_value_t -rte_efd_lookup (const struct rte_efd_table *table,unsigned int socket_id, +rte_efd_lookup (const struct rte_efd_table *table,unsigned int numa_id,const void *key);/**
@@ -259,8 +259,8 @@ rte_efd_lookup(const struct rte_efd_table *table, unsigned int socket_id,* * @param table * EFD table to reference -* @param socket_id -* Socket ID to use to lookup existing value (ideally caller's socket id) +* @param numa_id +* NUMA node ID to use to lookup existing value (ideally caller's NUMA node) * @param num_keys * Number of keys in the key_list array, must be less than RTE_EFD_BURST_MAX * @param key_list
@@ -269,7 +269,7 @@ rte_efd_lookup(const struct rte_efd_table *table, unsigned int socket_id,* Array of size num_keys where lookup values will be stored */ void -rte_efd_lookup_bulk (const struct rte_efd_table *table,unsigned int socket_id, +rte_efd_lookup_bulk (const struct rte_efd_table *table,unsigned int numa_id,int num_keys,const void **key_list,efd_value_t *value_list);
Signature · 1 line
2.55.0
PATCH 21/227 ip_frag: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/ip_frag/rte_ip_frag.h | 8 ++++---- lib/ip_frag/rte_ip_frag_common.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-)
lib/ip_frag/rte_ip_frag.h +4 -4
@@ -54,15 +54,15 @@ struct rte_ip_frag_death_row {* The value should be less or equal then bucket_num * bucket_entries. * @param max_cycles * Maximum TTL in cycles for each fragmented packet. -* @param socket_id -* The *socket_id* argument is the socket identifier in the case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA constraints. +* @param numa_id +* The *numa_id* argument is the NUMA node ID in the case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraints. * @return * The pointer to the new allocated fragmentation table, on success. NULL on error. */ struct rte_ip_frag_tbl *rte_ip_frag_table_create (uint32_t bucket_num,uint32_t bucket_entries,uint32_t max_entries, -uint64_t max_cycles,int socket_id); +uint64_t max_cycles,int numa_id);/** * Free allocated IP fragmentation table.
lib/ip_frag/rte_ip_frag_common.c +6 -6
@@ -43,7 +43,7 @@ rte_ip_frag_free_death_row(struct rte_ip_frag_death_row *dr,RTE_EXPORT_SYMBOL (rte_ip_frag_table_create) struct rte_ip_frag_tbl *rte_ip_frag_table_create (uint32_t bucket_num,uint32_t bucket_entries, -uint32_t max_entries,uint64_t max_cycles,int socket_id) +uint32_t max_entries,uint64_t max_cycles,int numa_id) {struct rte_ip_frag_tbl *tbl;size_t sz;
@@ -62,16 +62,16 @@ rte_ip_frag_table_create(uint32_t bucket_num, uint32_t bucket_entries, } sz =sizeof (*tbl) + nb_entries *sizeof (tbl->pkt[0 ]); -if ((tbl =rte_zmalloc_socket (__func__, sz,RTE_CACHE_LINE_SIZE , - socket_id)) ==NULL ) { + tbl =rte_zmalloc_numa (__func__, sz,RTE_CACHE_LINE_SIZE , numa_id); +if (tbl ==NULL ) {IP_FRAG_LOG_LINE (ERR , -"%s: allocation of %zu bytes at socket %d failed do" , - __func__, sz, socket_id); +"%s: allocation of %zu bytes at NUMA node %d failed do" , + __func__, sz, numa_id);return NULL ; }IP_FRAG_LOG_LINE (INFO ,"%s: allocated of %zu bytes at socket %d" , - __func__, sz, socket_id); + __func__, sz, numa_id); tbl->max_cycles = max_cycles; tbl->max_entries = max_entries;
Signature · 1 line
2.55.0
PATCH 22/227 node: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/node/ip4_lookup.c | 4 ++-- lib/node/ip4_lookup_fib.c | 10 +++++----- lib/node/ip6_lookup.c | 4 ++-- lib/node/ip6_lookup_fib.c | 10 +++++----- lib/node/kernel_rx.c | 4 ++-- lib/node/node_mbuf_dynfield.c | 2 +- lib/node/udp4_input.c | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-)
lib/node/ip4_lookup.c +2 -2
@@ -194,7 +194,7 @@ ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node)/* Setup LPM tables for all sockets */ RTE_LCORE_FOREACH (lcore_id) { - socket =rte_lcore_to_socket_id (lcore_id); + socket =rte_lcore_to_numa_id (lcore_id); rc =setup_lpm (&ip4_lookup_nm, socket);if (rc) { node_err("ip4_lookup",
@@ -207,7 +207,7 @@ ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node) }/* Update socket's LPM and mbuf dyn priv1 offset in node ctx */ -IP4_LOOKUP_NODE_LPM (node->ctx) = ip4_lookup_nm.lpm_tbl[graph->socket]; +IP4_LOOKUP_NODE_LPM (node->ctx) = ip4_lookup_nm.lpm_tbl[graph->numa_id];IP4_LOOKUP_NODE_PRIV1_OFF (node->ctx) = dyn; #if defined(__ARM_NEON) || defined(RTE_ARCH_X86) || \
lib/node/ip4_lookup_fib.c +5 -5
@@ -225,7 +225,7 @@ rte_node_ip4_fib_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop,uint32_t val;int ret; - nb_sockets =rte_socket_count (); + nb_sockets =rte_numa_count (); in.s_addr =htonl (ip);inet_ntop (AF_INET , &in, abuf,sizeof (abuf));/* Embedded next node id into 24 bit next hop */
@@ -288,15 +288,15 @@ ip4_lookup_fib_node_init(const struct rte_graph *graph, struct rte_node *node)return -rte_errno; } - rc =setup_fib (graph->socket); + rc =setup_fib (graph->numa_id);if (rc) { -node_err ("ip4_lookup_fib" ,"Failed to setup fib for sock %u, rc=%d" , - graph->socket, rc); +node_err ("ip4_lookup_fib" ,"Failed to setup fib for numa %u, rc=%d" , + graph->numa_id, rc);return rc; }/* Update socket's FIB and mbuf dyn priv1 offset in node ctx */ -IP4_LOOKUP_NODE_FIB (node->ctx) = ip4_lookup_fib_nm.fib[graph->socket]; +IP4_LOOKUP_NODE_FIB (node->ctx) = ip4_lookup_fib_nm.fib[graph->numa_id];IP4_LOOKUP_FIB_NODE_PRIV1_OFF (node->ctx) = dyn;node_dbg ("ip4_lookup_fib" ,"Initialized ip4_lookup_fib node" );
lib/node/ip6_lookup.c +2 -2
@@ -331,7 +331,7 @@ ip6_lookup_node_init(const struct rte_graph *graph, struct rte_node *node)/* Setup LPM tables for all sockets */ RTE_LCORE_FOREACH (lcore_id) { - socket =rte_lcore_to_socket_id (lcore_id); + socket =rte_lcore_to_numa_id (lcore_id); rc =setup_lpm6 (&ip6_lookup_nm, socket);if (rc) { node_err("ip6_lookup",
@@ -344,7 +344,7 @@ ip6_lookup_node_init(const struct rte_graph *graph, struct rte_node *node) }/* Update socket's LPM and mbuf dyn priv1 offset in node ctx */ -IP6_LOOKUP_NODE_LPM (node->ctx) = ip6_lookup_nm.lpm_tbl[graph->socket]; +IP6_LOOKUP_NODE_LPM (node->ctx) = ip6_lookup_nm.lpm_tbl[graph->numa_id];IP6_LOOKUP_NODE_PRIV1_OFF (node->ctx) = dyn;node_dbg ("ip6_lookup" ,"Initialized ip6_lookup node" );
lib/node/ip6_lookup_fib.c +5 -5
@@ -218,7 +218,7 @@ rte_node_ip6_fib_route_add(const struct rte_ipv6_addr *ip, uint8_t depth, uint16uint32_t val;int ret; - nb_sockets =rte_socket_count (); + nb_sockets =rte_numa_count ();inet_ntop (AF_INET6 , ip, abuf,sizeof (abuf));/* Embedded next node id into 24 bit next hop */ val = ((next_node <<16 ) | next_hop) & ((1ull <<24 ) -1 );
@@ -279,15 +279,15 @@ ip6_lookup_fib_node_init(const struct rte_graph *graph, struct rte_node *node)return -rte_errno; } - rc =setup_fib6 (graph->socket); + rc =setup_fib6 (graph->numa_id);if (rc) { -node_err ("ip6_lookup_fib" ,"Failed to setup fib6 for sock %u, rc=%d" , - graph->socket, rc); +node_err ("ip6_lookup_fib" ,"Failed to setup fib6 for numa %u, rc=%d" , + graph->numa_id, rc);return rc; }/* Update socket's FIB and mbuf dyn priv1 offset in node ctx */ -IP6_LOOKUP_FIB_NODE (node->ctx) = ip6_lookup_fib_nm.fib6[graph->socket]; +IP6_LOOKUP_FIB_NODE (node->ctx) = ip6_lookup_fib_nm.fib6[graph->numa_id];IP6_LOOKUP_FIB_NODE_PRIV1_OFF (node->ctx) = dyn;node_dbg ("ip6_lookup_fib" ,"Initialized ip6_lookup_fib node" );
lib/node/kernel_rx.c +2 -2
@@ -211,8 +211,8 @@ kernel_rx_node_init(const struct rte_graph *graph, struct rte_node *node)return -EINVAL ; } - recv_info =rte_zmalloc_socket ("kernel_rx_info" ,sizeof (kernel_rx_info_t), -RTE_CACHE_LINE_SIZE , graph->socket); + recv_info =rte_zmalloc_numa ("kernel_rx_info" ,sizeof (kernel_rx_info_t), +RTE_CACHE_LINE_SIZE , graph->numa_id);if (!recv_info) {node_err ("kernel_rx" ,"Kernel recv_info is NULL" );return -ENOMEM ;
lib/node/node_mbuf_dynfield.c +1 -1
@@ -36,7 +36,7 @@ int rte_node_mbuf_dynfield_register(void)if (!mz) { mz =rte_memzone_reserve_aligned (NODE_MBUF_DYNFIELD_MEMZONE_NAME ,sizeof (struct node_mbuf_dynfield_mz ), -SOCKET_ID_ANY ,0 , +RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE );if (!mz) {node_err ("node_mbuf_dyn" ,"rte_memzone_reserve_aligned failed" );
lib/node/udp4_input.c +2 -2
@@ -132,7 +132,7 @@ udp4_input_node_init(const struct rte_graph *graph, struct rte_node *node)/* Setup HASH tables for all sockets */ RTE_LCORE_FOREACH (lcore_id) { - socket =rte_lcore_to_socket_id (lcore_id); + socket =rte_lcore_to_numa_id (lcore_id); rc =setup_udp4_dstprt_hash (&udp4_input_nm, socket);if (rc) { node_err("udp4_lookup",
@@ -144,7 +144,7 @@ udp4_input_node_init(const struct rte_graph *graph, struct rte_node *node) init_once =1 ; } -UDP4_INPUT_NODE_HASH (node->ctx) = udp4_input_nm.hash_tbl[graph->socket]; +UDP4_INPUT_NODE_HASH (node->ctx) = udp4_input_nm.hash_tbl[graph->numa_id];node_dbg ("udp4_input" ,"Initialized udp4_input node" );return 0 ;
Signature · 1 line
2.55.0
PATCH 23/227 distributor: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/distributor/rte_distributor.c | 6 +++--- lib/distributor/rte_distributor.h | 4 ++-- lib/distributor/rte_distributor_single.c | 4 ++-- lib/distributor/rte_distributor_single.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-)
lib/distributor/rte_distributor.c +3 -3
@@ -720,7 +720,7 @@ rte_distributor_clear_returns(struct rte_distributor *d)RTE_EXPORT_SYMBOL (rte_distributor_create) struct rte_distributor *rte_distributor_create (const char *name, -unsigned int socket_id, +unsigned int numa_id,unsigned int num_workers,unsigned int alg_type) {
@@ -749,7 +749,7 @@ rte_distributor_create(const char *name,return NULL ; } d->d_single =rte_distributor_create_single (name, - socket_id, num_workers); + numa_id, num_workers);if (d->d_single ==NULL ) {free (d);/* rte_errno will have been set */
@@ -760,7 +760,7 @@ rte_distributor_create(const char *name, }snprintf (mz_name,sizeof (mz_name),RTE_DISTRIB_PREFIX "%s" , name); - mz =rte_memzone_reserve (mz_name,sizeof (*d), socket_id,NO_FLAGS ); + mz =rte_memzone_reserve (mz_name,sizeof (*d), numa_id,NO_FLAGS );if (mz ==NULL ) { rte_errno =ENOMEM ;return NULL ;
lib/distributor/rte_distributor.h +2 -2
@@ -35,7 +35,7 @@ struct rte_mbuf;* * @param name * The name to be given to the distributor instance. -* @param socket_id +* @param numa_id * The NUMA node on which the memory is to be allocated * @param num_workers * The maximum number of workers that will request packets from this
@@ -48,7 +48,7 @@ struct rte_mbuf;* The newly created distributor instance */ struct rte_distributor * -rte_distributor_create (const char *name,unsigned int socket_id, +rte_distributor_create (const char *name,unsigned int numa_id,unsigned int num_workers,unsigned int alg_type);
lib/distributor/rte_distributor_single.c +2 -2
@@ -375,7 +375,7 @@ rte_distributor_clear_returns_single(struct rte_distributor_single *d)/* creates a distributor instance */ struct rte_distributor_single *rte_distributor_create_single (const char *name, -unsigned socket_id, +unsigned int numa_id,unsigned num_workers) {struct rte_distributor_single *d;
@@ -395,7 +395,7 @@ rte_distributor_create_single(const char *name, }snprintf (mz_name,sizeof (mz_name),RTE_DISTRIB_PREFIX "%s" , name); - mz =rte_memzone_reserve (mz_name,sizeof (*d), socket_id,NO_FLAGS ); + mz =rte_memzone_reserve (mz_name,sizeof (*d), numa_id,NO_FLAGS );if (mz ==NULL ) { rte_errno =ENOMEM ;return NULL ;
lib/distributor/rte_distributor_single.h +2 -2
@@ -30,7 +30,7 @@ struct rte_mbuf;* * @param name * The name to be given to the distributor instance. -* @param socket_id +* @param numa_id * The NUMA node on which the memory is to be allocated * @param num_workers * The maximum number of workers that will request packets from this
@@ -39,7 +39,7 @@ struct rte_mbuf;* The newly created distributor instance */ struct rte_distributor_single * -rte_distributor_create_single (const char *name,unsigned int socket_id, +rte_distributor_create_single (const char *name,unsigned int numa_id,unsigned int num_workers);/* *** APIS to be called on the distributor lcore *** */
Signature · 1 line
2.55.0
PATCH 24/227 reorder: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/reorder/rte_reorder.c | 4 ++-- lib/reorder/rte_reorder.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
lib/reorder/rte_reorder.c +2 -2
@@ -160,7 +160,7 @@ rte_reorder_entry_insert(struct rte_tailq_entry *new_te)RTE_EXPORT_SYMBOL (rte_reorder_create) struct rte_reorder_buffer* -rte_reorder_create (const char *name,unsigned socket_id,unsigned int size) +rte_reorder_create (const char *name,unsigned int numa_id,unsigned int size) {struct rte_reorder_buffer *b =NULL ;struct rte_tailq_entry *te, *te_inserted;
@@ -190,7 +190,7 @@ rte_reorder_create(const char *name, unsigned socket_id, unsigned int size) }/* Allocate memory to store the reorder buffer structure. */ - b =rte_zmalloc_socket ("REORDER_BUFFER" , bufsize,0 , socket_id); + b =rte_zmalloc_numa ("REORDER_BUFFER" , bufsize,0 , numa_id);if (b ==NULL ) {REORDER_LOG (ERR ,"Memzone allocation failed" ); rte_errno =ENOMEM ;
lib/reorder/rte_reorder.h +2 -2
@@ -59,7 +59,7 @@ rte_reorder_free(struct rte_reorder_buffer *b);* * @param name * The name to be given to the reorder buffer instance. -* @param socket_id +* @param numa_id * The NUMA node on which the memory for the reorder buffer * instance is to be reserved. * @param size
@@ -71,7 +71,7 @@ rte_reorder_free(struct rte_reorder_buffer *b);* - EINVAL - invalid parameters */ struct rte_reorder_buffer * -rte_reorder_create (const char *name,unsigned int socket_id,unsigned int size) +rte_reorder_create (const char *name,unsigned int numa_id,unsigned int size) __rte_malloc__rte_dealloc (rte_reorder_free,1 );/**
Signature · 1 line
2.55.0
PATCH 25/227 stack: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/stack/rte_stack.c | 4 ++-- lib/stack/rte_stack.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
lib/stack/rte_stack.c +2 -2
@@ -52,7 +52,7 @@ rte_stack_get_memsize(unsigned int count, uint32_t flags)RTE_EXPORT_SYMBOL (rte_stack_create) struct rte_stack * -rte_stack_create (const char *name,unsigned int count,int socket_id, +rte_stack_create (const char *name,unsigned int count,int numa_id,uint32_t flags) {char mz_name[RTE_MEMZONE_NAMESIZE ];
@@ -108,7 +108,7 @@ rte_stack_create(const char *name, unsigned int count, int socket_id,rte_mcfg_tailq_write_lock (); - mz =rte_memzone_reserve_aligned (mz_name, sz, socket_id, + mz =rte_memzone_reserve_aligned (mz_name, sz, numa_id, 0, alignof(typeof(*s)));if (mz ==NULL ) {STACK_LOG_ERR ("Cannot reserve stack memzone!" );
lib/stack/rte_stack.h +4 -4
@@ -254,9 +254,9 @@ rte_stack_free_count(struct rte_stack *s)* The name of the stack. * @param count * The size of the stack. -* @param socket_id -* The *socket_id* argument is the socket identifier in case of -* NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA +* @param numa_id +* The *numa_id* argument is the NUMA node ID in case of +* NUMA. The value can be *RTE_NUMA_ID_ANY* if there is no NUMA * constraint for the reserved zone. * @param flags * An OR of the following:
@@ -273,7 +273,7 @@ rte_stack_free_count(struct rte_stack *s)* - ENOTSUP - platform does not support given flags combination. */ struct rte_stack * -rte_stack_create (const char *name,unsigned int count,int socket_id, +rte_stack_create (const char *name,unsigned int count,int numa_id,uint32_t flags);/**
Signature · 1 line
2.55.0
PATCH 26/227 regexdev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/regexdev/rte_regexdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/regexdev/rte_regexdev.c +1 -1
@@ -59,7 +59,7 @@ regexdev_shared_data_prepare(void)/* Allocate port data and ownership shared memory. */ mz =rte_memzone_reserve (MZ_RTE_REGEXDEV_DATA ,sizeof (*rte_regexdev_shared_data), -rte_socket_id (), flags); +rte_numa_id (), flags);if (mz ==NULL )return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 27/227 metrics: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/metrics/rte_metrics.c | 4 ++-- lib/metrics/rte_metrics.h | 4 ++-- lib/metrics/rte_metrics_telemetry.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
lib/metrics/rte_metrics.c +2 -2
@@ -58,7 +58,7 @@ struct rte_metrics_data_s {RTE_EXPORT_SYMBOL (rte_metrics_init) int -rte_metrics_init (int socket_id) +rte_metrics_init (int numa_id) {struct rte_metrics_data_s *stats;const struct rte_memzone *memzone;
@@ -72,7 +72,7 @@ rte_metrics_init(int socket_id)if (memzone !=NULL )return -EEXIST ; memzone =rte_memzone_reserve (RTE_METRICS_MEMZONE_NAME , -sizeof (struct rte_metrics_data_s ), socket_id,0 ); +sizeof (struct rte_metrics_data_s ), numa_id,0 );if (memzone ==NULL )return -ENOMEM ; stats = memzone->addr;
lib/metrics/rte_metrics.h +2 -2
@@ -76,7 +76,7 @@ struct rte_metric_value {* Initializes metric module. This function must be called from * a primary process before metrics are used. * -* @param socket_id +* @param numa_id * Socket to use for shared memory allocation. * @return * 0 on success
@@ -85,7 +85,7 @@ struct rte_metric_value {* -ENOMEM - cannot allocate metrics memzone * -E_RTE_SECONDARY - function called from secondary process */ -int rte_metrics_init (int socket_id); +int rte_metrics_init (int numa_id);/** * Deinitialize metric module. This function must be called from
lib/metrics/rte_metrics_telemetry.c +2 -2
@@ -98,7 +98,7 @@ rte_metrics_tel_reg_all_ethdev(int *metrics_register_done, int *reg_index_list)int ret, nb_drv_idx =0 ;uint16_t d; -rte_metrics_init (rte_socket_id ()); +rte_metrics_init (rte_numa_id ());RTE_ETH_FOREACH_DEV (d) {int i;/* Different device types have different numbers of stats, so
@@ -443,7 +443,7 @@ static intrte_metrics_tel_initial_metrics_setup (void) {int ret; -rte_metrics_init (rte_socket_id ()); +rte_metrics_init (rte_numa_id ());if (!tel_met_data.metrics_register_done) { ret = rte_metrics_tel_reg_all_ethdev(
Signature · 1 line
2.55.0
PATCH 28/227 mbuf: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/mbuf/rte_mbuf.c | 12 ++++++------ lib/mbuf/rte_mbuf.h | 18 +++++++++--------- lib/mbuf/rte_mbuf_dyn.c | 2 +- lib/mbuf/rte_mbuf_pool_ops.c | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-)
lib/mbuf/rte_mbuf.c +6 -6
@@ -229,7 +229,7 @@ RTE_EXPORT_SYMBOL(rte_pktmbuf_pool_create_by_ops)struct rte_mempool *rte_pktmbuf_pool_create_by_ops (const char *name,unsigned int n,unsigned int cache_size,uint16_t priv_size,uint16_t data_room_size, -int socket_id,const char *ops_name) +int numa_id,const char *ops_name) {struct rte_mempool *mp;struct rte_pktmbuf_pool_private mbp_priv;
@@ -250,7 +250,7 @@ rte_pktmbuf_pool_create_by_ops(const char *name, unsigned int n, mbp_priv.mbuf_priv_size = priv_size; mp =rte_mempool_create_empty (name, n, elt_size, cache_size, -sizeof (struct rte_pktmbuf_pool_private ), socket_id,0 ); +sizeof (struct rte_pktmbuf_pool_private ), numa_id,0 );if (mp ==NULL )return NULL ;
@@ -282,10 +282,10 @@ RTE_EXPORT_SYMBOL(rte_pktmbuf_pool_create)struct rte_mempool *rte_pktmbuf_pool_create (const char *name,unsigned int n,unsigned int cache_size,uint16_t priv_size,uint16_t data_room_size, -int socket_id) +int numa_id) {return rte_pktmbuf_pool_create_by_ops (name, n, cache_size, priv_size, - data_room_size, socket_id,NULL ); + data_room_size, numa_id,NULL ); }/* Helper to create a mbuf pool with pinned external data buffers. */
@@ -293,7 +293,7 @@ RTE_EXPORT_SYMBOL(rte_pktmbuf_pool_create_extbuf)struct rte_mempool *rte_pktmbuf_pool_create_extbuf (const char *name,unsigned int n,unsigned int cache_size,uint16_t priv_size, -uint16_t data_room_size,int socket_id, +uint16_t data_room_size,int numa_id,const struct rte_pktmbuf_extmem *ext_mem,unsigned int ext_num) {
@@ -344,7 +344,7 @@ rte_pktmbuf_pool_create_extbuf(const char *name, unsigned int n, mbp_priv.flags =RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF ; mp =rte_mempool_create_empty (name, n, elt_size, cache_size, -sizeof (struct rte_pktmbuf_pool_private ), socket_id,0 ); +sizeof (struct rte_pktmbuf_pool_private ), numa_id,0 );if (mp ==NULL )return NULL ;
lib/mbuf/rte_mbuf.h +9 -9
@@ -792,9 +792,9 @@ void rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg);* and the data buffer. This value must be aligned to RTE_MBUF_PRIV_ALIGN. * @param data_room_size * Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM. -* @param socket_id +* @param numa_id * The socket identifier where the memory should be allocated. The -* value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the +* value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for the * reserved zone. * @return * The pointer to the new allocated mempool, on success. NULL on error
@@ -808,7 +808,7 @@ void rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg);struct rte_mempool *rte_pktmbuf_pool_create (const char *name,unsigned n,unsigned cache_size,uint16_t priv_size,uint16_t data_room_size, -int socket_id); +int numa_id);/** * Create a mbuf pool with a given mempool ops name
@@ -828,9 +828,9 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,* and the data buffer. This value must be aligned to RTE_MBUF_PRIV_ALIGN. * @param data_room_size * Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM. -* @param socket_id +* @param numa_id * The socket identifier where the memory should be allocated. The -* value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the +* value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for the * reserved zone. * @param ops_name * The mempool ops name to be used for this mempool instead of
@@ -847,7 +847,7 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,struct rte_mempool *rte_pktmbuf_pool_create_by_ops (const char *name,unsigned int n,unsigned int cache_size,uint16_t priv_size,uint16_t data_room_size, -int socket_id,const char *ops_name); +int numa_id,const char *ops_name);/** A structure that describes the pinned external buffer segment. */ struct rte_pktmbuf_extmem {
@@ -875,9 +875,9 @@ struct rte_pktmbuf_extmem {* and the data buffer. This value must be aligned to RTE_MBUF_PRIV_ALIGN. * @param data_room_size * Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM. -* @param socket_id +* @param numa_id * The socket identifier where the memory should be allocated. The -* value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the +* value can be *RTE_NUMA_ID_ANY* if there is no NUMA constraint for the * reserved zone. * @param ext_mem * Pointer to the array of structures describing the external memory
@@ -898,7 +898,7 @@ struct rte_pktmbuf_extmem {struct rte_mempool *rte_pktmbuf_pool_create_extbuf (const char *name,unsigned int n,unsigned int cache_size,uint16_t priv_size, -uint16_t data_room_size,int socket_id, +uint16_t data_room_size,int numa_id,const struct rte_pktmbuf_extmem *ext_mem,unsigned int ext_num);
lib/mbuf/rte_mbuf_dyn.c +1 -1
@@ -114,7 +114,7 @@ init_shared_mem(void)if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) { mz =rte_memzone_reserve_aligned (RTE_MBUF_DYN_MZNAME ,sizeof (struct mbuf_dyn_shm ), -SOCKET_ID_ANY ,0 , +RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE ); }else { mz =rte_memzone_lookup (RTE_MBUF_DYN_MZNAME );
lib/mbuf/rte_mbuf_pool_ops.c +2 -2
@@ -26,7 +26,7 @@ rte_mbuf_set_platform_mempool_ops(const char *ops_name) mz =rte_memzone_lookup ("mbuf_platform_pool_ops" );if (mz ==NULL ) { mz =rte_memzone_reserve ("mbuf_platform_pool_ops" , -RTE_MEMPOOL_OPS_NAMESIZE ,SOCKET_ID_ANY ,0 ); +RTE_MEMPOOL_OPS_NAMESIZE ,RTE_NUMA_ID_ANY ,0 );if (mz ==NULL )return -rte_errno;strcpy (mz->addr, ops_name);
@@ -68,7 +68,7 @@ rte_mbuf_set_user_mempool_ops(const char *ops_name) mz =rte_memzone_lookup ("mbuf_user_pool_ops" );if (mz ==NULL ) { mz =rte_memzone_reserve ("mbuf_user_pool_ops" , -RTE_MEMPOOL_OPS_NAMESIZE ,SOCKET_ID_ANY ,0 ); +RTE_MEMPOOL_OPS_NAMESIZE ,RTE_NUMA_ID_ANY ,0 );if (mz ==NULL )return -rte_errno; }
Signature · 1 line
2.55.0
PATCH 29/227 timer: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/timer/rte_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/timer/rte_timer.c +1 -1
@@ -151,7 +151,7 @@ rte_timer_subsystem_init(void) mz =rte_memzone_lookup (mz_name);if (mz ==NULL ) { mz =rte_memzone_reserve_aligned (mz_name, mem_size, -SOCKET_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE ); +RTE_NUMA_ID_ANY ,0 ,RTE_CACHE_LINE_SIZE );if (mz ==NULL ) {rte_mcfg_timer_unlock ();return -ENOMEM ;
Signature · 1 line
2.55.0
PATCH 30/227 table: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/table/rte_swx_table_em.c | 2 +- lib/table/rte_swx_table_learner.c | 2 +- lib/table/rte_swx_table_selector.c | 2 +- lib/table/rte_swx_table_wm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
lib/table/rte_swx_table_em.c +1 -1
@@ -31,7 +31,7 @@ do { \static void *env_malloc (size_t size,size_t alignment,int numa_node) { -return rte_zmalloc_socket (NULL , size, alignment, numa_node); +return rte_zmalloc_numa (NULL , size, alignment, numa_node); } static void
lib/table/rte_swx_table_learner.c +1 -1
@@ -26,7 +26,7 @@static void *env_calloc (size_t size,size_t alignment,int numa_node) { -return rte_zmalloc_socket (NULL , size, alignment, numa_node); +return rte_zmalloc_numa (NULL , size, alignment, numa_node); } static void
lib/table/rte_swx_table_selector.c +1 -1
@@ -18,7 +18,7 @@static void *env_calloc (size_t size,size_t alignment,int numa_node) { -return rte_zmalloc_socket (NULL , size, alignment, numa_node); +return rte_zmalloc_numa (NULL , size, alignment, numa_node); } static void
lib/table/rte_swx_table_wm.c +1 -1
@@ -23,7 +23,7 @@static void *env_malloc (size_t size,size_t alignment,int numa_node) { -return rte_zmalloc_socket (NULL , size, alignment, numa_node); +return rte_zmalloc_numa (NULL , size, alignment, numa_node); } static void
Signature · 1 line
2.55.0
PATCH 31/227 rcu: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/rcu/rte_rcu_qsbr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rcu/rte_rcu_qsbr.c +1 -1
@@ -298,7 +298,7 @@ rte_rcu_qsbr_dq_create(const struct rte_rcu_qsbr_dq_parameters *params)/* Add token size to ring element size */ dq->r =rte_ring_create_elem (params->name, __RTE_QSBR_TOKEN_SIZE + params->esize, - qs_fifo_size,SOCKET_ID_ANY , flags); + qs_fifo_size,RTE_NUMA_ID_ANY , flags);if (dq->r ==NULL ) {RCU_LOG (ERR ,"defer queue create failed" );rte_free (dq);
Signature · 1 line
2.55.0
PATCH 32/227 pdump: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/pdump/rte_pdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/pdump/rte_pdump.c +1 -1
@@ -636,7 +636,7 @@ rte_pdump_init(void)return -1 ; mz =rte_memzone_reserve (MZ_RTE_PDUMP_STATS ,sizeof (*pdump_stats), -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (mz ==NULL ) {PDUMP_LOG_LINE (ERR ,"cannot allocate pdump statistics" );rte_mp_action_unregister (PDUMP_MP );
Signature · 1 line
2.55.0
PATCH 33/227 pdcp: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/pdcp/rte_pdcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/pdcp/rte_pdcp.c +2 -2
@@ -145,8 +145,8 @@ rte_pdcp_entity_establish(const struct rte_pdcp_entity_conf *conf)return NULL ; } - entity =rte_zmalloc_socket ("pdcp_entity" , entity_layout.total_size,RTE_CACHE_LINE_SIZE , -SOCKET_ID_ANY ); + entity =rte_zmalloc_numa ("pdcp_entity" , entity_layout.total_size,RTE_CACHE_LINE_SIZE , +RTE_NUMA_ID_ANY );if (entity ==NULL ) { rte_errno =ENOMEM ;return NULL ;
Signature · 1 line
2.55.0
PATCH 34/227 latencystats: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/latencystats/rte_latencystats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/latencystats/rte_latencystats.c +1 -1
@@ -282,7 +282,7 @@ rte_latencystats_init(uint64_t app_samp_intvl,/** Allocate stats in shared memory fo multi process support */ mz =rte_memzone_reserve (MZ_RTE_LATENCY_STATS ,sizeof (*glob_stats), -rte_socket_id (), flags); +rte_numa_id (), flags);if (mz ==NULL ) {LATENCY_STATS_LOG (ERR ,"Cannot reserve memory: %s:%d" , __func__, __LINE__);
Signature · 1 line
2.55.0
PATCH 35/227 gpudev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/gpudev/gpudev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/gpudev/gpudev.c +1 -1
@@ -169,7 +169,7 @@ gpu_shared_mem_init(void) memzone =rte_memzone_reserve (GPU_MEMZONE ,sizeof (*gpu_shared_mem) +sizeof (*gpu_shared_mem->gpus) * gpu_max, -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 ); }else { memzone =rte_memzone_lookup (GPU_MEMZONE ); }
Signature · 1 line
2.55.0
PATCH 36/227 dmadev: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/dmadev/rte_dmadev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/dmadev/rte_dmadev.c +2 -2
@@ -200,7 +200,7 @@ dma_shared_data_prepare(void)sizeof (struct rte_dma_dev_data ) * dma_devices_max;if (rte_eal_process_type () ==RTE_PROC_PRIMARY ) - mz =rte_memzone_reserve (mz_name, size,rte_socket_id (),0 ); + mz =rte_memzone_reserve (mz_name, size,rte_numa_id (),0 );else mz =rte_memzone_lookup (mz_name);if (mz ==NULL )
@@ -269,7 +269,7 @@ dma_allocate_primary(const char *name, int numa_node, size_t private_data_size)return NULL ; } - dev_private =rte_zmalloc_socket (name, private_data_size, + dev_private =rte_zmalloc_numa (name, private_data_size,RTE_CACHE_LINE_SIZE , numa_node);if (dev_private ==NULL ) {RTE_DMA_LOG (ERR ,"Cannot allocate private data" );
Signature · 1 line
2.55.0
PATCH 37/227 dispatcher: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/dispatcher/rte_dispatcher.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
lib/dispatcher/rte_dispatcher.c +6 -6
@@ -54,7 +54,7 @@ struct __rte_cache_aligned rte_dispatcher_lcore {struct rte_dispatcher {uint8_t event_dev_id; -int socket_id; +int numa_id;uint32_t service_id;struct rte_dispatcher_lcore lcores[RTE_MAX_LCORE ];uint16_t num_finalizers;
@@ -239,7 +239,7 @@ evd_service_register(struct rte_dispatcher *dispatcher) .callback = evd_process, .callback_userdata = dispatcher, .capabilities = RTE_SERVICE_CAP_MT_SAFE, - .socket_id = dispatcher->socket_id + .socket_id = dispatcher->numa_id };int rc;
@@ -271,15 +271,15 @@ RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_dispatcher_create, 23.11)struct rte_dispatcher *rte_dispatcher_create (uint8_t event_dev_id) { -int socket_id; +int numa_id;struct rte_dispatcher *dispatcher;int rc; - socket_id =rte_event_dev_socket_id (event_dev_id); + numa_id =rte_event_dev_numa_id (event_dev_id); dispatcher =rte_malloc_socket ("dispatcher" ,sizeof (struct rte_dispatcher ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (dispatcher ==NULL ) {RTE_EDEV_LOG_ERR ("Unable to allocate memory for dispatcher" );
@@ -289,7 +289,7 @@ rte_dispatcher_create(uint8_t event_dev_id) *dispatcher = (struct rte_dispatcher ) { .event_dev_id = event_dev_id, - .socket_id = socket_id + .numa_id = numa_id }; rc =evd_service_register (dispatcher);
Signature · 1 line
2.55.0
PATCH 38/227 vhost: use NUMA node terminology
In reply to Chengwen FengFrom: Chengwen Feng <[email protected]>
Rename socket_id parameters, internal variables and comments to the NUMA node terminology, and switch internal calls to rte_zmalloc_numa(), rte_numa_id() and RTE_NUMA_ID_ANY.
--- lib/vhost/iotlb.c | 2 +- lib/vhost/rte_vhost_crypto.h | 4 ++-- lib/vhost/vhost.c | 4 ++-- lib/vhost/vhost_crypto.c | 16 ++++++++-------- lib/vhost/vhost_user.c | 22 +++++++++++----------- 5 files changed, 24 insertions(+), 24 deletions(-)
lib/vhost/iotlb.c +1 -1
@@ -433,7 +433,7 @@ vhost_user_iotlb_init_one(struct virtio_net *dev, int asid)TAILQ_INIT (&dev->iotlb[asid]->pending_list);if (dev->flags &VIRTIO_DEV_SUPPORT_IOMMU ) { - dev->iotlb[asid]->pool =rte_calloc_socket ("iotlb_pool" ,IOTLB_CACHE_SIZE , + dev->iotlb[asid]->pool =rte_calloc_numa ("iotlb_pool" ,IOTLB_CACHE_SIZE ,sizeof (struct vhost_iotlb_entry ),0 , socket);if (!dev->iotlb[asid]->pool) {VHOST_CONFIG_LOG (dev->ifname,ERR ,"Failed to create IOTLB cache pool" );
lib/vhost/rte_vhost_crypto.h +2 -2
@@ -51,7 +51,7 @@ rte_vhost_crypto_driver_start(const char *path);* multiple Vhost-crypto devices. * @param sess_pool * The pointer to the created cryptodev session pool. -* @param socket_id +* @param numa_id * NUMA Socket ID to allocate resources on. * * @return * 0 if the Vhost Crypto Instance is created successfully.
@@ -60,7 +60,7 @@ rte_vhost_crypto_driver_start(const char *path);int rte_vhost_crypto_create (int vid,uint8_t cryptodev_id,struct rte_mempool *sess_pool, -int socket_id); +int numa_id);/** * Free the Vhost-crypto instance
lib/vhost/vhost.c +2 -2
@@ -635,7 +635,7 @@ static void init_vring_queue(struct virtio_net *dev __rte_unused, struct vhost_virtqueue *vq, uint32_t vring_idx) { - int numa_node = SOCKET_ID_ANY; + int numa_node = RTE_NUMA_ID_ANY;memset (vq,0 ,sizeof (struct vhost_virtqueue ));
@@ -648,7 +648,7 @@ init_vring_queue(struct virtio_net *dev __rte_unused, struct vhost_virtqueue *vqif (get_mempolicy (&numa_node,NULL ,0 , vq,MPOL_F_NODE |MPOL_F_ADDR )) {VHOST_CONFIG_LOG (dev->ifname,ERR ,"failed to query numa node: %s" ,rte_strerror (errno)); - numa_node =SOCKET_ID_ANY ; + numa_node =RTE_NUMA_ID_ANY ; }#endif vq->numa_node = numa_node;
lib/vhost/vhost_crypto.c +8 -8
@@ -217,7 +217,7 @@ struct __rte_cache_aligned vhost_crypto {uint64_t last_session_id;/** socket id for the device */ -int socket_id; +int numa_id;struct virtio_net *dev;
@@ -1806,7 +1806,7 @@ RTE_EXPORT_SYMBOL(rte_vhost_crypto_create)int rte_vhost_crypto_create (int vid,uint8_t cryptodev_id,struct rte_mempool *sess_pool, -int socket_id) +int numa_id) {struct virtio_net *dev =get_device (vid);struct rte_hash_parameters params = {0 };
@@ -1819,8 +1819,8 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,return -EINVAL ; } - vcrypto =rte_zmalloc_socket (NULL ,sizeof (*vcrypto), -RTE_CACHE_LINE_SIZE , socket_id); + vcrypto =rte_zmalloc_numa (NULL ,sizeof (*vcrypto), +RTE_CACHE_LINE_SIZE , numa_id);if (!vcrypto) {VC_LOG_ERR ("Insufficient memory" );return -ENOMEM ;
@@ -1837,7 +1837,7 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id, params.entries =VHOST_CRYPTO_SESSION_MAP_ENTRIES ; params.hash_func = rte_jhash; params.key_len =sizeof (uint64_t ); - params.numa_id = socket_id; + params.numa_id = numa_id; vcrypto->session_map =rte_hash_create (¶ms);if (!vcrypto->session_map) {VC_LOG_ERR ("Failed to creath session map" );
@@ -1850,7 +1850,7 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,VHOST_CRYPTO_MBUF_POOL_SIZE ,512 ,sizeof (struct vhost_crypto_data_req ),VHOST_CRYPTO_MAX_DATA_SIZE +RTE_PKTMBUF_HEADROOM , - rte_socket_id()); + rte_numa_id());if (!vcrypto->mbuf_pool) {VC_LOG_ERR ("Failed to creath mbuf pool" ); ret = -ENOMEM ;
@@ -1862,7 +1862,7 @@ rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,VHOST_CRYPTO_MBUF_POOL_SIZE ,sizeof (struct vhost_crypto_writeback_data ),128 ,0 ,NULL ,NULL , init_wb_data,NULL , - rte_socket_id(), 0); + rte_numa_id(), 0);if (!vcrypto->wb_pool) {VC_LOG_ERR ("Failed to creath mempool" ); ret = -ENOMEM ;
@@ -1955,7 +1955,7 @@ rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option)VHOST_CRYPTO_MBUF_POOL_SIZE ,sizeof (struct vhost_crypto_writeback_data ),128 ,0 ,NULL ,NULL , init_wb_data,NULL , - rte_socket_id(), 0); + rte_numa_id(), 0);if (!vcrypto->wb_pool) {VC_LOG_ERR ("Failed to creath mbuf pool" );return -ENOMEM ;
lib/vhost/vhost_user.c +11 -11
@@ -1382,7 +1382,7 @@ static int vhost_user_initialize_memory(struct virtio_net **pdev) {struct virtio_net *dev = *pdev; -int numa_node =SOCKET_ID_ANY ; +int numa_node =RTE_NUMA_ID_ANY ;if (dev->mem !=NULL ) { VHOST_CONFIG_LOG(dev->ifname, ERR,
@@ -1400,7 +1400,7 @@ vhost_user_initialize_memory(struct virtio_net **pdev) dev->nr_guest_pages =0 ;if (dev->guest_pages ==NULL ) { dev->max_guest_pages =8 ; - dev->guest_pages = rte_zmalloc_socket(NULL, + dev->guest_pages = rte_zmalloc_numa(NULL, dev->max_guest_pages * sizeof(struct guest_page), RTE_CACHE_LINE_SIZE,
@@ -1412,7 +1412,7 @@ vhost_user_initialize_memory(struct virtio_net **pdev) } } - dev->mem =rte_zmalloc_socket ("vhost-mem-table" ,sizeof (struct rte_vhost_memory ) + + dev->mem =rte_zmalloc_numa ("vhost-mem-table" ,sizeof (struct rte_vhost_memory ) +sizeof (struct rte_vhost_mem_region ) *VHOST_MEMORY_MAX_NREGIONS ,0 , numa_node);if (dev->mem ==NULL ) {VHOST_CONFIG_LOG (dev->ifname,ERR ,"failed to allocate memory for dev->mem" );
@@ -1919,7 +1919,7 @@ vhost_user_get_inflight_fd(struct virtio_net **pdev,uint16_t num_queues, queue_size;struct virtio_net *dev = *pdev;int fd, i, j; -int numa_node =SOCKET_ID_ANY ; +int numa_node =RTE_NUMA_ID_ANY ;void *addr;if (ctx->msg.size !=sizeof (ctx->msg.payload.inflight)) {
@@ -1937,7 +1937,7 @@ vhost_user_get_inflight_fd(struct virtio_net **pdev, numa_node = dev->virtqueue[0 ]->numa_node;if (dev->inflight_info ==NULL ) { - dev->inflight_info =rte_zmalloc_socket ("inflight_info" , + dev->inflight_info =rte_zmalloc_numa ("inflight_info" ,sizeof (struct inflight_mem_info ),0 , numa_node);if (!dev->inflight_info) {VHOST_CONFIG_LOG (dev->ifname,ERR ,"failed to alloc dev inflight area" );
@@ -2022,7 +2022,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev,struct vhost_virtqueue *vq;void *addr;int fd, i; -int numa_node =SOCKET_ID_ANY ; +int numa_node =RTE_NUMA_ID_ANY ;if (validate_msg_fds (dev, ctx,1 ) !=0 )return RTE_VHOST_MSG_RESULT_ERR ;
@@ -2070,7 +2070,7 @@ vhost_user_set_inflight_fd(struct virtio_net **pdev, numa_node = dev->virtqueue[0 ]->numa_node;if (!dev->inflight_info) { - dev->inflight_info =rte_zmalloc_socket ("inflight_info" , + dev->inflight_info =rte_zmalloc_numa ("inflight_info" ,sizeof (struct inflight_mem_info ),0 , numa_node);if (dev->inflight_info ==NULL ) {VHOST_CONFIG_LOG (dev->ifname,ERR ,"failed to alloc dev inflight area" );
@@ -2235,7 +2235,7 @@ vhost_check_queue_inflights_split(struct virtio_net *dev,vhost_virtqueue_reconnect_log_split (vq);if (resubmit_num) { - resubmit =rte_zmalloc_socket ("resubmit" ,sizeof (struct rte_vhost_resubmit_info ), + resubmit =rte_zmalloc_numa ("resubmit" ,sizeof (struct rte_vhost_resubmit_info ),0 , vq->numa_node);if (!resubmit) { VHOST_CONFIG_LOG(dev->ifname, ERR,
@@ -2243,7 +2243,7 @@ vhost_check_queue_inflights_split(struct virtio_net *dev,return RTE_VHOST_MSG_RESULT_ERR ; } - resubmit->resubmit_list =rte_zmalloc_socket ("resubmit_list" , + resubmit->resubmit_list =rte_zmalloc_numa ("resubmit_list" , resubmit_num *sizeof (struct rte_vhost_resubmit_desc ),0 , vq->numa_node);if (!resubmit->resubmit_list) {
@@ -2331,7 +2331,7 @@ vhost_check_queue_inflights_packed(struct virtio_net *dev, }if (resubmit_num) { - resubmit =rte_zmalloc_socket ("resubmit" ,sizeof (struct rte_vhost_resubmit_info ), + resubmit =rte_zmalloc_numa ("resubmit" ,sizeof (struct rte_vhost_resubmit_info ),0 , vq->numa_node);if (resubmit ==NULL ) { VHOST_CONFIG_LOG(dev->ifname, ERR,
@@ -2339,7 +2339,7 @@ vhost_check_queue_inflights_packed(struct virtio_net *dev,return RTE_VHOST_MSG_RESULT_ERR ; } - resubmit->resubmit_list =rte_zmalloc_socket ("resubmit_list" , + resubmit->resubmit_list =rte_zmalloc_numa ("resubmit_list" , resubmit_num *sizeof (struct rte_vhost_resubmit_desc ),0 , vq->numa_node);if (resubmit->resubmit_list ==NULL ) {
Signature · 1 line
2.55.0
PATCH 39/227 baseband/acc: 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/baseband/acc/acc_common.h | 4 +-- drivers/baseband/acc/rte_acc100_pmd.c | 36 ++++++++++++------------- drivers/baseband/acc/rte_vrb_pmd.c | 38 +++++++++++++-------------- 3 files changed, 39 insertions(+), 39 deletions(-)
drivers/baseband/acc/acc_common.h +2 -2
@@ -787,7 +787,7 @@ alloc_2x64mb_sw_rings_mem(struct rte_bbdev *dev, struct acc_device *d, int socket) {uint32_t sw_ring_size =ACC_SIZE_64MBYTE ; - d->sw_rings_base =rte_zmalloc_socket (dev->device->driver->name, + d->sw_rings_base =rte_zmalloc_numa (dev->device->driver->name,2 * sw_ring_size,RTE_CACHE_LINE_SIZE , socket);if (d->sw_rings_base ==NULL ) { rte_acc_log(ERR, "Failed to allocate memory for %s:%u",
@@ -830,7 +830,7 @@ alloc_sw_rings_min_mem(struct rte_bbdev *dev, struct acc_device *d,* the variable 'alignment' at the condition that the requested * size is less than the page size */ - sw_rings_base =rte_zmalloc_socket ( + sw_rings_base =rte_zmalloc_numa ( dev->device->driver->name, dev_sw_ring_size, alignment, socket);
drivers/baseband/acc/rte_acc100_pmd.c +18 -18
@@ -410,7 +410,7 @@ allocate_info_ring(struct rte_bbdev *dev)else reg_addr = &vf_reg_addr;/* Allocate InfoRing */ - d->info_ring =rte_zmalloc_socket ("Info Ring" , + d->info_ring =rte_zmalloc_numa ("Info Ring" ,ACC_INFO_RING_NUM_ENTRIES *sizeof (*d->info_ring),RTE_CACHE_LINE_SIZE , dev->data->numa_id);
@@ -437,7 +437,7 @@ allocate_info_ring(struct rte_bbdev *dev)/* Allocate 64MB memory used for all software rings */ static int -acc100_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int socket_id) +acc100_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int numa_id) {uint32_t phys_low, phys_high, value;struct acc_device *d = dev->data->dev_private;
@@ -451,13 +451,13 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)return -ENODEV ; } -alloc_sw_rings_min_mem (dev, d, num_queues, socket_id); +alloc_sw_rings_min_mem (dev, d, num_queues, numa_id);/* If minimal memory space approach failed, then allocate * the 2 * 64MB block for the sw rings */ if (d->sw_rings ==NULL ) -alloc_2x64mb_sw_rings_mem (dev, d, socket_id); +alloc_2x64mb_sw_rings_mem (dev, d, numa_id);if (d->sw_rings ==NULL ) { rte_bbdev_log(NOTICE,
@@ -508,10 +508,10 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)/* Configure tail pointer for use when SDONE enabled */ if (d->tail_ptrs ==NULL ) - d->tail_ptrs =rte_zmalloc_socket ( + d->tail_ptrs =rte_zmalloc_numa ( dev->device->driver->name,ACC100_NUM_QGRPS *ACC100_NUM_AQS *sizeof (uint32_t ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (d->tail_ptrs ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate tail ptr for %s:%u", dev->device->driver->name,
@@ -541,7 +541,7 @@ acc100_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) }if (d->harq_layout ==NULL ) - d->harq_layout =rte_zmalloc_socket ("HARQ Layout" , + d->harq_layout =rte_zmalloc_numa ("HARQ Layout" ,ACC_HARQ_LAYOUT *sizeof (*d->harq_layout),RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->harq_layout ==NULL ) {
@@ -693,8 +693,8 @@ acc100_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,return -ENODEV ; }/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (dev->device->driver->name,sizeof (*q), -RTE_CACHE_LINE_SIZE , conf->socket); + q =rte_zmalloc_numa (dev->device->driver->name,sizeof (*q), +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory" );return -ENOMEM ;
@@ -740,35 +740,35 @@ acc100_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, desc->req.fcw_ld.gain_h =1 ; } - q->lb_in =rte_zmalloc_socket (dev->device->driver->name, + q->lb_in =rte_zmalloc_numa (dev->device->driver->name,RTE_CACHE_LINE_SIZE , -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->lb_in ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate lb_in memory" ); ret = -ENOMEM ; goto free_q; } q->lb_in_addr_iova =rte_malloc_virt2iova (q->lb_in); - q->lb_out =rte_zmalloc_socket (dev->device->driver->name, + q->lb_out =rte_zmalloc_numa (dev->device->driver->name,RTE_CACHE_LINE_SIZE , -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->lb_out ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate lb_out memory" ); ret = -ENOMEM ; goto free_lb_in; } q->lb_out_addr_iova =rte_malloc_virt2iova (q->lb_out); - q->companion_ring_addr =rte_zmalloc_socket (dev->device->driver->name, + q->companion_ring_addr =rte_zmalloc_numa (dev->device->driver->name, d->sw_ring_max_depth *sizeof (*q->companion_ring_addr), -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->companion_ring_addr ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate companion_ring memory" ); ret = -ENOMEM ; goto free_lb_out; } - q->derm_buffer =rte_zmalloc_socket (dev->device->driver->name, + q->derm_buffer =rte_zmalloc_numa (dev->device->driver->name,RTE_BBDEV_TURBO_MAX_CB_SIZE *10 , -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->derm_buffer ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate derm_buffer memory" ); ret = -ENOMEM ;
@@ -4043,7 +4043,7 @@ static int acc100_pci_probe(struct rte_pci_driver *pci_drv,return -ENODEV ;/* allocate device private memory */ - bbdev->data->dev_private =rte_zmalloc_socket (dev_name, + bbdev->data->dev_private =rte_zmalloc_numa (dev_name,sizeof (struct acc_device ),RTE_CACHE_LINE_SIZE , pci_dev->device.numa_node);
drivers/baseband/acc/rte_vrb_pmd.c +19 -19
@@ -512,7 +512,7 @@ allocate_info_ring(struct rte_bbdev *dev)return 0 ;/* Already configured. */ /* Allocate InfoRing */ - d->info_ring =rte_zmalloc_socket ("Info Ring" ,ACC_INFO_RING_NUM_ENTRIES * + d->info_ring =rte_zmalloc_numa ("Info Ring" ,ACC_INFO_RING_NUM_ENTRIES *sizeof (*d->info_ring),RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->info_ring ==NULL ) { rte_bbdev_log(ERR,
@@ -540,7 +540,7 @@ allocate_info_ring(struct rte_bbdev *dev)/* Allocate 64MB memory used for all software rings. */ static int -vrb_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int socket_id) +vrb_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int numa_id) {uint32_t phys_low, phys_high, value;struct acc_device *d = dev->data->dev_private;
@@ -567,13 +567,13 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) }if (d->device_variant ==VRB1_VARIANT ) { -alloc_sw_rings_min_mem (dev, d, num_queues, socket_id); +alloc_sw_rings_min_mem (dev, d, num_queues, numa_id);/* If minimal memory space approach failed, then allocate * the 2 * 64MB block for the sw rings. */ if (d->sw_rings ==NULL ) -alloc_2x64mb_sw_rings_mem (dev, d, socket_id); +alloc_2x64mb_sw_rings_mem (dev, d, numa_id);if (d->sw_rings ==NULL ) {rte_bbdev_log (NOTICE ,"Failure allocating sw_rings memory" );
@@ -582,7 +582,7 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) }else if (d->device_variant ==VRB2_VARIANT ) { queues_per_op =RTE_MIN (VRB2_MAX_Q_PER_OP , num_queues);for (i =0 ; i <=RTE_BBDEV_OP_MLDTS ; i++) { -alloc_sw_rings_min_mem (dev, d, queues_per_op, socket_id); +alloc_sw_rings_min_mem (dev, d, queues_per_op, numa_id);if (d->sw_rings ==NULL ) {rte_bbdev_log (NOTICE ,"Failure allocating sw_rings memory %d" , i);return -ENOMEM ;
@@ -679,9 +679,9 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)/* Configure tail pointer for use when SDONE enabled. */ if (d->tail_ptrs ==NULL ) - d->tail_ptrs =rte_zmalloc_socket (dev->device->driver->name, + d->tail_ptrs =rte_zmalloc_numa (dev->device->driver->name, max_queues *sizeof (uint32_t ), -RTE_CACHE_LINE_SIZE , socket_id); +RTE_CACHE_LINE_SIZE , numa_id);if (d->tail_ptrs ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate tail ptr for %s:%u", dev->device->driver->name,
@@ -719,7 +719,7 @@ vrb_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) }if (d->harq_layout ==NULL ) - d->harq_layout =rte_zmalloc_socket ("HARQ Layout" , + d->harq_layout =rte_zmalloc_numa ("HARQ Layout" ,ACC_HARQ_LAYOUT *sizeof (*d->harq_layout),RTE_CACHE_LINE_SIZE , dev->data->numa_id);if (d->harq_layout ==NULL ) {
@@ -970,8 +970,8 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,return -ENODEV ; }/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (dev->device->driver->name,sizeof (*q), -RTE_CACHE_LINE_SIZE , conf->socket); + q =rte_zmalloc_numa (dev->device->driver->name,sizeof (*q), +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory" );return -ENOMEM ;
@@ -1046,27 +1046,27 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, desc->req.fcw_ld.gain_h =1 ; } - q->lb_in =rte_zmalloc_socket (dev->device->driver->name, + q->lb_in =rte_zmalloc_numa (dev->device->driver->name,RTE_CACHE_LINE_SIZE , -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->lb_in ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate lb_in memory" ); ret = -ENOMEM ; goto free_q; } q->lb_in_addr_iova =rte_malloc_virt2iova (q->lb_in); - q->lb_out =rte_zmalloc_socket (dev->device->driver->name, + q->lb_out =rte_zmalloc_numa (dev->device->driver->name,RTE_CACHE_LINE_SIZE , -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->lb_out ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate lb_out memory" ); ret = -ENOMEM ; goto free_lb_in; } q->lb_out_addr_iova =rte_malloc_virt2iova (q->lb_out); - q->companion_ring_addr =rte_zmalloc_socket (dev->device->driver->name, + q->companion_ring_addr =rte_zmalloc_numa (dev->device->driver->name, d->sw_ring_max_depth *sizeof (*q->companion_ring_addr), -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->companion_ring_addr ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate companion_ring memory" ); ret = -ENOMEM ;
@@ -1095,9 +1095,9 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, goto free_companion_ring_addr; } - q->fcw_ring =rte_zmalloc_socket (dev->device->driver->name, + q->fcw_ring =rte_zmalloc_numa (dev->device->driver->name,ACC_MAX_FCW_SIZE * d->sw_ring_max_depth, -RTE_CACHE_LINE_SIZE , conf->socket); +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->fcw_ring ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate fcw_ring memory" ); ret = -ENOMEM ;
@@ -4421,7 +4421,7 @@ static int vrb_pci_probe(struct rte_pci_driver *pci_drv,return -ENODEV ;/* allocate device private memory. */ - bbdev->data->dev_private =rte_zmalloc_socket (dev_name, + bbdev->data->dev_private =rte_zmalloc_numa (dev_name,sizeof (struct acc_device ),RTE_CACHE_LINE_SIZE , pci_dev->device.numa_node);
Signature · 1 line
2.55.0
PATCH 40/227 baseband/fpga_5gnr_fec: 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.
--- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +10 -10
@@ -377,7 +377,7 @@ fpga_5gnr_get_queue_map(struct fpga_5gnr_fec_device *d, uint32_t q_id) }static int -fpga_5gnr_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int socket_id) +fpga_5gnr_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int numa_id) {/* Number of queues bound to a PF/VF */ uint32_t hw_q_num =0 ;
@@ -438,9 +438,9 @@ fpga_5gnr_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_idRTE_BUILD_BUG_ON ((RTE_CACHE_LINE_SIZE %32 ) !=0 );/* Allocate memory for SW descriptor rings */ - d->sw_rings =rte_zmalloc_socket (dev->device->driver->name, + d->sw_rings =rte_zmalloc_numa (dev->device->driver->name, num_queues * ring_size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (d->sw_rings ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate memory for %s:%u sw_rings",
@@ -453,8 +453,8 @@ fpga_5gnr_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id d->sw_ring_max_depth =FPGA_5GNR_RING_MAX_SIZE ;/* Allocate memory for ring flush status */ - d->flush_queue_status =rte_zmalloc_socket (NULL , -sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , socket_id); + d->flush_queue_status =rte_zmalloc_numa (NULL , +sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , numa_id);if (d->flush_queue_status ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate memory for %s:%u flush_queue_status",
@@ -678,8 +678,8 @@ fpga_5gnr_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,return -1 ;/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (dev->device->driver->name,sizeof (*q), -RTE_CACHE_LINE_SIZE , conf->socket); + q =rte_zmalloc_numa (dev->device->driver->name,sizeof (*q), +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q ==NULL ) {/* Mark queue as un-assigned */ d->q_assigned_bit_map &= (0xFFFFFFFF - (1ULL << q_idx));
@@ -699,8 +699,8 @@ fpga_5gnr_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, q->ring_ctrl_reg.ring_base_addr = d->sw_rings_phys + (d->sw_ring_size * queue_id);/* Allocate memory for Completion Head variable*/ - q->ring_head_addr =rte_zmalloc_socket (dev->device->driver->name, -sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , conf->socket); + q->ring_head_addr =rte_zmalloc_numa (dev->device->driver->name, +sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->ring_head_addr ==NULL ) {/* Mark queue as un-assigned */ d->q_assigned_bit_map &= (0xFFFFFFFF - (1ULL << q_idx));
@@ -2933,7 +2933,7 @@ fpga_5gnr_fec_probe(struct rte_pci_driver *pci_drv,return -ENODEV ;/* allocate device private memory */ - bbdev->data->dev_private =rte_zmalloc_socket (dev_name, + bbdev->data->dev_private =rte_zmalloc_numa (dev_name,sizeof (struct fpga_5gnr_fec_device ),RTE_CACHE_LINE_SIZE , pci_dev->device.numa_node);
Signature · 1 line
2.55.0
PATCH 41/227 baseband/fpga_lte_fec: 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/baseband/fpga_lte_fec/fpga_lte_fec.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +10 -10
@@ -475,7 +475,7 @@ print_dma_dec_desc_debug_info(union fpga_dma_desc *desc)#endif static int -fpga_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int socket_id) +fpga_setup_queues (struct rte_bbdev *dev,uint16_t num_queues,int numa_id) {/* Number of queues bound to a PF/VF */ uint32_t hw_q_num =0 ;
@@ -536,9 +536,9 @@ fpga_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id)RTE_BUILD_BUG_ON ((RTE_CACHE_LINE_SIZE %32 ) !=0 );/* Allocate memory for SW descriptor rings */ - fpga_dev->sw_rings =rte_zmalloc_socket (dev->device->driver->name, + fpga_dev->sw_rings =rte_zmalloc_numa (dev->device->driver->name, num_queues * ring_size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (fpga_dev->sw_rings ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate memory for %s:%u sw_rings",
@@ -551,8 +551,8 @@ fpga_setup_queues(struct rte_bbdev *dev, uint16_t num_queues, int socket_id) fpga_dev->sw_ring_max_depth =FPGA_RING_MAX_SIZE ;/* Allocate memory for ring flush status */ - fpga_dev->flush_queue_status =rte_zmalloc_socket (NULL , -sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , socket_id); + fpga_dev->flush_queue_status =rte_zmalloc_numa (NULL , +sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , numa_id);if (fpga_dev->flush_queue_status ==NULL ) { rte_bbdev_log(ERR, "Failed to allocate memory for %s:%u flush_queue_status",
@@ -714,8 +714,8 @@ fpga_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,return -1 ;/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (dev->device->driver->name,sizeof (*q), -RTE_CACHE_LINE_SIZE , conf->socket); + q =rte_zmalloc_numa (dev->device->driver->name,sizeof (*q), +RTE_CACHE_LINE_SIZE , conf->numa_id);if (q ==NULL ) {/* Mark queue as un-assigned */ d->q_assigned_bit_map &= (0xFFFFFFFF - (1ULL << q_idx));
@@ -732,8 +732,8 @@ fpga_queue_setup(struct rte_bbdev *dev, uint16_t queue_id, (d->sw_ring_size * queue_id);/* Allocate memory for Completion Head variable*/ - q->ring_head_addr =rte_zmalloc_socket (dev->device->driver->name, -sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , conf->socket); + q->ring_head_addr =rte_zmalloc_numa (dev->device->driver->name, +sizeof (uint64_t ),RTE_CACHE_LINE_SIZE , conf->numa_id);if (q->ring_head_addr ==NULL ) {/* Mark queue as un-assigned */ d->q_assigned_bit_map &= (0xFFFFFFFF - (1ULL << q_idx));
@@ -2357,7 +2357,7 @@ fpga_lte_fec_probe(struct rte_pci_driver *pci_drv,return -ENODEV ;/* allocate device private memory */ - bbdev->data->dev_private =rte_zmalloc_socket (dev_name, + bbdev->data->dev_private =rte_zmalloc_numa (dev_name,sizeof (struct fpga_lte_fec_device ),RTE_CACHE_LINE_SIZE , pci_dev->device.numa_node);
Signature · 1 line
2.55.0
PATCH 42/227 baseband/null: 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/baseband/null/bbdev_null.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/baseband/null/bbdev_null.c +12 -12
@@ -29,13 +29,13 @@ RTE_LOG_REGISTER_DEFAULT(bbdev_null_logtype, NOTICE);/* Initialisation params structure that can be used by null BBDEV driver */ struct bbdev_null_params { -int socket_id; +int numa_id;uint16_t queues_num; };/* Acceptable params for null BBDEV devices */ #define BBDEV_NULL_MAX_NB_QUEUES_ARG "max_nb_queues" -#define BBDEV_NULL_SOCKET_ID_ARG "socket_id" +#define BBDEV_NULL_SOCKET_ID_ARG "numa_id"static const char *const bbdev_null_valid_params[] = {BBDEV_NULL_MAX_NB_QUEUES_ARG ,
@@ -117,15 +117,15 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, dev->data->dev_id, q_id);/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (RTE_STR (DRIVER_NAME ),sizeof (*q), -RTE_CACHE_LINE_SIZE , queue_conf->socket); + q =rte_zmalloc_numa (RTE_STR (DRIVER_NAME ),sizeof (*q), +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory" );return -ENOMEM ; } q->processed_pkts =rte_ring_create (ring_name, queue_conf->queue_size, - queue_conf->socket,RING_F_SP_ENQ |RING_F_SC_DEQ ); + queue_conf->numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ );if (q->processed_pkts ==NULL ) {rte_bbdev_log (ERR ,"Failed to create ring" ); goto free_q;
@@ -242,11 +242,11 @@ parse_bbdev_null_params(struct bbdev_null_params *params, goto exit; ret =rte_kvargs_process (kvlist, bbdev_null_valid_params[1 ], - &parse_u16_arg, ¶ms->socket_id); + &parse_u16_arg, ¶ms->numa_id);if (ret <0 ) goto exit; -if (params->socket_id >=RTE_MAX_NUMA_NODES ) { +if (params->numa_id >=RTE_MAX_NUMA_NODES ) {rte_bbdev_log (ERR ,"Invalid socket, must be < %u" ,RTE_MAX_NUMA_NODES ); goto exit;
@@ -270,9 +270,9 @@ null_bbdev_create(struct rte_vdev_device *vdev,if (bbdev ==NULL )return -ENODEV ; - bbdev->data->dev_private =rte_zmalloc_socket (name, + bbdev->data->dev_private =rte_zmalloc_numa (name,sizeof (struct bbdev_private ),RTE_CACHE_LINE_SIZE , - init_params->socket_id); + init_params->numa_id);if (bbdev->data->dev_private ==NULL ) {rte_bbdev_release (bbdev);return -ENOMEM ;
@@ -280,7 +280,7 @@ null_bbdev_create(struct rte_vdev_device *vdev, bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; - bbdev->data->numa_id = init_params->socket_id; + bbdev->data->numa_id = init_params->numa_id; bbdev->intr_handle =NULL ;/* register rx/tx burst functions for data path */
@@ -299,7 +299,7 @@ static int null_bbdev_probe(struct rte_vdev_device *vdev) {struct bbdev_null_params init_params = { -rte_socket_id (), +rte_numa_id (),RTE_BBDEV_DEFAULT_MAX_NB_QUEUES };const char *name;
@@ -316,7 +316,7 @@ null_bbdev_probe(struct rte_vdev_device *vdev)parse_bbdev_null_params (&init_params, input_args);rte_bbdev_log_debug ("Init %s on NUMA node %d with max queues: %d" , - name, init_params.socket_id, init_params.queues_num); + name, init_params.numa_id, init_params.queues_num);return null_bbdev_create (vdev, &init_params); }
Signature · 1 line
2.55.0
PATCH 43/227 baseband/turbo_sw: 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.
--- .../baseband/turbo_sw/bbdev_turbo_software.c | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-)
drivers/baseband/turbo_sw/bbdev_turbo_software.c +26 -26
@@ -58,13 +58,13 @@ struct bbdev_private {/* Initialisation params structure that can be used by Turbo SW driver */ struct turbo_sw_params { -int socket_id; +int numa_id;uint16_t queues_num; };/* Acceptable params for Turbo SW devices */ #define TURBO_SW_MAX_NB_QUEUES_ARG "max_nb_queues" -#define TURBO_SW_SOCKET_ID_ARG "socket_id" +#define TURBO_SW_SOCKET_ID_ARG "numa_id"static const char *const turbo_sw_valid_params[] = {TURBO_SW_MAX_NB_QUEUES_ARG ,
@@ -306,8 +306,8 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id,char name[RTE_RING_NAMESIZE ];/* Allocate the queue data structure. */ - q =rte_zmalloc_socket (RTE_STR (DRIVER_NAME ),sizeof (*q), -RTE_CACHE_LINE_SIZE , queue_conf->socket); + q =rte_zmalloc_numa (RTE_STR (DRIVER_NAME ),sizeof (*q), +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory" );return -ENOMEM ;
@@ -323,10 +323,10 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->enc_out =rte_zmalloc_socket (name, + q->enc_out =rte_zmalloc_numa (name, ((RTE_BBDEV_TURBO_MAX_TB_SIZE >>3 ) +3 ) *sizeof (*q->enc_out) *3 , -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->enc_out ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -345,9 +345,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->enc_in =rte_zmalloc_socket (name, + q->enc_in =rte_zmalloc_numa (name, (RTE_BBDEV_LDPC_MAX_CB_SIZE >>3 ) *sizeof (*q->enc_in), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->enc_in ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -365,9 +365,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->ag =rte_zmalloc_socket (name, + q->ag =rte_zmalloc_numa (name,RTE_BBDEV_TURBO_MAX_CB_SIZE *10 *sizeof (*q->ag), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->ag ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -385,9 +385,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->code_block =rte_zmalloc_socket (name, + q->code_block =rte_zmalloc_numa (name,RTE_BBDEV_TURBO_MAX_CB_SIZE *sizeof (*q->code_block), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->code_block ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -406,9 +406,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->deint_input =rte_zmalloc_socket (name, + q->deint_input =rte_zmalloc_numa (name,DEINT_INPUT_BUF_SIZE *sizeof (*q->deint_input), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->deint_input ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -427,9 +427,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->deint_output =rte_zmalloc_socket (NULL , + q->deint_output =rte_zmalloc_numa (NULL ,DEINT_OUTPUT_BUF_SIZE *sizeof (*q->deint_output), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->deint_output ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -448,9 +448,9 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, ret = -ENAMETOOLONG ; goto free_q; } - q->adapter_output =rte_zmalloc_socket (NULL , + q->adapter_output =rte_zmalloc_numa (NULL ,ADAPTER_OUTPUT_BUF_SIZE *sizeof (*q->adapter_output), -RTE_CACHE_LINE_SIZE , queue_conf->socket); +RTE_CACHE_LINE_SIZE , queue_conf->numa_id);if (q->adapter_output ==NULL ) {rte_bbdev_log (ERR ,"Failed to allocate queue memory for %s" , name);
@@ -469,7 +469,7 @@ q_setup(struct rte_bbdev *dev, uint16_t q_id, goto free_q; } q->processed_pkts =rte_ring_create (name, queue_conf->queue_size, - queue_conf->socket,RING_F_SP_ENQ |RING_F_SC_DEQ ); + queue_conf->numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ );if (q->processed_pkts ==NULL ) {rte_bbdev_log (ERR ,"Failed to create ring for %s" , name); ret = -rte_errno;
@@ -1874,11 +1874,11 @@ parse_turbo_sw_params(struct turbo_sw_params *params, const char *input_args) goto exit; ret =rte_kvargs_process (kvlist, turbo_sw_valid_params[1 ], - &parse_u16_arg, ¶ms->socket_id); + &parse_u16_arg, ¶ms->numa_id);if (ret <0 ) goto exit; -if (params->socket_id >=RTE_MAX_NUMA_NODES ) { +if (params->numa_id >=RTE_MAX_NUMA_NODES ) {rte_bbdev_log (ERR ,"Invalid socket, must be < %u" ,RTE_MAX_NUMA_NODES ); goto exit;
@@ -1902,9 +1902,9 @@ turbo_sw_bbdev_create(struct rte_vdev_device *vdev,if (bbdev ==NULL )return -ENODEV ; - bbdev->data->dev_private =rte_zmalloc_socket (name, + bbdev->data->dev_private =rte_zmalloc_numa (name,sizeof (struct bbdev_private ),RTE_CACHE_LINE_SIZE , - init_params->socket_id); + init_params->numa_id);if (bbdev->data->dev_private ==NULL ) {rte_bbdev_release (bbdev);return -ENOMEM ;
@@ -1912,7 +1912,7 @@ turbo_sw_bbdev_create(struct rte_vdev_device *vdev, bbdev->dev_ops = &pmd_ops; bbdev->device = &vdev->device; - bbdev->data->numa_id = init_params->socket_id; + bbdev->data->numa_id = init_params->numa_id; bbdev->intr_handle =NULL ;/* register rx/tx burst functions for data path */
@@ -1935,7 +1935,7 @@ static int turbo_sw_bbdev_probe(struct rte_vdev_device *vdev) {struct turbo_sw_params init_params = { -rte_socket_id (), +rte_numa_id (),RTE_BBDEV_DEFAULT_MAX_NB_QUEUES };const char *name;
@@ -1952,7 +1952,7 @@ turbo_sw_bbdev_probe(struct rte_vdev_device *vdev)rte_bbdev_log_debug ("Initialising %s on NUMA node %d with max queues: %d" , - name, init_params.socket_id, init_params.queues_num); + name, init_params.numa_id, init_params.queues_num);return turbo_sw_bbdev_create (vdev, &init_params); }
Signature · 1 line
2.55.0
PATCH 44/227 bus/auxiliary: 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/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/linux/auxiliary.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/bus/auxiliary/auxiliary_common.c +1 -1
@@ -84,7 +84,7 @@ auxiliary_probe_device(struct rte_driver *drv, struct rte_device *dev)if (!auxiliary_dev_exists (dev->name))return -ENOENT ; -if (aux_dev->device.numa_node <0 &&rte_socket_count () >1 ) +if (aux_dev->device.numa_node <0 &&rte_numa_count () >1 )AUXILIARY_LOG (INFO ,"Device %s is not NUMA-aware" , aux_dev->name); iova_mode =rte_eal_iova_mode ();
drivers/bus/auxiliary/linux/auxiliary.c +1 -1
@@ -43,7 +43,7 @@ auxiliary_scan_one(const char *dirname, const char *name) eal_parse_sysfs_value(filename, &tmp) == 0) dev->device.numa_node = tmp; else - dev->device.numa_node = SOCKET_ID_ANY; + dev->device.numa_node = RTE_NUMA_ID_ANY;auxiliary_on_scan (dev);
Signature · 1 line
2.55.0
PATCH 45/227 bus/dpaa: 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/bus/dpaa/dpaa_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -216,7 +216,7 @@ dpaa_create_device_list(void) goto cleanup; } - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ; cfg = &dpaa_netcfg->port_cfg[i]; fman_intf = cfg->fman_if;
Signature · 1 line
2.55.0
PATCH 46/227 bus/fslmc: 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/bus/fslmc/fslmc_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -251,7 +251,7 @@ scan_one_fslmc_device(char *dev_name)return -ENOMEM ; } - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ; dev->dev_type = dev_type;if (sscanf (dev_id,"%hu" , &dev->object_id) !=1 ) {
Signature · 1 line
2.55.0
PATCH 47/227 bus/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/bus/ifpga/ifpga_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/ifpga/ifpga_bus.c +1 -1
@@ -137,7 +137,7 @@ ifpga_scan_one(struct rte_rawdev *rawdev, goto end; afu_dev->device.devargs = devargs; - afu_dev->device.numa_node =SOCKET_ID_ANY ; + afu_dev->device.numa_node =RTE_NUMA_ID_ANY ; afu_dev->device.name = devargs->name; afu_dev->rawdev = rawdev; afu_dev->id.uuid.uuid_low =0 ;
Signature · 1 line
2.55.0
PATCH 48/227 bus/pci: 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/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci.c | 2 +- drivers/bus/pci/pci_common.c | 2 +- drivers/bus/pci/windows/pci.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -257,7 +257,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) dev->max_vfs =0 ;/* FreeBSD has no NUMA support (yet) */ - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ;pci_common_set (dev);
drivers/bus/pci/linux/pci.c +1 -1
@@ -291,7 +291,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) eal_parse_sysfs_value(filename, &tmp) == 0) dev->device.numa_node = tmp; else - dev->device.numa_node = SOCKET_ID_ANY; + dev->device.numa_node = RTE_NUMA_ID_ANY;pci_common_set (dev);
drivers/bus/pci/pci_common.c +1 -1
@@ -192,7 +192,7 @@ pci_probe_device(struct rte_driver *drv, struct rte_device *dev) loc->domain, loc->bus, loc->devid, loc->function, pci_dev->device.numa_node); -if (pci_dev->device.numa_node <0 &&rte_socket_count () >1 ) +if (pci_dev->device.numa_node <0 &&rte_numa_count () >1 )PCI_LOG (INFO ,"Device %s is not NUMA-aware" , pci_dev->name); already_probed = (pci_dev->intr_handle !=NULL );
drivers/bus/pci/windows/pci.c +1 -1
@@ -286,7 +286,7 @@ get_device_resource_info(HDEVINFO dev_info, }/* Get NUMA node using DEVPKEY_Device_Numa_Node */ - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ; res =SetupDiGetDevicePropertyW (dev_info, dev_info_data, &DEVPKEY_Device_Numa_Node, &property_type, (BYTE *)&numa_node,sizeof (numa_node),NULL ,0 );
Signature · 1 line
2.55.0
PATCH 49/227 bus/platform: 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/bus/platform/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/platform/platform.c +1 -1
@@ -61,7 +61,7 @@ dev_add(const char *dev_name) pdev->device.name = pdev->name; pdev->device.devargs =rte_bus_find_devargs (&platform_bus, dev_name);snprintf (path,sizeof (path),PLATFORM_BUS_DEVICES_PATH "/%s/numa_node" , dev_name); - pdev->device.numa_node =eal_parse_sysfs_value (path, &val) ?rte_socket_id () : val; + pdev->device.numa_node =eal_parse_sysfs_value (path, &val) ?rte_numa_id () : val; RTE_BUS_FOREACH_DEV(tmp, &platform_bus) {if (!strcmp (tmp->name, pdev->name)) {
Signature · 1 line
2.55.0
PATCH 50/227 bus/vdev: 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/bus/vdev/vdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/vdev/vdev.c +2 -2
@@ -275,7 +275,7 @@ insert_vdev(const char *name, const char *args, goto fail; } - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ;if (find_vdev (name)) {/*
@@ -537,7 +537,7 @@ vdev_scan(void) } dev->device.devargs = devargs; - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ; dev->device.name = devargs->name;rte_bus_add_device (&rte_vdev_bus, &dev->device);
Signature · 1 line
2.55.0
PATCH 51/227 bus/vmbus: 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/bus/vmbus/linux/vmbus_bus.c | 2 +- drivers/bus/vmbus/vmbus_channel.c | 2 +- drivers/bus/vmbus/vmbus_common.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/bus/vmbus/linux/vmbus_bus.c +1 -1
@@ -330,7 +330,7 @@ vmbus_scan_one(const char *name) dev->device.devargs =rte_bus_find_devargs (&rte_vmbus_bus, dev->name); - dev->device.numa_node =SOCKET_ID_ANY ; + dev->device.numa_node =RTE_NUMA_ID_ANY ;if (vmbus_use_numa (dev)) {/* get numa node (if present) */ snprintf(filename, sizeof(filename), "%s/numa_node",
drivers/bus/vmbus/vmbus_channel.c +1 -1
@@ -345,7 +345,7 @@ int vmbus_chan_create(const struct rte_vmbus_device *device,struct vmbus_channel *chan;int err; - chan =rte_zmalloc_socket ("VMBUS" ,sizeof (*chan),RTE_CACHE_LINE_SIZE , + chan =rte_zmalloc_numa ("VMBUS" ,sizeof (*chan),RTE_CACHE_LINE_SIZE , device->device.numa_node);if (!chan)return -ENOMEM ;
drivers/bus/vmbus/vmbus_common.c +1 -1
@@ -104,7 +104,7 @@ vmbus_probe_device(struct rte_driver *drv, struct rte_device *dev)if (ret !=0 ) goto free_intr; -if (vmbus_dev->device.numa_node <0 &&rte_socket_count () >1 ) +if (vmbus_dev->device.numa_node <0 &&rte_numa_count () >1 )VMBUS_LOG (INFO ,"Device %s is not NUMA-aware" , guid);/* call the driver probe() function */
Signature · 1 line
2.55.0
PATCH 52/227 common/cnxk: 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/common/cnxk/roc_platform.c | 2 +- drivers/common/cnxk/roc_platform.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/common/cnxk/roc_platform.c +1 -1
@@ -305,7 +305,7 @@ roc_plt_init(void)if (mz ==NULL ) { mz =rte_memzone_reserve (PLT_MODEL_MZ_NAME ,sizeof (struct roc_model ), -SOCKET_ID_ANY ,0 ); +RTE_NUMA_ID_ANY ,0 );if (mz ==NULL ) {plt_err ("Failed to reserve mem for roc_model" );return -ENOMEM ;
drivers/common/cnxk/roc_platform.h +1 -1
@@ -406,7 +406,7 @@ plt_lmt_region_reserve_aligned(const char *name, size_t len, uint32_t align)/* To ensure returned memory is physically contiguous, bounding * the start and end address in 2M range. */ -return rte_memzone_reserve_bounded (name, len,SOCKET_ID_ANY , +return rte_memzone_reserve_bounded (name, len,RTE_NUMA_ID_ANY ,RTE_MEMZONE_IOVA_CONTIG , align,RTE_PGSIZE_2M ); }
Signature · 1 line
2.55.0
PATCH 53/227 common/nitrox: 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/common/nitrox/nitrox_device.c | 2 +- drivers/common/nitrox/nitrox_qp.c | 16 ++++++++-------- drivers/common/nitrox/nitrox_qp.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/common/nitrox/nitrox_device.c +1 -1
@@ -19,7 +19,7 @@ ndev_allocate(struct rte_pci_device *pdev) {struct nitrox_device *ndev; - ndev =rte_zmalloc_socket ("nitrox device" ,sizeof (*ndev), + ndev =rte_zmalloc_numa ("nitrox device" ,sizeof (*ndev),RTE_CACHE_LINE_SIZE , pdev->device.numa_node);if (!ndev)
drivers/common/nitrox/nitrox_qp.c +8 -8
@@ -15,7 +15,7 @@static int nitrox_setup_cmdq (struct nitrox_qp *qp,uint8_t *bar_addr, -const char *dev_name,uint8_t instr_size,int socket_id) +const char *dev_name,uint8_t instr_size,int numa_id) {char mz_name[RTE_MEMZONE_NAMESIZE ];const struct rte_memzone *mz;
@@ -24,7 +24,7 @@ nitrox_setup_cmdq(struct nitrox_qp *qp, uint8_t *bar_addr,int err =0 ;snprintf (mz_name,sizeof (mz_name),"%s_cmdq_%d" , dev_name, qp->qno); - mz =rte_memzone_reserve_aligned (mz_name, cmdq_size, socket_id, + mz =rte_memzone_reserve_aligned (mz_name, cmdq_size, numa_id,RTE_MEMZONE_SIZE_HINT_ONLY |RTE_MEMZONE_256MB ,CMDQ_PKT_IN_ALIGN );
@@ -66,13 +66,13 @@ nitrox_setup_cmdq(struct nitrox_qp *qp, uint8_t *bar_addr, }static int -nitrox_setup_ridq (struct nitrox_qp *qp,int socket_id) +nitrox_setup_ridq (struct nitrox_qp *qp,int numa_id) {size_t ridq_size = qp->count *sizeof (*qp->ridq); - qp->ridq =rte_zmalloc_socket ("nitrox ridq" , ridq_size, + qp->ridq =rte_zmalloc_numa ("nitrox ridq" , ridq_size,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (!qp->ridq) {NITROX_LOG_LINE (ERR ,"Failed to create rid queue" );return -ENOMEM ;
@@ -107,7 +107,7 @@ nitrox_release_cmdq(struct nitrox_qp *qp, uint8_t *bar_addr)RTE_EXPORT_INTERNAL_SYMBOL (nitrox_qp_setup) intnitrox_qp_setup (struct nitrox_qp *qp,uint8_t *bar_addr,const char *dev_name, -uint32_t nb_descriptors,uint8_t instr_size,int socket_id) +uint32_t nb_descriptors,uint8_t instr_size,int numa_id) {int err;uint32_t count;
@@ -126,11 +126,11 @@ nitrox_qp_setup(struct nitrox_qp *qp, uint8_t *bar_addr, const char *dev_name, qp->head = qp->tail =0 ;rte_atomic_store_explicit (&qp->pending_count,0 , rte_memory_order_relaxed); - err =nitrox_setup_cmdq (qp, bar_addr, dev_name, instr_size, socket_id); + err =nitrox_setup_cmdq (qp, bar_addr, dev_name, instr_size, numa_id);if (err)return err; - err =nitrox_setup_ridq (qp, socket_id); + err =nitrox_setup_ridq (qp, numa_id);if (err) goto ridq_err;
drivers/common/nitrox/nitrox_qp.h +1 -1
@@ -139,7 +139,7 @@ nitrox_qp_dequeue(struct nitrox_qp *qp)__rte_internal int nitrox_qp_setup(struct nitrox_qp *qp, uint8_t *bar_addr,const char *dev_name,uint32_t nb_descriptors, -uint8_t inst_size,int socket_id); +uint8_t inst_size,int numa_id);__rte_internal int nitrox_qp_release(struct nitrox_qp *qp, uint8_t *bar_addr);
Signature · 1 line
2.55.0
PATCH 54/227 common/zsda: 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/common/zsda/zsda_device.c | 4 ++-- drivers/common/zsda/zsda_qp.c | 18 +++++++++--------- drivers/common/zsda/zsda_qp.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-)
drivers/common/zsda/zsda_device.c +2 -2
@@ -69,7 +69,7 @@ zsda_pci_device_allocate(struct rte_pci_device *pci_dev)struct zsda_pci_device *zsda_pci_dev;uint8_t zsda_dev_id;char name[ZSDA_DEV_NAME_MAX_LEN ]; -unsigned int socket_id =rte_socket_id (); +unsigned int numa_id =rte_numa_id ();rte_pci_device_name (&pci_dev->addr, name,sizeof (name)); snprintf(name + strlen(name), (ZSDA_DEV_NAME_MAX_LEN - strlen(name)),
@@ -99,7 +99,7 @@ zsda_pci_device_allocate(struct rte_pci_device *pci_dev) zsda_devs[zsda_dev_id].mz =rte_memzone_reserve (name,sizeof (struct zsda_pci_device ), - (int )(socket_id &0xfff ),0 ); + (int )(numa_id &0xfff ),0 );if (zsda_devs[zsda_dev_id].mz ==NULL ) {ZSDA_LOG (ERR ,"Failed! malloc" );
drivers/common/zsda/zsda_qp.c +9 -9
@@ -543,15 +543,15 @@ zsda_qps_hw_per_service(struct zsda_pci_device *zsda_pci_dev,static const struct rte_memzone *zsda_queue_dma_zone_reserve (const char *queue_name,const unsigned int queue_size, -const unsigned int socket_id) +const unsigned 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 &0xffff )) || - (socket_id == (mz->socket_id &0xffff )))) { + ((numa_id == (RTE_NUMA_ID_ANY &0xffff )) || + (numa_id == (mz->socket_id &0xffff )))) {ZSDA_LOG (DEBUG ,"re-use memzone already allocated for %s" , queue_name);
@@ -562,7 +562,7 @@ zsda_queue_dma_zone_reserve(const char *queue_name, } mz =rte_memzone_reserve_aligned (queue_name, queue_size, - (int )(socket_id &0xfff ), + (int )(numa_id &0xfff ),RTE_MEMZONE_IOVA_CONTIG , queue_size);return mz;
@@ -602,7 +602,7 @@ zsda_queue_create(const uint8_t dev_id, struct zsda_queue *queue, queue->hw_queue_number); qp_mz =zsda_queue_dma_zone_reserve (queue->memz_name, queue_size_bytes, -rte_socket_id ()); +rte_numa_id ());if (qp_mz ==NULL ) {ZSDA_LOG (ERR ,"Failed! qp_mz is NULL" );return -ENOMEM ;
@@ -652,11 +652,11 @@ zsda_cookie_init(const uint8_t dev_id, struct zsda_qp *qp, qp->srv[type].nb_descriptors = zsda_qp_conf->nb_descriptors; - qp->srv[type].op_cookies =rte_zmalloc_socket ( + qp->srv[type].op_cookies =rte_zmalloc_numa ("zsda PMD op cookie pointer" , zsda_qp_conf->nb_descriptors *sizeof (*qp->srv[type].op_cookies), -RTE_CACHE_LINE_SIZE , zsda_qp_conf->socket_id); +RTE_CACHE_LINE_SIZE , zsda_qp_conf->numa_id);if (qp->srv[type].op_cookies ==NULL ) {ZSDA_LOG (ERR ,"Failed! op_cookies is NULL" );
@@ -671,7 +671,7 @@ zsda_cookie_init(const uint8_t dev_id, struct zsda_qp *qp, qp->srv[type].op_cookie_pool =rte_mempool_create ( op_cookie_pool_name, qp->srv[type].nb_descriptors, zsda_qp_conf->cookie_size,64 ,0 ,NULL ,NULL ,NULL , -NULL , (int )(rte_socket_id () &0xfff ),0 ); +NULL , (int )(rte_numa_id () &0xfff ),0 );if (!qp->srv[type].op_cookie_pool) {ZSDA_LOG (ERR ,"Failed! op_cookie_pool is NULL" ); goto exit;
@@ -782,7 +782,7 @@ zsda_task_queue_setup(struct zsda_pci_device *zsda_pci_dev, conf.service_type = type; conf.cookie_size =sizeof (struct zsda_op_cookie ); conf.nb_descriptors = task_q_info->nb_des; - conf.socket_id = task_q_info->socket_id; + conf.numa_id = task_q_info->numa_id; conf.service_str = task_q_info->service_str; ret =zsda_common_qp_setup (zsda_pci_dev->zsda_dev_id, qp, qp_id, &conf);
drivers/common/zsda/zsda_qp.h +2 -2
@@ -137,7 +137,7 @@ struct zsda_qp_config {const struct zsda_qp_hw_data *hw;uint16_t nb_descriptors;uint32_t cookie_size; -int socket_id; +int numa_id;const char *service_str; };
@@ -157,7 +157,7 @@ struct zsda_op_cookie {struct task_queue_info {uint16_t qp_id;uint16_t nb_des; -int socket_id; +int numa_id;enum zsda_service_type type;const char *service_str;
Signature · 1 line
2.55.0
PATCH 55/227 compress/isal: 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/compress/isal/isal_compress_pmd.c | 4 ++-- drivers/compress/isal/isal_compress_pmd_ops.c | 24 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-)
drivers/compress/isal/isal_compress_pmd.c +2 -2
@@ -725,7 +725,7 @@ compdev_isal_probe(struct rte_vdev_device *dev) {struct rte_compressdev_pmd_init_params init_params = {"" , -rte_socket_id (), +rte_numa_id (), };const char *name, *args;int retval;
@@ -753,5 +753,5 @@ static struct rte_vdev_driver compdev_isal_pmd_drv = {RTE_PMD_REGISTER_VDEV (COMPDEV_NAME_ISAL_PMD , compdev_isal_pmd_drv);RTE_PMD_REGISTER_PARAM_STRING (COMPDEV_NAME_ISAL_PMD , -"socket_id=<int>" ); +"numa_id=<int>" );RTE_LOG_REGISTER_DEFAULT (isal_logtype_driver,INFO );
drivers/compress/isal/isal_compress_pmd_ops.c +12 -12
@@ -192,7 +192,7 @@ isal_comp_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id)/** Create a ring to place process packets on */ static struct rte_ring *isal_comp_pmd_qp_create_processed_pkts_ring (struct isal_comp_qp *qp, -unsigned int ring_size,int socket_id) +unsigned int ring_size,int numa_id) {struct rte_ring *r;
@@ -212,7 +212,7 @@ isal_comp_pmd_qp_create_processed_pkts_ring(struct isal_comp_qp *qp,return NULL ; } -return rte_ring_create (qp->name, ring_size, socket_id, +return rte_ring_create (qp->name, ring_size, numa_id,RING_F_SP_ENQ |RING_F_SC_DEQ ); }
@@ -234,7 +234,7 @@ struct isal_comp_qp *qp)/* Setup a queue pair */ static int isal_comp_pmd_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 isal_comp_qp *qp =NULL ;int retval;
@@ -244,34 +244,34 @@ isal_comp_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,isal_comp_pmd_qp_release (dev, qp_id);/* Allocate the queue pair data structure. */ - qp =rte_zmalloc_socket ("Isa-l compression PMD Queue Pair" ,sizeof (*qp), -RTE_CACHE_LINE_SIZE , socket_id); + qp =rte_zmalloc_numa ("Isa-l compression PMD Queue Pair" ,sizeof (*qp), +RTE_CACHE_LINE_SIZE , numa_id);if (qp ==NULL ) {ISAL_PMD_LOG (ERR ,"Failed to allocate queue pair memory" );return (-ENOMEM ); }/* Initialize memory for compression stream structure */ - qp->stream =rte_zmalloc_socket ("Isa-l compression stream " , + qp->stream =rte_zmalloc_numa ("Isa-l compression stream " ,sizeof (struct isal_zstream ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (qp->stream ==NULL ) {ISAL_PMD_LOG (ERR ,"Failed to allocate compression stream memory" ); goto qp_setup_cleanup; }/* Initialize memory for compression level buffer */ - qp->stream->level_buf =rte_zmalloc_socket ("Isa-l compression lev_buf" , + qp->stream->level_buf =rte_zmalloc_numa ("Isa-l compression lev_buf" ,ISAL_DEF_LVL3_DEFAULT ,RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (qp->stream->level_buf ==NULL ) {ISAL_PMD_LOG (ERR ,"Failed to allocate compression level_buf memory" ); goto qp_setup_cleanup; }/* Initialize memory for decompression state structure */ - qp->state =rte_zmalloc_socket ("Isa-l decompression state" , + qp->state =rte_zmalloc_numa ("Isa-l decompression state" ,sizeof (struct inflate_state ),RTE_CACHE_LINE_SIZE , - socket_id); + numa_id);if (qp->state ==NULL ) {ISAL_PMD_LOG (ERR ,"Failed to allocate decompression state memory" ); goto qp_setup_cleanup;
@@ -288,7 +288,7 @@ isal_comp_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, } qp->processed_pkts =isal_comp_pmd_qp_create_processed_pkts_ring (qp, - max_inflight_ops, socket_id); + max_inflight_ops, numa_id);if (qp->processed_pkts ==NULL ) {ISAL_PMD_LOG (ERR ,"Failed to create unique name for isal " "compression device" );
Signature · 1 line
2.55.0
PATCH 56/227 compress/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/compress/mlx5/mlx5_compress.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/compress/mlx5/mlx5_compress.c +9 -9
@@ -57,7 +57,7 @@ struct mlx5_compress_qp {uint16_t pi;uint16_t ci;struct mlx5_mr_ctrl mr_ctrl; -int socket_id; +int numa_id;struct mlx5_devx_cq cq;struct mlx5_devx_qp qp;struct mlx5_pmd_mr opaque_mr;
@@ -150,7 +150,7 @@ mlx5_compress_init_qp(struct mlx5_compress_qp *qp)static int mlx5_compress_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 mlx5_compress_priv *priv = dev->data->dev_private;struct mlx5_hca_attr *attr = &priv->cdev->config.hca_attr;
@@ -170,8 +170,8 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, alloc_size =RTE_ALIGN (alloc_size,RTE_CACHE_LINE_SIZE ); alloc_size +=sizeof (struct rte_comp_op *) * (1u << log_ops_n); - qp =rte_zmalloc_socket (__func__, alloc_size,RTE_CACHE_LINE_SIZE , - socket_id); + qp =rte_zmalloc_numa (__func__, alloc_size,RTE_CACHE_LINE_SIZE , + numa_id);if (qp ==NULL ) {DRV_LOG (ERR ,"Failed to allocate qp memory." ); rte_errno =ENOMEM ;
@@ -194,7 +194,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, goto err; } qp->entries_n =1 << log_ops_n; - qp->socket_id = socket_id; + qp->numa_id = numa_id; qp->qp_id = qp_id; qp->priv = priv; qp->ops = (struct rte_comp_op **)RTE_ALIGN((uintptr_t)(qp + 1),
@@ -208,7 +208,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, goto err; } ret =mlx5_devx_cq_create (priv->cdev->ctx, &qp->cq, log_ops_n, &cq_attr, - socket_id); + numa_id);if (ret !=0 ) {DRV_LOG (ERR ,"Failed to create CQ." ); goto err;
@@ -223,7 +223,7 @@ mlx5_compress_qp_setup(struct rte_compressdev *dev, uint16_t qp_id, attr->decomp_deflate_v1_en || attr->decomp_deflate_v2_en; ret =mlx5_devx_qp_create (priv->cdev->ctx, &qp->qp, qp_attr.num_of_send_wqbbs * -MLX5_WQE_SIZE , &qp_attr, socket_id); +MLX5_WQE_SIZE , &qp_attr, numa_id);if (ret !=0 ) {DRV_LOG (ERR ,"Failed to create QP." ); goto err;
@@ -368,7 +368,7 @@ mlx5_compress_xform_create(struct rte_compressdev *dev, ret =mlx5_compress_xform_validate (xform, &priv->cdev->config.hca_attr);if (ret <0 )return ret; - xfrm =rte_zmalloc_socket (__func__,sizeof (*xfrm),0 , + xfrm =rte_zmalloc_numa (__func__,sizeof (*xfrm),0 , priv->dev_config.numa_id);if (xfrm ==NULL )return -ENOMEM ;
@@ -828,7 +828,7 @@ mlx5_compress_dev_probe(struct mlx5_common_device *cdev,struct mlx5_compress_devarg_params devarg_prms = {0 };struct rte_compressdev_pmd_init_params init_params = { .name ="" , - .socket_id = cdev->dev->numa_node, + .numa_id = cdev->dev->numa_node, };const char *ibdev_name =mlx5_os_get_ctx_device_name (cdev->ctx);uint32_t crc32_opaq_offset;
Signature · 1 line
2.55.0