From 7e3738de16ba15f40a2f23c27b592bd9fa54e511 Mon Sep 17 00:00:00 2001 From: fengbojiang Date: Thu, 28 Jan 2021 17:08:59 +0000 Subject: [PATCH] DPDK: upgrade to DPDK 19.11.6(LTS). --- dpdk/MAINTAINERS | 25 +- dpdk/VERSION | 2 +- dpdk/app/pdump/main.c | 2 +- dpdk/app/test-acl/main.c | 2 +- dpdk/app/test-bbdev/ldpc_enc_default.data | 2 +- dpdk/app/test-crypto-perf/main.c | 3 +- dpdk/app/test-crypto-perf/meson.build | 3 + dpdk/app/test-eventdev/evt_options.c | 4 + dpdk/app/test-eventdev/test_pipeline_atq.c | 2 + dpdk/app/test-eventdev/test_pipeline_common.c | 10 +- dpdk/app/test-pipeline/config.c | 2 - dpdk/app/test-pmd/bpf_cmd.c | 4 +- dpdk/app/test-pmd/cmdline.c | 30 +- dpdk/app/test-pmd/cmdline_flow.c | 27 +- dpdk/app/test-pmd/cmdline_mtr.c | 1 + dpdk/app/test-pmd/config.c | 314 +++- dpdk/app/test-pmd/csumonly.c | 13 +- dpdk/app/test-pmd/meson.build | 12 + dpdk/app/test-pmd/parameters.c | 2 +- dpdk/app/test-pmd/testpmd.c | 208 ++- dpdk/app/test-pmd/testpmd.h | 2 + dpdk/app/test-pmd/txonly.c | 32 + dpdk/app/test-sad/main.c | 2 +- dpdk/app/test/Makefile | 2 +- dpdk/app/test/autotest_data.py | 4 +- dpdk/app/test/meson.build | 252 +-- dpdk/app/test/test.h | 2 - dpdk/app/test/test_acl.c | 20 +- dpdk/app/test/test_bpf.c | 39 +- dpdk/app/test/test_cryptodev.c | 425 ++++- .../test/test_cryptodev_aes_test_vectors.h | 126 +- dpdk/app/test/test_cryptodev_asym.c | 5 +- dpdk/app/test/test_cryptodev_blockcipher.c | 2 +- .../test/test_cryptodev_hash_test_vectors.h | 10 + .../test/test_cryptodev_mixed_test_vectors.h | 1320 +++++++++++++- dpdk/app/test/test_cycles.c | 8 +- dpdk/app/test/test_distributor.c | 214 ++- dpdk/app/test/test_event_crypto_adapter.c | 44 +- dpdk/app/test/test_event_eth_tx_adapter.c | 4 +- dpdk/app/test/test_fib_perf.c | 2 +- dpdk/app/test/test_flow_classify.c | 2 +- dpdk/app/test/test_hash.c | 7 +- ...ite_lf.c => test_hash_readwrite_lf_perf.c} | 7 +- dpdk/app/test/test_ipsec.c | 33 +- dpdk/app/test/test_kvargs.c | 40 +- dpdk/app/test/test_lpm_perf.c | 2 +- dpdk/app/test/test_malloc.c | 12 + dpdk/app/test/test_mbuf.c | 14 +- dpdk/app/test/test_pmd_perf.c | 2 +- dpdk/app/test/test_rcu_qsbr.c | 56 +- dpdk/app/test/test_ring.c | 4 +- dpdk/app/test/test_ring_perf.c | 3 +- dpdk/app/test/test_service_cores.c | 1 + dpdk/app/test/test_table_pipeline.c | 12 +- dpdk/buildtools/call-sphinx-build.py | 31 + dpdk/buildtools/meson.build | 6 +- dpdk/buildtools/options-ibverbs-static.sh | 11 +- dpdk/buildtools/pkg-config/meson.build | 55 + .../pkg-config/set-static-linker-flags.py | 38 + dpdk/buildtools/pmdinfogen/pmdinfogen.h | 2 +- dpdk/config/common_base | 2 - dpdk/config/defconfig_arm-armv7a-linuxapp-gcc | 1 - .../defconfig_arm64-graviton2-linux-gcc | 1 + .../defconfig_arm64-graviton2-linuxapp-gcc | 13 + dpdk/config/defconfig_graviton2 | 1 + dpdk/config/meson.build | 61 +- dpdk/config/rte_config.h | 4 +- dpdk/devtools/check-forbidden-tokens.awk | 4 +- dpdk/devtools/check-symbol-change.sh | 10 +- dpdk/devtools/checkpatches.sh | 8 + dpdk/devtools/test-meson-builds.sh | 13 +- dpdk/doc/api/doxy-api-index.md | 12 +- dpdk/doc/api/doxy-api.conf.in | 1 + dpdk/doc/build-sdk-meson.txt | 30 +- dpdk/doc/guides/compressdevs/qat_comp.rst | 5 +- dpdk/doc/guides/conf.py | 22 +- dpdk/doc/guides/contributing/abi_policy.rst | 31 +- .../guides/contributing/abi_versioning.rst | 126 +- .../doc/guides/contributing/documentation.rst | 12 +- dpdk/doc/guides/contributing/patches.rst | 20 +- dpdk/doc/guides/contributing/stable.rst | 8 +- .../doc/guides/contributing/vulnerability.rst | 6 +- dpdk/doc/guides/cryptodevs/aesni_gcm.rst | 13 + dpdk/doc/guides/cryptodevs/aesni_mb.rst | 13 + .../doc/guides/cryptodevs/features/kasumi.ini | 1 + .../guides/cryptodevs/features/octeontx.ini | 1 + .../guides/cryptodevs/features/octeontx2.ini | 1 + dpdk/doc/guides/cryptodevs/features/qat.ini | 5 + .../doc/guides/cryptodevs/features/snow3g.ini | 1 + dpdk/doc/guides/cryptodevs/features/zuc.ini | 1 + dpdk/doc/guides/cryptodevs/qat.rst | 63 +- dpdk/doc/guides/eventdevs/index.rst | 2 +- .../guides/freebsd_gsg/install_from_ports.rst | 2 +- dpdk/doc/guides/linux_gsg/build_dpdk.rst | 66 +- .../guides/linux_gsg/build_sample_apps.rst | 4 +- .../doc/guides/linux_gsg/eal_args.include.rst | 2 +- dpdk/doc/guides/linux_gsg/enable_func.rst | 60 +- dpdk/doc/guides/linux_gsg/linux_drivers.rst | 6 +- .../linux_gsg/nic_perf_intel_platform.rst | 5 +- dpdk/doc/guides/linux_gsg/sys_reqs.rst | 76 +- dpdk/doc/guides/meson.build | 22 +- dpdk/doc/guides/nics/dpaa2.rst | 4 +- dpdk/doc/guides/nics/enic.rst | 2 +- dpdk/doc/guides/nics/fail_safe.rst | 2 +- dpdk/doc/guides/nics/features/hns3.ini | 1 + dpdk/doc/guides/nics/features/hns3_vf.ini | 1 + dpdk/doc/guides/nics/features/i40e.ini | 1 - dpdk/doc/guides/nics/features/ice.ini | 1 - dpdk/doc/guides/nics/features/igb.ini | 1 + dpdk/doc/guides/nics/features/ixgbe.ini | 1 + dpdk/doc/guides/nics/hns3.rst | 1 + dpdk/doc/guides/nics/i40e.rst | 18 + dpdk/doc/guides/nics/ice.rst | 4 - dpdk/doc/guides/nics/mlx5.rst | 48 +- dpdk/doc/guides/nics/nfp.rst | 37 +- dpdk/doc/guides/nics/pcap_ring.rst | 2 +- dpdk/doc/guides/nics/sfc_efx.rst | 4 +- dpdk/doc/guides/prog_guide/cryptodev_lib.rst | 2 +- .../prog_guide/kernel_nic_interface.rst | 2 +- dpdk/doc/guides/prog_guide/lto.rst | 2 +- .../guides/prog_guide/multi_proc_support.rst | 2 +- .../prog_guide/packet_classif_access_ctrl.rst | 6 + .../thread_safety_dpdk_functions.rst | 4 +- dpdk/doc/guides/rel_notes/deprecation.rst | 11 - dpdk/doc/guides/rel_notes/release_19_11.rst | 1516 +++++++++++++++++ dpdk/doc/guides/sample_app_ug/ethtool.rst | 2 +- .../guides/sample_app_ug/flow_classify.rst | 2 +- .../guides/sample_app_ug/flow_filtering.rst | 2 +- dpdk/doc/guides/sample_app_ug/ipsec_secgw.rst | 4 +- .../guides/sample_app_ug/l2_forward_event.rst | 8 - .../sample_app_ug/l2_forward_real_virtual.rst | 9 - .../sample_app_ug/l3_forward_access_ctrl.rst | 8 +- .../sample_app_ug/l3_forward_power_man.rst | 2 +- .../guides/sample_app_ug/link_status_intr.rst | 7 - .../guides/sample_app_ug/multi_process.rst | 2 +- .../guides/testpmd_app_ug/testpmd_funcs.rst | 8 +- dpdk/doc/guides/tools/testbbdev.rst | 2 +- dpdk/doc/guides/windows_gsg/build_dpdk.rst | 51 +- dpdk/drivers/Makefile | 2 +- .../baseband/fpga_lte_fec/fpga_lte_fec.c | 4 +- .../baseband/turbo_sw/bbdev_turbo_software.c | 37 +- .../drivers/bus/dpaa/base/qbman/qman_driver.c | 10 +- dpdk/drivers/bus/dpaa/dpaa_bus.c | 5 + dpdk/drivers/bus/fslmc/fslmc_bus.c | 5 + dpdk/drivers/bus/fslmc/fslmc_vfio.c | 21 +- dpdk/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 9 +- dpdk/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 +- dpdk/drivers/bus/fslmc/qbman/qbman_debug.c | 9 +- dpdk/drivers/bus/fslmc/qbman/qbman_portal.c | 3 +- dpdk/drivers/bus/ifpga/ifpga_bus.c | 1 + dpdk/drivers/bus/ifpga/rte_bus_ifpga.h | 1 + dpdk/drivers/bus/pci/bsd/pci.c | 49 - dpdk/drivers/bus/pci/linux/pci.c | 17 +- dpdk/drivers/bus/pci/linux/pci_vfio.c | 45 +- dpdk/drivers/bus/pci/pci_common.c | 6 +- dpdk/drivers/bus/pci/pci_common_uio.c | 1 + dpdk/drivers/bus/pci/private.h | 25 - dpdk/drivers/bus/vdev/rte_bus_vdev.h | 2 +- dpdk/drivers/bus/vmbus/linux/vmbus_uio.c | 4 +- dpdk/drivers/bus/vmbus/vmbus_common.c | 2 +- dpdk/drivers/common/cpt/cpt_ucode.h | 24 +- dpdk/drivers/common/dpaax/caamflib/desc.h | 2 +- .../drivers/common/dpaax/caamflib/desc/pdcp.h | 55 +- dpdk/drivers/common/octeontx/octeontx_mbox.c | 17 +- dpdk/drivers/common/octeontx2/hw/otx2_npc.h | 4 +- dpdk/drivers/common/octeontx2/otx2_mbox.c | 7 +- dpdk/drivers/common/qat/qat_adf/icp_qat_fw.h | 5 + .../common/qat/qat_adf/icp_qat_fw_la.h | 2 + dpdk/drivers/common/qat/qat_common.c | 3 + dpdk/drivers/common/qat/qat_common.h | 3 + dpdk/drivers/common/qat/qat_device.c | 203 ++- dpdk/drivers/common/qat/qat_device.h | 90 +- dpdk/drivers/common/qat/qat_qp.c | 207 ++- dpdk/drivers/common/qat/qat_qp.h | 17 +- .../compress/isal/isal_compress_pmd_ops.c | 20 +- dpdk/drivers/compress/octeontx/otx_zip_pmd.c | 2 +- dpdk/drivers/compress/qat/qat_comp_pmd.c | 68 +- dpdk/drivers/compress/qat/qat_comp_pmd.h | 6 +- dpdk/drivers/compress/zlib/zlib_pmd.c | 2 + dpdk/drivers/compress/zlib/zlib_pmd_private.h | 2 +- dpdk/drivers/crypto/aesni_gcm/Makefile | 3 +- dpdk/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 + .../crypto/aesni_gcm/aesni_gcm_pmd_private.h | 2 +- dpdk/drivers/crypto/aesni_mb/Makefile | 3 +- .../crypto/aesni_mb/aesni_mb_pmd_private.h | 6 +- .../crypto/aesni_mb/rte_aesni_mb_pmd.c | 53 +- .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 8 +- dpdk/drivers/crypto/armv8/armv8_pmd_private.h | 34 +- dpdk/drivers/crypto/armv8/rte_armv8_pmd.c | 6 +- dpdk/drivers/crypto/caam_jr/Makefile | 7 + dpdk/drivers/crypto/caam_jr/caam_jr.c | 33 +- .../crypto/caam_jr/caam_jr_hw_specific.h | 2 +- dpdk/drivers/crypto/caam_jr/caam_jr_pvt.h | 9 +- dpdk/drivers/crypto/caam_jr/caam_jr_uio.c | 34 +- dpdk/drivers/crypto/caam_jr/meson.build | 5 + dpdk/drivers/crypto/ccp/ccp_dev.c | 2 +- dpdk/drivers/crypto/dpaa2_sec/Makefile | 7 + .../crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 28 +- dpdk/drivers/crypto/dpaa2_sec/meson.build | 5 + dpdk/drivers/crypto/dpaa_sec/Makefile | 7 + dpdk/drivers/crypto/dpaa_sec/dpaa_sec.c | 40 +- dpdk/drivers/crypto/dpaa_sec/meson.build | 5 + .../crypto/kasumi/kasumi_pmd_private.h | 4 +- dpdk/drivers/crypto/kasumi/rte_kasumi_pmd.c | 2 + dpdk/drivers/crypto/mvsam/mrvl_pmd_private.h | 2 +- dpdk/drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 + dpdk/drivers/crypto/nitrox/nitrox_csr.h | 20 +- dpdk/drivers/crypto/nitrox/nitrox_sym.c | 3 +- .../crypto/octeontx/otx_cryptodev_ops.c | 1 + .../drivers/crypto/octeontx2/otx2_cryptodev.c | 60 +- .../drivers/crypto/octeontx2/otx2_cryptodev.h | 4 +- .../crypto/octeontx2/otx2_cryptodev_ops.c | 22 +- .../crypto/octeontx2/otx2_cryptodev_ops.h | 2 +- .../crypto/openssl/openssl_pmd_private.h | 2 +- dpdk/drivers/crypto/openssl/rte_openssl_pmd.c | 24 + dpdk/drivers/crypto/qat/qat_asym.c | 4 +- dpdk/drivers/crypto/qat/qat_asym_pmd.c | 89 +- dpdk/drivers/crypto/qat/qat_asym_pmd.h | 8 +- dpdk/drivers/crypto/qat/qat_sym.c | 2 +- dpdk/drivers/crypto/qat/qat_sym.h | 2 +- .../drivers/crypto/qat/qat_sym_capabilities.h | 107 +- dpdk/drivers/crypto/qat/qat_sym_pmd.c | 145 +- dpdk/drivers/crypto/qat/qat_sym_pmd.h | 15 +- dpdk/drivers/crypto/qat/qat_sym_session.c | 199 ++- dpdk/drivers/crypto/qat/qat_sym_session.h | 1 + dpdk/drivers/crypto/scheduler/meson.build | 2 +- .../crypto/scheduler/scheduler_pmd_private.h | 1 - dpdk/drivers/crypto/snow3g/rte_snow3g_pmd.c | 2 + .../crypto/snow3g/snow3g_pmd_private.h | 2 +- dpdk/drivers/crypto/zuc/rte_zuc_pmd.c | 2 + dpdk/drivers/crypto/zuc/zuc_pmd_private.h | 4 +- dpdk/drivers/event/dpaa/dpaa_eventdev.c | 4 +- dpdk/drivers/event/dpaa2/dpaa2_eventdev.c | 13 +- .../event/dpaa2/dpaa2_eventdev_selftest.c | 13 +- dpdk/drivers/event/dsw/dsw_event.c | 15 +- dpdk/drivers/event/octeontx2/otx2_evdev.c | 104 +- dpdk/drivers/event/octeontx2/otx2_evdev.h | 12 + .../event/octeontx2/otx2_evdev_adptr.c | 4 +- .../event/octeontx2/otx2_evdev_stats.h | 2 +- .../event/octeontx2/otx2_worker_dual.h | 7 +- dpdk/drivers/mempool/dpaa2/meson.build | 2 + .../drivers/mempool/octeontx/octeontx_fpavf.c | 6 +- .../mempool/octeontx2/otx2_mempool_ops.c | 2 +- dpdk/drivers/meson.build | 14 +- .../drivers/net/af_packet/rte_eth_af_packet.c | 22 +- dpdk/drivers/net/af_xdp/rte_eth_af_xdp.c | 31 +- dpdk/drivers/net/atlantic/rte_pmd_atlantic.h | 2 +- dpdk/drivers/net/avp/avp_ethdev.c | 2 +- dpdk/drivers/net/bnx2x/bnx2x_ethdev.c | 4 + dpdk/drivers/net/bnxt/bnxt.h | 34 +- dpdk/drivers/net/bnxt/bnxt_cpr.c | 14 +- dpdk/drivers/net/bnxt/bnxt_cpr.h | 7 +- dpdk/drivers/net/bnxt/bnxt_ethdev.c | 143 +- dpdk/drivers/net/bnxt/bnxt_filter.c | 15 +- dpdk/drivers/net/bnxt/bnxt_flow.c | 20 +- dpdk/drivers/net/bnxt/bnxt_hwrm.c | 131 +- dpdk/drivers/net/bnxt/bnxt_hwrm.h | 4 +- dpdk/drivers/net/bnxt/bnxt_ring.c | 3 +- dpdk/drivers/net/bnxt/bnxt_ring.h | 23 +- dpdk/drivers/net/bnxt/bnxt_rxq.c | 55 +- dpdk/drivers/net/bnxt/bnxt_rxq.h | 7 +- dpdk/drivers/net/bnxt/bnxt_rxr.c | 49 +- dpdk/drivers/net/bnxt/bnxt_rxr.h | 2 - dpdk/drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 9 +- dpdk/drivers/net/bnxt/bnxt_stats.c | 67 - dpdk/drivers/net/bnxt/bnxt_txq.c | 36 +- dpdk/drivers/net/bnxt/bnxt_txr.c | 2 + dpdk/drivers/net/bnxt/bnxt_txr.h | 2 - dpdk/drivers/net/bnxt/bnxt_vnic.c | 3 + dpdk/drivers/net/bnxt/rte_pmd_bnxt.h | 3 +- .../net/bonding/eth_bond_8023ad_private.h | 3 + dpdk/drivers/net/bonding/eth_bond_private.h | 3 +- .../drivers/net/bonding/rte_eth_bond_8023ad.c | 32 +- dpdk/drivers/net/bonding/rte_eth_bond_api.c | 9 +- dpdk/drivers/net/bonding/rte_eth_bond_pmd.c | 31 +- dpdk/drivers/net/cxgbe/base/adapter.h | 1 + dpdk/drivers/net/cxgbe/cxgbe_ethdev.c | 11 +- dpdk/drivers/net/cxgbe/cxgbe_filter.c | 129 +- dpdk/drivers/net/cxgbe/cxgbe_filter.h | 4 +- dpdk/drivers/net/cxgbe/cxgbe_flow.c | 30 +- dpdk/drivers/net/cxgbe/mps_tcam.c | 1 + dpdk/drivers/net/cxgbe/sge.c | 175 +- dpdk/drivers/net/dpaa/dpaa_ethdev.c | 25 +- dpdk/drivers/net/dpaa/dpaa_rxtx.c | 2 +- dpdk/drivers/net/dpaa/rte_pmd_dpaa.h | 4 +- dpdk/drivers/net/dpaa2/dpaa2_ethdev.c | 22 +- dpdk/drivers/net/dpaa2/dpaa2_ethdev.h | 4 - dpdk/drivers/net/dpaa2/dpaa2_flow.c | 4 +- dpdk/drivers/net/dpaa2/dpaa2_mux.c | 2 +- dpdk/drivers/net/dpaa2/dpaa2_ptp.c | 2 + dpdk/drivers/net/dpaa2/meson.build | 7 +- dpdk/drivers/net/e1000/em_ethdev.c | 2 +- dpdk/drivers/net/e1000/igb_ethdev.c | 4 +- dpdk/drivers/net/e1000/igb_rxtx.c | 179 +- dpdk/drivers/net/ena/base/ena_com.c | 62 +- dpdk/drivers/net/ena/base/ena_com.h | 34 +- dpdk/drivers/net/ena/base/ena_plat_dpdk.h | 100 +- dpdk/drivers/net/ena/ena_ethdev.c | 27 +- dpdk/drivers/net/enetc/base/enetc_hw.h | 3 +- dpdk/drivers/net/enetc/enetc_ethdev.c | 5 +- dpdk/drivers/net/enic/enic_ethdev.c | 12 - dpdk/drivers/net/enic/enic_fm_flow.c | 105 +- dpdk/drivers/net/failsafe/failsafe.c | 1 + dpdk/drivers/net/failsafe/failsafe_ether.c | 27 +- dpdk/drivers/net/failsafe/failsafe_intr.c | 2 +- dpdk/drivers/net/failsafe/failsafe_ops.c | 10 +- dpdk/drivers/net/failsafe/failsafe_private.h | 8 + dpdk/drivers/net/fm10k/fm10k_ethdev.c | 32 +- dpdk/drivers/net/fm10k/fm10k_rxtx_vec.c | 39 +- dpdk/drivers/net/hinic/base/hinic_compat.h | 34 +- .../net/hinic/base/hinic_pmd_api_cmd.c | 7 +- dpdk/drivers/net/hinic/base/hinic_pmd_cfg.c | 7 +- dpdk/drivers/net/hinic/base/hinic_pmd_cfg.h | 1 + dpdk/drivers/net/hinic/base/hinic_pmd_cmdq.c | 41 +- dpdk/drivers/net/hinic/base/hinic_pmd_cmdq.h | 1 + dpdk/drivers/net/hinic/base/hinic_pmd_eqs.c | 10 +- dpdk/drivers/net/hinic/base/hinic_pmd_eqs.h | 4 + dpdk/drivers/net/hinic/base/hinic_pmd_hwdev.c | 178 +- dpdk/drivers/net/hinic/base/hinic_pmd_hwdev.h | 1 - dpdk/drivers/net/hinic/base/hinic_pmd_mbox.c | 96 +- dpdk/drivers/net/hinic/base/hinic_pmd_mbox.h | 7 +- dpdk/drivers/net/hinic/base/hinic_pmd_mgmt.c | 64 +- dpdk/drivers/net/hinic/base/hinic_pmd_mgmt.h | 7 +- .../drivers/net/hinic/base/hinic_pmd_niccfg.c | 66 +- .../drivers/net/hinic/base/hinic_pmd_niccfg.h | 2 - dpdk/drivers/net/hinic/base/hinic_pmd_nicio.c | 61 +- dpdk/drivers/net/hinic/base/hinic_pmd_wq.c | 11 +- dpdk/drivers/net/hinic/base/hinic_pmd_wq.h | 2 +- dpdk/drivers/net/hinic/hinic_pmd_ethdev.c | 119 +- dpdk/drivers/net/hinic/hinic_pmd_ethdev.h | 1 + dpdk/drivers/net/hinic/hinic_pmd_flow.c | 21 + dpdk/drivers/net/hinic/hinic_pmd_rx.c | 73 +- dpdk/drivers/net/hinic/hinic_pmd_rx.h | 9 +- dpdk/drivers/net/hinic/hinic_pmd_tx.c | 24 +- dpdk/drivers/net/hinic/hinic_pmd_tx.h | 4 +- dpdk/drivers/net/hns3/hns3_cmd.c | 24 +- dpdk/drivers/net/hns3/hns3_cmd.h | 52 +- dpdk/drivers/net/hns3/hns3_dcb.c | 111 +- dpdk/drivers/net/hns3/hns3_dcb.h | 17 +- dpdk/drivers/net/hns3/hns3_ethdev.c | 1055 +++++++++--- dpdk/drivers/net/hns3/hns3_ethdev.h | 75 +- dpdk/drivers/net/hns3/hns3_ethdev_vf.c | 823 +++++++-- dpdk/drivers/net/hns3/hns3_fdir.c | 27 +- dpdk/drivers/net/hns3/hns3_flow.c | 282 +-- dpdk/drivers/net/hns3/hns3_intr.c | 10 +- dpdk/drivers/net/hns3/hns3_mbx.c | 49 +- dpdk/drivers/net/hns3/hns3_mbx.h | 21 + dpdk/drivers/net/hns3/hns3_mp.c | 34 +- dpdk/drivers/net/hns3/hns3_mp.h | 4 +- dpdk/drivers/net/hns3/hns3_regs.c | 2 +- dpdk/drivers/net/hns3/hns3_regs.h | 10 + dpdk/drivers/net/hns3/hns3_rss.c | 62 +- dpdk/drivers/net/hns3/hns3_rss.h | 3 + dpdk/drivers/net/hns3/hns3_rxtx.c | 1392 +++++++++++---- dpdk/drivers/net/hns3/hns3_rxtx.h | 60 +- dpdk/drivers/net/hns3/hns3_stats.c | 24 +- dpdk/drivers/net/i40e/Makefile | 2 +- dpdk/drivers/net/i40e/base/README | 2 +- dpdk/drivers/net/i40e/base/i40e_adminq.c | 2 +- dpdk/drivers/net/i40e/base/i40e_adminq.h | 2 +- dpdk/drivers/net/i40e/base/i40e_adminq_cmd.h | 4 +- dpdk/drivers/net/i40e/base/i40e_alloc.h | 2 +- dpdk/drivers/net/i40e/base/i40e_common.c | 42 +- dpdk/drivers/net/i40e/base/i40e_dcb.c | 5 +- dpdk/drivers/net/i40e/base/i40e_dcb.h | 2 +- dpdk/drivers/net/i40e/base/i40e_devids.h | 2 +- dpdk/drivers/net/i40e/base/i40e_diag.c | 2 +- dpdk/drivers/net/i40e/base/i40e_diag.h | 2 +- dpdk/drivers/net/i40e/base/i40e_hmc.c | 2 +- dpdk/drivers/net/i40e/base/i40e_hmc.h | 2 +- dpdk/drivers/net/i40e/base/i40e_lan_hmc.c | 2 +- dpdk/drivers/net/i40e/base/i40e_lan_hmc.h | 2 +- dpdk/drivers/net/i40e/base/i40e_nvm.c | 10 +- dpdk/drivers/net/i40e/base/i40e_osdep.h | 2 +- dpdk/drivers/net/i40e/base/i40e_prototype.h | 2 +- dpdk/drivers/net/i40e/base/i40e_register.h | 2 +- dpdk/drivers/net/i40e/base/i40e_status.h | 2 +- dpdk/drivers/net/i40e/base/i40e_type.h | 2 +- dpdk/drivers/net/i40e/base/meson.build | 2 +- dpdk/drivers/net/i40e/base/virtchnl.h | 18 +- dpdk/drivers/net/i40e/i40e_ethdev.c | 297 ++-- dpdk/drivers/net/i40e/i40e_ethdev.h | 36 +- dpdk/drivers/net/i40e/i40e_ethdev_vf.c | 182 +- dpdk/drivers/net/i40e/i40e_fdir.c | 213 ++- dpdk/drivers/net/i40e/i40e_flow.c | 348 ++-- dpdk/drivers/net/i40e/i40e_rxtx.c | 31 +- dpdk/drivers/net/i40e/i40e_rxtx_vec_altivec.c | 61 +- dpdk/drivers/net/i40e/i40e_rxtx_vec_common.h | 1 + dpdk/drivers/net/i40e/i40e_rxtx_vec_neon.c | 56 +- dpdk/drivers/net/i40e/i40e_rxtx_vec_sse.c | 48 +- dpdk/drivers/net/i40e/i40e_vf_representor.c | 3 +- dpdk/drivers/net/i40e/meson.build | 3 + dpdk/drivers/net/i40e/rte_pmd_i40e.c | 1 - dpdk/drivers/net/i40e/rte_pmd_i40e.h | 12 +- dpdk/drivers/net/iavf/base/README | 2 +- dpdk/drivers/net/iavf/base/iavf_adminq.c | 2 +- dpdk/drivers/net/iavf/base/iavf_adminq.h | 2 +- dpdk/drivers/net/iavf/base/iavf_alloc.h | 2 +- dpdk/drivers/net/iavf/base/iavf_common.c | 2 +- dpdk/drivers/net/iavf/base/iavf_devids.h | 2 +- dpdk/drivers/net/iavf/base/iavf_osdep.h | 2 +- dpdk/drivers/net/iavf/base/iavf_status.h | 2 +- dpdk/drivers/net/iavf/base/virtchnl.h | 2 +- dpdk/drivers/net/iavf/iavf.h | 9 +- dpdk/drivers/net/iavf/iavf_ethdev.c | 139 +- dpdk/drivers/net/iavf/iavf_rxtx.c | 4 +- dpdk/drivers/net/iavf/iavf_rxtx_vec_common.h | 1 + dpdk/drivers/net/iavf/iavf_rxtx_vec_sse.c | 49 +- dpdk/drivers/net/iavf/iavf_vchnl.c | 103 +- dpdk/drivers/net/ice/base/ice_adminq_cmd.h | 18 +- dpdk/drivers/net/ice/base/ice_alloc.h | 2 +- dpdk/drivers/net/ice/base/ice_bitops.h | 2 +- dpdk/drivers/net/ice/base/ice_common.c | 9 +- dpdk/drivers/net/ice/base/ice_common.h | 2 +- dpdk/drivers/net/ice/base/ice_controlq.c | 41 +- dpdk/drivers/net/ice/base/ice_controlq.h | 2 +- dpdk/drivers/net/ice/base/ice_dcb.c | 2 +- dpdk/drivers/net/ice/base/ice_dcb.h | 2 +- dpdk/drivers/net/ice/base/ice_devids.h | 2 +- dpdk/drivers/net/ice/base/ice_fdir.c | 2 +- dpdk/drivers/net/ice/base/ice_fdir.h | 8 +- dpdk/drivers/net/ice/base/ice_flex_pipe.c | 60 +- dpdk/drivers/net/ice/base/ice_flex_pipe.h | 4 +- dpdk/drivers/net/ice/base/ice_flex_type.h | 2 +- dpdk/drivers/net/ice/base/ice_flow.c | 65 +- dpdk/drivers/net/ice/base/ice_flow.h | 4 +- dpdk/drivers/net/ice/base/ice_hw_autogen.h | 2 +- dpdk/drivers/net/ice/base/ice_lan_tx_rx.h | 2 +- dpdk/drivers/net/ice/base/ice_nvm.c | 2 +- dpdk/drivers/net/ice/base/ice_nvm.h | 2 +- dpdk/drivers/net/ice/base/ice_osdep.h | 18 +- dpdk/drivers/net/ice/base/ice_protocol_type.h | 2 +- dpdk/drivers/net/ice/base/ice_sbq_cmd.h | 2 +- dpdk/drivers/net/ice/base/ice_sched.c | 67 +- dpdk/drivers/net/ice/base/ice_sched.h | 9 +- dpdk/drivers/net/ice/base/ice_status.h | 2 +- dpdk/drivers/net/ice/base/ice_switch.c | 31 +- dpdk/drivers/net/ice/base/ice_switch.h | 2 +- dpdk/drivers/net/ice/base/ice_type.h | 6 +- dpdk/drivers/net/ice/base/meson.build | 2 +- dpdk/drivers/net/ice/ice_ethdev.c | 117 +- dpdk/drivers/net/ice/ice_ethdev.h | 7 + dpdk/drivers/net/ice/ice_fdir_filter.c | 17 +- dpdk/drivers/net/ice/ice_generic_flow.c | 33 +- dpdk/drivers/net/ice/ice_hash.c | 27 +- dpdk/drivers/net/ice/ice_rxtx.c | 64 +- dpdk/drivers/net/ice/ice_rxtx.h | 4 +- dpdk/drivers/net/ice/ice_rxtx_vec_common.h | 1 + dpdk/drivers/net/ice/ice_rxtx_vec_sse.c | 56 +- dpdk/drivers/net/ice/ice_switch_filter.c | 210 ++- dpdk/drivers/net/ifc/base/ifcvf.h | 3 + dpdk/drivers/net/ipn3ke/ipn3ke_representor.c | 3 +- dpdk/drivers/net/ipn3ke/meson.build | 6 +- dpdk/drivers/net/ixgbe/base/README | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_82598.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_82598.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_82599.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_82599.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_api.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_api.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_common.c | 9 +- dpdk/drivers/net/ixgbe/base/ixgbe_common.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb_82598.c | 10 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb_82598.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb_82599.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_dcb_82599.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_hv_vf.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_hv_vf.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_mbx.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_mbx.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_osdep.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_phy.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_phy.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_type.h | 14 +- dpdk/drivers/net/ixgbe/base/ixgbe_vf.c | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_vf.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_x540.c | 4 +- dpdk/drivers/net/ixgbe/base/ixgbe_x540.h | 2 +- dpdk/drivers/net/ixgbe/base/ixgbe_x550.c | 10 +- dpdk/drivers/net/ixgbe/base/ixgbe_x550.h | 2 +- dpdk/drivers/net/ixgbe/base/meson.build | 2 +- dpdk/drivers/net/ixgbe/ixgbe_ethdev.c | 88 +- dpdk/drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- dpdk/drivers/net/ixgbe/ixgbe_flow.c | 9 - dpdk/drivers/net/ixgbe/ixgbe_pf.c | 16 +- dpdk/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 64 +- dpdk/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 47 +- dpdk/drivers/net/ixgbe/rte_pmd_ixgbe.c | 6 + dpdk/drivers/net/ixgbe/rte_pmd_ixgbe.h | 4 +- dpdk/drivers/net/kni/rte_eth_kni.c | 5 + dpdk/drivers/net/memif/memif_socket.c | 14 +- dpdk/drivers/net/memif/rte_eth_memif.c | 30 +- dpdk/drivers/net/mlx4/mlx4.c | 32 +- dpdk/drivers/net/mlx4/mlx4_flow.c | 11 +- dpdk/drivers/net/mlx4/mlx4_glue.h | 2 +- dpdk/drivers/net/mlx4/mlx4_rxtx.h | 2 +- dpdk/drivers/net/mlx5/Makefile | 5 + dpdk/drivers/net/mlx5/meson.build | 2 + dpdk/drivers/net/mlx5/mlx5.c | 247 ++- dpdk/drivers/net/mlx5/mlx5.h | 52 +- dpdk/drivers/net/mlx5/mlx5_defs.h | 5 +- dpdk/drivers/net/mlx5/mlx5_devx_cmds.c | 11 +- dpdk/drivers/net/mlx5/mlx5_ethdev.c | 283 +-- dpdk/drivers/net/mlx5/mlx5_flow.c | 223 ++- dpdk/drivers/net/mlx5/mlx5_flow.h | 36 +- dpdk/drivers/net/mlx5/mlx5_flow_dv.c | 664 ++++++-- dpdk/drivers/net/mlx5/mlx5_flow_meter.c | 24 +- dpdk/drivers/net/mlx5/mlx5_flow_verbs.c | 45 +- dpdk/drivers/net/mlx5/mlx5_glue.c | 9 +- dpdk/drivers/net/mlx5/mlx5_glue.h | 6 +- dpdk/drivers/net/mlx5/mlx5_mac.c | 8 +- dpdk/drivers/net/mlx5/mlx5_mr.c | 2 +- dpdk/drivers/net/mlx5/mlx5_nl.c | 27 +- dpdk/drivers/net/mlx5/mlx5_prm.h | 7 +- dpdk/drivers/net/mlx5/mlx5_rss.c | 4 +- dpdk/drivers/net/mlx5/mlx5_rxq.c | 118 +- dpdk/drivers/net/mlx5/mlx5_rxtx.c | 191 ++- dpdk/drivers/net/mlx5/mlx5_rxtx.h | 7 +- dpdk/drivers/net/mlx5/mlx5_rxtx_vec.c | 19 +- dpdk/drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 40 +- dpdk/drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 60 +- dpdk/drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 61 +- dpdk/drivers/net/mlx5/mlx5_stats.c | 106 +- dpdk/drivers/net/mlx5/mlx5_trigger.c | 18 +- dpdk/drivers/net/mlx5/mlx5_txq.c | 70 +- dpdk/drivers/net/mlx5/mlx5_utils.c | 6 +- dpdk/drivers/net/mlx5/mlx5_utils.h | 14 - dpdk/drivers/net/mvneta/mvneta_ethdev.c | 2 +- dpdk/drivers/net/mvpp2/mrvl_ethdev.c | 6 +- dpdk/drivers/net/mvpp2/mrvl_flow.c | 4 +- dpdk/drivers/net/mvpp2/mrvl_mtr.c | 12 +- dpdk/drivers/net/netvsc/hn_ethdev.c | 60 +- dpdk/drivers/net/netvsc/hn_nvs.c | 53 +- dpdk/drivers/net/netvsc/hn_nvs.h | 2 +- dpdk/drivers/net/netvsc/hn_rndis.c | 32 +- dpdk/drivers/net/netvsc/hn_rxtx.c | 381 +++-- dpdk/drivers/net/netvsc/hn_var.h | 33 +- dpdk/drivers/net/netvsc/hn_vf.c | 215 +-- dpdk/drivers/net/nfp/nfp_net.c | 63 +- dpdk/drivers/net/nfp/nfp_net_pmd.h | 6 + dpdk/drivers/net/null/rte_eth_null.c | 29 +- dpdk/drivers/net/octeontx/base/meson.build | 5 +- dpdk/drivers/net/octeontx/octeontx_ethdev.c | 1 + dpdk/drivers/net/octeontx2/otx2_ethdev.c | 60 +- dpdk/drivers/net/octeontx2/otx2_ethdev.h | 6 + dpdk/drivers/net/octeontx2/otx2_ethdev_irq.c | 38 +- dpdk/drivers/net/octeontx2/otx2_ethdev_ops.c | 13 +- dpdk/drivers/net/octeontx2/otx2_flow.c | 2 + dpdk/drivers/net/octeontx2/otx2_link.c | 53 +- dpdk/drivers/net/octeontx2/otx2_mac.c | 2 + dpdk/drivers/net/octeontx2/otx2_rss.c | 2 +- dpdk/drivers/net/octeontx2/otx2_vlan.c | 5 - dpdk/drivers/net/pcap/rte_eth_pcap.c | 10 +- dpdk/drivers/net/pfe/pfe_ethdev.c | 10 +- dpdk/drivers/net/qede/base/bcm_osal.h | 3 +- dpdk/drivers/net/qede/base/ecore_sriov.c | 2 +- dpdk/drivers/net/qede/qede_ethdev.c | 63 +- dpdk/drivers/net/qede/qede_main.c | 9 +- dpdk/drivers/net/qede/qede_rxtx.c | 12 +- dpdk/drivers/net/ring/rte_eth_ring.c | 47 +- dpdk/drivers/net/sfc/base/ef10_evb.c | 28 +- dpdk/drivers/net/sfc/base/ef10_filter.c | 592 +++++-- dpdk/drivers/net/sfc/base/ef10_impl.h | 4 +- dpdk/drivers/net/sfc/base/ef10_nic.c | 4 +- dpdk/drivers/net/sfc/base/ef10_proxy.c | 8 +- dpdk/drivers/net/sfc/base/efx.h | 13 +- dpdk/drivers/net/sfc/base/efx_evb.c | 4 +- dpdk/drivers/net/sfc/base/efx_filter.c | 26 +- dpdk/drivers/net/sfc/base/efx_impl.h | 21 +- dpdk/drivers/net/sfc/base/efx_proxy.c | 4 +- dpdk/drivers/net/sfc/base/efx_tunnel.c | 12 +- dpdk/drivers/net/sfc/sfc.c | 3 +- dpdk/drivers/net/sfc/sfc.h | 2 + dpdk/drivers/net/sfc/sfc_ethdev.c | 68 +- dpdk/drivers/net/sfc/sfc_flow.c | 70 +- dpdk/drivers/net/sfc/sfc_flow.h | 2 + dpdk/drivers/net/sfc/sfc_rx.c | 22 +- dpdk/drivers/net/sfc/sfc_rx.h | 1 + dpdk/drivers/net/softnic/parser.c | 188 +- .../net/softnic/rte_eth_softnic_thread.c | 38 - dpdk/drivers/net/tap/rte_eth_tap.c | 187 +- dpdk/drivers/net/tap/rte_eth_tap.h | 1 + dpdk/drivers/net/tap/tap_flow.c | 8 +- dpdk/drivers/net/tap/tap_intr.c | 3 +- dpdk/drivers/net/thunderx/nicvf_ethdev.c | 18 +- dpdk/drivers/net/vdev_netvsc/vdev_netvsc.c | 27 +- dpdk/drivers/net/vhost/rte_eth_vhost.c | 92 +- dpdk/drivers/net/virtio/virtio_ethdev.c | 19 +- dpdk/drivers/net/virtio/virtio_rxtx.c | 11 +- .../net/virtio/virtio_rxtx_simple_altivec.c | 3 +- .../net/virtio/virtio_user/vhost_kernel_tap.c | 7 +- .../net/virtio/virtio_user/virtio_user_dev.h | 1 + dpdk/drivers/net/virtio/virtio_user_ethdev.c | 30 +- dpdk/drivers/net/virtio/virtqueue.c | 2 + dpdk/drivers/net/virtio/virtqueue.h | 17 +- dpdk/drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 +- dpdk/drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 + dpdk/drivers/net/vmxnet3/vmxnet3_rxtx.c | 14 +- dpdk/drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 3 +- dpdk/drivers/raw/ifpga/base/ifpga_fme.c | 27 +- dpdk/drivers/raw/ifpga/base/opae_spi.h | 1 + .../raw/ifpga/base/opae_spi_transaction.c | 2 +- dpdk/drivers/raw/ifpga/ifpga_rawdev.c | 53 +- dpdk/drivers/raw/ifpga/meson.build | 7 +- dpdk/drivers/raw/ioat/ioat_rawdev.c | 7 + dpdk/drivers/raw/skeleton/skeleton_rawdev.c | 4 +- .../raw/skeleton/skeleton_rawdev_test.c | 6 + dpdk/examples/bbdev_app/Makefile | 2 +- dpdk/examples/bbdev_app/main.c | 2 + dpdk/examples/bond/Makefile | 2 +- dpdk/examples/cmdline/Makefile | 2 +- dpdk/examples/distributor/Makefile | 2 +- dpdk/examples/eventdev_pipeline/Makefile | 2 +- dpdk/examples/eventdev_pipeline/main.c | 27 +- .../eventdev_pipeline/pipeline_common.h | 12 +- dpdk/examples/fips_validation/Makefile | 4 +- .../fips_validation/fips_validation.c | 87 +- .../fips_validation/fips_validation.h | 5 +- .../fips_validation/fips_validation_tdes.c | 25 +- dpdk/examples/fips_validation/main.c | 5 + dpdk/examples/flow_classify/Makefile | 2 +- dpdk/examples/flow_filtering/Makefile | 2 +- dpdk/examples/helloworld/Makefile | 2 +- dpdk/examples/ioat/Makefile | 2 +- dpdk/examples/ioat/ioatfwd.c | 10 +- dpdk/examples/ip_fragmentation/Makefile | 2 +- dpdk/examples/ip_fragmentation/main.c | 2 +- dpdk/examples/ip_pipeline/Makefile | 4 +- dpdk/examples/ip_pipeline/parser.c | 190 +-- dpdk/examples/ip_pipeline/thread.c | 44 - dpdk/examples/ip_reassembly/Makefile | 2 +- dpdk/examples/ip_reassembly/main.c | 2 +- dpdk/examples/ipsec-secgw/Makefile | 2 +- dpdk/examples/ipsec-secgw/ipsec-secgw.c | 2 +- dpdk/examples/ipsec-secgw/ipsec_process.c | 1 + dpdk/examples/ipsec-secgw/parser.c | 173 +- dpdk/examples/ipv4_multicast/Makefile | 2 +- dpdk/examples/ipv4_multicast/main.c | 2 +- dpdk/examples/kni/Makefile | 4 +- dpdk/examples/kni/main.c | 34 +- dpdk/examples/l2fwd-cat/Makefile | 2 +- dpdk/examples/l2fwd-crypto/Makefile | 8 +- dpdk/examples/l2fwd-crypto/main.c | 4 +- dpdk/examples/l2fwd-crypto/meson.build | 3 + dpdk/examples/l2fwd-event/Makefile | 2 +- dpdk/examples/l2fwd-event/main.c | 4 +- dpdk/examples/l2fwd-jobstats/Makefile | 2 +- dpdk/examples/l2fwd-jobstats/main.c | 5 +- dpdk/examples/l2fwd-keepalive/Makefile | 2 +- dpdk/examples/l2fwd-keepalive/main.c | 22 +- dpdk/examples/l2fwd-keepalive/meson.build | 8 +- dpdk/examples/l2fwd/Makefile | 2 +- dpdk/examples/l2fwd/main.c | 4 +- dpdk/examples/l3fwd-acl/Makefile | 2 +- dpdk/examples/l3fwd-acl/main.c | 2 +- dpdk/examples/l3fwd-power/Makefile | 2 +- dpdk/examples/l3fwd-power/main.c | 11 +- dpdk/examples/l3fwd/Makefile | 2 +- dpdk/examples/l3fwd/main.c | 2 +- dpdk/examples/link_status_interrupt/Makefile | 2 +- dpdk/examples/link_status_interrupt/main.c | 4 +- dpdk/examples/meson.build | 13 +- .../client_server_mp/mp_server/init.c | 2 +- .../client_server_mp/mp_server/main.c | 17 +- .../client_server_mp/shared/common.h | 2 +- .../multi_process/symmetric_mp/main.c | 2 +- dpdk/examples/ntb/Makefile | 4 +- dpdk/examples/packet_ordering/Makefile | 2 +- dpdk/examples/packet_ordering/main.c | 4 +- .../performance-thread/l3fwd-thread/main.c | 11 +- dpdk/examples/ptpclient/Makefile | 2 +- dpdk/examples/qos_meter/Makefile | 2 +- dpdk/examples/qos_sched/Makefile | 2 +- dpdk/examples/qos_sched/args.c | 2 +- dpdk/examples/qos_sched/cfg_file.c | 3 + dpdk/examples/qos_sched/init.c | 2 +- dpdk/examples/qos_sched/main.h | 4 +- dpdk/examples/rxtx_callbacks/Makefile | 4 +- dpdk/examples/server_node_efd/server/init.c | 2 +- dpdk/examples/service_cores/Makefile | 2 +- dpdk/examples/skeleton/Makefile | 2 +- dpdk/examples/tep_termination/Makefile | 2 +- dpdk/examples/tep_termination/main.c | 2 + dpdk/examples/timer/Makefile | 2 +- dpdk/examples/vdpa/Makefile | 2 +- dpdk/examples/vhost/Makefile | 2 +- dpdk/examples/vhost/main.c | 2 + dpdk/examples/vhost_blk/Makefile | 2 +- dpdk/examples/vhost_blk/vhost_blk.c | 14 +- dpdk/examples/vhost_blk/vhost_blk.h | 4 +- dpdk/examples/vhost_crypto/Makefile | 2 +- dpdk/examples/vhost_crypto/main.c | 4 +- .../vm_power_manager/channel_manager.c | 13 +- .../vm_power_manager/channel_manager.h | 9 +- .../guest_cli/vm_power_cli_guest.c | 6 +- dpdk/examples/vm_power_manager/main.c | 2 +- .../examples/vm_power_manager/power_manager.c | 1 - dpdk/examples/vmdq/Makefile | 2 +- dpdk/examples/vmdq/main.c | 48 +- dpdk/examples/vmdq_dcb/Makefile | 2 +- dpdk/kernel/freebsd/contigmem/contigmem.c | 4 +- dpdk/kernel/linux/kni/compat.h | 8 +- dpdk/kernel/linux/kni/kni_dev.h | 5 + dpdk/lib/Makefile | 2 +- dpdk/lib/librte_acl/rte_acl.c | 2 +- dpdk/lib/librte_bbdev/rte_bbdev.h | 19 +- dpdk/lib/librte_bbdev/rte_bbdev_op.h | 16 +- dpdk/lib/librte_bbdev/rte_bbdev_pmd.h | 14 +- dpdk/lib/librte_bpf/bpf_validate.c | 10 +- dpdk/lib/librte_bpf/rte_bpf.h | 6 +- dpdk/lib/librte_cfgfile/rte_cfgfile.c | 3 +- dpdk/lib/librte_compressdev/rte_compressdev.h | 6 +- dpdk/lib/librte_cryptodev/rte_crypto_sym.h | 7 +- dpdk/lib/librte_cryptodev/rte_cryptodev.c | 43 +- dpdk/lib/librte_cryptodev/rte_cryptodev_pmd.h | 3 +- .../librte_distributor/distributor_private.h | 3 + dpdk/lib/librte_distributor/rte_distributor.c | 217 ++- dpdk/lib/librte_distributor/rte_distributor.h | 23 +- .../rte_distributor_single.c | 4 + .../librte_eal/common/arch/arm/rte_cycles.c | 27 +- dpdk/lib/librte_eal/common/eal_common_dev.c | 1 + .../librte_eal/common/eal_common_fbarray.c | 2 +- dpdk/lib/librte_eal/common/eal_common_lcore.c | 12 +- dpdk/lib/librte_eal/common/eal_common_log.c | 2 +- .../lib/librte_eal/common/eal_common_memory.c | 2 +- .../librte_eal/common/eal_common_options.c | 2 +- dpdk/lib/librte_eal/common/eal_common_proc.c | 4 +- .../common/include/arch/arm/meson.build | 2 + .../common/include/arch/arm/rte_atomic_64.h | 8 + .../common/include/arch/arm/rte_cycles_32.h | 2 +- .../common/include/arch/arm/rte_cycles_64.h | 47 +- .../common/include/arch/arm/rte_vect.h | 6 +- .../common/include/arch/ppc_64/meson.build | 3 + .../common/include/arch/ppc_64/rte_altivec.h | 22 + .../common/include/arch/ppc_64/rte_memcpy.h | 15 +- .../common/include/arch/ppc_64/rte_vect.h | 3 +- .../common/include/arch/x86/meson.build | 2 + .../common/include/arch/x86/rte_atomic.h | 2 +- .../common/include/arch/x86/rte_memcpy.h | 11 +- .../common/include/generic/rte_byteorder.h | 6 +- .../common/include/generic/rte_mcslock.h | 9 +- .../common/include/generic/rte_memcpy.h | 4 + .../librte_eal/common/include/rte_common.h | 10 +- dpdk/lib/librte_eal/common/include/rte_eal.h | 5 +- .../librte_eal/common/include/rte_service.h | 12 +- .../common/include/rte_service_component.h | 15 +- dpdk/lib/librte_eal/common/include/rte_uuid.h | 2 + dpdk/lib/librte_eal/common/malloc_elem.c | 10 +- dpdk/lib/librte_eal/common/malloc_heap.c | 3 + dpdk/lib/librte_eal/common/rte_random.c | 2 +- dpdk/lib/librte_eal/common/rte_service.c | 78 +- dpdk/lib/librte_eal/freebsd/eal/eal.c | 2 +- .../librte_eal/freebsd/eal/eal_interrupts.c | 79 +- dpdk/lib/librte_eal/freebsd/eal/eal_memory.c | 4 +- dpdk/lib/librte_eal/linux/eal/eal.c | 4 +- dpdk/lib/librte_eal/linux/eal/eal_dev.c | 12 +- .../lib/librte_eal/linux/eal/eal_interrupts.c | 2 +- dpdk/lib/librte_eal/linux/eal/eal_memalloc.c | 47 +- dpdk/lib/librte_eal/linux/eal/eal_memory.c | 26 +- dpdk/lib/librte_eal/linux/eal/eal_vfio.c | 87 +- .../librte_eal/linux/eal/eal_vfio_mp_sync.c | 4 +- dpdk/lib/librte_eal/rte_eal_exports.def | 1 - dpdk/lib/librte_efd/rte_efd.c | 1 + dpdk/lib/librte_ethdev/ethdev_profile.h | 9 + dpdk/lib/librte_ethdev/rte_ethdev.c | 89 +- dpdk/lib/librte_ethdev/rte_ethdev.h | 57 +- dpdk/lib/librte_ethdev/rte_ethdev_pci.h | 26 - dpdk/lib/librte_ethdev/rte_ethdev_vdev.h | 26 - dpdk/lib/librte_ethdev/rte_flow.c | 20 +- dpdk/lib/librte_ethdev/rte_flow.h | 2 +- .../rte_event_crypto_adapter.c | 1 + .../rte_event_eth_tx_adapter.c | 2 + .../librte_eventdev/rte_event_timer_adapter.c | 86 +- dpdk/lib/librte_eventdev/rte_eventdev.c | 13 +- .../librte_eventdev/rte_eventdev_pmd_pci.h | 8 +- dpdk/lib/librte_fib/rte_fib.h | 15 + dpdk/lib/librte_fib/rte_fib6.h | 15 + .../librte_flow_classify/rte_flow_classify.h | 6 +- dpdk/lib/librte_gro/rte_gro.c | 17 +- dpdk/lib/librte_gso/gso_udp4.c | 5 +- dpdk/lib/librte_hash/rte_cuckoo_hash.c | 9 +- dpdk/lib/librte_ipsec/ipsec_sad.c | 2 + dpdk/lib/librte_ipsec/rte_ipsec.h | 6 +- dpdk/lib/librte_ipsec/sa.h | 2 +- dpdk/lib/librte_kni/rte_kni.h | 2 +- dpdk/lib/librte_kvargs/rte_kvargs.c | 2 + dpdk/lib/librte_kvargs/rte_kvargs.h | 2 +- dpdk/lib/librte_lpm/rte_lpm6.c | 9 +- dpdk/lib/librte_mbuf/rte_mbuf_dyn.c | 58 +- dpdk/lib/librte_mbuf/rte_mbuf_dyn.h | 2 +- dpdk/lib/librte_mempool/rte_mempool.c | 2 +- .../librte_mempool/rte_mempool_version.map | 4 - dpdk/lib/librte_meter/rte_meter_version.map | 6 - dpdk/lib/librte_net/rte_ip.h | 29 +- dpdk/lib/librte_net/rte_mpls.h | 1 + dpdk/lib/librte_pci/rte_pci.c | 17 +- dpdk/lib/librte_pci/rte_pci.h | 8 +- dpdk/lib/librte_port/rte_port_source_sink.c | 2 +- dpdk/lib/librte_power/power_pstate_cpufreq.c | 59 + dpdk/lib/librte_rawdev/rte_rawdev.c | 14 +- dpdk/lib/librte_rawdev/rte_rawdev.h | 11 +- dpdk/lib/librte_rawdev/rte_rawdev_pmd.h | 3 - dpdk/lib/librte_rawdev/rte_rawdev_version.map | 1 + dpdk/lib/librte_rcu/rte_rcu_qsbr.c | 6 +- dpdk/lib/librte_rcu/rte_rcu_qsbr.h | 17 +- dpdk/lib/librte_rib/rte_rib.h | 15 + dpdk/lib/librte_rib/rte_rib6.h | 17 +- dpdk/lib/librte_sched/rte_sched.c | 17 +- dpdk/lib/librte_security/rte_security.c | 70 +- dpdk/lib/librte_security/rte_security.h | 8 +- dpdk/lib/librte_stack/rte_stack.h | 7 +- dpdk/lib/librte_stack/rte_stack_lf_c11.h | 4 +- dpdk/lib/librte_stack/rte_stack_lf_generic.h | 2 +- dpdk/lib/librte_table/rte_table_hash_key16.c | 17 + dpdk/lib/librte_table/rte_table_hash_key32.c | 17 + dpdk/lib/librte_table/rte_table_hash_key8.c | 16 + dpdk/lib/librte_telemetry/rte_telemetry.h | 7 +- .../librte_telemetry/rte_telemetry_parser.c | 2 +- dpdk/lib/librte_timer/rte_timer.c | 24 +- dpdk/lib/librte_timer/rte_timer.h | 12 + dpdk/lib/librte_vhost/iotlb.c | 8 +- dpdk/lib/librte_vhost/rte_vhost.h | 24 +- dpdk/lib/librte_vhost/rte_vhost_crypto.h | 3 + dpdk/lib/librte_vhost/socket.c | 4 + dpdk/lib/librte_vhost/vhost.c | 59 +- dpdk/lib/librte_vhost/vhost.h | 18 - dpdk/lib/librte_vhost/vhost_crypto.c | 457 ++--- dpdk/lib/librte_vhost/vhost_user.c | 91 +- dpdk/lib/librte_vhost/virtio_net.c | 215 ++- dpdk/lib/meson.build | 16 +- dpdk/license/bsd-2-clause.txt | 20 + dpdk/license/isc.txt | 11 + dpdk/license/mit.txt | 18 + dpdk/meson.build | 28 +- dpdk/mk/machine/graviton2/rte.vars.mk | 34 + dpdk/mk/rte.app.mk | 4 + dpdk/mk/toolchain/gcc/rte.vars.mk | 5 + dpdk/usertools/cpu_layout.py | 4 +- dpdk/usertools/dpdk-pmdinfo.py | 7 +- 841 files changed, 19024 insertions(+), 8324 deletions(-) rename dpdk/app/test/{test_hash_readwrite_lf.c => test_hash_readwrite_lf_perf.c} (99%) create mode 100755 dpdk/buildtools/call-sphinx-build.py create mode 100644 dpdk/buildtools/pkg-config/meson.build create mode 100644 dpdk/buildtools/pkg-config/set-static-linker-flags.py create mode 120000 dpdk/config/defconfig_arm64-graviton2-linux-gcc create mode 100644 dpdk/config/defconfig_arm64-graviton2-linuxapp-gcc create mode 120000 dpdk/config/defconfig_graviton2 create mode 100644 dpdk/lib/librte_eal/common/include/arch/ppc_64/rte_altivec.h create mode 100644 dpdk/license/bsd-2-clause.txt create mode 100644 dpdk/license/isc.txt create mode 100644 dpdk/license/mit.txt create mode 100644 dpdk/mk/machine/graviton2/rte.vars.mk diff --git a/dpdk/MAINTAINERS b/dpdk/MAINTAINERS index 10c4e1a61..952ded7b0 100644 --- a/dpdk/MAINTAINERS +++ b/dpdk/MAINTAINERS @@ -46,7 +46,7 @@ M: Jerin Jacob T: git://dpdk.org/next/dpdk-next-net-mrvl Next-net-mlx Tree -M: Raslan Darawsheh +M: Raslan Darawsheh T: git://dpdk.org/next/dpdk-next-net-mlx Next-virtio Tree @@ -128,8 +128,11 @@ F: meson.build F: lib/librte_eal/freebsd/BSDmakefile.meson F: meson_options.txt F: config/rte_config.h +F: buildtools/call-sphinx-build.py F: buildtools/gen-pmdinfo-cfile.sh F: buildtools/map_to_def.py +F: buildtools/list-dir-globs.py +F: buildtools/pkg-config/ F: buildtools/symlink-drivers-solibs.sh Public CI @@ -370,7 +373,7 @@ F: devtools/test-null.sh F: doc/guides/prog_guide/switch_representation.rst Flow API -M: Ori Kam +M: Ori Kam T: git://dpdk.org/next/dpdk-next-net F: app/test-pmd/cmdline_flow.c F: doc/guides/prog_guide/rte_flow.rst @@ -456,8 +459,8 @@ F: lib/librte_eventdev/*crypto_adapter* F: app/test/test_event_crypto_adapter.c F: doc/guides/prog_guide/event_crypto_adapter.rst -Raw device API - EXPERIMENTAL -M: Shreyansh Jain +Raw device API +M: Nipun Gupta M: Hemant Agrawal F: lib/librte_rawdev/ F: drivers/raw/skeleton/ @@ -728,17 +731,17 @@ F: doc/guides/nics/features/octeontx2*.ini F: doc/guides/nics/octeontx2.rst Mellanox mlx4 -M: Matan Azrad -M: Shahaf Shuler +M: Matan Azrad +M: Shahaf Shuler T: git://dpdk.org/next/dpdk-next-net-mlx F: drivers/net/mlx4/ F: doc/guides/nics/mlx4.rst F: doc/guides/nics/features/mlx4.ini Mellanox mlx5 -M: Matan Azrad -M: Shahaf Shuler -M: Viacheslav Ovsiienko +M: Matan Azrad +M: Shahaf Shuler +M: Viacheslav Ovsiienko T: git://dpdk.org/next/dpdk-next-net-mlx F: drivers/net/mlx5/ F: buildtools/options-ibverbs-static.sh @@ -746,7 +749,7 @@ F: doc/guides/nics/mlx5.rst F: doc/guides/nics/features/mlx5.ini Microsoft vdev_netvsc - EXPERIMENTAL -M: Matan Azrad +M: Matan Azrad F: drivers/net/vdev_netvsc/ F: doc/guides/nics/vdev_netvsc.rst F: doc/guides/nics/features/vdev_netvsc.ini @@ -1491,7 +1494,7 @@ M: Marko Kovacevic F: examples/fips_validation/ F: doc/guides/sample_app_ug/fips_validation.rst -M: Ori Kam +M: Ori Kam F: examples/flow_filtering/ F: doc/guides/sample_app_ug/flow_filtering.rst diff --git a/dpdk/VERSION b/dpdk/VERSION index b78ee2529..729b18d89 100644 --- a/dpdk/VERSION +++ b/dpdk/VERSION @@ -1 +1 @@ -19.11.2 +19.11.6 diff --git a/dpdk/app/pdump/main.c b/dpdk/app/pdump/main.c index d05a02366..c38c53719 100644 --- a/dpdk/app/pdump/main.c +++ b/dpdk/app/pdump/main.c @@ -151,7 +151,7 @@ static uint8_t multiple_core_capture; static void pdump_usage(const char *prgname) { - printf("usage: %s [EAL options]" + printf("usage: %s [EAL options] --" " --["CMD_LINE_OPT_MULTI"]\n" " --"CMD_LINE_OPT_PDUMP" " "'(port= | device_id=)," diff --git a/dpdk/app/test-acl/main.c b/dpdk/app/test-acl/main.c index 57f23942e..08f06c1fa 100644 --- a/dpdk/app/test-acl/main.c +++ b/dpdk/app/test-acl/main.c @@ -12,7 +12,7 @@ #include #include -#define PRINT_USAGE_START "%s [EAL options]\n" +#define PRINT_USAGE_START "%s [EAL options] --\n" #define RTE_LOGTYPE_TESTACL RTE_LOGTYPE_USER1 diff --git a/dpdk/app/test-bbdev/ldpc_enc_default.data b/dpdk/app/test-bbdev/ldpc_enc_default.data index 371cbc692..52d51ae33 120000 --- a/dpdk/app/test-bbdev/ldpc_enc_default.data +++ b/dpdk/app/test-bbdev/ldpc_enc_default.data @@ -1 +1 @@ -test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data \ No newline at end of file +test_vectors/ldpc_enc_v2342.data \ No newline at end of file diff --git a/dpdk/app/test-crypto-perf/main.c b/dpdk/app/test-crypto-perf/main.c index 52a1860fb..7bb286ccb 100644 --- a/dpdk/app/test-crypto-perf/main.c +++ b/dpdk/app/test-crypto-perf/main.c @@ -582,7 +582,8 @@ main(int argc, char **argv) goto err; } - if (!opts.silent) + if (!opts.silent && opts.test != CPERF_TEST_TYPE_THROUGHPUT && + opts.test != CPERF_TEST_TYPE_LATENCY) show_test_vector(t_vec); total_nb_qps = nb_cryptodevs * opts.nb_qps; diff --git a/dpdk/app/test-crypto-perf/meson.build b/dpdk/app/test-crypto-perf/meson.build index 0674396da..c416091fd 100644 --- a/dpdk/app/test-crypto-perf/meson.build +++ b/dpdk/app/test-crypto-perf/meson.build @@ -13,3 +13,6 @@ sources = files('cperf_ops.c', 'cperf_test_verify.c', 'main.c') deps += ['cryptodev', 'security'] +if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER') + deps += 'pmd_crypto_scheduler' +endif diff --git a/dpdk/app/test-eventdev/evt_options.c b/dpdk/app/test-eventdev/evt_options.c index c60b61a90..4f4800d99 100644 --- a/dpdk/app/test-eventdev/evt_options.c +++ b/dpdk/app/test-eventdev/evt_options.c @@ -197,6 +197,10 @@ evt_parse_nb_timer_adptrs(struct evt_options *opt, const char *arg) int ret; ret = parser_read_uint8(&(opt->nb_timer_adptrs), arg); + if (opt->nb_timer_adptrs <= 0) { + evt_err("Number of timer adapters cannot be <= 0"); + return -EINVAL; + } return ret; } diff --git a/dpdk/app/test-eventdev/test_pipeline_atq.c b/dpdk/app/test-eventdev/test_pipeline_atq.c index 8e8686c14..0872b25b5 100644 --- a/dpdk/app/test-eventdev/test_pipeline_atq.c +++ b/dpdk/app/test-eventdev/test_pipeline_atq.c @@ -495,6 +495,8 @@ pipeline_atq_capability_check(struct evt_options *opt) evt_nr_active_lcores(opt->wlcores), dev_info.max_event_ports); } + if (!evt_has_all_types_queue(opt->dev_id)) + return false; return true; } diff --git a/dpdk/app/test-eventdev/test_pipeline_common.c b/dpdk/app/test-eventdev/test_pipeline_common.c index fa91bf229..126e2165a 100644 --- a/dpdk/app/test-eventdev/test_pipeline_common.c +++ b/dpdk/app/test-eventdev/test_pipeline_common.c @@ -385,12 +385,16 @@ pipeline_event_tx_adapter_setup(struct evt_options *opt, if (!(cap & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) { uint32_t service_id = -1U; - rte_event_eth_tx_adapter_service_id_get(consm, - &service_id); + ret = rte_event_eth_tx_adapter_service_id_get(consm, + &service_id); + if (ret != -ESRCH && ret != 0) { + evt_err("Failed to get Tx adptr service ID"); + return ret; + } ret = evt_service_setup(service_id); if (ret) { evt_err("Failed to setup service core" - " for Tx adapter\n"); + " for Tx adapter"); return ret; } } diff --git a/dpdk/app/test-pipeline/config.c b/dpdk/app/test-pipeline/config.c index 28ac9fcc0..33f3f1c82 100644 --- a/dpdk/app/test-pipeline/config.c +++ b/dpdk/app/test-pipeline/config.c @@ -42,8 +42,6 @@ #include "main.h" -struct app_params app; - static const char usage[] = "\n"; void diff --git a/dpdk/app/test-pmd/bpf_cmd.c b/dpdk/app/test-pmd/bpf_cmd.c index 830bfc13a..d2deadd4e 100644 --- a/dpdk/app/test-pmd/bpf_cmd.c +++ b/dpdk/app/test-pmd/bpf_cmd.c @@ -55,7 +55,7 @@ static const struct rte_bpf_xsym bpf_xsym[] = { struct cmd_bpf_ld_result { cmdline_fixed_string_t bpf; cmdline_fixed_string_t dir; - uint8_t port; + uint16_t port; uint16_t queue; cmdline_fixed_string_t op; cmdline_fixed_string_t flags; @@ -153,7 +153,7 @@ cmdline_parse_inst_t cmd_operate_bpf_ld_parse = { struct cmd_bpf_unld_result { cmdline_fixed_string_t bpf; cmdline_fixed_string_t dir; - uint8_t port; + uint16_t port; uint16_t queue; }; diff --git a/dpdk/app/test-pmd/cmdline.c b/dpdk/app/test-pmd/cmdline.c index d9f5f6f16..9287fa3ea 100644 --- a/dpdk/app/test-pmd/cmdline.c +++ b/dpdk/app/test-pmd/cmdline.c @@ -94,7 +94,7 @@ static void cmd_help_brief_parsed(__attribute__((unused)) void *parsed_result, " help ports : Configuring ports.\n" " help registers : Reading and setting port registers.\n" " help filters : Filters configuration help.\n" - " help traffic_management : Traffic Management commmands.\n" + " help traffic_management : Traffic Management commands.\n" " help devices : Device related cmds.\n" " help all : All of the above sections.\n\n" ); @@ -614,7 +614,7 @@ static void cmd_help_long_parsed(void *parsed_result, "set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)" " Set Aggregation mode for IEEE802.3AD (mode 4)" - "set bonding xmit_balance_policy (port_id) (l2|l23|l34)\n" + "set bonding balance_xmit_policy (port_id) (l2|l23|l34)\n" " Set the transmit balance policy for bonded device running in balance mode.\n\n" "set bonding mon_period (port_id) (value)\n" @@ -1913,18 +1913,13 @@ cmd_config_rx_tx_parsed(void *parsed_result, nb_txq = res->value; } else if (!strcmp(res->name, "rxd")) { - if (res->value <= 0 || res->value > RTE_TEST_RX_DESC_MAX) { - printf("rxd %d invalid - must be > 0 && <= %d\n", - res->value, RTE_TEST_RX_DESC_MAX); + if (check_nb_rxd(res->value) != 0) return; - } nb_rxd = res->value; } else if (!strcmp(res->name, "txd")) { - if (res->value <= 0 || res->value > RTE_TEST_TX_DESC_MAX) { - printf("txd %d invalid - must be > 0 && <= %d\n", - res->value, RTE_TEST_TX_DESC_MAX); + if (check_nb_txd(res->value) != 0) return; - } + nb_txd = res->value; } else { printf("Unknown parameter\n"); @@ -4173,6 +4168,9 @@ cmd_tx_vlan_set_parsed(void *parsed_result, { struct cmd_tx_vlan_set_result *res = parsed_result; + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; + if (!port_is_stopped(res->port_id)) { printf("Please stop port %d first\n", res->port_id); return; @@ -4227,6 +4225,9 @@ cmd_tx_vlan_set_qinq_parsed(void *parsed_result, { struct cmd_tx_vlan_set_qinq_result *res = parsed_result; + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; + if (!port_is_stopped(res->port_id)) { printf("Please stop port %d first\n", res->port_id); return; @@ -4340,6 +4341,9 @@ cmd_tx_vlan_reset_parsed(void *parsed_result, { struct cmd_tx_vlan_reset_result *res = parsed_result; + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; + if (!port_is_stopped(res->port_id)) { printf("Please stop port %d first\n", res->port_id); return; @@ -5122,7 +5126,7 @@ cmd_gso_size_parsed(void *parsed_result, if (test_done == 0) { printf("Before setting GSO segsz, please first" - " stop fowarding\n"); + " stop forwarding\n"); return; } @@ -16805,8 +16809,10 @@ cmd_ddp_get_list_parsed( #ifdef RTE_LIBRTE_I40E_PMD size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4; p_list = (struct rte_pmd_i40e_profile_list *)malloc(size); - if (!p_list) + if (!p_list) { printf("%s: Failed to malloc buffer\n", __func__); + return; + } if (ret == -ENOTSUP) ret = rte_pmd_i40e_get_ddp_list(res->port_id, diff --git a/dpdk/app/test-pmd/cmdline_flow.c b/dpdk/app/test-pmd/cmdline_flow.c index f05997873..be39f4b74 100644 --- a/dpdk/app/test-pmd/cmdline_flow.c +++ b/dpdk/app/test-pmd/cmdline_flow.c @@ -1005,7 +1005,6 @@ static const enum index item_pppoes[] = { }; static const enum index item_pppoe_proto_id[] = { - ITEM_PPPOE_PROTO_ID, ITEM_NEXT, ZERO, }; @@ -2544,11 +2543,14 @@ static const struct token token_list[] = { session_id)), }, [ITEM_PPPOE_PROTO_ID] = { - .name = "proto_id", + .name = "pppoe_proto_id", .help = "match PPPoE session protocol identifier", .priv = PRIV_ITEM(PPPOE_PROTO_ID, sizeof(struct rte_flow_item_pppoe_proto_id)), - .next = NEXT(item_pppoe_proto_id), + .next = NEXT(item_pppoe_proto_id, NEXT_ENTRY(UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON + (struct rte_flow_item_pppoe_proto_id, proto_id)), .call = parse_vc, }, [ITEM_HIGIG2] = { @@ -3898,30 +3900,15 @@ parse_vc_action_rss(struct context *ctx, const struct token *token, .func = RTE_ETH_HASH_FUNCTION_DEFAULT, .level = 0, .types = rss_hf, - .key_len = sizeof(action_rss_data->key), + .key_len = 0, .queue_num = RTE_MIN(nb_rxq, ACTION_RSS_QUEUE_NUM), - .key = action_rss_data->key, + .key = NULL, .queue = action_rss_data->queue, }, - .key = "testpmd's default RSS hash key, " - "override it for better balancing", .queue = { 0 }, }; for (i = 0; i < action_rss_data->conf.queue_num; ++i) action_rss_data->queue[i] = i; - if (!port_id_is_invalid(ctx->port, DISABLED_WARN) && - ctx->port != (portid_t)RTE_PORT_ALL) { - struct rte_eth_dev_info info; - int ret2; - - ret2 = rte_eth_dev_info_get(ctx->port, &info); - if (ret2 != 0) - return ret2; - - action_rss_data->conf.key_len = - RTE_MIN(sizeof(action_rss_data->key), - info.hash_key_size); - } action->conf = &action_rss_data->conf; return ret; } diff --git a/dpdk/app/test-pmd/cmdline_mtr.c b/dpdk/app/test-pmd/cmdline_mtr.c index ab5c8642d..045c2e28d 100644 --- a/dpdk/app/test-pmd/cmdline_mtr.c +++ b/dpdk/app/test-pmd/cmdline_mtr.c @@ -1262,6 +1262,7 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result, ret = rte_mtr_policer_actions_update(port_id, mtr_id, action_mask, actions, &error); if (ret != 0) { + free(actions); print_err_msg(&error); return; } diff --git a/dpdk/app/test-pmd/config.c b/dpdk/app/test-pmd/config.c index 62e547be0..5f8905c06 100644 --- a/dpdk/app/test-pmd/config.c +++ b/dpdk/app/test-pmd/config.c @@ -53,6 +53,14 @@ #include "testpmd.h" +#ifdef CLOCK_MONOTONIC_RAW /* Defined in glibc bits/time.h */ +#define CLOCK_TYPE_ID CLOCK_MONOTONIC_RAW +#else +#define CLOCK_TYPE_ID CLOCK_MONOTONIC +#endif + +#define NS_PER_SEC 1E9 + static char *flowtype_to_str(uint16_t flow_type); static const struct { @@ -125,9 +133,10 @@ nic_stats_display(portid_t port_id) static uint64_t prev_pkts_tx[RTE_MAX_ETHPORTS]; static uint64_t prev_bytes_rx[RTE_MAX_ETHPORTS]; static uint64_t prev_bytes_tx[RTE_MAX_ETHPORTS]; - static uint64_t prev_cycles[RTE_MAX_ETHPORTS]; + static uint64_t prev_ns[RTE_MAX_ETHPORTS]; + struct timespec cur_time; uint64_t diff_pkts_rx, diff_pkts_tx, diff_bytes_rx, diff_bytes_tx, - diff_cycles; + diff_ns; uint64_t mpps_rx, mpps_tx, mbps_rx, mbps_tx; struct rte_eth_stats stats; struct rte_port *port = &ports[port_id]; @@ -184,10 +193,17 @@ nic_stats_display(portid_t port_id) } } - diff_cycles = prev_cycles[port_id]; - prev_cycles[port_id] = rte_rdtsc(); - if (diff_cycles > 0) - diff_cycles = prev_cycles[port_id] - diff_cycles; + diff_ns = 0; + if (clock_gettime(CLOCK_TYPE_ID, &cur_time) == 0) { + uint64_t ns; + + ns = cur_time.tv_sec * NS_PER_SEC; + ns += cur_time.tv_nsec; + + if (prev_ns[port_id] != 0) + diff_ns = ns - prev_ns[port_id]; + prev_ns[port_id] = ns; + } diff_pkts_rx = (stats.ipackets > prev_pkts_rx[port_id]) ? (stats.ipackets - prev_pkts_rx[port_id]) : 0; @@ -195,10 +211,10 @@ nic_stats_display(portid_t port_id) (stats.opackets - prev_pkts_tx[port_id]) : 0; prev_pkts_rx[port_id] = stats.ipackets; prev_pkts_tx[port_id] = stats.opackets; - mpps_rx = diff_cycles > 0 ? - diff_pkts_rx * rte_get_tsc_hz() / diff_cycles : 0; - mpps_tx = diff_cycles > 0 ? - diff_pkts_tx * rte_get_tsc_hz() / diff_cycles : 0; + mpps_rx = diff_ns > 0 ? + (double)diff_pkts_rx / diff_ns * NS_PER_SEC : 0; + mpps_tx = diff_ns > 0 ? + (double)diff_pkts_tx / diff_ns * NS_PER_SEC : 0; diff_bytes_rx = (stats.ibytes > prev_bytes_rx[port_id]) ? (stats.ibytes - prev_bytes_rx[port_id]) : 0; @@ -206,10 +222,10 @@ nic_stats_display(portid_t port_id) (stats.obytes - prev_bytes_tx[port_id]) : 0; prev_bytes_rx[port_id] = stats.ibytes; prev_bytes_tx[port_id] = stats.obytes; - mbps_rx = diff_cycles > 0 ? - diff_bytes_rx * rte_get_tsc_hz() / diff_cycles : 0; - mbps_tx = diff_cycles > 0 ? - diff_bytes_tx * rte_get_tsc_hz() / diff_cycles : 0; + mbps_rx = diff_ns > 0 ? + (double)diff_bytes_rx / diff_ns * NS_PER_SEC : 0; + mbps_tx = diff_ns > 0 ? + (double)diff_bytes_tx / diff_ns * NS_PER_SEC : 0; printf("\n Throughput (since last show)\n"); printf(" Rx-pps: %12"PRIu64" Rx-bps: %12"PRIu64"\n Tx-pps: %12" @@ -223,11 +239,28 @@ nic_stats_display(portid_t port_id) void nic_stats_clear(portid_t port_id) { + int ret; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { print_valid_ports(); return; } - rte_eth_stats_reset(port_id); + + ret = rte_eth_stats_reset(port_id); + if (ret != 0) { + printf("%s: Error: failed to reset stats (port %u): %s", + __func__, port_id, strerror(-ret)); + return; + } + + ret = rte_eth_stats_get(port_id, &ports[port_id].stats); + if (ret != 0) { + if (ret < 0) + ret = -ret; + printf("%s: Error: failed to get stats (port %u): %s", + __func__, port_id, strerror(ret)); + return; + } printf("\n NIC statistics for port %d cleared\n", port_id); } @@ -303,10 +336,21 @@ nic_xstats_clear(portid_t port_id) print_valid_ports(); return; } + ret = rte_eth_xstats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset xstats (port %u): %s", + __func__, port_id, strerror(-ret)); + return; + } + + ret = rte_eth_stats_get(port_id, &ports[port_id].stats); + if (ret != 0) { + if (ret < 0) + ret = -ret; + printf("%s: Error: failed to get stats (port %u): %s", __func__, port_id, strerror(ret)); + return; } } @@ -1234,8 +1278,9 @@ port_mtu_set(portid_t port_id, uint16_t mtu) return; } diag = rte_eth_dev_set_mtu(port_id, mtu); - if (diag == 0 && - dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { + if (diag) + printf("Set MTU failed. diag=%d\n", diag); + else if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_JUMBO_FRAME) { /* * Ether overhead in driver is equal to the difference of * max_rx_pktlen and max_mtu in rte_eth_dev_info when the @@ -1250,10 +1295,7 @@ port_mtu_set(portid_t port_id, uint16_t mtu) } else rte_port->dev_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME; - - return; } - printf("Set MTU failed. diag=%d\n", diag); } /* Generic flow management functions. */ @@ -1526,7 +1568,7 @@ port_flow_query(portid_t port_id, uint32_t rule, /** List flow rules. */ void -port_flow_list(portid_t port_id, uint32_t n, const uint32_t group[n]) +port_flow_list(portid_t port_id, uint32_t n, const uint32_t *group) { struct rte_port *port; struct port_flow *pf; @@ -1643,22 +1685,102 @@ tx_queue_id_is_invalid(queueid_t txq_id) } static int -rx_desc_id_is_invalid(uint16_t rxdesc_id) +get_rx_ring_size(portid_t port_id, queueid_t rxq_id, uint16_t *ring_size) { - if (rxdesc_id < nb_rxd) + struct rte_port *port = &ports[port_id]; + struct rte_eth_rxq_info rx_qinfo; + int ret; + + ret = rte_eth_rx_queue_info_get(port_id, rxq_id, &rx_qinfo); + if (ret == 0) { + *ring_size = rx_qinfo.nb_desc; + return ret; + } + + if (ret != -ENOTSUP) + return ret; + /* + * If the rte_eth_rx_queue_info_get is not support for this PMD, + * ring_size stored in testpmd will be used for validity verification. + * When configure the rxq by rte_eth_rx_queue_setup with nb_rx_desc + * being 0, it will use a default value provided by PMDs to setup this + * rxq. If the default value is 0, it will use the + * RTE_ETH_DEV_FALLBACK_RX_RINGSIZE to setup this rxq. + */ + if (port->nb_rx_desc[rxq_id]) + *ring_size = port->nb_rx_desc[rxq_id]; + else if (port->dev_info.default_rxportconf.ring_size) + *ring_size = port->dev_info.default_rxportconf.ring_size; + else + *ring_size = RTE_ETH_DEV_FALLBACK_RX_RINGSIZE; + return 0; +} + +static int +get_tx_ring_size(portid_t port_id, queueid_t txq_id, uint16_t *ring_size) +{ + struct rte_port *port = &ports[port_id]; + struct rte_eth_txq_info tx_qinfo; + int ret; + + ret = rte_eth_tx_queue_info_get(port_id, txq_id, &tx_qinfo); + if (ret == 0) { + *ring_size = tx_qinfo.nb_desc; + return ret; + } + + if (ret != -ENOTSUP) + return ret; + /* + * If the rte_eth_tx_queue_info_get is not support for this PMD, + * ring_size stored in testpmd will be used for validity verification. + * When configure the txq by rte_eth_tx_queue_setup with nb_tx_desc + * being 0, it will use a default value provided by PMDs to setup this + * txq. If the default value is 0, it will use the + * RTE_ETH_DEV_FALLBACK_TX_RINGSIZE to setup this txq. + */ + if (port->nb_tx_desc[txq_id]) + *ring_size = port->nb_tx_desc[txq_id]; + else if (port->dev_info.default_txportconf.ring_size) + *ring_size = port->dev_info.default_txportconf.ring_size; + else + *ring_size = RTE_ETH_DEV_FALLBACK_TX_RINGSIZE; + return 0; +} + +static int +rx_desc_id_is_invalid(portid_t port_id, queueid_t rxq_id, uint16_t rxdesc_id) +{ + uint16_t ring_size; + int ret; + + ret = get_rx_ring_size(port_id, rxq_id, &ring_size); + if (ret) + return 1; + + if (rxdesc_id < ring_size) return 0; - printf("Invalid RX descriptor %d (must be < nb_rxd=%d)\n", - rxdesc_id, nb_rxd); + + printf("Invalid RX descriptor %u (must be < ring_size=%u)\n", + rxdesc_id, ring_size); return 1; } static int -tx_desc_id_is_invalid(uint16_t txdesc_id) +tx_desc_id_is_invalid(portid_t port_id, queueid_t txq_id, uint16_t txdesc_id) { - if (txdesc_id < nb_txd) + uint16_t ring_size; + int ret; + + ret = get_tx_ring_size(port_id, txq_id, &ring_size); + if (ret) + return 1; + + if (txdesc_id < ring_size) return 0; - printf("Invalid TX descriptor %d (must be < nb_txd=%d)\n", - txdesc_id, nb_txd); + + printf("Invalid TX descriptor %u (must be < ring_size=%u)\n", + txdesc_id, ring_size); return 1; } @@ -1779,11 +1901,7 @@ rx_ring_desc_display(portid_t port_id, queueid_t rxq_id, uint16_t rxd_id) { const struct rte_memzone *rx_mz; - if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; - if (rx_queue_id_is_invalid(rxq_id)) - return; - if (rx_desc_id_is_invalid(rxd_id)) + if (rx_desc_id_is_invalid(port_id, rxq_id, rxd_id)) return; rx_mz = ring_dma_zone_lookup("rx_ring", port_id, rxq_id); if (rx_mz == NULL) @@ -1796,11 +1914,7 @@ tx_ring_desc_display(portid_t port_id, queueid_t txq_id, uint16_t txd_id) { const struct rte_memzone *tx_mz; - if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; - if (tx_queue_id_is_invalid(txq_id)) - return; - if (tx_desc_id_is_invalid(txd_id)) + if (tx_desc_id_is_invalid(port_id, txq_id, txd_id)) return; tx_mz = ring_dma_zone_lookup("tx_ring", port_id, txq_id); if (tx_mz == NULL) @@ -1841,10 +1955,17 @@ rxtx_config_display(void) struct rte_eth_txconf *tx_conf = &ports[pid].tx_conf[0]; uint16_t *nb_rx_desc = &ports[pid].nb_rx_desc[0]; uint16_t *nb_tx_desc = &ports[pid].nb_tx_desc[0]; - uint16_t nb_rx_desc_tmp; - uint16_t nb_tx_desc_tmp; struct rte_eth_rxq_info rx_qinfo; struct rte_eth_txq_info tx_qinfo; + uint16_t rx_free_thresh_tmp; + uint16_t tx_free_thresh_tmp; + uint16_t tx_rs_thresh_tmp; + uint16_t nb_rx_desc_tmp; + uint16_t nb_tx_desc_tmp; + uint64_t offloads_tmp; + uint8_t pthresh_tmp; + uint8_t hthresh_tmp; + uint8_t wthresh_tmp; int32_t rc; /* per port config */ @@ -1858,41 +1979,64 @@ rxtx_config_display(void) /* per rx queue config only for first queue to be less verbose */ for (qid = 0; qid < 1; qid++) { rc = rte_eth_rx_queue_info_get(pid, qid, &rx_qinfo); - if (rc) + if (rc) { nb_rx_desc_tmp = nb_rx_desc[qid]; - else + rx_free_thresh_tmp = + rx_conf[qid].rx_free_thresh; + pthresh_tmp = rx_conf[qid].rx_thresh.pthresh; + hthresh_tmp = rx_conf[qid].rx_thresh.hthresh; + wthresh_tmp = rx_conf[qid].rx_thresh.wthresh; + offloads_tmp = rx_conf[qid].offloads; + } else { nb_rx_desc_tmp = rx_qinfo.nb_desc; + rx_free_thresh_tmp = + rx_qinfo.conf.rx_free_thresh; + pthresh_tmp = rx_qinfo.conf.rx_thresh.pthresh; + hthresh_tmp = rx_qinfo.conf.rx_thresh.hthresh; + wthresh_tmp = rx_qinfo.conf.rx_thresh.wthresh; + offloads_tmp = rx_qinfo.conf.offloads; + } printf(" RX queue: %d\n", qid); printf(" RX desc=%d - RX free threshold=%d\n", - nb_rx_desc_tmp, rx_conf[qid].rx_free_thresh); + nb_rx_desc_tmp, rx_free_thresh_tmp); printf(" RX threshold registers: pthresh=%d hthresh=%d " " wthresh=%d\n", - rx_conf[qid].rx_thresh.pthresh, - rx_conf[qid].rx_thresh.hthresh, - rx_conf[qid].rx_thresh.wthresh); - printf(" RX Offloads=0x%"PRIx64"\n", - rx_conf[qid].offloads); + pthresh_tmp, hthresh_tmp, wthresh_tmp); + printf(" RX Offloads=0x%"PRIx64"\n", offloads_tmp); } /* per tx queue config only for first queue to be less verbose */ for (qid = 0; qid < 1; qid++) { rc = rte_eth_tx_queue_info_get(pid, qid, &tx_qinfo); - if (rc) + if (rc) { nb_tx_desc_tmp = nb_tx_desc[qid]; - else + tx_free_thresh_tmp = + tx_conf[qid].tx_free_thresh; + pthresh_tmp = tx_conf[qid].tx_thresh.pthresh; + hthresh_tmp = tx_conf[qid].tx_thresh.hthresh; + wthresh_tmp = tx_conf[qid].tx_thresh.wthresh; + offloads_tmp = tx_conf[qid].offloads; + tx_rs_thresh_tmp = tx_conf[qid].tx_rs_thresh; + } else { nb_tx_desc_tmp = tx_qinfo.nb_desc; + tx_free_thresh_tmp = + tx_qinfo.conf.tx_free_thresh; + pthresh_tmp = tx_qinfo.conf.tx_thresh.pthresh; + hthresh_tmp = tx_qinfo.conf.tx_thresh.hthresh; + wthresh_tmp = tx_qinfo.conf.tx_thresh.wthresh; + offloads_tmp = tx_qinfo.conf.offloads; + tx_rs_thresh_tmp = tx_qinfo.conf.tx_rs_thresh; + } printf(" TX queue: %d\n", qid); printf(" TX desc=%d - TX free threshold=%d\n", - nb_tx_desc_tmp, tx_conf[qid].tx_free_thresh); + nb_tx_desc_tmp, tx_free_thresh_tmp); printf(" TX threshold registers: pthresh=%d hthresh=%d " " wthresh=%d\n", - tx_conf[qid].tx_thresh.pthresh, - tx_conf[qid].tx_thresh.hthresh, - tx_conf[qid].tx_thresh.wthresh); + pthresh_tmp, hthresh_tmp, wthresh_tmp); printf(" TX offloads=0x%"PRIx64" - TX RS bit threshold=%d\n", - tx_conf[qid].offloads, tx_conf->tx_rs_thresh); + offloads_tmp, tx_rs_thresh_tmp); } } } @@ -2537,6 +2681,10 @@ set_fwd_lcores_mask(uint64_t lcoremask) void set_fwd_lcores_number(uint16_t nb_lc) { + if (test_done == 0) { + printf("Please stop forwarding first\n"); + return; + } if (nb_lc > nb_cfg_lcores) { printf("nb fwd cores %u > %u (max. number of configured " "lcores) - ignored\n", @@ -2684,17 +2832,41 @@ show_tx_pkt_segments(void) printf("Split packet: %s\n", split); } +static bool +nb_segs_is_invalid(unsigned int nb_segs) +{ + uint16_t ring_size; + uint16_t queue_id; + uint16_t port_id; + int ret; + + RTE_ETH_FOREACH_DEV(port_id) { + for (queue_id = 0; queue_id < nb_txq; queue_id++) { + ret = get_tx_ring_size(port_id, queue_id, &ring_size); + + if (ret) + return true; + + if (ring_size < nb_segs) { + printf("nb segments per TX packets=%u >= " + "TX queue(%u) ring_size=%u - ignored\n", + nb_segs, queue_id, ring_size); + return true; + } + } + } + + return false; +} + void set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) { uint16_t tx_pkt_len; unsigned i; - if (nb_segs >= (unsigned) nb_txd) { - printf("nb segments per TX packets=%u >= nb_txd=%u - ignored\n", - nb_segs, (unsigned int) nb_txd); + if (nb_segs_is_invalid(nb_segs)) return; - } /* * Check that each segment length is greater or equal than @@ -3038,9 +3210,11 @@ vlan_extend_set(portid_t port_id, int on) } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); - if (diag < 0) + if (diag < 0) { printf("rx_vlan_extend_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + return; + } ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } @@ -3065,9 +3239,11 @@ rx_vlan_strip_set(portid_t port_id, int on) } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); - if (diag < 0) + if (diag < 0) { printf("rx_vlan_strip_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + return; + } ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } @@ -3106,9 +3282,11 @@ rx_vlan_filter_set(portid_t port_id, int on) } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); - if (diag < 0) + if (diag < 0) { printf("rx_vlan_filter_set(port_pi=%d, on=%d) failed " "diag=%d\n", port_id, on, diag); + return; + } ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } @@ -3133,9 +3311,11 @@ rx_vlan_qinq_strip_set(portid_t port_id, int on) } diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload); - if (diag < 0) + if (diag < 0) { printf("%s(port_pi=%d, on=%d) failed " "diag=%d\n", __func__, port_id, on, diag); + return; + } ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads; } @@ -3193,8 +3373,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) struct rte_eth_dev_info dev_info; int ret; - if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; if (vlan_id_is_invalid(vlan_id)) return; @@ -3225,8 +3403,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) struct rte_eth_dev_info dev_info; int ret; - if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; if (vlan_id_is_invalid(vlan_id)) return; if (vlan_id_is_invalid(vlan_id_outer)) @@ -3252,8 +3428,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) void tx_vlan_reset(portid_t port_id) { - if (port_id_is_invalid(port_id, ENABLED_WARN)) - return; ports[port_id].dev_conf.txmode.offloads &= ~(DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT); diff --git a/dpdk/app/test-pmd/csumonly.c b/dpdk/app/test-pmd/csumonly.c index 25091de88..7b92ab119 100644 --- a/dpdk/app/test-pmd/csumonly.c +++ b/dpdk/app/test-pmd/csumonly.c @@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info) /* * Parse an ethernet header to fill the ethertype, l2_len, l3_len and - * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan - * header. The l4_len argument is only set in case of TCP (useful for TSO). + * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN + * headers. The l4_len argument is only set in case of TCP (useful for TSO). */ static void parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info) { struct rte_ipv4_hdr *ipv4_hdr; struct rte_ipv6_hdr *ipv6_hdr; + struct rte_vlan_hdr *vlan_hdr; info->l2_len = sizeof(struct rte_ether_hdr); info->ethertype = eth_hdr->ether_type; - if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) { - struct rte_vlan_hdr *vlan_hdr = ( - struct rte_vlan_hdr *)(eth_hdr + 1); - + while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) || + info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) { + vlan_hdr = (struct rte_vlan_hdr *) + ((char *)eth_hdr + info->l2_len); info->l2_len += sizeof(struct rte_vlan_hdr); info->ethertype = vlan_hdr->eth_proto; } diff --git a/dpdk/app/test-pmd/meson.build b/dpdk/app/test-pmd/meson.build index 6006c60f9..b0249bdb3 100644 --- a/dpdk/app/test-pmd/meson.build +++ b/dpdk/app/test-pmd/meson.build @@ -28,6 +28,18 @@ deps += ['ethdev', 'gro', 'gso', 'cmdline', 'metrics', 'meter', 'bus_pci'] if dpdk_conf.has('RTE_LIBRTE_PDUMP') deps += 'pdump' endif +if dpdk_conf.has('RTE_LIBRTE_BITRATESTATS') + deps += 'bitratestats' +endif +if dpdk_conf.has('RTE_LIBRTE_LATENCYSTATS') + deps += 'latencystats' +endif +if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER') + deps += 'pmd_crypto_scheduler' +endif +if dpdk_conf.has('RTE_LIBRTE_BOND_PMD') + deps += 'pmd_bond' +endif if dpdk_conf.has('RTE_LIBRTE_BNXT_PMD') deps += 'pmd_bnxt' endif diff --git a/dpdk/app/test-pmd/parameters.c b/dpdk/app/test-pmd/parameters.c index 2e7a50441..0eb784478 100644 --- a/dpdk/app/test-pmd/parameters.c +++ b/dpdk/app/test-pmd/parameters.c @@ -49,7 +49,7 @@ static void usage(char* progname) { - printf("usage: %s " + printf("usage: %s [EAL options] -- " #ifdef RTE_LIBRTE_CMDLINE "[--interactive|-i] " "[--cmdline-file=FILENAME] " diff --git a/dpdk/app/test-pmd/testpmd.c b/dpdk/app/test-pmd/testpmd.c index 31361e499..8d3b7b2a3 100644 --- a/dpdk/app/test-pmd/testpmd.c +++ b/dpdk/app/test-pmd/testpmd.c @@ -1071,6 +1071,177 @@ check_nb_txq(queueid_t txq) return 0; } +/* + * Get the allowed maximum number of RXDs of every rx queue. + * *pid return the port id which has minimal value of + * max_rxd in all queues of all ports. + */ +static uint16_t +get_allowed_max_nb_rxd(portid_t *pid) +{ + uint16_t allowed_max_rxd = UINT16_MAX; + portid_t pi; + struct rte_eth_dev_info dev_info; + + RTE_ETH_FOREACH_DEV(pi) { + if (eth_dev_info_get_print_err(pi, &dev_info) != 0) + continue; + + if (dev_info.rx_desc_lim.nb_max < allowed_max_rxd) { + allowed_max_rxd = dev_info.rx_desc_lim.nb_max; + *pid = pi; + } + } + return allowed_max_rxd; +} + +/* + * Get the allowed minimal number of RXDs of every rx queue. + * *pid return the port id which has minimal value of + * min_rxd in all queues of all ports. + */ +static uint16_t +get_allowed_min_nb_rxd(portid_t *pid) +{ + uint16_t allowed_min_rxd = 0; + portid_t pi; + struct rte_eth_dev_info dev_info; + + RTE_ETH_FOREACH_DEV(pi) { + if (eth_dev_info_get_print_err(pi, &dev_info) != 0) + continue; + + if (dev_info.rx_desc_lim.nb_min > allowed_min_rxd) { + allowed_min_rxd = dev_info.rx_desc_lim.nb_min; + *pid = pi; + } + } + + return allowed_min_rxd; +} + +/* + * Check input rxd is valid or not. + * If input rxd is not greater than any of maximum number + * of RXDs of every Rx queues and is not less than any of + * minimal number of RXDs of every Rx queues, it is valid. + * if valid, return 0, else return -1 + */ +int +check_nb_rxd(queueid_t rxd) +{ + uint16_t allowed_max_rxd; + uint16_t allowed_min_rxd; + portid_t pid = 0; + + allowed_max_rxd = get_allowed_max_nb_rxd(&pid); + if (rxd > allowed_max_rxd) { + printf("Fail: input rxd (%u) can't be greater " + "than max_rxds (%u) of port %u\n", + rxd, + allowed_max_rxd, + pid); + return -1; + } + + allowed_min_rxd = get_allowed_min_nb_rxd(&pid); + if (rxd < allowed_min_rxd) { + printf("Fail: input rxd (%u) can't be less " + "than min_rxds (%u) of port %u\n", + rxd, + allowed_min_rxd, + pid); + return -1; + } + + return 0; +} + +/* + * Get the allowed maximum number of TXDs of every rx queues. + * *pid return the port id which has minimal value of + * max_txd in every tx queue. + */ +static uint16_t +get_allowed_max_nb_txd(portid_t *pid) +{ + uint16_t allowed_max_txd = UINT16_MAX; + portid_t pi; + struct rte_eth_dev_info dev_info; + + RTE_ETH_FOREACH_DEV(pi) { + if (eth_dev_info_get_print_err(pi, &dev_info) != 0) + continue; + + if (dev_info.tx_desc_lim.nb_max < allowed_max_txd) { + allowed_max_txd = dev_info.tx_desc_lim.nb_max; + *pid = pi; + } + } + return allowed_max_txd; +} + +/* + * Get the allowed maximum number of TXDs of every tx queues. + * *pid return the port id which has minimal value of + * min_txd in every tx queue. + */ +static uint16_t +get_allowed_min_nb_txd(portid_t *pid) +{ + uint16_t allowed_min_txd = 0; + portid_t pi; + struct rte_eth_dev_info dev_info; + + RTE_ETH_FOREACH_DEV(pi) { + if (eth_dev_info_get_print_err(pi, &dev_info) != 0) + continue; + + if (dev_info.tx_desc_lim.nb_min > allowed_min_txd) { + allowed_min_txd = dev_info.tx_desc_lim.nb_min; + *pid = pi; + } + } + + return allowed_min_txd; +} + +/* + * Check input txd is valid or not. + * If input txd is not greater than any of maximum number + * of TXDs of every Rx queues, it is valid. + * if valid, return 0, else return -1 + */ +int +check_nb_txd(queueid_t txd) +{ + uint16_t allowed_max_txd; + uint16_t allowed_min_txd; + portid_t pid = 0; + + allowed_max_txd = get_allowed_max_nb_txd(&pid); + if (txd > allowed_max_txd) { + printf("Fail: input txd (%u) can't be greater " + "than max_txds (%u) of port %u\n", + txd, + allowed_max_txd, + pid); + return -1; + } + + allowed_min_txd = get_allowed_min_nb_txd(&pid); + if (txd < allowed_min_txd) { + printf("Fail: input txd (%u) can't be less " + "than min_txds (%u) of port %u\n", + txd, + allowed_min_txd, + pid); + return -1; + } + return 0; +} + + /* * Get the allowed maximum number of hairpin queues. * *pid return the port id which has minimal value of @@ -1430,9 +1601,9 @@ init_fwd_streams(void) static void pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) { - unsigned int total_burst; - unsigned int nb_burst; - unsigned int burst_stats[3]; + uint64_t total_burst; + uint64_t nb_burst; + uint64_t burst_stats[3]; uint16_t pktnb_stats[3]; uint16_t nb_pkt; int burst_percent[3]; @@ -1461,8 +1632,8 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) } if (total_burst == 0) return; - burst_percent[0] = (burst_stats[0] * 100) / total_burst; - printf(" %s-bursts : %u [%d%% of %d pkts", rx_tx, total_burst, + burst_percent[0] = (double)burst_stats[0] / total_burst * 100; + printf(" %s-bursts : %"PRIu64" [%d%% of %d pkts", rx_tx, total_burst, burst_percent[0], (int) pktnb_stats[0]); if (burst_stats[0] == total_burst) { printf("]\n"); @@ -1473,7 +1644,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) 100 - burst_percent[0], pktnb_stats[1]); return; } - burst_percent[1] = (burst_stats[1] * 100) / total_burst; + burst_percent[1] = (double)burst_stats[1] / total_burst * 100; burst_percent[2] = 100 - (burst_percent[0] + burst_percent[1]); if ((burst_percent[1] == 0) || (burst_percent[2] == 0)) { printf(" + %d%% of others]\n", 100 - burst_percent[0]); @@ -1698,11 +1869,22 @@ fwd_stats_display(void) "%s\n", acc_stats_border, acc_stats_border); #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES - if (total_recv > 0) - printf("\n CPU cycles/packet=%u (total cycles=" - "%"PRIu64" / total RX packets=%"PRIu64")\n", - (unsigned int)(fwd_cycles / total_recv), - fwd_cycles, total_recv); +#define CYC_PER_MHZ 1E6 + if (total_recv > 0 || total_xmit > 0) { + uint64_t total_pkts = 0; + if (strcmp(cur_fwd_eng->fwd_mode_name, "txonly") == 0 || + strcmp(cur_fwd_eng->fwd_mode_name, "flowgen") == 0) + total_pkts = total_xmit; + else + total_pkts = total_recv; + + printf("\n CPU cycles/packet=%.2F (total cycles=" + "%"PRIu64" / total %s packets=%"PRIu64") at %"PRIu64 + " MHz Clock\n", + (double) fwd_cycles / total_pkts, + fwd_cycles, cur_fwd_eng->fwd_mode_name, total_pkts, + (uint64_t)(rte_get_tsc_hz() / CYC_PER_MHZ)); + } #endif } @@ -2752,7 +2934,7 @@ check_all_ports_link_status(uint32_t port_mask) "Port%d Link Up. speed %u Mbps- %s\n", portid, link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex\n")); + ("full-duplex") : ("half-duplex")); else printf("Port %d Link Down\n", portid); continue; @@ -3193,6 +3375,8 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf, struct rte_eth_dcb_tx_conf *tx_conf = ð_conf->tx_adv_conf.dcb_tx_conf; + memset(&rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + rc = rte_eth_dev_rss_hash_conf_get(pid, &rss_conf); if (rc != 0) return rc; diff --git a/dpdk/app/test-pmd/testpmd.h b/dpdk/app/test-pmd/testpmd.h index 0694e1ef8..2b1e9a24f 100644 --- a/dpdk/app/test-pmd/testpmd.h +++ b/dpdk/app/test-pmd/testpmd.h @@ -859,6 +859,8 @@ queueid_t get_allowed_max_nb_rxq(portid_t *pid); int check_nb_rxq(queueid_t rxq); queueid_t get_allowed_max_nb_txq(portid_t *pid); int check_nb_txq(queueid_t txq); +int check_nb_rxd(queueid_t rxd); +int check_nb_txd(queueid_t txd); queueid_t get_allowed_max_nb_hairpinq(portid_t *pid); int check_nb_hairpinq(queueid_t hairpinq); diff --git a/dpdk/app/test-pmd/txonly.c b/dpdk/app/test-pmd/txonly.c index 8ed436def..a1822c631 100644 --- a/dpdk/app/test-pmd/txonly.c +++ b/dpdk/app/test-pmd/txonly.c @@ -147,6 +147,34 @@ setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr, ip_hdr->hdr_checksum = (uint16_t) ip_cksum; } +static inline void +update_pkt_header(struct rte_mbuf *pkt, uint32_t total_pkt_len) +{ + struct rte_ipv4_hdr *ip_hdr; + struct rte_udp_hdr *udp_hdr; + uint16_t pkt_data_len; + uint16_t pkt_len; + + pkt_data_len = (uint16_t) (total_pkt_len - ( + sizeof(struct rte_ether_hdr) + + sizeof(struct rte_ipv4_hdr) + + sizeof(struct rte_udp_hdr))); + /* updata udp pkt length */ + udp_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_udp_hdr *, + sizeof(struct rte_ether_hdr) + + sizeof(struct rte_ipv4_hdr)); + pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr)); + udp_hdr->dgram_len = RTE_CPU_TO_BE_16(pkt_len); + + /* updata ip pkt length and csum */ + ip_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *, + sizeof(struct rte_ether_hdr)); + ip_hdr->hdr_checksum = 0; + pkt_len = (uint16_t) (pkt_len + sizeof(struct rte_ipv4_hdr)); + ip_hdr->total_length = RTE_CPU_TO_BE_16(pkt_len); + ip_hdr->hdr_checksum = rte_ipv4_cksum(ip_hdr); +} + static inline bool pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, struct rte_ether_hdr *eth_hdr, const uint16_t vlan_tci, @@ -212,6 +240,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr)); + + if (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND) || txonly_multi_flow) + update_pkt_header(pkt, pkt_len); + /* * Complete first mbuf of packet and append it to the * burst of packets to be transmitted. diff --git a/dpdk/app/test-sad/main.c b/dpdk/app/test-sad/main.c index b01e84c57..8380fad74 100644 --- a/dpdk/app/test-sad/main.c +++ b/dpdk/app/test-sad/main.c @@ -617,7 +617,7 @@ main(int argc, char **argv) { int ret; struct rte_ipsec_sad *sad; - struct rte_ipsec_sad_conf conf; + struct rte_ipsec_sad_conf conf = {0}; unsigned int lcore_id; ret = rte_eal_init(argc, argv); diff --git a/dpdk/app/test/Makefile b/dpdk/app/test/Makefile index 1ee155009..30eff3320 100644 --- a/dpdk/app/test/Makefile +++ b/dpdk/app/test/Makefile @@ -122,7 +122,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_perf.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_functions.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_multiwriter.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite.c -SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite_lf.c +SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite_lf_perf.c SRCS-$(CONFIG_RTE_LIBRTE_RIB) += test_rib.c SRCS-$(CONFIG_RTE_LIBRTE_RIB) += test_rib6.c diff --git a/dpdk/app/test/autotest_data.py b/dpdk/app/test/autotest_data.py index 6deb97bcc..ca29b09f3 100644 --- a/dpdk/app/test/autotest_data.py +++ b/dpdk/app/test/autotest_data.py @@ -670,8 +670,8 @@ non_parallel_test_list = [ "Report": None, }, { - "Name": "Hash read-write lock-free concurrency autotest", - "Command": "hash_readwrite_lf_autotest", + "Name": "Hash read-write lock-free concurrency perf autotest", + "Command": "hash_readwrite_lf_perf_autotest", "Func": default_autotest, "Report": None, }, diff --git a/dpdk/app/test/meson.build b/dpdk/app/test/meson.build index 8cb90c499..1fa9124c7 100644 --- a/dpdk/app/test/meson.build +++ b/dpdk/app/test/meson.build @@ -56,7 +56,7 @@ test_sources = files('commands.c', 'test_hash_multiwriter.c', 'test_hash_readwrite.c', 'test_hash_perf.c', - 'test_hash_readwrite_lf.c', + 'test_hash_readwrite_lf_perf.c', 'test_interrupts.c', 'test_ipsec.c', 'test_ipsec_sad.c', @@ -154,88 +154,89 @@ test_deps = ['acl', 'timer' ] -fast_test_names = [ - 'acl_autotest', - 'alarm_autotest', - 'atomic_autotest', - 'byteorder_autotest', - 'cmdline_autotest', - 'common_autotest', - 'cpuflags_autotest', - 'cycles_autotest', - 'debug_autotest', - 'eal_flags_c_opt_autotest', - 'eal_flags_master_opt_autotest', - 'eal_flags_n_opt_autotest', - 'eal_flags_hpet_autotest', - 'eal_flags_no_huge_autotest', - 'eal_flags_w_opt_autotest', - 'eal_flags_b_opt_autotest', - 'eal_flags_vdev_opt_autotest', - 'eal_flags_r_opt_autotest', - 'eal_flags_mem_autotest', - 'eal_flags_file_prefix_autotest', - 'eal_flags_misc_autotest', - 'eal_fs_autotest', - 'errno_autotest', - 'event_ring_autotest', - 'fib_autotest', - 'fib6_autotest', - 'func_reentrancy_autotest', - 'flow_classify_autotest', - 'hash_autotest', - 'interrupt_autotest', - 'logs_autotest', - 'lpm_autotest', - 'lpm6_autotest', - 'malloc_autotest', - 'mbuf_autotest', - 'mcslock_autotest', - 'memcpy_autotest', - 'memory_autotest', - 'mempool_autotest', - 'memzone_autotest', - 'meter_autotest', - 'multiprocess_autotest', - 'per_lcore_autotest', - 'prefetch_autotest', - 'rcu_qsbr_autotest', - 'red_autotest', - 'rib_autotest', - 'rib6_autotest', - 'ring_autotest', - 'rwlock_test1_autotest', - 'rwlock_rda_autotest', - 'rwlock_rds_wrm_autotest', - 'rwlock_rde_wro_autotest', - 'sched_autotest', - 'spinlock_autotest', - 'stack_autotest', - 'stack_lf_autotest', - 'string_autotest', - 'table_autotest', - 'tailq_autotest', - 'timer_autotest', - 'user_delay_us', - 'version_autotest', - 'crc_autotest', - 'delay_us_sleep_autotest', - 'distributor_autotest', - 'eventdev_common_autotest', - 'fbarray_autotest', - 'hash_readwrite_autotest', - 'hash_readwrite_lf_autotest', - 'ipsec_autotest', - 'kni_autotest', - 'kvargs_autotest', - 'member_autotest', - 'metrics_autotest', - 'power_cpufreq_autotest', - 'power_autotest', - 'power_kvm_vm_autotest', - 'reorder_autotest', - 'service_autotest', - 'thash_autotest', +# Each test is marked with flag true/false +# to indicate whether it can run in no-huge mode. +fast_tests = [ + ['acl_autotest', true], + ['alarm_autotest', false], + ['atomic_autotest', false], + ['byteorder_autotest', true], + ['cmdline_autotest', true], + ['common_autotest', true], + ['cpuflags_autotest', true], + ['cycles_autotest', true], + ['debug_autotest', true], + ['eal_flags_c_opt_autotest', false], + ['eal_flags_master_opt_autotest', false], + ['eal_flags_n_opt_autotest', false], + ['eal_flags_hpet_autotest', false], + ['eal_flags_no_huge_autotest', false], + ['eal_flags_w_opt_autotest', false], + ['eal_flags_b_opt_autotest', false], + ['eal_flags_vdev_opt_autotest', false], + ['eal_flags_r_opt_autotest', false], + ['eal_flags_mem_autotest', false], + ['eal_flags_file_prefix_autotest', false], + ['eal_flags_misc_autotest', false], + ['eal_fs_autotest', true], + ['errno_autotest', true], + ['event_ring_autotest', true], + ['fib_autotest', true], + ['fib6_autotest', true], + ['func_reentrancy_autotest', false], + ['flow_classify_autotest', false], + ['hash_autotest', true], + ['interrupt_autotest', true], + ['logs_autotest', true], + ['lpm_autotest', true], + ['lpm6_autotest', true], + ['malloc_autotest', false], + ['mbuf_autotest', false], + ['mcslock_autotest', false], + ['memcpy_autotest', true], + ['memory_autotest', false], + ['mempool_autotest', false], + ['memzone_autotest', false], + ['meter_autotest', true], + ['multiprocess_autotest', false], + ['per_lcore_autotest', true], + ['prefetch_autotest', true], + ['rcu_qsbr_autotest', true], + ['red_autotest', true], + ['rib_autotest', true], + ['rib6_autotest', true], + ['ring_autotest', true], + ['rwlock_test1_autotest', true], + ['rwlock_rda_autotest', true], + ['rwlock_rds_wrm_autotest', true], + ['rwlock_rde_wro_autotest', true], + ['sched_autotest', true], + ['spinlock_autotest', true], + ['stack_autotest', false], + ['stack_lf_autotest', false], + ['string_autotest', true], + ['table_autotest', true], + ['tailq_autotest', true], + ['timer_autotest', false], + ['user_delay_us', true], + ['version_autotest', true], + ['crc_autotest', true], + ['delay_us_sleep_autotest', true], + ['distributor_autotest', false], + ['eventdev_common_autotest', true], + ['fbarray_autotest', true], + ['hash_readwrite_autotest', false], + ['ipsec_autotest', true], + ['kni_autotest', false], + ['kvargs_autotest', true], + ['member_autotest', true], + ['metrics_autotest', true], + ['power_cpufreq_autotest', false], + ['power_autotest', true], + ['power_kvm_vm_autotest', false], + ['reorder_autotest', true], + ['service_autotest', true], + ['thash_autotest', true], ] perf_test_names = [ @@ -269,6 +270,7 @@ perf_test_names = [ 'stack_perf_autotest', 'stack_lf_perf_autotest', 'rand_perf_autotest', + 'hash_readwrite_lf_perf_autotest', ] driver_test_names = [ @@ -322,6 +324,10 @@ endif # they are used via a driver-specific API. if dpdk_conf.has('RTE_LIBRTE_BOND_PMD') test_deps += 'pmd_bond' + if dpdk_conf.has('RTE_LIBRTE_RING_PMD') + test_sources += 'test_link_bonding_mode4.c' + driver_test_names += 'link_bonding_mode4_autotest' + endif endif if dpdk_conf.has('RTE_LIBRTE_RING_PMD') test_deps += 'pmd_ring' @@ -330,16 +336,14 @@ if dpdk_conf.has('RTE_LIBRTE_RING_PMD') test_sources += 'test_event_eth_tx_adapter.c' test_sources += 'test_bitratestats.c' test_sources += 'test_latencystats.c' - test_sources += 'test_link_bonding_mode4.c' test_sources += 'sample_packet_forward.c' test_sources += 'test_pdump.c' - fast_test_names += 'ring_pmd_autotest' + fast_tests += [['ring_pmd_autotest', true]] perf_test_names += 'ring_pmd_perf_autotest' - fast_test_names += 'event_eth_tx_adapter_autotest' - fast_test_names += 'bitratestats_autotest' - fast_test_names += 'latencystats_autotest' - driver_test_names += 'link_bonding_mode4_autotest' - fast_test_names += 'pdump_autotest' + fast_tests += [['event_eth_tx_adapter_autotest', false]] + fast_tests += [['bitratestats_autotest', true]] + fast_tests += [['latencystats_autotest', true]] + fast_tests += [['pdump_autotest', true]] endif if dpdk_conf.has('RTE_LIBRTE_POWER') @@ -360,6 +364,9 @@ endif # specify -D_GNU_SOURCE unconditionally cflags += '-D_GNU_SOURCE' +# Enable using internal APIs in unit tests +cflags += ['-DALLOW_INTERNAL_API'] + test_dep_objs = [] if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') compress_test_dep = dependency('zlib', required: false) @@ -367,12 +374,13 @@ if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') test_dep_objs += compress_test_dep test_sources += 'test_compressdev.c' test_deps += 'compressdev' - fast_test_names += 'compressdev_autotest' + fast_tests += [['compressdev_autotest', false]] endif endif if dpdk_conf.has('RTE_LIBRTE_PMD_CRYPTO_SCHEDULER') driver_test_names += 'cryptodev_scheduler_autotest' + test_deps += 'pmd_crypto_scheduler' endif foreach d:test_deps @@ -383,7 +391,7 @@ test_dep_objs += cc.find_library('execinfo', required: false) link_libs = [] if get_option('default_library') == 'static' - link_libs = dpdk_drivers + link_libs = dpdk_static_libraries + dpdk_drivers endif dpdk_test = executable('dpdk-test', @@ -391,9 +399,21 @@ dpdk_test = executable('dpdk-test', link_whole: link_libs, dependencies: test_dep_objs, c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'], - install_rpath: driver_install_path, + install_rpath: join_paths(get_option('prefix'), + driver_install_path), install: true) +has_hugepage = true +if is_linux + check_hugepage = run_command('cat', + '/proc/sys/vm/nr_hugepages') + if (check_hugepage.returncode() != 0 or + check_hugepage.stdout().strip() == '0') + has_hugepage = false + endif +endif +message('hugepage availability: @0@'.format(has_hugepage)) + # some perf tests (eg: memcpy perf autotest)take very long # to complete, so timeout to 10 minutes timeout_seconds = 600 @@ -402,37 +422,43 @@ timeout_seconds_fast = 10 get_coremask = find_program('get-coremask.sh') num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip() -test_args = [num_cores_arg] +default_test_args = [num_cores_arg] + +foreach arg : fast_tests + test_args = default_test_args + run_test = true + if not has_hugepage + if arg[1] + test_args += ['--no-huge', '-m', '2048'] + else + run_test = false + endif + endif -foreach arg : fast_test_names if (get_option('default_library') == 'shared' and - arg == 'event_eth_tx_adapter_autotest') + arg[0] == 'event_eth_tx_adapter_autotest') foreach drv:dpdk_drivers test_args += ['-d', drv.full_path().split('.a')[0] + '.so'] endforeach endif - if host_machine.system() == 'linux' - test(arg, dpdk_test, - env : ['DPDK_TEST=' + arg], - args : test_args + - ['--file-prefix=@0@'.format(arg)], - timeout : timeout_seconds_fast, - is_parallel : false, - suite : 'fast-tests') - else - test(arg, dpdk_test, - env : ['DPDK_TEST=' + arg], + if is_linux + test_args += ['--file-prefix=@0@'.format(arg[0])] + endif + + if run_test + test(arg[0], dpdk_test, + env : ['DPDK_TEST=' + arg[0]], args : test_args, - timeout : timeout_seconds_fast, - is_parallel : false, - suite : 'fast-tests') + timeout : timeout_seconds_fast, + is_parallel : false, + suite : 'fast-tests') endif endforeach foreach arg : perf_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], - args : test_args, + args : default_test_args, timeout : timeout_seconds, is_parallel : false, suite : 'perf-tests') @@ -441,7 +467,7 @@ endforeach foreach arg : driver_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], - args : test_args, + args : default_test_args, timeout : timeout_seconds, is_parallel : false, suite : 'driver-tests') @@ -450,7 +476,7 @@ endforeach foreach arg : dump_test_names test(arg, dpdk_test, env : ['DPDK_TEST=' + arg], - args : test_args, + args : default_test_args, timeout : timeout_seconds, is_parallel : false, suite : 'debug-tests') diff --git a/dpdk/app/test/test.h b/dpdk/app/test/test.h index ac0c50616..b07f6c1ef 100644 --- a/dpdk/app/test/test.h +++ b/dpdk/app/test/test.h @@ -22,8 +22,6 @@ # define TEST_TRACE_FAILURE(_file, _line, _func) #endif -#define RTE_TEST_TRACE_FAILURE TEST_TRACE_FAILURE - #include #define TEST_ASSERT RTE_TEST_ASSERT diff --git a/dpdk/app/test/test_acl.c b/dpdk/app/test/test_acl.c index 9cd9e37db..b78b67193 100644 --- a/dpdk/app/test/test_acl.c +++ b/dpdk/app/test/test_acl.c @@ -1394,16 +1394,18 @@ test_invalid_parameters(void) } else rte_acl_free(acx); - /* invalid NUMA node */ - memcpy(¶m, &acl_param, sizeof(param)); - param.socket_id = RTE_MAX_NUMA_NODES + 1; + if (rte_eal_has_hugepages()) { + /* invalid NUMA node */ + memcpy(¶m, &acl_param, sizeof(param)); + param.socket_id = RTE_MAX_NUMA_NODES + 1; - acx = rte_acl_create(¶m); - if (acx != NULL) { - printf("Line %i: ACL context creation with invalid NUMA " - "should have failed!\n", __LINE__); - rte_acl_free(acx); - return -1; + acx = rte_acl_create(¶m); + if (acx != NULL) { + printf("Line %i: ACL context creation with invalid " + "NUMA should have failed!\n", __LINE__); + rte_acl_free(acx); + return -1; + } } /* NULL name */ diff --git a/dpdk/app/test/test_bpf.c b/dpdk/app/test/test_bpf.c index ee534687a..4a61a7d7c 100644 --- a/dpdk/app/test/test_bpf.c +++ b/dpdk/app/test/test_bpf.c @@ -1797,13 +1797,6 @@ test_call1_check(uint64_t rc, const void *arg) dummy_func1(arg, &v32, &v64); v64 += v32; - if (v64 != rc) { - printf("%s@%d: invalid return value " - "expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n", - __func__, __LINE__, v64, rc); - return -1; - } - return 0; return cmp_res(__func__, v64, rc, dv, dv, sizeof(*dv)); } @@ -1934,13 +1927,7 @@ test_call2_check(uint64_t rc, const void *arg) dummy_func2(&a, &b); v = a.u64 + a.u32 + b.u16 + b.u8; - if (v != rc) { - printf("%s@%d: invalid return value " - "expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n", - __func__, __LINE__, v, rc); - return -1; - } - return 0; + return cmp_res(__func__, v, rc, arg, arg, 0); } static const struct rte_bpf_xsym test_call2_xsym[] = { @@ -2429,7 +2416,6 @@ test_call5_check(uint64_t rc, const void *arg) v = 0; fail: - return cmp_res(__func__, v, rc, &v, &rc, sizeof(v)); } @@ -2458,6 +2444,7 @@ static const struct rte_bpf_xsym test_call5_xsym[] = { }, }; +/* all bpf test cases */ static const struct bpf_test tests[] = { { .name = "test_store1", @@ -2738,7 +2725,6 @@ run_test(const struct bpf_test *tst) } tst->prepare(tbuf); - rc = rte_bpf_exec(bpf, tbuf); ret = tst->check_result(rc, tbuf); if (ret != 0) { @@ -2746,17 +2732,20 @@ run_test(const struct bpf_test *tst) __func__, __LINE__, tst->name, ret, strerror(ret)); } + /* repeat the same test with jit, when possible */ rte_bpf_get_jit(bpf, &jit); - if (jit.func == NULL) - return 0; + if (jit.func != NULL) { - tst->prepare(tbuf); - rc = jit.func(tbuf); - rv = tst->check_result(rc, tbuf); - ret |= rv; - if (rv != 0) { - printf("%s@%d: check_result(%s) failed, error: %d(%s);\n", - __func__, __LINE__, tst->name, rv, strerror(ret)); + tst->prepare(tbuf); + rc = jit.func(tbuf); + rv = tst->check_result(rc, tbuf); + ret |= rv; + if (rv != 0) { + printf("%s@%d: check_result(%s) failed, " + "error: %d(%s);\n", + __func__, __LINE__, tst->name, + rv, strerror(ret)); + } } rte_bpf_destroy(bpf); diff --git a/dpdk/app/test/test_cryptodev.c b/dpdk/app/test/test_cryptodev.c index 79ced809d..a852040ec 100644 --- a/dpdk/app/test/test_cryptodev.c +++ b/dpdk/app/test/test_cryptodev.c @@ -643,7 +643,7 @@ test_device_configure_invalid_dev_id(void) "Need at least %d devices for test", 1); /* valid dev_id values */ - dev_id = ts_params->valid_devs[ts_params->valid_dev_count - 1]; + dev_id = ts_params->valid_devs[0]; /* Stop the device in case it's started so it can be configured */ rte_cryptodev_stop(dev_id); @@ -2701,13 +2701,15 @@ create_wireless_algo_cipher_auth_session(uint8_t dev_id, /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->cipher_xform, ts_params->session_priv_mpool); + if (status == -ENOTSUP) + return status; TEST_ASSERT_EQUAL(status, 0, "session init failed"); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2827,6 +2829,7 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id, /* Create Crypto session*/ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); + TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); if (cipher_op == RTE_CRYPTO_CIPHER_OP_DECRYPT) { ut_params->auth_xform.next = NULL; @@ -2840,8 +2843,10 @@ create_wireless_algo_auth_cipher_session(uint8_t dev_id, &ut_params->auth_xform, ts_params->session_priv_mpool); + if (status == -ENOTSUP) + return status; + TEST_ASSERT_EQUAL(status, 0, "session init failed"); - TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2985,6 +2990,11 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag, struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + enum rte_crypto_cipher_algorithm cipher_algo = + ut_params->cipher_xform.cipher.algo; + enum rte_crypto_auth_algorithm auth_algo = + ut_params->auth_xform.auth.algo; + /* Generate Crypto op data structure */ ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); @@ -3005,8 +3015,22 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag, TEST_ASSERT_NOT_NULL(sym_op->auth.digest.data, "no room to append auth tag"); ut_params->digest = sym_op->auth.digest.data; - sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( - ut_params->ibuf, data_pad_len); + + if (rte_pktmbuf_is_contiguous(ut_params->ibuf)) { + sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( + ut_params->ibuf, data_pad_len); + } else { + struct rte_mbuf *m = ut_params->ibuf; + unsigned int offset = data_pad_len; + + while (offset > m->data_len && m->next != NULL) { + offset -= m->data_len; + m = m->next; + } + sym_op->auth.digest.phys_addr = rte_pktmbuf_iova_offset( + m, offset); + } + if (op == RTE_CRYPTO_AUTH_OP_GENERATE) memset(sym_op->auth.digest.data, 0, auth_tag_len); else @@ -3023,10 +3047,25 @@ create_wireless_algo_cipher_hash_operation(const uint8_t *auth_tag, iv_ptr += cipher_iv_len; rte_memcpy(iv_ptr, auth_iv, auth_iv_len); - sym_op->cipher.data.length = cipher_len; - sym_op->cipher.data.offset = cipher_offset; - sym_op->auth.data.length = auth_len; - sym_op->auth.data.offset = auth_offset; + if (cipher_algo == RTE_CRYPTO_CIPHER_SNOW3G_UEA2 || + cipher_algo == RTE_CRYPTO_CIPHER_KASUMI_F8 || + cipher_algo == RTE_CRYPTO_CIPHER_ZUC_EEA3) { + sym_op->cipher.data.length = cipher_len; + sym_op->cipher.data.offset = cipher_offset; + } else { + sym_op->cipher.data.length = cipher_len >> 3; + sym_op->cipher.data.offset = cipher_offset >> 3; + } + + if (auth_algo == RTE_CRYPTO_AUTH_SNOW3G_UIA2 || + auth_algo == RTE_CRYPTO_AUTH_KASUMI_F9 || + auth_algo == RTE_CRYPTO_AUTH_ZUC_EIA3) { + sym_op->auth.data.length = auth_len; + sym_op->auth.data.offset = auth_offset; + } else { + sym_op->auth.data.length = auth_len >> 3; + sym_op->auth.data.offset = auth_offset >> 3; + } return 0; } @@ -6595,8 +6634,9 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, unsigned int ciphertext_len; struct rte_cryptodev_info dev_info; + struct rte_crypto_op *op; - /* Check if device supports particular algorithms */ + /* Check if device supports particular algorithms separately */ if (test_mixed_check_if_unsupported(tdata)) return -ENOTSUP; @@ -6612,18 +6652,26 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, } /* Create the session */ - retval = create_wireless_algo_auth_cipher_session( - ts_params->valid_devs[0], - (verify ? RTE_CRYPTO_CIPHER_OP_DECRYPT - : RTE_CRYPTO_CIPHER_OP_ENCRYPT), - (verify ? RTE_CRYPTO_AUTH_OP_VERIFY - : RTE_CRYPTO_AUTH_OP_GENERATE), - tdata->auth_algo, - tdata->cipher_algo, - tdata->auth_key.data, tdata->auth_key.len, - tdata->auth_iv.len, tdata->digest_enc.len, - tdata->cipher_iv.len); - + if (verify) + retval = create_wireless_algo_cipher_auth_session( + ts_params->valid_devs[0], + RTE_CRYPTO_CIPHER_OP_DECRYPT, + RTE_CRYPTO_AUTH_OP_VERIFY, + tdata->auth_algo, + tdata->cipher_algo, + tdata->auth_key.data, tdata->auth_key.len, + tdata->auth_iv.len, tdata->digest_enc.len, + tdata->cipher_iv.len); + else + retval = create_wireless_algo_auth_cipher_session( + ts_params->valid_devs[0], + RTE_CRYPTO_CIPHER_OP_ENCRYPT, + RTE_CRYPTO_AUTH_OP_GENERATE, + tdata->auth_algo, + tdata->cipher_algo, + tdata->auth_key.data, tdata->auth_key.len, + tdata->auth_iv.len, tdata->digest_enc.len, + tdata->cipher_iv.len); if (retval < 0) return retval; @@ -6666,7 +6714,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, tdata->cipher_iv.data, tdata->cipher_iv.len, tdata->auth_iv.data, tdata->auth_iv.len, (tdata->digest_enc.offset == 0 ? - (verify ? ciphertext_pad_len : plaintext_pad_len) + plaintext_pad_len : tdata->digest_enc.offset), tdata->validCipherLen.len_bits, tdata->cipher.offset_bits, @@ -6677,9 +6725,19 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); + /* Check if the op failed because the device doesn't */ + /* support this particular combination of algorithms */ + if (op == NULL && ut_params->op->status == + RTE_CRYPTO_OP_STATUS_INVALID_SESSION) { + printf("Device doesn't support this mixed combination. " + "Test Skipped.\n"); + return -ENOTSUP; + } + ut_params->op = op; + TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); ut_params->obuf = (op_mode == IN_PLACE ? @@ -6694,12 +6752,10 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, (tdata->cipher.offset_bits >> 3); debug_hexdump(stdout, "plaintext:", plaintext, - (tdata->plaintext.len_bits >> 3) - - tdata->digest_enc.len); + tdata->plaintext.len_bits >> 3); debug_hexdump(stdout, "plaintext expected:", tdata->plaintext.data, - (tdata->plaintext.len_bits >> 3) - - tdata->digest_enc.len); + tdata->plaintext.len_bits >> 3); } else { if (ut_params->obuf) ciphertext = rte_pktmbuf_mtod(ut_params->obuf, @@ -6744,6 +6800,10 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata, DIGEST_BYTE_LENGTH_SNOW3G_UIA2, "Generated auth tag not as expected"); } + + TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, + "crypto op processing failed"); + return 0; } @@ -6767,6 +6827,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, uint8_t digest_buffer[10000]; struct rte_cryptodev_info dev_info; + struct rte_crypto_op *op; /* Check if device supports particular algorithms */ if (test_mixed_check_if_unsupported(tdata)) @@ -6795,18 +6856,26 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, } /* Create the session */ - retval = create_wireless_algo_auth_cipher_session( - ts_params->valid_devs[0], - (verify ? RTE_CRYPTO_CIPHER_OP_DECRYPT - : RTE_CRYPTO_CIPHER_OP_ENCRYPT), - (verify ? RTE_CRYPTO_AUTH_OP_VERIFY - : RTE_CRYPTO_AUTH_OP_GENERATE), - tdata->auth_algo, - tdata->cipher_algo, - tdata->auth_key.data, tdata->auth_key.len, - tdata->auth_iv.len, tdata->digest_enc.len, - tdata->cipher_iv.len); - + if (verify) + retval = create_wireless_algo_cipher_auth_session( + ts_params->valid_devs[0], + RTE_CRYPTO_CIPHER_OP_DECRYPT, + RTE_CRYPTO_AUTH_OP_VERIFY, + tdata->auth_algo, + tdata->cipher_algo, + tdata->auth_key.data, tdata->auth_key.len, + tdata->auth_iv.len, tdata->digest_enc.len, + tdata->cipher_iv.len); + else + retval = create_wireless_algo_auth_cipher_session( + ts_params->valid_devs[0], + RTE_CRYPTO_CIPHER_OP_ENCRYPT, + RTE_CRYPTO_AUTH_OP_GENERATE, + tdata->auth_algo, + tdata->cipher_algo, + tdata->auth_key.data, tdata->auth_key.len, + tdata->auth_iv.len, tdata->digest_enc.len, + tdata->cipher_iv.len); if (retval < 0) return retval; @@ -6816,7 +6885,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, plaintext_pad_len = RTE_ALIGN_CEIL(plaintext_len, 16); ut_params->ibuf = create_segmented_mbuf(ts_params->mbuf_pool, - plaintext_pad_len, 15, 0); + ciphertext_pad_len, 15, 0); TEST_ASSERT_NOT_NULL(ut_params->ibuf, "Failed to allocate input buffer in mempool"); @@ -6850,7 +6919,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, tdata->cipher_iv.data, tdata->cipher_iv.len, tdata->auth_iv.data, tdata->auth_iv.len, (tdata->digest_enc.offset == 0 ? - (verify ? ciphertext_pad_len : plaintext_pad_len) + plaintext_pad_len : tdata->digest_enc.offset), tdata->validCipherLen.len_bits, tdata->cipher.offset_bits, @@ -6861,9 +6930,20 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, if (retval < 0) return retval; - ut_params->op = process_crypto_request(ts_params->valid_devs[0], + op = process_crypto_request(ts_params->valid_devs[0], ut_params->op); + /* Check if the op failed because the device doesn't */ + /* support this particular combination of algorithms */ + if (op == NULL && ut_params->op->status == + RTE_CRYPTO_OP_STATUS_INVALID_SESSION) { + printf("Device doesn't support this mixed combination. " + "Test Skipped.\n"); + return -ENOTSUP; + } + + ut_params->op = op; + TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf"); ut_params->obuf = (op_mode == IN_PLACE ? @@ -6936,6 +7016,10 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata, tdata->digest_enc.len, "Generated auth tag not as expected"); } + + TEST_ASSERT_EQUAL(ut_params->op->status, RTE_CRYPTO_OP_STATUS_SUCCESS, + "crypto op processing failed"); + return 0; } @@ -6997,6 +7081,176 @@ test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl(void) &auth_aes_cmac_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); } +/** MIXED AUTH + CIPHER */ + +static int +test_auth_zuc_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_snow_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_zuc_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_snow_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_aes_cmac_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_snow_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_aes_cmac_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_snow_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_zuc_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_zuc_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_snow_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_snow_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_snow_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_zuc_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_snow_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_zuc_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_aes_cmac_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_zuc_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_aes_cmac_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_zuc_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_null_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_snow_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_null_cipher_snow_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_snow_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_null_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_zuc_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_null_cipher_zuc_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_zuc_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_snow_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_null_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_snow_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_snow_cipher_null_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_zuc_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_null_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_zuc_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_zuc_cipher_null_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_null_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_null_cipher_aes_ctr_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_null_cipher_aes_ctr_test_case_1, OUT_OF_PLACE, 1); +} + +static int +test_auth_aes_cmac_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_null_test_case_1, OUT_OF_PLACE, 0); +} + +static int +test_verify_auth_aes_cmac_cipher_null_test_case_1(void) +{ + return test_mixed_auth_cipher( + &auth_aes_cmac_cipher_null_test_case_1, OUT_OF_PLACE, 1); +} + static int test_3DES_chain_qat_all(void) { @@ -9158,8 +9412,10 @@ test_stats(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; struct rte_cryptodev_stats stats; - struct rte_cryptodev *dev; - cryptodev_stats_get_t temp_pfn; + + if (rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats) + == -ENOTSUP) + return -ENOTSUP; rte_cryptodev_stats_reset(ts_params->valid_devs[0]); TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0] + 600, @@ -9167,18 +9423,9 @@ test_stats(void) "rte_cryptodev_stats_get invalid dev failed"); TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], 0) != 0), "rte_cryptodev_stats_get invalid Param failed"); - dev = &rte_cryptodevs[ts_params->valid_devs[0]]; - temp_pfn = dev->dev_ops->stats_get; - dev->dev_ops->stats_get = (cryptodev_stats_get_t)0; - TEST_ASSERT((rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats) - == -ENOTSUP), - "rte_cryptodev_stats_get invalid Param failed"); - dev->dev_ops->stats_get = temp_pfn; /* Test expected values */ - ut_setup(); test_AES_CBC_HMAC_SHA1_encrypt_digest(); - ut_teardown(); TEST_ASSERT_SUCCESS(rte_cryptodev_stats_get(ts_params->valid_devs[0], &stats), "rte_cryptodev_stats_get failed"); @@ -10469,7 +10716,7 @@ aes128cbc_hmac_sha1_test_vector = { static const struct test_crypto_vector aes128cbc_hmac_sha1_aad_test_vector = { .crypto_algo = RTE_CRYPTO_CIPHER_AES_CBC, - .cipher_offset = 12, + .cipher_offset = 8, .cipher_len = 496, .cipher_key = { .data = { @@ -10505,9 +10752,9 @@ aes128cbc_hmac_sha1_aad_test_vector = { }, .digest = { .data = { - 0x1F, 0x6A, 0xD2, 0x8B, 0x4B, 0xB3, 0xC0, 0x9E, - 0x86, 0x9B, 0x3A, 0xF2, 0x00, 0x5B, 0x4F, 0x08, - 0x62, 0x8D, 0x62, 0x65 + 0x6D, 0xF3, 0x50, 0x79, 0x7A, 0x2A, 0xAC, 0x7F, + 0xA6, 0xF0, 0xC6, 0x38, 0x1F, 0xA4, 0xDD, 0x9B, + 0x62, 0x0F, 0xFB, 0x10 }, .len = 20 } @@ -12296,6 +12543,68 @@ static struct unit_test_suite cryptodev_qat_testsuite = { TEST_CASE_ST(ut_setup, ut_teardown, test_verify_aes_cmac_aes_ctr_digest_enc_test_case_1_oop_sgl), + /** AUTH ZUC + CIPHER SNOW3G */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_zuc_cipher_snow_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_zuc_cipher_snow_test_case_1), + /** AUTH AES CMAC + CIPHER SNOW3G */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_aes_cmac_cipher_snow_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_aes_cmac_cipher_snow_test_case_1), + /** AUTH ZUC + CIPHER AES CTR */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_zuc_cipher_aes_ctr_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_zuc_cipher_aes_ctr_test_case_1), + /** AUTH SNOW3G + CIPHER AES CTR */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_aes_ctr_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_aes_ctr_test_case_1), + /** AUTH SNOW3G + CIPHER ZUC */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_zuc_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_zuc_test_case_1), + /** AUTH AES CMAC + CIPHER ZUC */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_aes_cmac_cipher_zuc_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_aes_cmac_cipher_zuc_test_case_1), + + /** AUTH NULL + CIPHER SNOW3G */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_null_cipher_snow_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_null_cipher_snow_test_case_1), + /** AUTH NULL + CIPHER ZUC */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_null_cipher_zuc_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_null_cipher_zuc_test_case_1), + /** AUTH SNOW3G + CIPHER NULL */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_snow_cipher_null_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_snow_cipher_null_test_case_1), + /** AUTH ZUC + CIPHER NULL */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_zuc_cipher_null_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_zuc_cipher_null_test_case_1), + /** AUTH NULL + CIPHER AES CTR */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_null_cipher_aes_ctr_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_null_cipher_aes_ctr_test_case_1), + /** AUTH AES CMAC + CIPHER NULL */ + TEST_CASE_ST(ut_setup, ut_teardown, + test_auth_aes_cmac_cipher_null_test_case_1), + TEST_CASE_ST(ut_setup, ut_teardown, + test_verify_auth_aes_cmac_cipher_null_test_case_1), + TEST_CASES_END() /**< NULL terminate unit test array */ } }; diff --git a/dpdk/app/test/test_cryptodev_aes_test_vectors.h b/dpdk/app/test/test_cryptodev_aes_test_vectors.h index 8307fcf9a..66994b659 100644 --- a/dpdk/app/test/test_cryptodev_aes_test_vectors.h +++ b/dpdk/app/test/test_cryptodev_aes_test_vectors.h @@ -358,69 +358,69 @@ static const struct blockcipher_test_data null_test_data_chain_x1_multiple = { static const uint8_t ciphertext512_aes128cbc_aad[] = { 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, - 0x6F, 0x75, 0x73, 0x79, 0x6D, 0x70, 0xB4, 0xAD, - 0x09, 0x7C, 0xD7, 0x52, 0xD6, 0xF2, 0xBF, 0xD1, - 0x9D, 0x79, 0xC6, 0xB6, 0x8F, 0x94, 0xEB, 0xD8, - 0xBA, 0x5E, 0x01, 0x49, 0x7D, 0xB3, 0xC5, 0xFE, - 0x18, 0xF4, 0xE3, 0x60, 0x8C, 0x84, 0x68, 0x13, - 0x33, 0x06, 0x85, 0x60, 0xD3, 0xE7, 0x8A, 0xB5, - 0x23, 0xA2, 0xDE, 0x52, 0x5C, 0xB6, 0x26, 0x37, - 0xBB, 0x23, 0x8A, 0x38, 0x07, 0x85, 0xB6, 0x2E, - 0xC3, 0x69, 0x57, 0x79, 0x6B, 0xE4, 0xD7, 0x86, - 0x23, 0x72, 0x4C, 0x65, 0x49, 0x08, 0x1E, 0xF3, - 0xCC, 0x71, 0x4C, 0x45, 0x97, 0x03, 0xBC, 0xA0, - 0x9D, 0xF0, 0x4F, 0x5D, 0xEC, 0x40, 0x6C, 0xC6, - 0x52, 0xC0, 0x9D, 0x1C, 0xDC, 0x8B, 0xC2, 0xFA, - 0x35, 0xA7, 0x3A, 0x00, 0x04, 0x1C, 0xA6, 0x91, - 0x5D, 0xEB, 0x07, 0xA1, 0xB9, 0x3E, 0xD1, 0xB6, - 0xCA, 0x96, 0xEC, 0x71, 0xF7, 0x7D, 0xB6, 0x09, - 0x3D, 0x19, 0x6E, 0x75, 0x03, 0xC3, 0x1A, 0x4E, - 0x5B, 0x4D, 0xEA, 0xD9, 0x92, 0x96, 0x01, 0xFB, - 0xA3, 0xC2, 0x6D, 0xC4, 0x17, 0x6B, 0xB4, 0x3B, - 0x1E, 0x87, 0x54, 0x26, 0x95, 0x63, 0x07, 0x73, - 0xB6, 0xBA, 0x52, 0xD7, 0xA7, 0xD0, 0x9C, 0x75, - 0x8A, 0xCF, 0xC4, 0x3C, 0x4A, 0x55, 0x0E, 0x53, - 0xEC, 0xE0, 0x31, 0x51, 0xB7, 0xB7, 0xD2, 0xB4, - 0xF3, 0x2B, 0x70, 0x6D, 0x15, 0x9E, 0x57, 0x30, - 0x72, 0xE5, 0xA4, 0x71, 0x5F, 0xA4, 0xE8, 0x7C, - 0x46, 0x58, 0x36, 0x71, 0x91, 0x55, 0xAA, 0x99, - 0x3B, 0x3F, 0xF6, 0xA2, 0x9D, 0x27, 0xBF, 0xC2, - 0x62, 0x2C, 0x85, 0xB7, 0x51, 0xDD, 0xFD, 0x7B, - 0x8B, 0xB5, 0xDD, 0x2A, 0x73, 0xF8, 0x93, 0x9A, - 0x3F, 0xAD, 0x1D, 0xF0, 0x46, 0xD1, 0x76, 0x83, - 0x71, 0x4E, 0xD3, 0x0D, 0x64, 0x8C, 0xC3, 0xE6, - 0x03, 0xED, 0xE8, 0x53, 0x23, 0x1A, 0xC7, 0x86, - 0xEB, 0x87, 0xD6, 0x78, 0xF9, 0xFB, 0x9C, 0x1D, - 0xE7, 0x4E, 0xC0, 0x70, 0x27, 0x7A, 0x43, 0xE2, - 0x5D, 0xA4, 0x10, 0x40, 0xBE, 0x61, 0x0D, 0x2B, - 0x25, 0x08, 0x75, 0x91, 0xB5, 0x5A, 0x26, 0xC8, - 0x32, 0xA7, 0xC6, 0x88, 0xBF, 0x75, 0x94, 0xCC, - 0x58, 0xA4, 0xFE, 0x2F, 0xF7, 0x5C, 0xD2, 0x36, - 0x66, 0x55, 0xF0, 0xEA, 0xF5, 0x64, 0x43, 0xE7, - 0x6D, 0xE0, 0xED, 0xA1, 0x10, 0x0A, 0x84, 0x07, - 0x11, 0x88, 0xFA, 0xA1, 0xD3, 0xA0, 0x00, 0x5D, - 0xEB, 0xB5, 0x62, 0x01, 0x72, 0xC1, 0x9B, 0x39, - 0x0B, 0xD3, 0xAF, 0x04, 0x19, 0x42, 0xEC, 0xFF, - 0x4B, 0xB3, 0x5E, 0x87, 0x27, 0xE4, 0x26, 0x57, - 0x76, 0xCD, 0x36, 0x31, 0x5B, 0x94, 0x74, 0xFF, - 0x33, 0x91, 0xAA, 0xD1, 0x45, 0x34, 0xC2, 0x11, - 0xF0, 0x35, 0x44, 0xC9, 0xD5, 0xA2, 0x5A, 0xC2, - 0xE9, 0x9E, 0xCA, 0xE2, 0x6F, 0xD2, 0x40, 0xB4, - 0x93, 0x42, 0x78, 0x20, 0x92, 0x88, 0xC7, 0x16, - 0xCF, 0x15, 0x54, 0x7B, 0xE1, 0x46, 0x38, 0x69, - 0xB8, 0xE4, 0xF1, 0x81, 0xF0, 0x08, 0x6F, 0x92, - 0x6D, 0x1A, 0xD9, 0x93, 0xFA, 0xD7, 0x35, 0xFE, - 0x7F, 0x59, 0x43, 0x1D, 0x3A, 0x3B, 0xFC, 0xD0, - 0x14, 0x95, 0x1E, 0xB2, 0x04, 0x08, 0x4F, 0xC6, - 0xEA, 0xE8, 0x22, 0xF3, 0xD7, 0x66, 0x93, 0xAA, - 0xFD, 0xA0, 0xFE, 0x03, 0x96, 0x54, 0x78, 0x35, - 0x18, 0xED, 0xB7, 0x2F, 0x40, 0xE3, 0x8E, 0x22, - 0xC6, 0xDA, 0xB0, 0x8E, 0xA0, 0xA1, 0x62, 0x03, - 0x63, 0x34, 0x11, 0xF5, 0x9E, 0xAA, 0x6B, 0xC4, - 0x14, 0x75, 0x4C, 0xF4, 0xD8, 0xD9, 0xF1, 0x76, - 0xE3, 0xD3, 0x55, 0xCE, 0x22, 0x7D, 0x4A, 0xB7, - 0xBB, 0x7F, 0x4F, 0x09, 0x88, 0x70, 0x6E, 0x09, - 0x84, 0x6B, 0x24, 0x19, 0x2C, 0x20, 0x73, 0x75 + 0x1D, 0x7C, 0x76, 0xED, 0xC2, 0x10, 0x3C, 0xB5, + 0x14, 0x07, 0x3C, 0x33, 0x7B, 0xBE, 0x9E, 0xA9, + 0x01, 0xC5, 0xAA, 0xA6, 0xB6, 0x7A, 0xE1, 0xDB, + 0x39, 0xAA, 0xAA, 0xF4, 0xEE, 0xA7, 0x71, 0x71, + 0x78, 0x0D, 0x5A, 0xD4, 0xF9, 0xCD, 0x75, 0xD1, + 0x9C, 0x7F, 0xC8, 0x58, 0x46, 0x7A, 0xD1, 0x81, + 0xEA, 0xCC, 0x08, 0xDC, 0x82, 0x73, 0x22, 0x08, + 0x11, 0x73, 0x7C, 0xB1, 0x84, 0x6A, 0x8E, 0x67, + 0x3F, 0x5D, 0xDB, 0x0E, 0xE2, 0xC2, 0xCB, 0x6D, + 0x88, 0xEC, 0x3F, 0x50, 0x44, 0xD3, 0x47, 0x6E, + 0xDD, 0x42, 0xDC, 0x2A, 0x5E, 0x5C, 0x50, 0x24, + 0x57, 0x8A, 0xE7, 0xC5, 0x53, 0x6D, 0x89, 0x33, + 0x21, 0x65, 0x82, 0xD6, 0xE9, 0xE7, 0x77, 0x10, + 0xC2, 0x09, 0x91, 0xC1, 0x42, 0x62, 0x36, 0xF4, + 0x43, 0x37, 0x95, 0xB3, 0x7E, 0x21, 0xC5, 0x3E, + 0x65, 0xCB, 0xB6, 0xAA, 0xEC, 0xA5, 0xC6, 0x5C, + 0x4D, 0xBE, 0x14, 0xF1, 0x98, 0xBF, 0x6C, 0x8A, + 0x9E, 0x9F, 0xD4, 0xB4, 0xF2, 0x22, 0x96, 0x99, + 0x37, 0x32, 0xB6, 0xC1, 0x04, 0x66, 0x52, 0x37, + 0x5D, 0x5F, 0x58, 0x92, 0xC9, 0x97, 0xEA, 0x60, + 0x60, 0x27, 0x57, 0xF9, 0x47, 0x4F, 0xBC, 0xDF, + 0x05, 0xBD, 0x37, 0x87, 0xBB, 0x09, 0xA5, 0xBE, + 0xC1, 0xFC, 0x32, 0x86, 0x6A, 0xB7, 0x8B, 0x1E, + 0x6B, 0xCE, 0x8D, 0x81, 0x63, 0x4C, 0xF2, 0x7F, + 0xD1, 0x45, 0x82, 0xE8, 0x0D, 0x1C, 0x4D, 0xA8, + 0xBF, 0x2D, 0x2B, 0x52, 0xE5, 0xDB, 0xAB, 0xFD, + 0x04, 0xA2, 0xA1, 0x1E, 0x21, 0x1D, 0x06, 0x9A, + 0xC2, 0x7D, 0x99, 0xFC, 0xB4, 0x72, 0x89, 0x41, + 0x55, 0x69, 0xFA, 0x1F, 0x78, 0x2F, 0x35, 0x59, + 0xD7, 0x59, 0x6D, 0xA6, 0x45, 0xC9, 0x2B, 0x06, + 0x6C, 0xEC, 0x83, 0x34, 0xA5, 0x08, 0xDB, 0x6F, + 0xDE, 0x75, 0x21, 0x9B, 0xB0, 0xCB, 0x0A, 0xAE, + 0x22, 0x99, 0x74, 0x1C, 0x9D, 0x37, 0x0E, 0xC6, + 0x3A, 0x45, 0x49, 0xE5, 0xE3, 0x21, 0x11, 0xEA, + 0x34, 0x25, 0xD5, 0x76, 0xB0, 0x30, 0x19, 0x87, + 0x14, 0x3A, 0x10, 0x6F, 0x6D, 0xDD, 0xE9, 0x60, + 0x6A, 0x00, 0x6A, 0x4C, 0x5B, 0x85, 0x3E, 0x1A, + 0x41, 0xFA, 0xDE, 0x2D, 0x2F, 0x2E, 0x5B, 0x79, + 0x09, 0x66, 0x65, 0xD0, 0xDB, 0x32, 0x05, 0xB5, + 0xEA, 0xFB, 0x6A, 0xD5, 0x43, 0xF8, 0xBD, 0x98, + 0x7B, 0x8E, 0x3B, 0x85, 0x89, 0x5D, 0xC5, 0x59, + 0x54, 0x22, 0x75, 0xA8, 0x60, 0xDC, 0x0A, 0x37, + 0x8C, 0xD8, 0x05, 0xEA, 0x62, 0x62, 0x71, 0x98, + 0x0C, 0xCB, 0xCE, 0x0A, 0xD9, 0xE6, 0xE8, 0xA7, + 0xB3, 0x2D, 0x89, 0xA7, 0x60, 0xF0, 0x42, 0xA7, + 0x3D, 0x80, 0x44, 0xE7, 0xC1, 0xA6, 0x88, 0xB1, + 0x4F, 0xC0, 0xB1, 0xAF, 0x40, 0xF3, 0x54, 0x72, + 0x8F, 0xAF, 0x47, 0x96, 0x19, 0xEB, 0xA5, 0x5C, + 0x00, 0x3B, 0x36, 0xC8, 0x3F, 0x1E, 0x63, 0x54, + 0xF3, 0x3D, 0x85, 0x44, 0x9B, 0x9B, 0x20, 0xE3, + 0x9D, 0xEF, 0x62, 0x21, 0xA1, 0x0B, 0x78, 0xF4, + 0x2B, 0x89, 0x66, 0x5E, 0x97, 0xC6, 0xC4, 0x55, + 0x35, 0x32, 0xD7, 0x44, 0x95, 0x9A, 0xE7, 0xF2, + 0x57, 0x52, 0x5B, 0x92, 0x86, 0x8F, 0x8B, 0xCF, + 0x41, 0x89, 0xF6, 0x2A, 0xD3, 0x42, 0x87, 0x43, + 0x56, 0x1F, 0x0E, 0x49, 0xF1, 0x32, 0x6D, 0xA8, + 0x62, 0xDF, 0x47, 0xBB, 0xB6, 0x53, 0xF8, 0x5C, + 0x36, 0xDA, 0x34, 0x34, 0x2D, 0x2E, 0x1D, 0x33, + 0xAF, 0x6A, 0x1E, 0xF1, 0xC9, 0x72, 0xB5, 0x3C, + 0x64, 0x4C, 0x96, 0x12, 0x78, 0x67, 0x6A, 0xE5, + 0x8B, 0x05, 0x80, 0xAE, 0x7D, 0xE5, 0x9B, 0x24, + 0xDB, 0xFF, 0x1E, 0xB8, 0x36, 0x6D, 0x3D, 0x5D, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75 }; /* AES128-CTR-SHA1 test vector */ diff --git a/dpdk/app/test/test_cryptodev_asym.c b/dpdk/app/test/test_cryptodev_asym.c index 69df29304..a0802994f 100644 --- a/dpdk/app/test/test_cryptodev_asym.c +++ b/dpdk/app/test/test_cryptodev_asym.c @@ -933,8 +933,9 @@ testsuite_setup(void) } /* setup asym session pool */ - unsigned int session_size = - rte_cryptodev_asym_get_private_session_size(dev_id); + unsigned int session_size = RTE_MAX( + rte_cryptodev_asym_get_private_session_size(dev_id), + rte_cryptodev_asym_get_header_session_size()); /* * Create mempool with TEST_NUM_SESSIONS * 2, * to include the session headers diff --git a/dpdk/app/test/test_cryptodev_blockcipher.c b/dpdk/app/test/test_cryptodev_blockcipher.c index 5bfe2d009..2f91d000a 100644 --- a/dpdk/app/test/test_cryptodev_blockcipher.c +++ b/dpdk/app/test/test_cryptodev_blockcipher.c @@ -93,7 +93,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, uint64_t feat_flags = dev_info.feature_flags; uint64_t oop_flag = RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT; - if (t->feature_mask && BLOCKCIPHER_TEST_FEATURE_OOP) { + if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_OOP) { if (!(feat_flags & oop_flag)) { printf("Device doesn't support out-of-place " "scatter-gather in input mbuf. " diff --git a/dpdk/app/test/test_cryptodev_hash_test_vectors.h b/dpdk/app/test/test_cryptodev_hash_test_vectors.h index cff283118..394bb6b60 100644 --- a/dpdk/app/test/test_cryptodev_hash_test_vectors.h +++ b/dpdk/app/test/test_cryptodev_hash_test_vectors.h @@ -460,6 +460,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha1_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -473,6 +474,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha1_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -540,6 +542,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha224_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -553,6 +556,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha224_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -596,6 +600,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha256_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -609,6 +614,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha256_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -654,6 +660,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha384_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -667,6 +674,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha384_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -712,6 +720,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha512_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_GEN, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) @@ -724,6 +733,7 @@ static const struct blockcipher_test_case hash_test_cases[] = { .test_data = &sha512_test_vector, .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY, .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL | + BLOCKCIPHER_TEST_TARGET_PMD_QAT | BLOCKCIPHER_TEST_TARGET_PMD_CCP | BLOCKCIPHER_TEST_TARGET_PMD_MVSAM | #if IMB_VERSION_NUM >= IMB_VERSION(0, 52, 0) diff --git a/dpdk/app/test/test_cryptodev_mixed_test_vectors.h b/dpdk/app/test/test_cryptodev_mixed_test_vectors.h index bca47c05c..f50dcb045 100644 --- a/dpdk/app/test/test_cryptodev_mixed_test_vectors.h +++ b/dpdk/app/test/test_cryptodev_mixed_test_vectors.h @@ -126,9 +126,9 @@ struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_aes_ctr_test_case_1 = { 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, - 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + 0x5A, 0x5A, 0x5A, 0x5A }, - .len_bits = 128 << 3, + .len_bits = 124 << 3, }, .ciphertext = { .data = { @@ -169,4 +169,1320 @@ struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_aes_ctr_test_case_1 = { } }; +struct mixed_cipher_auth_test_data auth_zuc_cipher_snow_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_ZUC_EIA3, + .auth_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .auth = { + .len_bits = 73 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .cipher_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .cipher = { + .len_bits = 77 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x98, 0x3b, 0x41, 0xd4, 0x7d, 0x78, 0x0c, 0x9e, + 0x1a, 0xd1, 0x1d, 0x7e, 0xb7, 0x03, 0x91, 0xb1, + 0xde, 0x0b, 0x35, 0xda, 0x2d, 0xc6, 0x2f, 0x83, + 0xe7, 0xb7, 0x8d, 0x63, 0x06, 0xca, 0x0e, 0xa0, + 0x7e, 0x94, 0x1b, 0x7b, 0xe9, 0x13, 0x48, 0xf9, + 0xfc, 0xb1, 0x70, 0xe2, 0x21, 0x7f, 0xec, 0xd9, + 0x7f, 0x9f, 0x68, 0xad, 0xb1, 0x6e, 0x5d, 0x7d, + 0x21, 0xe5, 0x69, 0xd2, 0x80, 0xed, 0x77, 0x5c, + 0xeb, 0xde, 0x3f, 0x40, 0x93, 0xc5, 0x38, 0x81, + 0x00 + }, + .len_bits = 73 << 3, + }, + .ciphertext = { + .data = { + 0x18, 0x46, 0xE1, 0xC5, 0x2C, 0x85, 0x93, 0x22, + 0x84, 0x80, 0xD6, 0x84, 0x5C, 0x99, 0x55, 0xE0, + 0xD5, 0x02, 0x41, 0x74, 0x4A, 0xD2, 0x8E, 0x7E, + 0xB9, 0x79, 0xD3, 0xE5, 0x76, 0x75, 0xD5, 0x59, + 0x26, 0xD7, 0x06, 0x2D, 0xF4, 0x71, 0x26, 0x40, + 0xAC, 0x77, 0x62, 0xAC, 0x35, 0x0D, 0xC5, 0x35, + 0xF8, 0x03, 0x54, 0x52, 0x2E, 0xCA, 0x14, 0xD8, + 0x2E, 0x6C, 0x0E, 0x7A, 0x09, 0xE7, 0x20, 0xDD, + 0x7C, 0xE3, 0x28, 0x77, 0x53, 0x65, 0xBA, 0x54, + 0xE8, 0x25, 0x04, 0x52, 0xFD + }, + .len_bits = 77 << 3, + }, + .digest_enc = { + .data = { + 0x25, 0x04, 0x52, 0xFD + }, + .len = 4, + .offset = 73, + }, + .validDataLen = { + .len_bits = 77 << 3, + }, + .validCipherLen = { + .len_bits = 77 << 3, + }, + .validAuthLen = { + .len_bits = 73 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_snow_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_AES_CMAC, + .auth_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .auth_iv = { + .data = { + }, + .len = 0, + }, + .auth = { + .len_bits = 512 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .cipher_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .cipher_iv = { + .data = { + }, + .len = 0, + }, + .cipher = { + .len_bits = 516 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, + 0x6F, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, + 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, + 0x6F, 0x6E, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, + 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x70, 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x20, + 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6D, 0x65, + 0x20, 0x6E, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, + 0x76, 0x65, 0x6E, 0x20, 0x69, 0x6E, 0x20, 0x68, + 0x69, 0x73, 0x20, 0x6F, 0x77, 0x6E, 0x20, 0x70, + 0x72, 0x6F, 0x73, 0x70, 0x65, 0x72, 0x6F, 0x75, + 0x73, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, + 0x79, 0x2C, 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, + 0x61, 0x6E, 0x79, 0x20, 0x68, 0x6F, 0x6D, 0x65, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, + 0x68, 0x61, 0x6E, 0x74, 0x69, 0x65, 0x73, 0x2C, + 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6E, + 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x64, 0x72, 0x75, 0x6E, 0x6B, 0x20, 0x61, 0x6E, + 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, + 0x73, 0x6F, 0x63, 0x6B, 0x65, 0x64, 0x2C, 0x20, + 0x61, 0x6E, 0x64, 0x20, 0x68, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, 0x68, 0x69, + 0x6C, 0x64, 0x72, 0x65, 0x6E, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x62, 0x75, 0x6C, 0x6C, 0x69, + 0x65, 0x64, 0x2C, 0x20, 0x61, 0x62, 0x75, 0x73, + 0x65, 0x64, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65, 0x64, + 0x2E, 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, + 0x6E, 0x79, 0x20, 0x66, 0x61, 0x6D, 0x69, 0x6C, + 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6E, 0x67, + 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x66, 0x6F, 0x6F, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x79, 0x20, 0x63, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x61, 0x66, 0x66, + 0x6F, 0x72, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x62, + 0x75, 0x79, 0x3F, 0x20, 0x48, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, + 0x20, 0x62, 0x72, 0x6F, 0x6B, 0x65, 0x6E, 0x3F, + 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x74, 0x61, 0x6B, 0x65, 0x20, 0x70, 0x6C, + 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x61, 0x6D, 0x65, 0x20, 0x6E, 0x69, + 0x67, 0x68, 0x74, 0x2C, 0x20, 0x68, 0x6F, 0x77, + 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x70, 0x65, + 0x6F, 0x70, 0x6C, 0x65, 0x20, 0x77, 0x6F, 0x75, + 0x6C, 0x64, 0x20, 0x67, 0x6F, 0x20, 0x69, 0x6E, + 0x73, 0x61, 0x6E, 0x65, 0x3F, 0x20, 0x48, 0x6F, + 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, + 0x6F, 0x63, 0x6B, 0x72, 0x6F, 0x61, 0x63, 0x68, + 0x65, 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6C, + 0x61, 0x6E, 0x64, 0x6C, 0x6F, 0x72, 0x64, 0x73, + 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, 0x20, 0x74, + 0x72, 0x69, 0x75, 0x6D, 0x70, 0x68, 0x3F, 0x20, + 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x77, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x73, + 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6C, 0x6F, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75 + }, + .len_bits = 512 << 3, + }, + .ciphertext = { + .data = { + 0x8A, 0xA9, 0x74, 0x31, 0xB1, 0xF2, 0xAB, 0x00, + 0xD6, 0x3D, 0xFA, 0xBD, 0xD9, 0x65, 0x52, 0x80, + 0xB5, 0x98, 0x20, 0xFF, 0x8D, 0x1C, 0x0F, 0x53, + 0xDD, 0x79, 0xCC, 0x9D, 0x7A, 0x6D, 0x76, 0x06, + 0xB6, 0xF4, 0xAC, 0xDA, 0xF2, 0x24, 0x02, 0x58, + 0x5F, 0xE3, 0xD4, 0xF7, 0x0B, 0x3B, 0x1C, 0x4C, + 0x0B, 0x4C, 0xC7, 0x4D, 0x3D, 0xFA, 0x28, 0xD9, + 0xA0, 0x90, 0x3E, 0x91, 0xDC, 0xC4, 0xE1, 0x2E, + 0x7C, 0xB4, 0xBD, 0xE0, 0x9E, 0xC8, 0x33, 0x42, + 0x0E, 0x84, 0xEF, 0x3C, 0xF1, 0x8B, 0x2C, 0xBD, + 0x33, 0x70, 0x22, 0xBA, 0xD4, 0x0B, 0xB2, 0x83, + 0x7F, 0x27, 0x51, 0x92, 0xD1, 0x40, 0x1E, 0xCD, + 0x62, 0x0F, 0x61, 0x5F, 0xB4, 0xB1, 0x0D, 0x1A, + 0x16, 0x1B, 0xE8, 0xA8, 0x2B, 0x45, 0xBA, 0x56, + 0x30, 0xD0, 0xE3, 0xCA, 0x4D, 0x23, 0xA3, 0x38, + 0xD6, 0x2C, 0xE4, 0x8D, 0xFF, 0x23, 0x97, 0x9E, + 0xE9, 0xBD, 0x70, 0xAF, 0x6B, 0x68, 0xA7, 0x21, + 0x3C, 0xFB, 0xB2, 0x99, 0x4D, 0xE9, 0x70, 0x56, + 0x36, 0xB8, 0xD7, 0xE0, 0xEB, 0x62, 0xA1, 0x79, + 0xF9, 0xD6, 0xAD, 0x83, 0x75, 0x54, 0xF5, 0x45, + 0x82, 0xE8, 0xD6, 0xA9, 0x76, 0x11, 0xC7, 0x81, + 0x2C, 0xBA, 0x67, 0xB5, 0xDB, 0xE5, 0xF2, 0x6B, + 0x7D, 0x9F, 0x4E, 0xDC, 0xA1, 0x62, 0xF1, 0xF0, + 0xAD, 0xD4, 0x7A, 0xA3, 0xF3, 0x76, 0x29, 0xA4, + 0xB7, 0xF3, 0x31, 0x84, 0xE7, 0x1F, 0x0D, 0x01, + 0xBD, 0x46, 0x07, 0x51, 0x05, 0x76, 0xE2, 0x95, + 0xF8, 0x48, 0x18, 0x8A, 0x1E, 0x92, 0x8B, 0xBC, + 0x30, 0x05, 0xF5, 0xD6, 0x96, 0xEF, 0x78, 0xB6, + 0xF3, 0xEC, 0x4C, 0xB1, 0x88, 0x8B, 0x63, 0x40, + 0x07, 0x37, 0xB4, 0x1A, 0xBD, 0xE9, 0x38, 0xB4, + 0x31, 0x35, 0x9D, 0x0C, 0xF1, 0x24, 0x0E, 0xD2, + 0xAE, 0x39, 0xA6, 0x41, 0x3C, 0x91, 0x6A, 0x4B, + 0xEC, 0x46, 0x76, 0xB4, 0x15, 0xC3, 0x58, 0x96, + 0x69, 0x02, 0x21, 0x37, 0x65, 0xDF, 0xA6, 0x43, + 0x78, 0x81, 0x8B, 0x39, 0x37, 0xE3, 0xF3, 0xD9, + 0xA2, 0xAA, 0x3F, 0xA9, 0x21, 0x24, 0x93, 0x4A, + 0xB0, 0xDE, 0x22, 0x5F, 0xF8, 0xD3, 0xCC, 0x13, + 0x5C, 0xC2, 0x5C, 0x98, 0x6D, 0xFB, 0x34, 0x26, + 0xE2, 0xC9, 0x26, 0x23, 0x41, 0xAB, 0xC3, 0x8A, + 0xEC, 0x62, 0xA9, 0x5B, 0x51, 0xB9, 0x10, 0x9D, + 0xB1, 0xBB, 0xDE, 0x78, 0xDE, 0xE7, 0xF0, 0x9F, + 0x91, 0x6C, 0x4D, 0xFC, 0xB3, 0x9C, 0xFF, 0xA4, + 0x9D, 0xB8, 0xCD, 0xF6, 0xA8, 0x6A, 0xDB, 0x3B, + 0x82, 0xFE, 0xCD, 0x6B, 0x08, 0x0A, 0x5E, 0x76, + 0xE9, 0xB3, 0xA2, 0x78, 0x25, 0xDB, 0xB1, 0x76, + 0x42, 0x2C, 0xFB, 0x20, 0x87, 0x81, 0x76, 0x17, + 0x99, 0xFD, 0x56, 0x52, 0xE2, 0xB0, 0x8E, 0x1B, + 0x99, 0xB3, 0x6B, 0x16, 0xC5, 0x4F, 0x0D, 0xBB, + 0x0E, 0xB7, 0x54, 0x63, 0xD9, 0x67, 0xD9, 0x85, + 0x1F, 0xA8, 0xF0, 0xF0, 0xB0, 0x41, 0xDC, 0xBC, + 0x75, 0xEE, 0x23, 0x7D, 0x40, 0xCE, 0xB8, 0x0A, + 0x6D, 0xC1, 0xD7, 0xCB, 0xAE, 0xCE, 0x91, 0x9E, + 0x3E, 0x5A, 0x76, 0xF8, 0xC0, 0xF2, 0x7F, 0x0B, + 0xD2, 0x5F, 0x63, 0xBE, 0xB2, 0x81, 0x8E, 0x6D, + 0xB3, 0x6B, 0x67, 0x9D, 0xAC, 0xE2, 0xDB, 0x7C, + 0x11, 0x19, 0x55, 0x55, 0x11, 0xED, 0x7F, 0x4E, + 0x9E, 0x4B, 0x6E, 0x01, 0x74, 0x4A, 0xE8, 0x78, + 0xEC, 0xCD, 0xF7, 0xA2, 0x6E, 0xDB, 0xB6, 0x3B, + 0x4D, 0x2C, 0x09, 0x62, 0x57, 0x6E, 0x38, 0x8A, + 0x61, 0x17, 0x00, 0xE9, 0x86, 0x7F, 0x3D, 0x93, + 0xBC, 0xC3, 0x27, 0x90, 0x7E, 0x41, 0x81, 0xBA, + 0x74, 0x70, 0x19, 0xE8, 0xD2, 0x88, 0x61, 0xDF, + 0xB4, 0xED, 0xA4, 0x9D, 0x3D, 0xED, 0x95, 0x65, + 0xCA, 0xFF, 0x8D, 0x58, 0x63, 0x10, 0x9D, 0xBE, + 0x78, 0x81, 0x47, 0x38 + }, + .len_bits = 516 << 3, + }, + .digest_enc = { + .data = { + 0x78, 0x81, 0x47, 0x38 + }, + .len = 4, + .offset = 512, + }, + .validDataLen = { + .len_bits = 516 << 3, + }, + .validCipherLen = { + .len_bits = 516 << 3, + }, + .validAuthLen = { + .len_bits = 512 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_zuc_cipher_aes_ctr_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_ZUC_EIA3, + .auth_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .auth = { + .len_bits = 73 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_AES_CTR, + .cipher_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .cipher = { + .len_bits = 77 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x98, 0x3b, 0x41, 0xd4, 0x7d, 0x78, 0x0c, 0x9e, + 0x1a, 0xd1, 0x1d, 0x7e, 0xb7, 0x03, 0x91, 0xb1, + 0xde, 0x0b, 0x35, 0xda, 0x2d, 0xc6, 0x2f, 0x83, + 0xe7, 0xb7, 0x8d, 0x63, 0x06, 0xca, 0x0e, 0xa0, + 0x7e, 0x94, 0x1b, 0x7b, 0xe9, 0x13, 0x48, 0xf9, + 0xfc, 0xb1, 0x70, 0xe2, 0x21, 0x7f, 0xec, 0xd9, + 0x7f, 0x9f, 0x68, 0xad, 0xb1, 0x6e, 0x5d, 0x7d, + 0x21, 0xe5, 0x69, 0xd2, 0x80, 0xed, 0x77, 0x5c, + 0xeb, 0xde, 0x3f, 0x40, 0x93, 0xc5, 0x38, 0x81, + 0x00 + }, + .len_bits = 73 << 3, + }, + .ciphertext = { + .data = { + 0x53, 0x92, 0x9F, 0x88, 0x32, 0xA1, 0x6D, 0x66, + 0x00, 0x32, 0x29, 0xF9, 0x14, 0x75, 0x6D, 0xB3, + 0xEB, 0x64, 0x25, 0x09, 0xE1, 0x80, 0x31, 0x8C, + 0xF8, 0x47, 0x64, 0xAA, 0x07, 0x8E, 0x06, 0xBF, + 0x05, 0xD7, 0x43, 0xEE, 0xFF, 0x11, 0x33, 0x4A, + 0x82, 0xCF, 0x88, 0x6F, 0x33, 0xB2, 0xB5, 0x67, + 0x50, 0x0A, 0x74, 0x2D, 0xE4, 0x56, 0x40, 0x31, + 0xEE, 0xB3, 0x6C, 0x6E, 0x6A, 0x7B, 0x20, 0xBA, + 0x4E, 0x44, 0x34, 0xC8, 0x62, 0x21, 0x8C, 0x45, + 0xD7, 0x85, 0x44, 0xF4, 0x7E + }, + .len_bits = 77 << 3, + }, + .digest_enc = { + .data = { + 0x85, 0x44, 0xF4, 0x7E + }, + .len = 4, + .offset = 73, + }, + .validDataLen = { + .len_bits = 77 << 3, + }, + .validCipherLen = { + .len_bits = 77 << 3, + }, + .validAuthLen = { + .len_bits = 73 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_snow_cipher_aes_ctr_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_AES_CTR, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 52 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 + }, + .len_bits = 48 << 3, + }, + .ciphertext = { + .data = { + 0x91, 0x96, 0x28, 0xB4, 0x89, 0x74, 0xF6, 0x5E, + 0x98, 0x58, 0xA1, 0xD3, 0x0E, 0xE3, 0xFC, 0x39, + 0xDB, 0x36, 0xE4, 0x97, 0x74, 0x5B, 0x5E, 0xD4, + 0x1B, 0x8A, 0xC5, 0x9D, 0xDF, 0x96, 0x97, 0x5F, + 0x58, 0x4A, 0x75, 0x74, 0x27, 0x07, 0xF3, 0x7F, + 0xCE, 0x2C, 0x4A, 0x6C, 0xE5, 0x19, 0xE7, 0x8B, + 0xF3, 0x21, 0x84, 0x6C + }, + .len_bits = 52 << 3, + }, + .digest_enc = { + .data = { + 0xF3, 0x21, 0x84, 0x6C + }, + .len = 4, + .offset = 48, + }, + .validDataLen = { + .len_bits = 52 << 3, + }, + .validCipherLen = { + .len_bits = 52 << 3, + }, + .validAuthLen = { + .len_bits = 48 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_snow_cipher_zuc_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 52 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 + }, + .len_bits = 48 << 3, + }, + .ciphertext = { + .data = { + 0x52, 0x11, 0xCD, 0xFF, 0xF8, 0x88, 0x61, 0x1E, + 0xF5, 0xD2, 0x8E, 0xEB, 0x2A, 0x49, 0x18, 0x1F, + 0xF4, 0xDA, 0x8B, 0x19, 0x60, 0x0B, 0x92, 0x9E, + 0x79, 0x2A, 0x5B, 0x0B, 0x7E, 0xC6, 0x22, 0x36, + 0x74, 0xA4, 0x6C, 0xBC, 0xF5, 0x25, 0x69, 0xAE, + 0xDA, 0x04, 0xB9, 0xAF, 0x16, 0x42, 0x0F, 0xCB, + 0x3E, 0xC9, 0x49, 0xE9 + }, + .len_bits = 52 << 3, + }, + .digest_enc = { + .data = { + 0x3E, 0xC9, 0x49, 0xE9 + }, + .len = 4, + .offset = 48, + }, + .validDataLen = { + .len_bits = 52 << 3, + }, + .validCipherLen = { + .len_bits = 52 << 3, + }, + .validAuthLen = { + .len_bits = 48 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_zuc_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_AES_CMAC, + .auth_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .auth_iv = { + .data = { + }, + .len = 0, + }, + .auth = { + .len_bits = 512 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .cipher_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .cipher_iv = { + .data = { + }, + .len = 0, + }, + .cipher = { + .len_bits = 516 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, + 0x6F, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, + 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, + 0x6F, 0x6E, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, + 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x70, 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x20, + 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6D, 0x65, + 0x20, 0x6E, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, + 0x76, 0x65, 0x6E, 0x20, 0x69, 0x6E, 0x20, 0x68, + 0x69, 0x73, 0x20, 0x6F, 0x77, 0x6E, 0x20, 0x70, + 0x72, 0x6F, 0x73, 0x70, 0x65, 0x72, 0x6F, 0x75, + 0x73, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, + 0x79, 0x2C, 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, + 0x61, 0x6E, 0x79, 0x20, 0x68, 0x6F, 0x6D, 0x65, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, + 0x68, 0x61, 0x6E, 0x74, 0x69, 0x65, 0x73, 0x2C, + 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6E, + 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x64, 0x72, 0x75, 0x6E, 0x6B, 0x20, 0x61, 0x6E, + 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, + 0x73, 0x6F, 0x63, 0x6B, 0x65, 0x64, 0x2C, 0x20, + 0x61, 0x6E, 0x64, 0x20, 0x68, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, 0x68, 0x69, + 0x6C, 0x64, 0x72, 0x65, 0x6E, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x62, 0x75, 0x6C, 0x6C, 0x69, + 0x65, 0x64, 0x2C, 0x20, 0x61, 0x62, 0x75, 0x73, + 0x65, 0x64, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65, 0x64, + 0x2E, 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, + 0x6E, 0x79, 0x20, 0x66, 0x61, 0x6D, 0x69, 0x6C, + 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6E, 0x67, + 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x66, 0x6F, 0x6F, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x79, 0x20, 0x63, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x61, 0x66, 0x66, + 0x6F, 0x72, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x62, + 0x75, 0x79, 0x3F, 0x20, 0x48, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, + 0x20, 0x62, 0x72, 0x6F, 0x6B, 0x65, 0x6E, 0x3F, + 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x74, 0x61, 0x6B, 0x65, 0x20, 0x70, 0x6C, + 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x61, 0x6D, 0x65, 0x20, 0x6E, 0x69, + 0x67, 0x68, 0x74, 0x2C, 0x20, 0x68, 0x6F, 0x77, + 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x70, 0x65, + 0x6F, 0x70, 0x6C, 0x65, 0x20, 0x77, 0x6F, 0x75, + 0x6C, 0x64, 0x20, 0x67, 0x6F, 0x20, 0x69, 0x6E, + 0x73, 0x61, 0x6E, 0x65, 0x3F, 0x20, 0x48, 0x6F, + 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, + 0x6F, 0x63, 0x6B, 0x72, 0x6F, 0x61, 0x63, 0x68, + 0x65, 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6C, + 0x61, 0x6E, 0x64, 0x6C, 0x6F, 0x72, 0x64, 0x73, + 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, 0x20, 0x74, + 0x72, 0x69, 0x75, 0x6D, 0x70, 0x68, 0x3F, 0x20, + 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x77, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x73, + 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6C, 0x6F, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75 + }, + .len_bits = 512 << 3, + }, + .ciphertext = { + .data = { + 0x3C, 0x89, 0x1C, 0xE5, 0xB7, 0xDE, 0x61, 0x4D, + 0x05, 0x37, 0x3F, 0x40, 0xC9, 0xCF, 0x10, 0x07, + 0x7F, 0x18, 0xC5, 0x96, 0x21, 0xA9, 0xCF, 0xF5, + 0xBB, 0x9C, 0x22, 0x72, 0x00, 0xBE, 0xAC, 0x4B, + 0x55, 0x02, 0x19, 0x2B, 0x37, 0x64, 0x15, 0x6B, + 0x54, 0x74, 0xAE, 0x0F, 0xE7, 0x68, 0xB3, 0x92, + 0x17, 0x26, 0x75, 0xEE, 0x0B, 0xE9, 0x46, 0x3C, + 0x6E, 0x76, 0x52, 0x14, 0x2B, 0xD0, 0xB6, 0xD0, + 0x09, 0x07, 0x17, 0x12, 0x58, 0x61, 0xE8, 0x2A, + 0x7C, 0x55, 0x67, 0x66, 0x49, 0xD1, 0x4E, 0x2F, + 0x06, 0x96, 0x3A, 0xF7, 0x05, 0xE3, 0x65, 0x47, + 0x7C, 0xBB, 0x66, 0x25, 0xC4, 0x73, 0xB3, 0x7B, + 0x3D, 0x1D, 0x59, 0x54, 0x4E, 0x38, 0x9C, 0x4D, + 0x10, 0x4B, 0x49, 0xA4, 0x92, 0xC7, 0xD7, 0x17, + 0x6F, 0xC0, 0xEE, 0x8D, 0xBE, 0xA5, 0xE3, 0xB9, + 0xBA, 0x5E, 0x88, 0x36, 0x06, 0x19, 0xB7, 0x86, + 0x66, 0x19, 0x90, 0xC4, 0xAE, 0xB3, 0xFE, 0xA7, + 0xCF, 0x2A, 0xD8, 0x6C, 0x0E, 0xD5, 0x24, 0x2A, + 0x92, 0x93, 0xB9, 0x12, 0xCB, 0x50, 0x0A, 0x22, + 0xB0, 0x09, 0x06, 0x17, 0x85, 0xC9, 0x03, 0x70, + 0x18, 0xF2, 0xD5, 0x6A, 0x66, 0xC2, 0xB6, 0xC6, + 0xA5, 0xA3, 0x24, 0xEC, 0xB9, 0x07, 0xD5, 0x8A, + 0xA0, 0x44, 0x54, 0xD7, 0x21, 0x9F, 0x02, 0x83, + 0x78, 0x7B, 0x78, 0x9C, 0x97, 0x2A, 0x36, 0x51, + 0xAF, 0xE1, 0x79, 0x81, 0x07, 0x53, 0xE4, 0xA0, + 0xC7, 0xCF, 0x10, 0x7C, 0xB2, 0xE6, 0xA1, 0xFD, + 0x81, 0x0B, 0x96, 0x50, 0x5D, 0xFE, 0xB3, 0xC6, + 0x75, 0x00, 0x0C, 0x56, 0x83, 0x9B, 0x7B, 0xF4, + 0xE0, 0x3A, 0xC0, 0xE1, 0xA9, 0xEC, 0xAC, 0x47, + 0x24, 0xF5, 0x12, 0x1B, 0xD0, 0x28, 0x32, 0xE2, + 0x3B, 0x42, 0xC1, 0x5B, 0x98, 0x98, 0x78, 0x2D, + 0xC1, 0x69, 0x05, 0x37, 0x24, 0xF0, 0x73, 0xBA, + 0xBE, 0x57, 0xAC, 0x40, 0x9A, 0x91, 0x42, 0x49, + 0x31, 0x0F, 0xED, 0x45, 0xA8, 0x25, 0xFF, 0x1B, + 0xF4, 0x2F, 0x61, 0x7A, 0xB0, 0x60, 0xC6, 0x5E, + 0x0E, 0xF6, 0x96, 0x35, 0x90, 0xAF, 0x3B, 0x9D, + 0x4D, 0x6C, 0xE7, 0xF2, 0x4F, 0xC0, 0xBA, 0x57, + 0x92, 0x18, 0xB7, 0xF5, 0x1D, 0x06, 0x81, 0xF6, + 0xE3, 0xF4, 0x66, 0x8C, 0x33, 0x74, 0xBE, 0x64, + 0x8C, 0x18, 0xED, 0x7F, 0x68, 0x2A, 0xE4, 0xAF, + 0xF1, 0x02, 0x07, 0x51, 0x22, 0x96, 0xC8, 0x9E, + 0x23, 0x7F, 0x6A, 0xD7, 0x80, 0x0F, 0x2D, 0xFC, + 0xCC, 0xD0, 0x95, 0x86, 0x00, 0x2A, 0x77, 0xDD, + 0xA2, 0x60, 0x1E, 0x0F, 0x8E, 0x42, 0x44, 0x37, + 0x7E, 0x33, 0xC4, 0xE0, 0x04, 0x53, 0xF6, 0x3F, + 0xDD, 0x1D, 0x5E, 0x24, 0xDA, 0xAE, 0xEF, 0x06, + 0x06, 0x05, 0x13, 0x3A, 0x1E, 0xFF, 0xAD, 0xAD, + 0xEE, 0x0F, 0x6F, 0x05, 0xA5, 0xFB, 0x3B, 0xC3, + 0xDB, 0xA0, 0x20, 0xC1, 0x65, 0x8B, 0x39, 0xAB, + 0xC9, 0xEC, 0xA8, 0x31, 0x85, 0x6C, 0xD2, 0xE4, + 0x76, 0x77, 0x76, 0xD5, 0x81, 0x01, 0x73, 0x36, + 0x08, 0x8C, 0xC3, 0xD4, 0x70, 0x7A, 0xA3, 0xDF, + 0xAD, 0x3A, 0x00, 0x46, 0x88, 0x65, 0x10, 0xBE, + 0xD8, 0x1C, 0x19, 0x98, 0xE9, 0x29, 0xDD, 0x58, + 0x46, 0x31, 0xEB, 0x3D, 0xD0, 0x12, 0x02, 0x83, + 0x15, 0xDD, 0x70, 0x27, 0x0D, 0xB5, 0xBB, 0x0C, + 0xE3, 0xF1, 0x02, 0xF2, 0xD7, 0x1D, 0x17, 0x6D, + 0xDF, 0x2A, 0x42, 0x1F, 0x01, 0x5C, 0x68, 0xB1, + 0x64, 0x74, 0xCE, 0x74, 0xB1, 0x3C, 0x2F, 0x43, + 0x5F, 0xB7, 0x7E, 0x3E, 0x6F, 0xE3, 0xDC, 0x03, + 0xD9, 0x0C, 0xDD, 0x42, 0x65, 0x7F, 0xEA, 0x69, + 0x6F, 0xDB, 0xD7, 0xFB, 0xFF, 0x4D, 0xB4, 0x48, + 0xFE, 0x0F, 0x59, 0x24, 0x8F, 0x13, 0xA8, 0x60, + 0xF7, 0x13, 0xE5, 0xB1, 0x8D, 0xB7, 0x70, 0xEE, + 0x82, 0x8F, 0xCF, 0x7E + }, + .len_bits = 516 << 3, + }, + .digest_enc = { + .data = { + 0x82, 0x8F, 0xCF, 0x7E + }, + .len = 4, + .offset = 512, + }, + .validDataLen = { + .len_bits = 516 << 3, + }, + .validCipherLen = { + .len_bits = 516 << 3, + }, + .validAuthLen = { + .len_bits = 512 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_null_cipher_snow_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_NULL, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 44 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_SNOW3G_UEA2, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, + }, + .len_bits = 44 << 3, + }, + .ciphertext = { + .data = { + 0x95, 0x2E, 0x5A, 0xE1, 0x50, 0xB8, 0x59, 0x2A, + 0x9B, 0xA0, 0x38, 0xA9, 0x8E, 0x2F, 0xED, 0xAB, + 0xFD, 0xC8, 0x3B, 0x47, 0x46, 0x0B, 0x50, 0x16, + 0xEC, 0x88, 0x45, 0xB6, 0x05, 0xC7, 0x54, 0xF8, + 0xBD, 0x91, 0xAA, 0xB6, 0xA4, 0xDC, 0x64, 0xB4, + 0xCB, 0xEB, 0x97, 0x06, 0x1C, 0xB5, 0x72, 0x34 + }, + .len_bits = 48 << 3, + }, + .digest_enc = { + .data = { + 0x1C, 0xB5, 0x72, 0x34 + }, + .len = 4, + .offset = 44, + }, + .validDataLen = { + .len_bits = 48 << 3, + }, + .validCipherLen = { + .len_bits = 48 << 3, + }, + .validAuthLen = { + .len_bits = 44 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_null_cipher_zuc_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_NULL, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_ZUC_EEA3, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 52 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 + }, + .len_bits = 48 << 3, + }, + .ciphertext = { + .data = { + 0x52, 0x11, 0xCD, 0xFF, 0xF8, 0x88, 0x61, 0x1E, + 0xF5, 0xD2, 0x8E, 0xEB, 0x2A, 0x49, 0x18, 0x1F, + 0xF4, 0xDA, 0x8B, 0x19, 0x60, 0x0B, 0x92, 0x9E, + 0x79, 0x2A, 0x5B, 0x0B, 0x7E, 0xC6, 0x22, 0x36, + 0x74, 0xA4, 0x6C, 0xBC, 0xF5, 0x25, 0x69, 0xAE, + 0xDA, 0x04, 0xB9, 0xAF, 0x16, 0x42, 0x0F, 0xCB, + 0x06, 0x7C, 0x1D, 0x29 + }, + .len_bits = 52 << 3, + }, + .digest_enc = { + .data = { + 0x06, 0x7C, 0x1D, 0x29 + }, + .len = 4, + .offset = 48, + }, + .validDataLen = { + .len_bits = 52 << 3, + }, + .validCipherLen = { + .len_bits = 52 << 3, + }, + .validAuthLen = { + .len_bits = 48 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_snow_cipher_null_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_SNOW3G_UIA2, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_NULL, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 52 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 + }, + .len_bits = 48 << 3, + }, + .ciphertext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09, + 0x38, 0xB5, 0x54, 0xC0 + }, + .len_bits = 52 << 3, + }, + .digest_enc = { + .data = { + 0x38, 0xB5, 0x54, 0xC0 + }, + .len = 4, + .offset = 48, + }, + .validDataLen = { + .len_bits = 52 << 3, + }, + .validCipherLen = { + .len_bits = 52 << 3, + }, + .validAuthLen = { + .len_bits = 48 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_zuc_cipher_null_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_ZUC_EIA3, + .auth_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .auth = { + .len_bits = 73 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_NULL, + .cipher_key = { + .data = { + 0xc9, 0xe6, 0xce, 0xc4, 0x60, 0x7c, 0x72, 0xdb, + 0x00, 0x0a, 0xef, 0xa8, 0x83, 0x85, 0xab, 0x0a + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0xa9, 0x40, 0x59, 0xda, 0x50, 0x00, 0x00, 0x00, + 0x29, 0x40, 0x59, 0xda, 0x50, 0x00, 0x80, 0x00 + }, + .len = 16, + }, + .cipher = { + .len_bits = 77 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x98, 0x3b, 0x41, 0xd4, 0x7d, 0x78, 0x0c, 0x9e, + 0x1a, 0xd1, 0x1d, 0x7e, 0xb7, 0x03, 0x91, 0xb1, + 0xde, 0x0b, 0x35, 0xda, 0x2d, 0xc6, 0x2f, 0x83, + 0xe7, 0xb7, 0x8d, 0x63, 0x06, 0xca, 0x0e, 0xa0, + 0x7e, 0x94, 0x1b, 0x7b, 0xe9, 0x13, 0x48, 0xf9, + 0xfc, 0xb1, 0x70, 0xe2, 0x21, 0x7f, 0xec, 0xd9, + 0x7f, 0x9f, 0x68, 0xad, 0xb1, 0x6e, 0x5d, 0x7d, + 0x21, 0xe5, 0x69, 0xd2, 0x80, 0xed, 0x77, 0x5c, + 0xeb, 0xde, 0x3f, 0x40, 0x93, 0xc5, 0x38, 0x81, + 0x00 + }, + .len_bits = 73 << 3, + }, + .ciphertext = { + .data = { + 0x98, 0x3b, 0x41, 0xd4, 0x7d, 0x78, 0x0c, 0x9e, + 0x1a, 0xd1, 0x1d, 0x7e, 0xb7, 0x03, 0x91, 0xb1, + 0xde, 0x0b, 0x35, 0xda, 0x2d, 0xc6, 0x2f, 0x83, + 0xe7, 0xb7, 0x8d, 0x63, 0x06, 0xca, 0x0e, 0xa0, + 0x7e, 0x94, 0x1b, 0x7b, 0xe9, 0x13, 0x48, 0xf9, + 0xfc, 0xb1, 0x70, 0xe2, 0x21, 0x7f, 0xec, 0xd9, + 0x7f, 0x9f, 0x68, 0xad, 0xb1, 0x6e, 0x5d, 0x7d, + 0x21, 0xe5, 0x69, 0xd2, 0x80, 0xed, 0x77, 0x5c, + 0xeb, 0xde, 0x3f, 0x40, 0x93, 0xc5, 0x38, 0x81, + 0x00, 0x24, 0xa8, 0x42, 0xb3 + }, + .len_bits = 77 << 3, + }, + .digest_enc = { + .data = { + 0x24, 0xa8, 0x42, 0xb3 + }, + .len = 4, + .offset = 73, + }, + .validDataLen = { + .len_bits = 77 << 3, + }, + .validCipherLen = { + .len_bits = 77 << 3, + }, + .validAuthLen = { + .len_bits = 73 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_null_cipher_aes_ctr_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_NULL, + .auth_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .auth_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .auth = { + .len_bits = 48 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_AES_CTR, + .cipher_key = { + .data = { + 0xC7, 0x36, 0xC6, 0xAA, 0xB2, 0x2B, 0xFF, 0xF9, + 0x1E, 0x26, 0x98, 0xD2, 0xE2, 0x2A, 0xD5, 0x7E + }, + .len = 16, + }, + .cipher_iv = { + .data = { + 0x14, 0x79, 0x3E, 0x41, 0x03, 0x97, 0xE8, 0xFD, + 0x94, 0x79, 0x3E, 0x41, 0x03, 0x97, 0x68, 0xFD + }, + .len = 16, + }, + .cipher = { + .len_bits = 52 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0xD0, 0xA7, 0xD4, 0x63, 0xDF, 0x9F, 0xB2, 0xB2, + 0x78, 0x83, 0x3F, 0xA0, 0x2E, 0x23, 0x5A, 0xA1, + 0x72, 0xBD, 0x97, 0x0C, 0x14, 0x73, 0xE1, 0x29, + 0x07, 0xFB, 0x64, 0x8B, 0x65, 0x99, 0xAA, 0xA0, + 0xB2, 0x4A, 0x03, 0x86, 0x65, 0x42, 0x2B, 0x20, + 0xA4, 0x99, 0x27, 0x6A, 0x50, 0x42, 0x70, 0x09 + }, + .len_bits = 48 << 3, + }, + .ciphertext = { + .data = { + 0x91, 0x96, 0x28, 0xB4, 0x89, 0x74, 0xF6, 0x5E, + 0x98, 0x58, 0xA1, 0xD3, 0x0E, 0xE3, 0xFC, 0x39, + 0xDB, 0x36, 0xE4, 0x97, 0x74, 0x5B, 0x5E, 0xD4, + 0x1B, 0x8A, 0xC5, 0x9D, 0xDF, 0x96, 0x97, 0x5F, + 0x58, 0x4A, 0x75, 0x74, 0x27, 0x07, 0xF3, 0x7F, + 0xCE, 0x2C, 0x4A, 0x6C, 0xE5, 0x19, 0xE7, 0x8B, + 0xCB, 0x94, 0xD0, 0xAC + }, + .len_bits = 52 << 3, + }, + .digest_enc = { + .data = { + 0xCB, 0x94, 0xD0, 0xAC + }, + .len = 4, + .offset = 48, + }, + .validDataLen = { + .len_bits = 52 << 3, + }, + .validCipherLen = { + .len_bits = 52 << 3, + }, + .validAuthLen = { + .len_bits = 48 << 3, + } +}; + +struct mixed_cipher_auth_test_data auth_aes_cmac_cipher_null_test_case_1 = { + .auth_algo = RTE_CRYPTO_AUTH_AES_CMAC, + .auth_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .auth_iv = { + .data = { + }, + .len = 0, + }, + .auth = { + .len_bits = 512 << 3, + .offset_bits = 0, + }, + .cipher_algo = RTE_CRYPTO_CIPHER_NULL, + .cipher_key = { + .data = { + 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + }, + .len = 16, + }, + .cipher_iv = { + .data = { + }, + .len = 0, + }, + .cipher = { + .len_bits = 516 << 3, + .offset_bits = 0, + }, + .plaintext = { + .data = { + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, + 0x6F, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, + 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, + 0x6F, 0x6E, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, + 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x70, 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x20, + 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6D, 0x65, + 0x20, 0x6E, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, + 0x76, 0x65, 0x6E, 0x20, 0x69, 0x6E, 0x20, 0x68, + 0x69, 0x73, 0x20, 0x6F, 0x77, 0x6E, 0x20, 0x70, + 0x72, 0x6F, 0x73, 0x70, 0x65, 0x72, 0x6F, 0x75, + 0x73, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, + 0x79, 0x2C, 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, + 0x61, 0x6E, 0x79, 0x20, 0x68, 0x6F, 0x6D, 0x65, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, + 0x68, 0x61, 0x6E, 0x74, 0x69, 0x65, 0x73, 0x2C, + 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6E, + 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x64, 0x72, 0x75, 0x6E, 0x6B, 0x20, 0x61, 0x6E, + 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, + 0x73, 0x6F, 0x63, 0x6B, 0x65, 0x64, 0x2C, 0x20, + 0x61, 0x6E, 0x64, 0x20, 0x68, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, 0x68, 0x69, + 0x6C, 0x64, 0x72, 0x65, 0x6E, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x62, 0x75, 0x6C, 0x6C, 0x69, + 0x65, 0x64, 0x2C, 0x20, 0x61, 0x62, 0x75, 0x73, + 0x65, 0x64, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65, 0x64, + 0x2E, 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, + 0x6E, 0x79, 0x20, 0x66, 0x61, 0x6D, 0x69, 0x6C, + 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6E, 0x67, + 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x66, 0x6F, 0x6F, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x79, 0x20, 0x63, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x61, 0x66, 0x66, + 0x6F, 0x72, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x62, + 0x75, 0x79, 0x3F, 0x20, 0x48, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, + 0x20, 0x62, 0x72, 0x6F, 0x6B, 0x65, 0x6E, 0x3F, + 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x74, 0x61, 0x6B, 0x65, 0x20, 0x70, 0x6C, + 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x61, 0x6D, 0x65, 0x20, 0x6E, 0x69, + 0x67, 0x68, 0x74, 0x2C, 0x20, 0x68, 0x6F, 0x77, + 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x70, 0x65, + 0x6F, 0x70, 0x6C, 0x65, 0x20, 0x77, 0x6F, 0x75, + 0x6C, 0x64, 0x20, 0x67, 0x6F, 0x20, 0x69, 0x6E, + 0x73, 0x61, 0x6E, 0x65, 0x3F, 0x20, 0x48, 0x6F, + 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, + 0x6F, 0x63, 0x6B, 0x72, 0x6F, 0x61, 0x63, 0x68, + 0x65, 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6C, + 0x61, 0x6E, 0x64, 0x6C, 0x6F, 0x72, 0x64, 0x73, + 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, 0x20, 0x74, + 0x72, 0x69, 0x75, 0x6D, 0x70, 0x68, 0x3F, 0x20, + 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x77, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x73, + 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6C, 0x6F, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75 + }, + .len_bits = 512 << 3, + }, + .ciphertext = { + .data = { + 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x6C, + 0x6F, 0x75, 0x73, 0x79, 0x20, 0x65, 0x61, 0x72, + 0x74, 0x68, 0x21, 0x20, 0x48, 0x65, 0x20, 0x77, + 0x6F, 0x6E, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, + 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x70, 0x65, 0x6F, 0x70, 0x6C, 0x65, 0x20, + 0x77, 0x65, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x74, 0x75, 0x74, 0x65, 0x20, 0x74, + 0x68, 0x61, 0x74, 0x20, 0x73, 0x61, 0x6D, 0x65, + 0x20, 0x6E, 0x69, 0x67, 0x68, 0x74, 0x20, 0x65, + 0x76, 0x65, 0x6E, 0x20, 0x69, 0x6E, 0x20, 0x68, + 0x69, 0x73, 0x20, 0x6F, 0x77, 0x6E, 0x20, 0x70, + 0x72, 0x6F, 0x73, 0x70, 0x65, 0x72, 0x6F, 0x75, + 0x73, 0x20, 0x63, 0x6F, 0x75, 0x6E, 0x74, 0x72, + 0x79, 0x2C, 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, + 0x61, 0x6E, 0x79, 0x20, 0x68, 0x6F, 0x6D, 0x65, + 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x73, + 0x68, 0x61, 0x6E, 0x74, 0x69, 0x65, 0x73, 0x2C, + 0x20, 0x68, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x68, 0x75, 0x73, 0x62, 0x61, 0x6E, + 0x64, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, + 0x64, 0x72, 0x75, 0x6E, 0x6B, 0x20, 0x61, 0x6E, + 0x64, 0x20, 0x77, 0x69, 0x76, 0x65, 0x73, 0x20, + 0x73, 0x6F, 0x63, 0x6B, 0x65, 0x64, 0x2C, 0x20, + 0x61, 0x6E, 0x64, 0x20, 0x68, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, 0x68, 0x69, + 0x6C, 0x64, 0x72, 0x65, 0x6E, 0x20, 0x77, 0x65, + 0x72, 0x65, 0x20, 0x62, 0x75, 0x6C, 0x6C, 0x69, + 0x65, 0x64, 0x2C, 0x20, 0x61, 0x62, 0x75, 0x73, + 0x65, 0x64, 0x2C, 0x20, 0x6F, 0x72, 0x20, 0x61, + 0x62, 0x61, 0x6E, 0x64, 0x6F, 0x6E, 0x65, 0x64, + 0x2E, 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, + 0x6E, 0x79, 0x20, 0x66, 0x61, 0x6D, 0x69, 0x6C, + 0x69, 0x65, 0x73, 0x20, 0x68, 0x75, 0x6E, 0x67, + 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6F, 0x72, + 0x20, 0x66, 0x6F, 0x6F, 0x64, 0x20, 0x74, 0x68, + 0x65, 0x79, 0x20, 0x63, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x6E, 0x6F, 0x74, 0x20, 0x61, 0x66, 0x66, + 0x6F, 0x72, 0x64, 0x20, 0x74, 0x6F, 0x20, 0x62, + 0x75, 0x79, 0x3F, 0x20, 0x48, 0x6F, 0x77, 0x20, + 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, + 0x20, 0x62, 0x72, 0x6F, 0x6B, 0x65, 0x6E, 0x3F, + 0x20, 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, + 0x79, 0x20, 0x73, 0x75, 0x69, 0x63, 0x69, 0x64, + 0x65, 0x73, 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, + 0x20, 0x74, 0x61, 0x6B, 0x65, 0x20, 0x70, 0x6C, + 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, + 0x20, 0x73, 0x61, 0x6D, 0x65, 0x20, 0x6E, 0x69, + 0x67, 0x68, 0x74, 0x2C, 0x20, 0x68, 0x6F, 0x77, + 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x70, 0x65, + 0x6F, 0x70, 0x6C, 0x65, 0x20, 0x77, 0x6F, 0x75, + 0x6C, 0x64, 0x20, 0x67, 0x6F, 0x20, 0x69, 0x6E, + 0x73, 0x61, 0x6E, 0x65, 0x3F, 0x20, 0x48, 0x6F, + 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, 0x20, 0x63, + 0x6F, 0x63, 0x6B, 0x72, 0x6F, 0x61, 0x63, 0x68, + 0x65, 0x73, 0x20, 0x61, 0x6E, 0x64, 0x20, 0x6C, + 0x61, 0x6E, 0x64, 0x6C, 0x6F, 0x72, 0x64, 0x73, + 0x20, 0x77, 0x6F, 0x75, 0x6C, 0x64, 0x20, 0x74, + 0x72, 0x69, 0x75, 0x6D, 0x70, 0x68, 0x3F, 0x20, + 0x48, 0x6F, 0x77, 0x20, 0x6D, 0x61, 0x6E, 0x79, + 0x20, 0x77, 0x69, 0x6E, 0x6E, 0x65, 0x72, 0x73, + 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6C, 0x6F, + 0x73, 0x65, 0x72, 0x73, 0x2C, 0x20, 0x73, 0x75, + 0x4C, 0x77, 0x87, 0xA0 + }, + .len_bits = 516 << 3, + }, + .digest_enc = { + .data = { + 0x4C, 0x77, 0x87, 0xA0 + }, + .len = 4, + .offset = 512, + }, + .validDataLen = { + .len_bits = 516 << 3, + }, + .validCipherLen = { + .len_bits = 516 << 3, + }, + .validAuthLen = { + .len_bits = 512 << 3, + } +}; + #endif /* TEST_CRYPTODEV_MIXED_TEST_VECTORS_H_ */ diff --git a/dpdk/app/test/test_cycles.c b/dpdk/app/test/test_cycles.c index c78e6a5b1..97d42f303 100644 --- a/dpdk/app/test/test_cycles.c +++ b/dpdk/app/test/test_cycles.c @@ -79,8 +79,14 @@ REGISTER_TEST_COMMAND(cycles_autotest, test_cycles); static int test_delay_us_sleep(void) { + int rv; + rte_delay_us_callback_register(rte_delay_us_sleep); - return check_wait_one_second(); + rv = check_wait_one_second(); + /* restore original delay function */ + rte_delay_us_callback_register(rte_delay_us_block); + + return rv; } REGISTER_TEST_COMMAND(delay_us_sleep_autotest, test_delay_us_sleep); diff --git a/dpdk/app/test/test_distributor.c b/dpdk/app/test/test_distributor.c index ba1f81cf8..3b2a4cbcf 100644 --- a/dpdk/app/test/test_distributor.c +++ b/dpdk/app/test/test_distributor.c @@ -27,7 +27,9 @@ struct worker_params worker_params; /* statics - all zero-initialized by default */ static volatile int quit; /**< general quit variable for all threads */ static volatile int zero_quit; /**< var for when we just want thr0 to quit*/ +static volatile int zero_sleep; /**< thr0 has quit basic loop and is sleeping*/ static volatile unsigned worker_idx; +static volatile unsigned zero_idx; struct worker_stats { volatile unsigned handled_packets; @@ -42,7 +44,8 @@ total_packet_count(void) { unsigned i, count = 0; for (i = 0; i < worker_idx; i++) - count += worker_stats[i].handled_packets; + count += __atomic_load_n(&worker_stats[i].handled_packets, + __ATOMIC_RELAXED); return count; } @@ -50,7 +53,10 @@ total_packet_count(void) static inline void clear_packet_count(void) { - memset(&worker_stats, 0, sizeof(worker_stats)); + unsigned int i; + for (i = 0; i < RTE_MAX_LCORE; i++) + __atomic_store_n(&worker_stats[i].handled_packets, 0, + __ATOMIC_RELAXED); } /* this is the basic worker function for sanity test @@ -62,23 +68,18 @@ handle_work(void *arg) struct rte_mbuf *buf[8] __rte_cache_aligned; struct worker_params *wp = arg; struct rte_distributor *db = wp->dist; - unsigned int count = 0, num = 0; + unsigned int num; unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED); - int i; - for (i = 0; i < 8; i++) - buf[i] = NULL; - num = rte_distributor_get_pkt(db, id, buf, buf, num); + num = rte_distributor_get_pkt(db, id, buf, NULL, 0); while (!quit) { __atomic_fetch_add(&worker_stats[id].handled_packets, num, __ATOMIC_RELAXED); - count += num; num = rte_distributor_get_pkt(db, id, buf, buf, num); } __atomic_fetch_add(&worker_stats[id].handled_packets, num, __ATOMIC_RELAXED); - count += num; rte_distributor_return_pkt(db, id, buf, num); return 0; } @@ -102,6 +103,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) struct rte_mbuf *returns[BURST*2]; unsigned int i, count; unsigned int retries; + unsigned int processed; printf("=== Basic distributor sanity tests ===\n"); clear_packet_count(); @@ -115,7 +117,11 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 0; - rte_distributor_process(db, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(db, &bufs[processed], + BURST - processed); + count = 0; do { @@ -128,12 +134,14 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) printf("Line %d: Error, not all packets flushed. " "Expected %u, got %u\n", __LINE__, BURST, total_packet_count()); + rte_mempool_put_bulk(p, (void *)bufs, BURST); return -1; } for (i = 0; i < rte_lcore_count() - 1; i++) printf("Worker %u handled %u packets\n", i, - worker_stats[i].handled_packets); + __atomic_load_n(&worker_stats[i].handled_packets, + __ATOMIC_RELAXED)); printf("Sanity test with all zero hashes done.\n"); /* pick two flows and check they go correctly */ @@ -153,12 +161,15 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) printf("Line %d: Error, not all packets flushed. " "Expected %u, got %u\n", __LINE__, BURST, total_packet_count()); + rte_mempool_put_bulk(p, (void *)bufs, BURST); return -1; } for (i = 0; i < rte_lcore_count() - 1; i++) printf("Worker %u handled %u packets\n", i, - worker_stats[i].handled_packets); + __atomic_load_n( + &worker_stats[i].handled_packets, + __ATOMIC_RELAXED)); printf("Sanity test with two hash values done\n"); } @@ -179,12 +190,14 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) printf("Line %d: Error, not all packets flushed. " "Expected %u, got %u\n", __LINE__, BURST, total_packet_count()); + rte_mempool_put_bulk(p, (void *)bufs, BURST); return -1; } for (i = 0; i < rte_lcore_count() - 1; i++) printf("Worker %u handled %u packets\n", i, - worker_stats[i].handled_packets); + __atomic_load_n(&worker_stats[i].handled_packets, + __ATOMIC_RELAXED)); printf("Sanity test with non-zero hashes done\n"); rte_mempool_put_bulk(p, (void *)bufs, BURST); @@ -233,6 +246,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) if (num_returned != BIG_BATCH) { printf("line %d: Missing packets, expected %d\n", __LINE__, num_returned); + rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH); return -1; } @@ -247,6 +261,7 @@ sanity_test(struct worker_params *wp, struct rte_mempool *p) if (j == BIG_BATCH) { printf("Error: could not find source packet #%u\n", i); + rte_mempool_put_bulk(p, (void *)many_bufs, BIG_BATCH); return -1; } } @@ -270,24 +285,20 @@ handle_work_with_free_mbufs(void *arg) struct rte_mbuf *buf[8] __rte_cache_aligned; struct worker_params *wp = arg; struct rte_distributor *d = wp->dist; - unsigned int count = 0; unsigned int i; - unsigned int num = 0; + unsigned int num; unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED); - for (i = 0; i < 8; i++) - buf[i] = NULL; - num = rte_distributor_get_pkt(d, id, buf, buf, num); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); while (!quit) { - worker_stats[id].handled_packets += num; - count += num; + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); for (i = 0; i < num; i++) rte_pktmbuf_free(buf[i]); - num = rte_distributor_get_pkt(d, - id, buf, buf, num); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); } - worker_stats[id].handled_packets += num; - count += num; + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); rte_distributor_return_pkt(d, id, buf, num); return 0; } @@ -303,6 +314,7 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p) struct rte_distributor *d = wp->dist; unsigned i; struct rte_mbuf *bufs[BURST]; + unsigned int processed; printf("=== Sanity test with mbuf alloc/free (%s) ===\n", wp->name); @@ -313,10 +325,12 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p) rte_distributor_process(d, NULL, 0); for (j = 0; j < BURST; j++) { bufs[j]->hash.usr = (i+j) << 1; - rte_mbuf_refcnt_set(bufs[j], 1); } - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, + &bufs[processed], BURST - processed); } rte_distributor_flush(d); @@ -337,55 +351,61 @@ sanity_test_with_mbuf_alloc(struct worker_params *wp, struct rte_mempool *p) static int handle_work_for_shutdown_test(void *arg) { - struct rte_mbuf *pkt = NULL; struct rte_mbuf *buf[8] __rte_cache_aligned; struct worker_params *wp = arg; struct rte_distributor *d = wp->dist; - unsigned int count = 0; - unsigned int num = 0; - unsigned int total = 0; - unsigned int i; - unsigned int returned = 0; + unsigned int num; + unsigned int zero_id = 0; + unsigned int zero_unset; const unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED); - num = rte_distributor_get_pkt(d, id, buf, buf, num); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); + + if (num > 0) { + zero_unset = RTE_MAX_LCORE; + __atomic_compare_exchange_n(&zero_idx, &zero_unset, id, + 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE); + } + zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE); /* wait for quit single globally, or for worker zero, wait * for zero_quit */ - while (!quit && !(id == 0 && zero_quit)) { - worker_stats[id].handled_packets += num; - count += num; - for (i = 0; i < num; i++) - rte_pktmbuf_free(buf[i]); - num = rte_distributor_get_pkt(d, - id, buf, buf, num); - total += num; - } - worker_stats[id].handled_packets += num; - count += num; - returned = rte_distributor_return_pkt(d, id, buf, num); + while (!quit && !(id == zero_id && zero_quit)) { + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); + + if (num > 0) { + zero_unset = RTE_MAX_LCORE; + __atomic_compare_exchange_n(&zero_idx, &zero_unset, id, + 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE); + } + zero_id = __atomic_load_n(&zero_idx, __ATOMIC_ACQUIRE); + } + + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); + if (id == zero_id) { + rte_distributor_return_pkt(d, id, NULL, 0); - if (id == 0) { /* for worker zero, allow it to restart to pick up last packet * when all workers are shutting down. */ + __atomic_store_n(&zero_sleep, 1, __ATOMIC_RELEASE); while (zero_quit) usleep(100); + __atomic_store_n(&zero_sleep, 0, __ATOMIC_RELEASE); - num = rte_distributor_get_pkt(d, - id, buf, buf, num); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); while (!quit) { - worker_stats[id].handled_packets += num; - count += num; - rte_pktmbuf_free(pkt); - num = rte_distributor_get_pkt(d, id, buf, buf, num); + __atomic_fetch_add(&worker_stats[id].handled_packets, + num, __ATOMIC_RELAXED); + num = rte_distributor_get_pkt(d, id, buf, NULL, 0); } - returned = rte_distributor_return_pkt(d, - id, buf, num); - printf("Num returned = %d\n", returned); } + rte_distributor_return_pkt(d, id, buf, num); return 0; } @@ -401,7 +421,10 @@ sanity_test_with_worker_shutdown(struct worker_params *wp, { struct rte_distributor *d = wp->dist; struct rte_mbuf *bufs[BURST]; - unsigned i; + struct rte_mbuf *bufs2[BURST]; + unsigned int i; + unsigned int failed = 0; + unsigned int processed = 0; printf("=== Sanity test of worker shutdown ===\n"); @@ -419,7 +442,10 @@ sanity_test_with_worker_shutdown(struct worker_params *wp, for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 1; - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, &bufs[processed], + BURST - processed); rte_distributor_flush(d); /* at this point, we will have processed some packets and have a full @@ -427,32 +453,45 @@ sanity_test_with_worker_shutdown(struct worker_params *wp, */ /* get more buffers to queue up, again setting them to the same flow */ - if (rte_mempool_get_bulk(p, (void *)bufs, BURST) != 0) { + if (rte_mempool_get_bulk(p, (void *)bufs2, BURST) != 0) { printf("line %d: Error getting mbufs from pool\n", __LINE__); + rte_mempool_put_bulk(p, (void *)bufs, BURST); return -1; } for (i = 0; i < BURST; i++) - bufs[i]->hash.usr = 1; + bufs2[i]->hash.usr = 1; /* get worker zero to quit */ zero_quit = 1; - rte_distributor_process(d, bufs, BURST); + rte_distributor_process(d, bufs2, BURST); /* flush the distributor */ rte_distributor_flush(d); - rte_delay_us(10000); + while (!__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE)) + rte_distributor_flush(d); + + zero_quit = 0; + while (__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE)) + rte_delay_us(100); for (i = 0; i < rte_lcore_count() - 1; i++) printf("Worker %u handled %u packets\n", i, - worker_stats[i].handled_packets); + __atomic_load_n(&worker_stats[i].handled_packets, + __ATOMIC_RELAXED)); if (total_packet_count() != BURST * 2) { printf("Line %d: Error, not all packets flushed. " "Expected %u, got %u\n", __LINE__, BURST * 2, total_packet_count()); - return -1; + failed = 1; } + rte_mempool_put_bulk(p, (void *)bufs, BURST); + rte_mempool_put_bulk(p, (void *)bufs2, BURST); + + if (failed) + return -1; + printf("Sanity test with worker shutdown passed\n\n"); return 0; } @@ -466,7 +505,9 @@ test_flush_with_worker_shutdown(struct worker_params *wp, { struct rte_distributor *d = wp->dist; struct rte_mbuf *bufs[BURST]; - unsigned i; + unsigned int i; + unsigned int failed = 0; + unsigned int processed; printf("=== Test flush fn with worker shutdown (%s) ===\n", wp->name); @@ -481,7 +522,10 @@ test_flush_with_worker_shutdown(struct worker_params *wp, for (i = 0; i < BURST; i++) bufs[i]->hash.usr = 0; - rte_distributor_process(d, bufs, BURST); + processed = 0; + while (processed < BURST) + processed += rte_distributor_process(d, &bufs[processed], + BURST - processed); /* at this point, we will have processed some packets and have a full * backlog for the other ones at worker 0. */ @@ -492,20 +536,31 @@ test_flush_with_worker_shutdown(struct worker_params *wp, /* flush the distributor */ rte_distributor_flush(d); - rte_delay_us(10000); + while (!__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE)) + rte_distributor_flush(d); zero_quit = 0; + + while (__atomic_load_n(&zero_sleep, __ATOMIC_ACQUIRE)) + rte_delay_us(100); + for (i = 0; i < rte_lcore_count() - 1; i++) printf("Worker %u handled %u packets\n", i, - worker_stats[i].handled_packets); + __atomic_load_n(&worker_stats[i].handled_packets, + __ATOMIC_RELAXED)); if (total_packet_count() != BURST) { printf("Line %d: Error, not all packets flushed. " "Expected %u, got %u\n", __LINE__, BURST, total_packet_count()); - return -1; + failed = 1; } + rte_mempool_put_bulk(p, (void *)bufs, BURST); + + if (failed) + return -1; + printf("Flush test with worker shutdown passed\n\n"); return 0; } @@ -571,21 +626,34 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p) const unsigned num_workers = rte_lcore_count() - 1; unsigned i; struct rte_mbuf *bufs[RTE_MAX_LCORE]; - rte_mempool_get_bulk(p, (void *)bufs, num_workers); + struct rte_mbuf *returns[RTE_MAX_LCORE]; + if (rte_mempool_get_bulk(p, (void *)bufs, num_workers) != 0) { + printf("line %d: Error getting mbufs from pool\n", __LINE__); + return; + } zero_quit = 0; quit = 1; - for (i = 0; i < num_workers; i++) + for (i = 0; i < num_workers; i++) { bufs[i]->hash.usr = i << 1; - rte_distributor_process(d, bufs, num_workers); - - rte_mempool_put_bulk(p, (void *)bufs, num_workers); + rte_distributor_process(d, &bufs[i], 1); + } rte_distributor_process(d, NULL, 0); rte_distributor_flush(d); rte_eal_mp_wait_lcore(); + + while (rte_distributor_returned_pkts(d, returns, RTE_MAX_LCORE)) + ; + + rte_distributor_clear_returns(d); + rte_mempool_put_bulk(p, (void *)bufs, num_workers); + quit = 0; worker_idx = 0; + zero_idx = RTE_MAX_LCORE; + zero_quit = 0; + zero_sleep = 0; } static int diff --git a/dpdk/app/test/test_event_crypto_adapter.c b/dpdk/app/test/test_event_crypto_adapter.c index 8d42462d8..1a9aa06c7 100644 --- a/dpdk/app/test/test_event_crypto_adapter.c +++ b/dpdk/app/test/test_event_crypto_adapter.c @@ -171,7 +171,6 @@ test_op_forward_mode(uint8_t session_less) struct rte_event ev; uint32_t cap; int ret; - uint8_t cipher_key[17]; memset(&m_data, 0, sizeof(m_data)); @@ -183,14 +182,7 @@ test_op_forward_mode(uint8_t session_less) /* Setup Cipher Parameters */ cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; cipher_xform.next = NULL; - - cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; - cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; - - cipher_xform.cipher.key.data = cipher_key; - cipher_xform.cipher.key.length = 16; - cipher_xform.cipher.iv.offset = IV_OFFSET; - cipher_xform.cipher.iv.length = 16; + cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; op = rte_crypto_op_alloc(params.op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); @@ -209,8 +201,8 @@ test_op_forward_mode(uint8_t session_less) &cipher_xform, params.session_priv_mpool); TEST_ASSERT_SUCCESS(ret, "Failed to init session\n"); - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, - evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, + &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -296,7 +288,7 @@ test_sessionless_with_op_forward_mode(void) uint32_t cap; int ret; - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -321,7 +313,7 @@ test_session_with_op_forward_mode(void) uint32_t cap; int ret; - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -378,7 +370,6 @@ test_op_new_mode(uint8_t session_less) struct rte_mbuf *m; uint32_t cap; int ret; - uint8_t cipher_key[17]; memset(&m_data, 0, sizeof(m_data)); @@ -390,14 +381,7 @@ test_op_new_mode(uint8_t session_less) /* Setup Cipher Parameters */ cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; cipher_xform.next = NULL; - - cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_AES_CBC; - cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT; - - cipher_xform.cipher.key.data = cipher_key; - cipher_xform.cipher.key.length = 16; - cipher_xform.cipher.iv.offset = IV_OFFSET; - cipher_xform.cipher.iv.length = 16; + cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL; op = rte_crypto_op_alloc(params.op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC); @@ -410,8 +394,8 @@ test_op_new_mode(uint8_t session_less) params.session_mpool); TEST_ASSERT_NOT_NULL(sess, "Session creation failed\n"); - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, - evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, + &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { @@ -460,7 +444,7 @@ test_sessionless_with_op_new_mode(void) uint32_t cap; int ret; - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -486,7 +470,7 @@ test_session_with_op_new_mode(void) uint32_t cap; int ret; - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (!(cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_OP_FWD) && @@ -564,7 +548,9 @@ configure_cryptodev(void) params.session_mpool = rte_cryptodev_sym_session_pool_create( "CRYPTO_ADAPTER_SESSION_MP", - MAX_NB_SESSIONS, 0, 0, 0, SOCKET_ID_ANY); + MAX_NB_SESSIONS, 0, 0, + sizeof(union rte_event_crypto_metadata), + SOCKET_ID_ANY); TEST_ASSERT_NOT_NULL(params.session_mpool, "session mempool allocation failed\n"); @@ -706,7 +692,7 @@ test_crypto_adapter_create(void) /* Create adapter with default port creation callback */ ret = rte_event_crypto_adapter_create(TEST_ADAPTER_ID, - TEST_CDEV_ID, + evdev, &conf, 0); TEST_ASSERT_SUCCESS(ret, "Failed to create event crypto adapter\n"); @@ -719,7 +705,7 @@ test_crypto_adapter_qp_add_del(void) uint32_t cap; int ret; - ret = rte_event_crypto_adapter_caps_get(TEST_ADAPTER_ID, evdev, &cap); + ret = rte_event_crypto_adapter_caps_get(evdev, TEST_CDEV_ID, &cap); TEST_ASSERT_SUCCESS(ret, "Failed to get adapter capabilities\n"); if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_INTERNAL_PORT_QP_EV_BIND) { diff --git a/dpdk/app/test/test_event_eth_tx_adapter.c b/dpdk/app/test/test_event_eth_tx_adapter.c index 3af749280..707303090 100644 --- a/dpdk/app/test/test_event_eth_tx_adapter.c +++ b/dpdk/app/test/test_event_eth_tx_adapter.c @@ -45,7 +45,7 @@ static uint64_t eid = ~0ULL; static uint32_t tid; static inline int -port_init_common(uint8_t port, const struct rte_eth_conf *port_conf, +port_init_common(uint16_t port, const struct rte_eth_conf *port_conf, struct rte_mempool *mp) { const uint16_t rx_ring_size = RING_SIZE, tx_ring_size = RING_SIZE; @@ -104,7 +104,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf, } static inline int -port_init(uint8_t port, struct rte_mempool *mp) +port_init(uint16_t port, struct rte_mempool *mp) { struct rte_eth_conf conf = { 0 }; return port_init_common(port, &conf, mp); diff --git a/dpdk/app/test/test_fib_perf.c b/dpdk/app/test/test_fib_perf.c index 573087c3c..dd2e54db8 100644 --- a/dpdk/app/test/test_fib_perf.c +++ b/dpdk/app/test/test_fib_perf.c @@ -35,7 +35,7 @@ struct route_rule { uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM]; +static struct route_rule large_route_table[MAX_RULE_NUM]; static uint32_t num_route_entries; #define NUM_ROUTE_ENTRIES num_route_entries diff --git a/dpdk/app/test/test_flow_classify.c b/dpdk/app/test/test_flow_classify.c index ff5265c6a..ef0b6fdd5 100644 --- a/dpdk/app/test/test_flow_classify.c +++ b/dpdk/app/test/test_flow_classify.c @@ -23,7 +23,7 @@ #define FLOW_CLASSIFY_MAX_RULE_NUM 100 #define MAX_PKT_BURST 32 -#define NB_SOCKETS 1 +#define NB_SOCKETS 4 #define MEMPOOL_CACHE_SIZE 256 #define MBUF_SIZE 512 #define NB_MBUF 512 diff --git a/dpdk/app/test/test_hash.c b/dpdk/app/test/test_hash.c index 0052dce2d..2ac298e21 100644 --- a/dpdk/app/test/test_hash.c +++ b/dpdk/app/test/test_hash.c @@ -1142,8 +1142,11 @@ fbk_hash_unit_test(void) handle = rte_fbk_hash_create(&invalid_params_7); RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); - handle = rte_fbk_hash_create(&invalid_params_8); - RETURN_IF_ERROR_FBK(handle != NULL, "fbk hash creation should have failed"); + if (rte_eal_has_hugepages()) { + handle = rte_fbk_hash_create(&invalid_params_8); + RETURN_IF_ERROR_FBK(handle != NULL, + "fbk hash creation should have failed"); + } handle = rte_fbk_hash_create(&invalid_params_same_name_1); RETURN_IF_ERROR_FBK(handle == NULL, "fbk hash creation should have succeeded"); diff --git a/dpdk/app/test/test_hash_readwrite_lf.c b/dpdk/app/test/test_hash_readwrite_lf_perf.c similarity index 99% rename from dpdk/app/test/test_hash_readwrite_lf.c rename to dpdk/app/test/test_hash_readwrite_lf_perf.c index 97c304054..7bfc067f4 100644 --- a/dpdk/app/test/test_hash_readwrite_lf.c +++ b/dpdk/app/test/test_hash_readwrite_lf_perf.c @@ -1241,7 +1241,7 @@ err: } static int -test_hash_readwrite_lf_main(void) +test_hash_readwrite_lf_perf_main(void) { /* * Variables used to choose different tests. @@ -1254,7 +1254,7 @@ test_hash_readwrite_lf_main(void) int ext_bkt = 0; if (rte_lcore_count() < 2) { - printf("Not enough cores for hash_readwrite_lf_autotest, expecting at least 2\n"); + printf("Not enough cores for hash_readwrite_lf_perf_autotest, expecting at least 2\n"); return TEST_SKIPPED; } @@ -1431,4 +1431,5 @@ results: return 0; } -REGISTER_TEST_COMMAND(hash_readwrite_lf_autotest, test_hash_readwrite_lf_main); +REGISTER_TEST_COMMAND(hash_readwrite_lf_perf_autotest, + test_hash_readwrite_lf_perf_main); diff --git a/dpdk/app/test/test_ipsec.c b/dpdk/app/test/test_ipsec.c index 9e1447293..79d00d7e0 100644 --- a/dpdk/app/test/test_ipsec.c +++ b/dpdk/app/test/test_ipsec.c @@ -1167,6 +1167,34 @@ test_ipsec_dump_buffers(struct ipsec_unitest_params *ut_params, int i) } } +static void +destroy_dummy_sec_session(struct ipsec_unitest_params *ut, + uint32_t j) +{ + rte_security_session_destroy(&dummy_sec_ctx, + ut->ss[j].security.ses); + ut->ss[j].security.ctx = NULL; +} + +static void +destroy_crypto_session(struct ipsec_unitest_params *ut, + uint8_t crypto_dev, uint32_t j) +{ + rte_cryptodev_sym_session_clear(crypto_dev, ut->ss[j].crypto.ses); + rte_cryptodev_sym_session_free(ut->ss[j].crypto.ses); + memset(&ut->ss[j], 0, sizeof(ut->ss[j])); +} + +static void +destroy_session(struct ipsec_unitest_params *ut, + uint8_t crypto_dev, uint32_t j) +{ + if (ut->ss[j].type == RTE_SECURITY_ACTION_TYPE_NONE) + return destroy_crypto_session(ut, crypto_dev, j); + else + return destroy_dummy_sec_session(ut, j); +} + static void destroy_sa(uint32_t j) { @@ -1175,9 +1203,8 @@ destroy_sa(uint32_t j) rte_ipsec_sa_fini(ut->ss[j].sa); rte_free(ut->ss[j].sa); - rte_cryptodev_sym_session_clear(ts->valid_dev, ut->ss[j].crypto.ses); - rte_cryptodev_sym_session_free(ut->ss[j].crypto.ses); - memset(&ut->ss[j], 0, sizeof(ut->ss[j])); + + destroy_session(ut, ts->valid_dev, j); } static int diff --git a/dpdk/app/test/test_kvargs.c b/dpdk/app/test/test_kvargs.c index a42056f36..2a2dae43a 100644 --- a/dpdk/app/test/test_kvargs.c +++ b/dpdk/app/test/test_kvargs.c @@ -142,7 +142,7 @@ static int test_valid_kvargs(void) valid_keys = valid_keys_list; kvlist = rte_kvargs_parse(args, valid_keys); if (kvlist == NULL) { - printf("rte_kvargs_parse() error"); + printf("rte_kvargs_parse() error\n"); goto fail; } if (strcmp(kvlist->pairs[0].value, "[0,1]") != 0) { @@ -157,6 +157,40 @@ static int test_valid_kvargs(void) } rte_kvargs_free(kvlist); + /* test using empty string (it is valid) */ + args = ""; + kvlist = rte_kvargs_parse(args, NULL); + if (kvlist == NULL) { + printf("rte_kvargs_parse() error\n"); + goto fail; + } + if (rte_kvargs_count(kvlist, NULL) != 0) { + printf("invalid count value\n"); + goto fail; + } + rte_kvargs_free(kvlist); + + /* test using empty elements (it is valid) */ + args = "foo=1,,check=value2,,"; + kvlist = rte_kvargs_parse(args, NULL); + if (kvlist == NULL) { + printf("rte_kvargs_parse() error\n"); + goto fail; + } + if (rte_kvargs_count(kvlist, NULL) != 2) { + printf("invalid count value\n"); + goto fail; + } + if (rte_kvargs_count(kvlist, "foo") != 1) { + printf("invalid count value for 'foo'\n"); + goto fail; + } + if (rte_kvargs_count(kvlist, "check") != 1) { + printf("invalid count value for 'check'\n"); + goto fail; + } + rte_kvargs_free(kvlist); + return 0; fail: @@ -179,11 +213,11 @@ static int test_invalid_kvargs(void) const char *args_list[] = { "wrong-key=x", /* key not in valid_keys_list */ "foo=1,foo=", /* empty value */ - "foo=1,,foo=2", /* empty key/value */ "foo=1,foo", /* no value */ "foo=1,=2", /* no key */ "foo=[1,2", /* no closing bracket in value */ ",=", /* also test with a smiley */ + "foo=[", /* no value in list and no closing bracket */ NULL }; const char **args; const char *valid_keys_list[] = { "foo", "check", NULL }; @@ -197,8 +231,8 @@ static int test_invalid_kvargs(void) rte_kvargs_free(kvlist); goto fail; } - return 0; } + return 0; fail: printf("while processing <%s>", *args); diff --git a/dpdk/app/test/test_lpm_perf.c b/dpdk/app/test/test_lpm_perf.c index a2578fe90..489719c40 100644 --- a/dpdk/app/test/test_lpm_perf.c +++ b/dpdk/app/test/test_lpm_perf.c @@ -34,7 +34,7 @@ struct route_rule { uint8_t depth; }; -struct route_rule large_route_table[MAX_RULE_NUM]; +static struct route_rule large_route_table[MAX_RULE_NUM]; static uint32_t num_route_entries; #define NUM_ROUTE_ENTRIES num_route_entries diff --git a/dpdk/app/test/test_malloc.c b/dpdk/app/test/test_malloc.c index a16e28cc3..57f796f9e 100644 --- a/dpdk/app/test/test_malloc.c +++ b/dpdk/app/test/test_malloc.c @@ -746,6 +746,18 @@ test_malloc_bad_params(void) if (bad_ptr != NULL) goto err_return; + /* rte_malloc expected to return null with size will cause overflow */ + align = RTE_CACHE_LINE_SIZE; + size = (size_t)-8; + + bad_ptr = rte_malloc(type, size, align); + if (bad_ptr != NULL) + goto err_return; + + bad_ptr = rte_realloc(NULL, size, align); + if (bad_ptr != NULL) + goto err_return; + return 0; err_return: diff --git a/dpdk/app/test/test_mbuf.c b/dpdk/app/test/test_mbuf.c index 61ecffc18..a5bd1693b 100644 --- a/dpdk/app/test/test_mbuf.c +++ b/dpdk/app/test/test_mbuf.c @@ -1144,7 +1144,7 @@ test_refcnt_mbuf(void) tref += refcnt_lcore[slave]; if (tref != refcnt_lcore[master]) - rte_panic("refernced mbufs: %u, freed mbufs: %u\n", + rte_panic("referenced mbufs: %u, freed mbufs: %u\n", tref, refcnt_lcore[master]); rte_mempool_dump(stdout, refcnt_pool); @@ -2481,9 +2481,13 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) offset3 = rte_mbuf_dynfield_register_offset(&dynfield3, offsetof(struct rte_mbuf, dynfield1[1])); - if (offset3 != offsetof(struct rte_mbuf, dynfield1[1])) - GOTO_FAIL("failed to register dynamic field 3, offset=%d: %s", - offset3, strerror(errno)); + if (offset3 != offsetof(struct rte_mbuf, dynfield1[1])) { + if (rte_errno == EBUSY) + printf("mbuf test error skipped: dynfield is busy\n"); + else + GOTO_FAIL("failed to register dynamic field 3, offset=" + "%d: %s", offset3, strerror(errno)); + } printf("dynfield: offset=%d, offset2=%d, offset3=%d\n", offset, offset2, offset3); @@ -2519,7 +2523,7 @@ test_mbuf_dyn(struct rte_mempool *pktmbuf_pool) flag3 = rte_mbuf_dynflag_register_bitnum(&dynflag3, rte_bsf64(PKT_LAST_FREE)); if (flag3 != rte_bsf64(PKT_LAST_FREE)) - GOTO_FAIL("failed to register dynamic flag 3, flag2=%d: %s", + GOTO_FAIL("failed to register dynamic flag 3, flag3=%d: %s", flag3, strerror(errno)); printf("dynflag: flag=%d, flag2=%d, flag3=%d\n", flag, flag2, flag3); diff --git a/dpdk/app/test/test_pmd_perf.c b/dpdk/app/test/test_pmd_perf.c index d61be58bb..352cd4715 100644 --- a/dpdk/app/test/test_pmd_perf.c +++ b/dpdk/app/test/test_pmd_perf.c @@ -151,7 +151,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) "Port%d Link Up. Speed %u Mbps - %s\n", portid, link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex\n")); + ("full-duplex") : ("half-duplex")); if (link_mbps == 0) link_mbps = link.link_speed; } else diff --git a/dpdk/app/test/test_rcu_qsbr.c b/dpdk/app/test/test_rcu_qsbr.c index b60dc5099..5542b3c17 100644 --- a/dpdk/app/test/test_rcu_qsbr.c +++ b/dpdk/app/test/test_rcu_qsbr.c @@ -273,13 +273,13 @@ static int test_rcu_qsbr_start(void) { uint64_t token; - int i; + unsigned int i; printf("\nTest rte_rcu_qsbr_start()\n"); rte_rcu_qsbr_init(t[0], RTE_MAX_LCORE); - for (i = 0; i < 3; i++) + for (i = 0; i < num_cores; i++) rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]); token = rte_rcu_qsbr_start(t[0]); @@ -293,14 +293,18 @@ test_rcu_qsbr_check_reader(void *arg) { struct rte_rcu_qsbr *temp; uint8_t read_type = (uint8_t)((uintptr_t)arg); + unsigned int i; temp = t[read_type]; /* Update quiescent state counter */ - rte_rcu_qsbr_quiescent(temp, enabled_core_ids[0]); - rte_rcu_qsbr_quiescent(temp, enabled_core_ids[1]); - rte_rcu_qsbr_thread_unregister(temp, enabled_core_ids[2]); - rte_rcu_qsbr_quiescent(temp, enabled_core_ids[3]); + for (i = 0; i < num_cores; i++) { + if (i % 2 == 0) + rte_rcu_qsbr_quiescent(temp, enabled_core_ids[i]); + else + rte_rcu_qsbr_thread_unregister(temp, + enabled_core_ids[i]); + } return 0; } @@ -311,7 +315,8 @@ test_rcu_qsbr_check_reader(void *arg) static int test_rcu_qsbr_check(void) { - int i, ret; + int ret; + unsigned int i; uint64_t token; printf("\nTest rte_rcu_qsbr_check()\n"); @@ -329,7 +334,7 @@ test_rcu_qsbr_check(void) ret = rte_rcu_qsbr_check(t[0], token, true); TEST_RCU_QSBR_RETURN_IF_ERROR((ret == 0), "Blocking QSBR check"); - for (i = 0; i < 3; i++) + for (i = 0; i < num_cores; i++) rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]); ret = rte_rcu_qsbr_check(t[0], token, false); @@ -344,7 +349,7 @@ test_rcu_qsbr_check(void) /* Threads are offline, hence this should pass */ TEST_RCU_QSBR_RETURN_IF_ERROR((ret == 0), "Non-blocking QSBR check"); - for (i = 0; i < 3; i++) + for (i = 0; i < num_cores; i++) rte_rcu_qsbr_thread_unregister(t[0], enabled_core_ids[i]); ret = rte_rcu_qsbr_check(t[0], token, true); @@ -352,7 +357,7 @@ test_rcu_qsbr_check(void) rte_rcu_qsbr_init(t[0], RTE_MAX_LCORE); - for (i = 0; i < 4; i++) + for (i = 0; i < num_cores; i++) rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[i]); token = rte_rcu_qsbr_start(t[0]); @@ -591,7 +596,7 @@ test_rcu_qsbr_thread_offline(void) static int test_rcu_qsbr_dump(void) { - int i; + unsigned int i; printf("\nTest rte_rcu_qsbr_dump()\n"); @@ -608,7 +613,7 @@ test_rcu_qsbr_dump(void) rte_rcu_qsbr_thread_register(t[0], enabled_core_ids[0]); - for (i = 1; i < 3; i++) + for (i = 1; i < num_cores; i++) rte_rcu_qsbr_thread_register(t[1], enabled_core_ids[i]); rte_rcu_qsbr_dump(stdout, t[0]); @@ -758,7 +763,7 @@ test_rcu_qsbr_sw_sv_3qs(void) { uint64_t token[3]; uint32_t c; - int i; + int i, num_readers; int32_t pos[3]; writer_done = 0; @@ -781,7 +786,11 @@ test_rcu_qsbr_sw_sv_3qs(void) thread_info[0].ih = 0; /* Reader threads are launched */ - for (i = 0; i < 4; i++) + /* Keep the number of reader threads low to reduce + * the execution time. + */ + num_readers = num_cores < 4 ? num_cores : 4; + for (i = 0; i < num_readers; i++) rte_eal_remote_launch(test_rcu_qsbr_reader, &thread_info[0], enabled_core_ids[i]); @@ -814,7 +823,7 @@ test_rcu_qsbr_sw_sv_3qs(void) /* Check the quiescent state status */ rte_rcu_qsbr_check(t[0], token[0], true); - for (i = 0; i < 4; i++) { + for (i = 0; i < num_readers; i++) { c = hash_data[0][0][enabled_core_ids[i]]; if (c != COUNTER_VALUE && c != 0) { printf("Reader lcore %d did not complete #0 = %d\n", @@ -832,7 +841,7 @@ test_rcu_qsbr_sw_sv_3qs(void) /* Check the quiescent state status */ rte_rcu_qsbr_check(t[0], token[1], true); - for (i = 0; i < 4; i++) { + for (i = 0; i < num_readers; i++) { c = hash_data[0][3][enabled_core_ids[i]]; if (c != COUNTER_VALUE && c != 0) { printf("Reader lcore %d did not complete #3 = %d\n", @@ -850,7 +859,7 @@ test_rcu_qsbr_sw_sv_3qs(void) /* Check the quiescent state status */ rte_rcu_qsbr_check(t[0], token[2], true); - for (i = 0; i < 4; i++) { + for (i = 0; i < num_readers; i++) { c = hash_data[0][6][enabled_core_ids[i]]; if (c != COUNTER_VALUE && c != 0) { printf("Reader lcore %d did not complete #6 = %d\n", @@ -869,7 +878,7 @@ test_rcu_qsbr_sw_sv_3qs(void) writer_done = 1; /* Wait and check return value from reader threads */ - for (i = 0; i < 4; i++) + for (i = 0; i < num_readers; i++) if (rte_eal_wait_lcore(enabled_core_ids[i]) < 0) goto error; rte_hash_free(h[0]); @@ -899,6 +908,12 @@ test_rcu_qsbr_mw_mv_mqs(void) unsigned int i, j; unsigned int test_cores; + if (RTE_MAX_LCORE < 5 || num_cores < 4) { + printf("Not enough cores for %s, expecting at least 5\n", + __func__); + return TEST_SKIPPED; + } + writer_done = 0; test_cores = num_cores / 4; test_cores = test_cores * 4; @@ -984,11 +999,6 @@ test_rcu_qsbr_main(void) { uint16_t core_id; - if (rte_lcore_count() < 5) { - printf("Not enough cores for rcu_qsbr_autotest, expecting at least 5\n"); - return TEST_SKIPPED; - } - num_cores = 0; RTE_LCORE_FOREACH_SLAVE(core_id) { enabled_core_ids[num_cores] = core_id; diff --git a/dpdk/app/test/test_ring.c b/dpdk/app/test/test_ring.c index aaf1e70ad..4825c9e2e 100644 --- a/dpdk/app/test/test_ring.c +++ b/dpdk/app/test/test_ring.c @@ -696,7 +696,7 @@ test_ring_basic_ex(void) printf("%u ring entries are now free\n", rte_ring_free_count(rp)); - for (i = 0; i < RING_SIZE; i ++) { + for (i = 0; i < RING_SIZE - 1; i ++) { rte_ring_enqueue(rp, obj[i]); } @@ -705,7 +705,7 @@ test_ring_basic_ex(void) goto fail_test; } - for (i = 0; i < RING_SIZE; i ++) { + for (i = 0; i < RING_SIZE - 1; i ++) { rte_ring_dequeue(rp, &obj[i]); } diff --git a/dpdk/app/test/test_ring_perf.c b/dpdk/app/test/test_ring_perf.c index 70ee46ffe..3cf27965d 100644 --- a/dpdk/app/test/test_ring_perf.c +++ b/dpdk/app/test/test_ring_perf.c @@ -296,12 +296,13 @@ load_loop_fn(void *p) static int run_on_all_cores(struct rte_ring *r) { - uint64_t total = 0; + uint64_t total; struct thread_params param; unsigned int i, c; memset(¶m, 0, sizeof(struct thread_params)); for (i = 0; i < RTE_DIM(bulk_sizes); i++) { + total = 0; printf("\nBulk enq/dequeue count on size %u\n", bulk_sizes[i]); param.size = bulk_sizes[i]; param.r = r; diff --git a/dpdk/app/test/test_service_cores.c b/dpdk/app/test/test_service_cores.c index a922c7ddc..2a4978e29 100644 --- a/dpdk/app/test/test_service_cores.c +++ b/dpdk/app/test/test_service_cores.c @@ -114,6 +114,7 @@ unregister_all(void) } rte_service_lcore_reset_all(); + rte_eal_mp_wait_lcore(); return TEST_SUCCESS; } diff --git a/dpdk/app/test/test_table_pipeline.c b/dpdk/app/test/test_table_pipeline.c index 441338ac0..bc412c308 100644 --- a/dpdk/app/test/test_table_pipeline.c +++ b/dpdk/app/test/test_table_pipeline.c @@ -190,11 +190,13 @@ check_pipeline_invalid_params(void) goto fail; } - p = rte_pipeline_create(&pipeline_params_3); - if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid " - "socket\n", __func__); - goto fail; + if (rte_eal_has_hugepages()) { + p = rte_pipeline_create(&pipeline_params_3); + if (p != NULL) { + RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with " + "invalid socket\n", __func__); + goto fail; + } } /* Check pipeline consistency */ diff --git a/dpdk/buildtools/call-sphinx-build.py b/dpdk/buildtools/call-sphinx-build.py new file mode 100755 index 000000000..b9a3994e1 --- /dev/null +++ b/dpdk/buildtools/call-sphinx-build.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation +# + +import sys +import os +from os.path import join +from subprocess import run, PIPE +from distutils.version import StrictVersion + +(sphinx, src, dst) = sys.argv[1:] # assign parameters to variables + +# for sphinx version >= 1.7 add parallelism using "-j auto" +ver = run([sphinx, '--version'], stdout=PIPE).stdout.decode().split()[-1] +sphinx_cmd = [sphinx] +if StrictVersion(ver) >= StrictVersion('1.7'): + sphinx_cmd += ['-j', 'auto'] + +# find all the files sphinx will process so we can write them as dependencies +srcfiles = [] +for root, dirs, files in os.walk(src): + srcfiles.extend([join(root, f) for f in files]) + +# run sphinx, putting the html output in a "html" directory +process = run(sphinx_cmd + ['-b', 'html', src, join(dst, 'html')], check=True) +print(str(process.args) + ' Done OK') + +# create a gcc format .d file giving all the dependencies of this doc build +with open(join(dst, '.html.d'), 'w') as d: + d.write('html: ' + ' '.join(srcfiles) + '\n') diff --git a/dpdk/buildtools/meson.build b/dpdk/buildtools/meson.build index cd6f4c1af..ea13d9fc3 100644 --- a/dpdk/buildtools/meson.build +++ b/dpdk/buildtools/meson.build @@ -12,10 +12,12 @@ ldflags_ibverbs_static = find_program('options-ibverbs-static.sh') # set up map-to-def script using python, either built-in or external python3 = import('python').find_installation(required: false) if python3.found() - map_to_def_cmd = [python3, files('map_to_def.py')] + py3 = [python3] else - map_to_def_cmd = ['meson', 'runpython', files('map_to_def.py')] + py3 = ['meson', 'runpython'] endif +map_to_def_cmd = py3 + files('map_to_def.py') +sphinx_wrapper = py3 + files('call-sphinx-build.py') # stable ABI always starts with "DPDK_" is_experimental_cmd = [find_program('grep', 'findstr'), '^DPDK_'] diff --git a/dpdk/buildtools/options-ibverbs-static.sh b/dpdk/buildtools/options-ibverbs-static.sh index 0f285a343..0740a711f 100755 --- a/dpdk/buildtools/options-ibverbs-static.sh +++ b/dpdk/buildtools/options-ibverbs-static.sh @@ -9,6 +9,13 @@ # # PKG_CONFIG_PATH may be required to be set if libibverbs.pc is not installed. -pkg-config --libs-only-l --static libibverbs | +lib='libibverbs' +deps='pthread|nl' + +pkg-config --libs --static $lib | tr '[:space:]' '\n' | - sed -r '/^-l(pthread|nl)/! s,(^-l)(.*),\1:lib\2.a,' + sed -r "/^-l($deps)/! s,(^-l)(.*),\1:lib\2.a," | # explicit .a + sed -n '/^-[Ll]/p' | # extra link options may break with make + tac | + awk "/^-l:$lib.a/&&c++ {next} 1" | # drop first duplicates of main lib + tac diff --git a/dpdk/buildtools/pkg-config/meson.build b/dpdk/buildtools/pkg-config/meson.build new file mode 100644 index 000000000..5f1930428 --- /dev/null +++ b/dpdk/buildtools/pkg-config/meson.build @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation + +pkg = import('pkgconfig') +pkg_extra_cflags = ['-include', 'rte_config.h'] + machine_args +if is_freebsd + pkg_extra_cflags += ['-D__BSD_VISIBLE'] +endif + +# When calling pkg-config --static --libs, pkg-config will always output the +# regular libs first, and then the extra libs from Libs.private field, +# since the assumption is that those are additional dependencies for building +# statically that the .a files depend upon. The output order of .pc fields is: +# Libs Libs.private Requires Requires.private +# The fields Requires* are for package names. +# The flags of the DPDK libraries must be defined in Libs* fields. +# However, the DPDK drivers are linked only in static builds (Libs.private), +# and those need to come *before* the regular libraries (Libs field). +# This requirement is satisfied by moving the regular libs in a separate file +# included in the field Requires (after Libs.private). +# Another requirement is to allow linking dependencies as shared libraries, +# while linking static DPDK libraries and drivers. It is satisfied by +# listing the static files in Libs.private with the explicit syntax -l:libfoo.a. +# As a consequence, the regular DPDK libraries are already listed as static +# in the field Libs.private. The second occurences of DPDK libraries, +# included from Requires and used for shared library linkage case, +# are skipped in the case of static linkage thanks to the flag --as-needed. + + +pkg.generate(name: 'dpdk-libs', + filebase: 'libdpdk-libs', + description: '''Internal-only DPDK pkgconfig file. Not for direct use. +Use libdpdk.pc instead of this file to query DPDK compile/link arguments''', + version: meson.project_version(), + subdirs: [get_option('include_subdir_arch'), '.'], + extra_cflags: pkg_extra_cflags, + libraries: ['-Wl,--as-needed'] + dpdk_libraries, + libraries_private: dpdk_extra_ldflags) + +pkg.generate(name: 'DPDK', # main DPDK pkgconfig file + filebase: 'libdpdk', + version: meson.project_version(), + description: '''The Data Plane Development Kit (DPDK). +Note that CFLAGS might contain an -march flag higher than typical baseline. +This is required for a number of static inline functions in the public headers.''', + requires: ['libdpdk-libs', libbsd], # may need libbsd for string funcs + # if libbsd is not enabled, then this is blank + libraries_private: ['-Wl,--whole-archive'] + + dpdk_drivers + dpdk_static_libraries + + ['-Wl,--no-whole-archive'] +) + +# For static linking with dependencies as shared libraries, +# the internal static libraries must be flagged explicitly. +run_command(py3, 'set-static-linker-flags.py', check: true) diff --git a/dpdk/buildtools/pkg-config/set-static-linker-flags.py b/dpdk/buildtools/pkg-config/set-static-linker-flags.py new file mode 100644 index 000000000..2745db34c --- /dev/null +++ b/dpdk/buildtools/pkg-config/set-static-linker-flags.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Intel Corporation + +# Script to fix flags for static linking in pkgconfig files from meson +# Should be called from meson build itself +import os +import sys + + +def fix_ldflag(f): + if not f.startswith('-lrte_'): + return f + return '-l:lib' + f[2:] + '.a' + + +def fix_libs_private(line): + if not line.startswith('Libs.private'): + return line + ldflags = [fix_ldflag(flag) for flag in line.split()] + return ' '.join(ldflags) + '\n' + + +def process_pc_file(filepath): + print('Processing', filepath) + with open(filepath) as src: + lines = src.readlines() + with open(filepath, 'w') as dst: + dst.writelines([fix_libs_private(line) for line in lines]) + + +if 'MESON_BUILD_ROOT' not in os.environ: + print('This script must be called from a meson build environment') + sys.exit(1) +for root, dirs, files in os.walk(os.environ['MESON_BUILD_ROOT']): + pc_files = [f for f in files if f.endswith('.pc')] + for f in pc_files: + process_pc_file(os.path.join(root, f)) diff --git a/dpdk/buildtools/pmdinfogen/pmdinfogen.h b/dpdk/buildtools/pmdinfogen/pmdinfogen.h index c8a9e2136..467216d12 100644 --- a/dpdk/buildtools/pmdinfogen/pmdinfogen.h +++ b/dpdk/buildtools/pmdinfogen/pmdinfogen.h @@ -82,7 +82,7 @@ if ((fend) == ELFDATA2LSB) \ ___x = le##width##toh(x); \ else \ ___x = be##width##toh(x); \ - ___x; \ +___x; \ }) #define TO_NATIVE(fend, width, x) CONVERT_NATIVE(fend, width, x) diff --git a/dpdk/config/common_base b/dpdk/config/common_base index 2e0c72598..340614637 100644 --- a/dpdk/config/common_base +++ b/dpdk/config/common_base @@ -328,7 +328,6 @@ CONFIG_RTE_LIBRTE_ICE_PMD=y CONFIG_RTE_LIBRTE_ICE_DEBUG_RX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX=n CONFIG_RTE_LIBRTE_ICE_DEBUG_TX_FREE=n -CONFIG_RTE_LIBRTE_ICE_RX_ALLOW_BULK_ALLOC=y CONFIG_RTE_LIBRTE_ICE_16BYTE_RX_DESC=n # Compile burst-oriented IAVF PMD driver @@ -573,7 +572,6 @@ CONFIG_RTE_CRYPTO_MAX_DEVS=64 # Compile PMD for ARMv8 Crypto device # CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO=n -CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO_DEBUG=n # # Compile NXP CAAM JR crypto Driver diff --git a/dpdk/config/defconfig_arm-armv7a-linuxapp-gcc b/dpdk/config/defconfig_arm-armv7a-linuxapp-gcc index c91423f0e..749f9924d 100644 --- a/dpdk/config/defconfig_arm-armv7a-linuxapp-gcc +++ b/dpdk/config/defconfig_arm-armv7a-linuxapp-gcc @@ -45,7 +45,6 @@ CONFIG_RTE_LIBRTE_CXGBE_PMD=n CONFIG_RTE_LIBRTE_E1000_PMD=n CONFIG_RTE_LIBRTE_ENIC_PMD=n CONFIG_RTE_LIBRTE_FM10K_PMD=n -CONFIG_RTE_LIBRTE_I40E_PMD=n CONFIG_RTE_LIBRTE_IXGBE_PMD=n CONFIG_RTE_LIBRTE_MLX4_PMD=n CONFIG_RTE_LIBRTE_VMXNET3_PMD=n diff --git a/dpdk/config/defconfig_arm64-graviton2-linux-gcc b/dpdk/config/defconfig_arm64-graviton2-linux-gcc new file mode 120000 index 000000000..80ac94d54 --- /dev/null +++ b/dpdk/config/defconfig_arm64-graviton2-linux-gcc @@ -0,0 +1 @@ +defconfig_arm64-graviton2-linuxapp-gcc \ No newline at end of file diff --git a/dpdk/config/defconfig_arm64-graviton2-linuxapp-gcc b/dpdk/config/defconfig_arm64-graviton2-linuxapp-gcc new file mode 100644 index 000000000..e99fef307 --- /dev/null +++ b/dpdk/config/defconfig_arm64-graviton2-linuxapp-gcc @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) Amazon.com, Inc or its affiliates +# + +#include "defconfig_arm64-armv8a-linux-gcc" + +CONFIG_RTE_MACHINE="graviton2" +CONFIG_RTE_MAX_LCORE=64 +CONFIG_RTE_CACHE_LINE_SIZE=64 +CONFIG_RTE_MAX_MEM_MB=1048576 +CONFIG_RTE_MAX_NUMA_NODES=1 +CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n +CONFIG_RTE_LIBRTE_VHOST_NUMA=n diff --git a/dpdk/config/defconfig_graviton2 b/dpdk/config/defconfig_graviton2 new file mode 120000 index 000000000..80ac94d54 --- /dev/null +++ b/dpdk/config/defconfig_graviton2 @@ -0,0 +1 @@ +defconfig_arm64-graviton2-linuxapp-gcc \ No newline at end of file diff --git a/dpdk/config/meson.build b/dpdk/config/meson.build index 41747012d..bab00f148 100644 --- a/dpdk/config/meson.build +++ b/dpdk/config/meson.build @@ -14,6 +14,10 @@ foreach env:supported_exec_envs set_variable('is_' + env, exec_env == env) endforeach +# MS linker requires special treatment. +# TODO: use cc.get_linker_id() with Meson >= 0.54 +is_ms_linker = is_windows and (cc.get_id() == 'clang') + # set the major version, which might be used by drivers and libraries # depending on the configuration options pver = meson.project_version().split('.') @@ -50,9 +54,11 @@ eal_pmd_path = join_paths(get_option('prefix'), driver_install_path) # driver .so files often depend upon the bus drivers for their connect bus, # e.g. ixgbe depends on librte_bus_pci. This means that the bus drivers need # to be in the library path, so symlink the drivers from the main lib directory. -meson.add_install_script('../buildtools/symlink-drivers-solibs.sh', - get_option('libdir'), - pmd_subdir_opt) +if not is_windows + meson.add_install_script('../buildtools/symlink-drivers-solibs.sh', + get_option('libdir'), + pmd_subdir_opt) +endif # set the machine type and cflags for it if meson.is_cross_build() @@ -98,11 +104,15 @@ dpdk_conf.set('RTE_TOOLCHAIN_' + toolchain.to_upper(), 1) dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8) -add_project_link_arguments('-Wl,--no-as-needed', language: 'c') +if not is_windows + add_project_link_arguments('-Wl,--no-as-needed', language: 'c') +endif -# use pthreads -add_project_link_arguments('-pthread', language: 'c') -dpdk_extra_ldflags += '-pthread' +# use pthreads if available for the platform +if not is_ms_linker + add_project_link_arguments('-pthread', language: 'c') + dpdk_extra_ldflags += '-pthread' +endif # on some OS, maths functions are in a separate library if cc.find_library('m', required : false).found() @@ -136,6 +146,15 @@ if numa_dep.found() and cc.has_header('numaif.h') dpdk_extra_ldflags += '-lnuma' endif +has_libfdt = 0 +fdt_dep = cc.find_library('libfdt', required: false) +if fdt_dep.found() and cc.has_header('fdt.h') + dpdk_conf.set10('RTE_HAS_LIBFDT', true) + has_libfdt = 1 + add_project_link_arguments('-lfdt', language: 'c') + dpdk_extra_ldflags += '-lfdt' +endif + # check for libbsd libbsd = dependency('libbsd', required: false) if libbsd.found() @@ -143,11 +162,9 @@ if libbsd.found() endif # check for pcap -pcap_dep = dependency('pcap', required: false) -if pcap_dep.found() - # pcap got a pkg-config file only in 1.9.0 and before that meson uses - # an internal pcap-config finder, which is not compatible with - # cross-compilation, so try to fallback to find_library +pcap_dep = dependency('libpcap', required: false, method: 'pkg-config') +if not pcap_dep.found() + # pcap got a pkg-config file only in 1.9.0 pcap_dep = cc.find_library('pcap', required: false) endif if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) @@ -166,6 +183,7 @@ warning_flags = [ # additional warnings in alphabetical order '-Wcast-qual', '-Wdeprecated', + '-Wformat', '-Wformat-nonliteral', '-Wformat-security', '-Wmissing-declarations', @@ -183,6 +201,10 @@ warning_flags = [ '-Wno-packed-not-aligned', '-Wno-missing-field-initializers' ] +if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0') +# FIXME: Bugzilla 396 + warning_flags += '-Wno-zero-length-bounds' +endif if not dpdk_conf.get('RTE_ARCH_64') # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!! warning_flags += '-Wno-pointer-to-int-cast' @@ -202,6 +224,11 @@ dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true) +if dpdk_conf.get('RTE_ARCH_64') + dpdk_conf.set('RTE_MAX_MEM_MB', 524288) +else # for 32-bit we need smaller reserved memory areas + dpdk_conf.set('RTE_MAX_MEM_MB', 2048) +endif compile_time_cpuflags = [] @@ -231,6 +258,16 @@ if is_freebsd add_project_arguments('-D__BSD_VISIBLE', language: 'c') endif +if is_windows + # Minimum supported API is Windows 7. + add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c') + + # Use MinGW-w64 stdio, because DPDK assumes ANSI-compliant formatting. + if cc.get_id() == 'gcc' + add_project_arguments('-D__USE_MINGW_ANSI_STDIO', language: 'c') + endif +endif + if get_option('b_lto') if cc.has_argument('-ffat-lto-objects') add_project_arguments('-ffat-lto-objects', language: 'c') diff --git a/dpdk/config/rte_config.h b/dpdk/config/rte_config.h index d30786bc0..0f9dae3ba 100644 --- a/dpdk/config/rte_config.h +++ b/dpdk/config/rte_config.h @@ -38,7 +38,6 @@ #define RTE_MAX_MEM_MB_PER_LIST 32768 #define RTE_MAX_MEMSEG_PER_TYPE 32768 #define RTE_MAX_MEM_MB_PER_TYPE 65536 -#define RTE_MAX_MEM_MB 524288 #define RTE_MAX_MEMZONE 2560 #define RTE_MAX_TAILQ 32 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO @@ -100,6 +99,9 @@ /****** driver defines ********/ +/* Packet prefetching in PMDs */ +#define RTE_PMD_PACKET_PREFETCH 1 + /* QuickAssist device */ /* Max. number of QuickAssist devices which can be attached */ #define RTE_PMD_QAT_MAX_PCI_DEVICES 48 diff --git a/dpdk/devtools/check-forbidden-tokens.awk b/dpdk/devtools/check-forbidden-tokens.awk index 8c89de3d4..61ba707c9 100755 --- a/dpdk/devtools/check-forbidden-tokens.awk +++ b/dpdk/devtools/check-forbidden-tokens.awk @@ -54,7 +54,7 @@ BEGIN { } for (i in deny_folders) { re = "^\\+\\+\\+ b/" deny_folders[i]; - if ($0 ~ deny_folders[i]) { + if ($0 ~ re) { in_file = 1 last_file = $0 } @@ -62,7 +62,7 @@ BEGIN { } END { if (count > 0) { - print "Warning in " substr(last_file,6) ":" + print "Warning in " substr(last_file,7) ":" print MESSAGE exit RET_ON_FAIL } diff --git a/dpdk/devtools/check-symbol-change.sh b/dpdk/devtools/check-symbol-change.sh index c5434f3bb..ed2178e36 100755 --- a/dpdk/devtools/check-symbol-change.sh +++ b/dpdk/devtools/check-symbol-change.sh @@ -17,13 +17,11 @@ build_map_changes() # map files are altered, and all section/symbol names # appearing between a triggering of this rule and the # next trigger of this rule are associated with this file - /[-+] a\/.*\.map/ {map=$2; in_map=1} + /[-+] [ab]\/.*\.map/ {map=$2; in_map=1; next} - # Same pattern as above, only it matches on anything that - # does not end in 'map', indicating we have left the map chunk. - # When we hit this, turn off the in_map variable, which - # supresses the subordonate rules below - /[-+] a\/.*\.[^map]/ {in_map=0} + # The previous rule catches all .map files, anything else + # indicates we left the map chunk. + /[-+] [ab]\// {in_map=0} # Triggering this rule, which starts a line and ends it # with a { identifies a versioned section. The section name is diff --git a/dpdk/devtools/checkpatches.sh b/dpdk/devtools/checkpatches.sh index b16bace92..9902e2a9b 100755 --- a/dpdk/devtools/checkpatches.sh +++ b/dpdk/devtools/checkpatches.sh @@ -70,6 +70,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # links must prefer https over http + awk -v FOLDERS='doc' \ + -v EXPRESSIONS='http://.*dpdk.org' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using non https link to dpdk.org' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + return $res } diff --git a/dpdk/devtools/test-meson-builds.sh b/dpdk/devtools/test-meson-builds.sh index 688567714..8678a3d82 100755 --- a/dpdk/devtools/test-meson-builds.sh +++ b/dpdk/devtools/test-meson-builds.sh @@ -38,20 +38,21 @@ else fi default_path=$PATH -default_pkgpath=$PKG_CONFIG_PATH default_cppflags=$CPPFLAGS default_cflags=$CFLAGS default_ldflags=$LDFLAGS +default_meson_options=$DPDK_MESON_OPTIONS load_env () # { targetcc=$1 + # reset variables before target-specific config export PATH=$default_path - export PKG_CONFIG_PATH=$default_pkgpath + unset PKG_CONFIG_PATH # global default makes no sense export CPPFLAGS=$default_cppflags export CFLAGS=$default_cflags export LDFLAGS=$default_ldflags - unset DPDK_MESON_OPTIONS + export DPDK_MESON_OPTIONS=$default_meson_options command -v $targetcc >/dev/null 2>&1 || return 1 DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p') . $srcdir/devtools/load-devel-config @@ -134,19 +135,17 @@ done # Test installation of the x86-default target, to be used for checking # the sample apps build using the pkg-config file for cflags and libs +load_env cc build_path=$(readlink -f $builds_dir/build-x86-default) export DESTDIR=$build_path/install-root $ninja_cmd -C $build_path install - -load_env cc pc_file=$(find $DESTDIR -name libdpdk.pc) export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH - # if pkg-config defines the necessary flags, test building some examples if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then export PKGCONF="pkg-config --define-prefix" for example in cmdline helloworld l2fwd l3fwd skeleton timer; do echo "## Building $example" - $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean all + $MAKE -C $DESTDIR/usr/local/share/dpdk/examples/$example clean shared static done fi diff --git a/dpdk/doc/api/doxy-api-index.md b/dpdk/doc/api/doxy-api-index.md index dff496be0..5568dbc61 100644 --- a/dpdk/doc/api/doxy-api-index.md +++ b/dpdk/doc/api/doxy-api-index.md @@ -1,4 +1,4 @@ -API {#index} +API ===