Version in base suite: 18.11.5-1~deb10u1 Base version: dpdk_18.11.5-1~deb10u1 Target version: dpdk_18.11.6-1~deb10u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/d/dpdk/dpdk_18.11.5-1~deb10u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/d/dpdk/dpdk_18.11.6-1~deb10u1.dsc .ci/linux-build.sh | 4 .ci/linux-setup.sh | 2 .travis.yml | 7 app/proc-info/main.c | 36 app/test-crypto-perf/cperf_test_verify.c | 14 app/test-eventdev/test_perf_common.c | 10 app/test-eventdev/test_pipeline_common.c | 8 app/test-pmd/cmdline.c | 139 -- app/test-pmd/config.c | 10 app/test-pmd/csumonly.c | 3 app/test-pmd/parameters.c | 11 app/test-pmd/testpmd.c | 9 buildtools/check-experimental-syms.sh | 4 buildtools/pmdinfogen/meson.build | 5 config/common_base | 1 config/meson.build | 15 debian/.gitlab-ci.yml | 3 debian/changelog | 27 debian/control | 3 debian/dpdk-dev.lintian-overrides | 13 debian/dpdk.lintian-overrides | 6 debian/libdpdk-dev.lintian-overrides | 7 debian/librte-eal18.11.symbols | 1 debian/librte-gro18.11.symbols | 8 debian/patches/0004-build-bump-minimum-Meson-version-to-0.47.1.patch | 2 debian/patches/0005-build-use-dependency-instead-of-find_library.patch | 45 debian/patches/0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch | 6 debian/patches/0008-Revert-common-octeontx-add-missing-public-symbol.patch | 16 debian/patches/avoid-as-needed-as-it-causes-overlinking.patch | 41 debian/patches/series | 2 debian/rules | 2 devtools/checkpatches.sh | 26 devtools/test-null.sh | 1 doc/guides/contributing/coding_style.rst | 8 doc/guides/contributing/versioning.rst | 4 doc/guides/cryptodevs/aesni_gcm.rst | 3 doc/guides/cryptodevs/aesni_mb.rst | 2 doc/guides/cryptodevs/ccp.rst | 32 doc/guides/cryptodevs/dpaa_sec.rst | 6 doc/guides/cryptodevs/qat.rst | 4 doc/guides/cryptodevs/zuc.rst | 2 doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst | 16 doc/guides/linux_gsg/nic_perf_intel_platform.rst | 2 doc/guides/nics/fm10k.rst | 6 doc/guides/nics/liquidio.rst | 4 doc/guides/nics/octeontx.rst | 4 doc/guides/nics/tap.rst | 6 doc/guides/nics/thunderx.rst | 4 doc/guides/nics/virtio.rst | 18 doc/guides/prog_guide/env_abstraction_layer.rst | 2 doc/guides/prog_guide/event_timer_adapter.rst | 5 doc/guides/prog_guide/generic_segmentation_offload_lib.rst | 2 doc/guides/prog_guide/kernel_nic_interface.rst | 2 doc/guides/prog_guide/packet_classif_access_ctrl.rst | 4 doc/guides/prog_guide/rte_flow.rst | 2 doc/guides/prog_guide/rte_security.rst | 4 doc/guides/prog_guide/switch_representation.rst | 6 doc/guides/rel_notes/release_17_11.rst | 2 doc/guides/rel_notes/release_18_02.rst | 2 doc/guides/rel_notes/release_18_11.rst | 441 +++++++ doc/guides/sample_app_ug/ethtool.rst | 2 doc/guides/sample_app_ug/intro.rst | 6 doc/guides/sample_app_ug/l2_forward_crypto.rst | 2 doc/guides/sample_app_ug/performance_thread.rst | 2 doc/guides/testpmd_app_ug/run_app.rst | 6 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 98 - doc/guides/tools/testbbdev.rst | 3 drivers/bus/dpaa/dpaa_bus.c | 4 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 2 drivers/bus/fslmc/qbman/qbman_portal.c | 2 drivers/bus/fslmc/qbman/qbman_portal.h | 2 drivers/bus/pci/Makefile | 2 drivers/bus/pci/linux/pci.c | 13 drivers/bus/pci/linux/pci_uio.c | 2 drivers/bus/pci/linux/pci_vfio.c | 13 drivers/common/cpt/cpt_ucode.h | 3 drivers/common/dpaax/dpaax_iova_table.c | 7 drivers/common/dpaax/dpaax_iova_table.h | 2 drivers/common/octeontx/rte_common_octeontx_version.map | 1 drivers/compress/isal/meson.build | 1 drivers/compress/octeontx/include/zip_regs.h | 8 drivers/compress/octeontx/otx_zip.h | 2 drivers/compress/octeontx/otx_zip_pmd.c | 2 drivers/crypto/armv8/rte_armv8_pmd.c | 1 drivers/crypto/ccp/ccp_crypto.c | 24 drivers/crypto/ccp/ccp_crypto.h | 7 drivers/crypto/ccp/ccp_dev.h | 2 drivers/crypto/ccp/ccp_pmd_ops.c | 28 drivers/crypto/ccp/ccp_pmd_private.h | 6 drivers/crypto/ccp/rte_ccp_pmd.c | 57 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 drivers/crypto/dpaa_sec/dpaa_sec.c | 11 drivers/crypto/mvsam/rte_mrvl_pmd.c | 1 drivers/crypto/null/null_crypto_pmd.c | 1 drivers/crypto/null/null_crypto_pmd_private.h | 2 drivers/crypto/octeontx/otx_cryptodev.c | 1 drivers/crypto/openssl/rte_openssl_pmd.c | 35 drivers/crypto/qat/qat_sym.c | 5 drivers/crypto/qat/qat_sym_capabilities.h | 6 drivers/crypto/virtio/virtio_pci.c | 4 drivers/crypto/virtio/virtio_pci.h | 6 drivers/event/dpaa/dpaa_eventdev.c | 1 drivers/event/dpaa/dpaa_eventdev.h | 2 drivers/event/dpaa2/dpaa2_eventdev.c | 7 drivers/event/octeontx/ssovf_worker.h | 17 drivers/event/opdl/opdl_test.c | 3 drivers/event/sw/sw_evdev_xstats.c | 5 drivers/net/af_packet/rte_eth_af_packet.c | 14 drivers/net/atlantic/atl_ethdev.c | 7 drivers/net/atlantic/atl_types.h | 3 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 73 - drivers/net/axgbe/axgbe_phy_impl.c | 6 drivers/net/bnxt/bnxt.h | 60 drivers/net/bnxt/bnxt_cpr.c | 4 drivers/net/bnxt/bnxt_ethdev.c | 625 ++++------ drivers/net/bnxt/bnxt_filter.c | 1 drivers/net/bnxt/bnxt_flow.c | 21 drivers/net/bnxt/bnxt_hwrm.c | 162 +- drivers/net/bnxt/bnxt_hwrm.h | 3 drivers/net/bnxt/bnxt_irq.c | 2 drivers/net/bnxt/bnxt_irq.h | 1 drivers/net/bnxt/bnxt_ring.c | 12 drivers/net/bnxt/bnxt_rxq.c | 104 + drivers/net/bnxt/bnxt_rxq.h | 2 drivers/net/bnxt/bnxt_rxr.c | 50 drivers/net/bnxt/bnxt_stats.c | 63 - drivers/net/bnxt/bnxt_txq.c | 8 drivers/net/bnxt/bnxt_txq.h | 1 drivers/net/bnxt/bnxt_txr.c | 6 drivers/net/bnxt/bnxt_util.c | 11 drivers/net/bnxt/bnxt_util.h | 1 drivers/net/bonding/rte_eth_bond_8023ad.c | 58 drivers/net/bonding/rte_eth_bond_args.c | 5 drivers/net/bonding/rte_eth_bond_pmd.c | 297 +--- drivers/net/cxgbe/base/adapter.h | 2 drivers/net/cxgbe/cxgbe_ethdev.c | 18 drivers/net/cxgbe/cxgbe_filter.c | 219 +-- drivers/net/cxgbe/cxgbe_filter.h | 22 drivers/net/cxgbe/cxgbe_flow.c | 101 + drivers/net/cxgbe/cxgbe_main.c | 12 drivers/net/cxgbe/l2t.c | 3 drivers/net/cxgbe/l2t.h | 3 drivers/net/cxgbe/sge.c | 1 drivers/net/dpaa2/dpaa2_ethdev.c | 2 drivers/net/dpaa2/dpaa2_rxtx.c | 58 drivers/net/dpaa2/mc/dpkg.c | 5 drivers/net/e1000/e1000_ethdev.h | 16 drivers/net/e1000/em_ethdev.c | 21 drivers/net/e1000/em_rxtx.c | 110 + drivers/net/e1000/igb_ethdev.c | 12 drivers/net/e1000/igb_flow.c | 9 drivers/net/enetc/base/enetc_hw.h | 3 drivers/net/enetc/enetc_ethdev.c | 8 drivers/net/enic/Makefile | 2 drivers/net/enic/enic.h | 8 drivers/net/enic/enic_ethdev.c | 15 drivers/net/enic/enic_main.c | 52 drivers/net/enic/enic_rxtx_vec_avx2.c | 5 drivers/net/enic/meson.build | 2 drivers/net/fm10k/fm10k_rxtx_vec.c | 11 drivers/net/i40e/i40e_ethdev.c | 4 drivers/net/i40e/i40e_ethdev_vf.c | 42 drivers/net/i40e/i40e_flow.c | 38 drivers/net/i40e/i40e_rxtx.c | 7 drivers/net/i40e/i40e_rxtx_vec_neon.c | 5 drivers/net/ifc/ifcvf_vdpa.c | 8 drivers/net/ixgbe/ixgbe_ethdev.c | 174 ++ drivers/net/ixgbe/ixgbe_ethdev.h | 20 drivers/net/ixgbe/ixgbe_flow.c | 2 drivers/net/ixgbe/ixgbe_pf.c | 1 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 70 + drivers/net/ixgbe/rte_pmd_ixgbe.c | 126 -- drivers/net/mlx4/Makefile | 8 drivers/net/mlx4/meson.build | 18 drivers/net/mlx4/mlx4_utils.h | 15 drivers/net/mlx5/Makefile | 8 drivers/net/mlx5/meson.build | 17 drivers/net/mlx5/mlx5.c | 1 drivers/net/mlx5/mlx5_flow.c | 44 drivers/net/mlx5/mlx5_flow.h | 8 drivers/net/mlx5/mlx5_flow_dv.c | 27 drivers/net/mlx5/mlx5_flow_tcf.c | 8 drivers/net/mlx5/mlx5_flow_verbs.c | 27 drivers/net/mlx5/mlx5_rxq.c | 34 drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 2 drivers/net/mlx5/mlx5_utils.h | 5 drivers/net/null/rte_eth_null.c | 7 drivers/net/pcap/meson.build | 6 drivers/net/qede/Makefile | 1 drivers/net/qede/base/ecore_chain.h | 84 - drivers/net/qede/meson.build | 2 drivers/net/qede/qede_ethdev.c | 355 ++--- drivers/net/qede/qede_ethdev.h | 6 drivers/net/qede/qede_filter.c | 5 drivers/net/qede/qede_rxtx.c | 367 ++++- drivers/net/qede/qede_rxtx.h | 26 drivers/net/sfc/sfc_ev.c | 2 drivers/net/sfc/sfc_flow.c | 4 drivers/net/szedata2/meson.build | 2 drivers/net/tap/rte_eth_tap.c | 7 drivers/net/vhost/rte_eth_vhost.c | 4 drivers/net/virtio/virtio_ethdev.c | 14 drivers/net/virtio/virtio_ethdev.h | 3 drivers/net/virtio/virtio_rxtx.c | 14 drivers/net/virtio/virtio_rxtx.h | 2 drivers/net/virtio/virtio_rxtx_simple_neon.c | 10 drivers/net/virtio/virtio_rxtx_simple_sse.c | 10 drivers/net/virtio/virtio_user/virtio_user_dev.c | 10 drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 9 examples/bbdev_app/Makefile | 10 examples/bond/Makefile | 10 examples/cmdline/Makefile | 10 examples/distributor/Makefile | 10 examples/ethtool/lib/rte_ethtool.c | 2 examples/eventdev_pipeline/Makefile | 10 examples/exception_path/Makefile | 10 examples/fips_validation/Makefile | 10 examples/fips_validation/fips_validation_tdes.c | 2 examples/fips_validation/main.c | 60 examples/flow_classify/Makefile | 10 examples/flow_filtering/Makefile | 10 examples/helloworld/Makefile | 10 examples/ip_fragmentation/Makefile | 10 examples/ip_pipeline/Makefile | 10 examples/ip_reassembly/Makefile | 10 examples/ipsec-secgw/Makefile | 10 examples/ipsec-secgw/ep0.cfg | 8 examples/ipsec-secgw/ep1.cfg | 12 examples/ipsec-secgw/ipsec-secgw.c | 1 examples/ipsec-secgw/ipsec.c | 8 examples/ipsec-secgw/sa.c | 4 examples/ipv4_multicast/Makefile | 10 examples/kni/Makefile | 10 examples/kni/main.c | 1 examples/l2fwd-cat/Makefile | 10 examples/l2fwd-crypto/Makefile | 10 examples/l2fwd-jobstats/Makefile | 10 examples/l2fwd-keepalive/Makefile | 10 examples/l2fwd/Makefile | 10 examples/l3fwd-acl/Makefile | 10 examples/l3fwd-power/Makefile | 10 examples/l3fwd-power/main.c | 2 examples/l3fwd-vf/Makefile | 10 examples/l3fwd/Makefile | 10 examples/link_status_interrupt/Makefile | 10 examples/load_balancer/Makefile | 10 examples/multi_process/client_server_mp/mp_client/client.c | 18 examples/multi_process/client_server_mp/mp_server/args.c | 40 examples/multi_process/client_server_mp/mp_server/args.h | 2 examples/multi_process/client_server_mp/mp_server/init.c | 7 examples/packet_ordering/Makefile | 10 examples/ptpclient/Makefile | 10 examples/qos_meter/Makefile | 10 examples/qos_sched/Makefile | 10 examples/rxtx_callbacks/Makefile | 10 examples/service_cores/Makefile | 10 examples/skeleton/Makefile | 10 examples/tep_termination/Makefile | 10 examples/timer/Makefile | 10 examples/vhost/Makefile | 10 examples/vhost_scsi/Makefile | 8 examples/vm_power_manager/channel_monitor.c | 12 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 2 examples/vm_power_manager/oob_monitor_x86.c | 34 examples/vm_power_manager/power_manager.c | 3 examples/vm_power_manager/power_manager.h | 12 examples/vmdq/Makefile | 10 examples/vmdq_dcb/Makefile | 10 kernel/linux/kni/ethtool/igb/e1000_82575.c | 3 kernel/linux/kni/ethtool/igb/e1000_mbx.c | 1 kernel/linux/kni/ethtool/igb/e1000_phy.c | 1 kernel/linux/kni/ethtool/igb/igb_ethtool.c | 4 kernel/linux/kni/ethtool/igb/igb_main.c | 4 kernel/linux/kni/ethtool/igb/igb_param.c | 1 kernel/linux/kni/ethtool/ixgbe/ixgbe_82599.c | 2 kernel/linux/kni/ethtool/ixgbe/ixgbe_common.c | 1 kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c | 1 kernel/linux/kni/ethtool/ixgbe/ixgbe_main.c | 4 lib/Makefile | 2 lib/librte_compat/rte_compat.h | 4 lib/librte_cryptodev/rte_cryptodev.c | 44 lib/librte_cryptodev/rte_cryptodev_pmd.h | 1 lib/librte_distributor/meson.build | 5 lib/librte_distributor/rte_distributor.c | 68 - lib/librte_distributor/rte_distributor_v20.c | 59 lib/librte_eal/bsdapp/eal/eal.c | 5 lib/librte_eal/bsdapp/eal/eal_interrupts.c | 9 lib/librte_eal/common/eal_common_lcore.c | 9 lib/librte_eal/common/eal_common_log.c | 2 lib/librte_eal/common/eal_common_proc.c | 4 lib/librte_eal/common/eal_hugepages.h | 2 lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h | 2 lib/librte_eal/common/include/arch/x86/rte_memcpy.h | 18 lib/librte_eal/common/include/rte_dev.h | 58 lib/librte_eal/common/include/rte_interrupts.h | 21 lib/librte_eal/common/include/rte_version.h | 2 lib/librte_eal/common/malloc_elem.c | 9 lib/librte_eal/common/meson.build | 3 lib/librte_eal/common/rte_malloc.c | 3 lib/librte_eal/common/rte_reciprocal.c | 7 lib/librte_eal/common/rte_service.c | 27 lib/librte_eal/linuxapp/eal/eal_interrupts.c | 82 + lib/librte_eal/linuxapp/eal/eal_memory.c | 2 lib/librte_eal/linuxapp/eal/eal_vfio.c | 16 lib/librte_eal/rte_eal_version.map | 1 lib/librte_efd/rte_efd.c | 2 lib/librte_ethdev/rte_eth_ctrl.h | 2 lib/librte_ethdev/rte_ethdev.c | 13 lib/librte_ethdev/rte_ethdev.h | 12 lib/librte_ethdev/rte_flow.c | 165 ++ lib/librte_eventdev/rte_event_timer_adapter.c | 8 lib/librte_eventdev/rte_eventdev.c | 4 lib/librte_mempool/rte_mempool.c | 17 lib/librte_port/meson.build | 4 lib/librte_power/guest_channel.c | 12 lib/librte_power/power_acpi_cpufreq.c | 7 lib/librte_security/rte_security.h | 12 lib/librte_vhost/rte_vhost.h | 2 lib/librte_vhost/socket.c | 10 lib/librte_vhost/vhost.c | 258 +++- lib/librte_vhost/vhost.h | 184 +- lib/librte_vhost/vhost_user.c | 151 +- lib/librte_vhost/virtio_net.c | 203 +-- meson.build | 2 meson_options.txt | 2 mk/rte.app.mk | 4 mk/toolchain/gcc/rte.toolchain-compat.mk | 2 pkg/dpdk.spec | 2 test/test/process.h | 51 test/test/test_cryptodev.c | 83 - test/test/test_distributor.c | 6 test/test/test_distributor_perf.c | 2 test/test/test_efd.c | 2 test/test/test_efd_perf.c | 6 test/test/test_hash_perf.c | 12 test/test/test_hash_readwrite_lf.c | 8 test/test/test_interrupts.c | 10 test/test/test_link_bonding.c | 13 test/test/test_lpm_perf.c | 4 test/test/test_mbuf.c | 3 test/test/test_member_perf.c | 16 test/test/test_service_cores.c | 2 usertools/dpdk-pmdinfo.py | 65 - usertools/dpdk-telemetry-client.py | 14 345 files changed, 4998 insertions(+), 2982 deletions(-) diff -Nru dpdk-18.11.5/.ci/linux-build.sh dpdk-18.11.6/.ci/linux-build.sh --- dpdk-18.11.5/.ci/linux-build.sh 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/.ci/linux-build.sh 2020-01-31 09:55:30.000000000 +0000 @@ -19,6 +19,10 @@ OPTS="$OPTS --cross-file config/arm/arm64_armv8_linuxapp_gcc" fi +if [ "$BUILD_DOCS" = "1" ]; then + OPTS="$OPTS -Denable_docs=true" +fi + OPTS="$OPTS --default-library=$DEF_LIB" meson build --werror -Dexamples=all $OPTS ninja -C build diff -Nru dpdk-18.11.5/.ci/linux-setup.sh dpdk-18.11.6/.ci/linux-setup.sh --- dpdk-18.11.5/.ci/linux-setup.sh 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/.ci/linux-setup.sh 2020-01-31 09:55:30.000000000 +0000 @@ -1,3 +1,3 @@ #!/bin/sh -python3 -m pip install --upgrade meson --user +python3 -m pip install --upgrade 'meson==0.47.1' --user diff -Nru dpdk-18.11.5/.travis.yml dpdk-18.11.6/.travis.yml --- dpdk-18.11.5/.travis.yml 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/.travis.yml 2020-01-31 09:55:30.000000000 +0000 @@ -23,6 +23,9 @@ - *required_packages - [libbsd-dev, libpcap-dev, libcrypto++-dev, libjansson4] +doc_packages: &doc_packages + - [doxygen, graphviz, python3-sphinx] + before_install: ./.ci/${TRAVIS_OS_NAME}-setup.sh env: @@ -51,12 +54,13 @@ apt: packages: - *extra_packages - - env: DEF_LIB="shared" EXTRA_PACKAGES=1 + - env: DEF_LIB="shared" EXTRA_PACKAGES=1 BUILD_DOCS=1 compiler: gcc addons: apt: packages: - *extra_packages + - *doc_packages - env: DEF_LIB="static" OPTS="-Denable_kmods=false" EXTRA_PACKAGES=1 compiler: gcc addons: @@ -81,6 +85,7 @@ apt: packages: - *extra_packages + - *doc_packages - env: DEF_LIB="static" OPTS="-Denable_kmods=false" EXTRA_PACKAGES=1 compiler: clang addons: diff -Nru dpdk-18.11.5/app/proc-info/main.c dpdk-18.11.6/app/proc-info/main.c --- dpdk-18.11.5/app/proc-info/main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/proc-info/main.c 2020-01-31 09:55:30.000000000 +0000 @@ -167,7 +167,7 @@ int err = gethostname(host_id, MAX_LONG_OPT_SZ-1); if (err) - strcpy(host_id, "unknown"); + strlcpy(host_id, "unknown", sizeof(host_id)); } return 0; @@ -334,50 +334,50 @@ if ((type_end != NULL) && (strncmp(cnt_name, "rx_", strlen("rx_")) == 0)) { if (strncmp(type_end, "_errors", strlen("_errors")) == 0) - strncpy(cnt_type, "if_rx_errors", cnt_type_len); + strlcpy(cnt_type, "if_rx_errors", cnt_type_len); else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0) - strncpy(cnt_type, "if_rx_dropped", cnt_type_len); + strlcpy(cnt_type, "if_rx_dropped", cnt_type_len); else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0) - strncpy(cnt_type, "if_rx_octets", cnt_type_len); + strlcpy(cnt_type, "if_rx_octets", cnt_type_len); else if (strncmp(type_end, "_packets", strlen("_packets")) == 0) - strncpy(cnt_type, "if_rx_packets", cnt_type_len); + strlcpy(cnt_type, "if_rx_packets", cnt_type_len); else if (strncmp(type_end, "_placement", strlen("_placement")) == 0) - strncpy(cnt_type, "if_rx_errors", cnt_type_len); + strlcpy(cnt_type, "if_rx_errors", cnt_type_len); else if (strncmp(type_end, "_buff", strlen("_buff")) == 0) - strncpy(cnt_type, "if_rx_errors", cnt_type_len); + strlcpy(cnt_type, "if_rx_errors", cnt_type_len); else /* Does not fit obvious type: use a more generic one */ - strncpy(cnt_type, "derive", cnt_type_len); + strlcpy(cnt_type, "derive", cnt_type_len); } else if ((type_end != NULL) && (strncmp(cnt_name, "tx_", strlen("tx_"))) == 0) { if (strncmp(type_end, "_errors", strlen("_errors")) == 0) - strncpy(cnt_type, "if_tx_errors", cnt_type_len); + strlcpy(cnt_type, "if_tx_errors", cnt_type_len); else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0) - strncpy(cnt_type, "if_tx_dropped", cnt_type_len); + strlcpy(cnt_type, "if_tx_dropped", cnt_type_len); else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0) - strncpy(cnt_type, "if_tx_octets", cnt_type_len); + strlcpy(cnt_type, "if_tx_octets", cnt_type_len); else if (strncmp(type_end, "_packets", strlen("_packets")) == 0) - strncpy(cnt_type, "if_tx_packets", cnt_type_len); + strlcpy(cnt_type, "if_tx_packets", cnt_type_len); else /* Does not fit obvious type: use a more generic one */ - strncpy(cnt_type, "derive", cnt_type_len); + strlcpy(cnt_type, "derive", cnt_type_len); } else if ((type_end != NULL) && (strncmp(cnt_name, "flow_", strlen("flow_"))) == 0) { if (strncmp(type_end, "_filters", strlen("_filters")) == 0) - strncpy(cnt_type, "operations", cnt_type_len); + strlcpy(cnt_type, "operations", cnt_type_len); else if (strncmp(type_end, "_errors", strlen("_errors")) == 0) - strncpy(cnt_type, "errors", cnt_type_len); + strlcpy(cnt_type, "errors", cnt_type_len); else if (strncmp(type_end, "_filters", strlen("_filters")) == 0) - strncpy(cnt_type, "filter_result", cnt_type_len); + strlcpy(cnt_type, "filter_result", cnt_type_len); } else if ((type_end != NULL) && (strncmp(cnt_name, "mac_", strlen("mac_"))) == 0) { if (strncmp(type_end, "_errors", strlen("_errors")) == 0) - strncpy(cnt_type, "errors", cnt_type_len); + strlcpy(cnt_type, "errors", cnt_type_len); } else { /* Does not fit obvious type, or strrchr error: */ /* use a more generic type */ - strncpy(cnt_type, "derive", cnt_type_len); + strlcpy(cnt_type, "derive", cnt_type_len); } } diff -Nru dpdk-18.11.5/app/test-crypto-perf/cperf_test_verify.c dpdk-18.11.6/app/test-crypto-perf/cperf_test_verify.c --- dpdk-18.11.5/app/test-crypto-perf/cperf_test_verify.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-crypto-perf/cperf_test_verify.c 2020-01-31 09:55:30.000000000 +0000 @@ -202,11 +202,19 @@ { uint32_t segment_sz = options->segment_sz; uint8_t *mbuf_data; - uint8_t *test_data = - (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ? + uint8_t *test_data; + uint32_t remaining_bytes = options->max_buffer_size; + + if (options->op_type == CPERF_AEAD) { + test_data = (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) ? test_vector->plaintext.data : test_vector->ciphertext.data; - uint32_t remaining_bytes = options->max_buffer_size; + } else { + test_data = + (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT) ? + test_vector->plaintext.data : + test_vector->ciphertext.data; + } while (remaining_bytes) { mbuf_data = rte_pktmbuf_mtod(mbuf, uint8_t *); diff -Nru dpdk-18.11.5/app/test-eventdev/test_perf_common.c dpdk-18.11.6/app/test-eventdev/test_perf_common.c --- dpdk-18.11.5/app/test-eventdev/test_perf_common.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-eventdev/test_perf_common.c 2020-01-31 09:55:30.000000000 +0000 @@ -128,8 +128,9 @@ fflush(stdout); rte_delay_ms(1000); printf("%s(): lcore %d Average event timer arm latency = %.3f us\n", - __func__, rte_lcore_id(), (float)(arm_latency / count) / - (rte_get_timer_hz() / 1000000)); + __func__, rte_lcore_id(), + count ? (float)(arm_latency / count) / + (rte_get_timer_hz() / 1000000) : 0); return 0; } @@ -189,8 +190,9 @@ fflush(stdout); rte_delay_ms(1000); printf("%s(): lcore %d Average event timer arm latency = %.3f us\n", - __func__, rte_lcore_id(), (float)(arm_latency / count) / - (rte_get_timer_hz() / 1000000)); + __func__, rte_lcore_id(), + count ? (float)(arm_latency / count) / + (rte_get_timer_hz() / 1000000) : 0); return 0; } diff -Nru dpdk-18.11.5/app/test-eventdev/test_pipeline_common.c dpdk-18.11.6/app/test-eventdev/test_pipeline_common.c --- dpdk-18.11.5/app/test-eventdev/test_pipeline_common.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-eventdev/test_pipeline_common.c 2020-01-31 09:55:30.000000000 +0000 @@ -159,6 +159,7 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) { uint16_t i; + int ret; uint8_t nb_queues = 1; struct test_pipeline *t = evt_test_priv(test); struct rte_eth_rxconf rx_conf; @@ -187,7 +188,12 @@ struct rte_eth_conf local_port_conf = port_conf; uint32_t caps = 0; - rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + ret = rte_event_eth_tx_adapter_caps_get(opt->dev_id, i, &caps); + if (ret != 0) { + evt_err("failed to get event tx adapter[%d] caps", i); + return ret; + } + if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT)) t->internal_port = 0; diff -Nru dpdk-18.11.5/app/test-pmd/cmdline.c dpdk-18.11.6/app/test-pmd/cmdline.c --- dpdk-18.11.5/app/test-pmd/cmdline.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-pmd/cmdline.c 2020-01-31 09:55:30.000000000 +0000 @@ -776,6 +776,9 @@ "port close (port_id|all)\n" " Close all ports or port_id.\n\n" + "port reset (port_id|all)\n" + " Reset all ports or port_id.\n\n" + "port attach (ident)\n" " Attach physical or virtual dev by pci address or virtual device name\n\n" @@ -796,11 +799,9 @@ "port config all max-pkt-len (value)\n" " Set the max packet length.\n\n" - "port config all (crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|hw-vlan-filter|" - "hw-vlan-strip|hw-vlan-extend|drop-en)" - " (on|off)\n" - " Set crc-strip/scatter/rx-checksum/hardware-vlan/drop_en" - " for ports.\n\n" + "port config all drop-en (on|off)\n" + " Enable or disable packet drop on all RX queues of all ports when no " + "receive buffers available.\n\n" "port config all rss (all|default|ip|tcp|udp|sctp|" "ether|port|vxlan|geneve|nvgre|none|)\n" @@ -873,7 +874,7 @@ "port config rx_offload vlan_strip|" "ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|" "outer_ipv4_cksum|macsec_strip|header_split|" - "vlan_filter|vlan_extend|jumbo_frame|crc_strip|" + "vlan_filter|vlan_extend|jumbo_frame|" "scatter|timestamp|security|keep_crc on|off\n" " Enable or disable a per port Rx offloading" " on all Rx queues of a port\n\n" @@ -881,7 +882,7 @@ "port (port_id) rxq (queue_id) rx_offload vlan_strip|" "ipv4_cksum|udp_cksum|tcp_cksum|tcp_lro|qinq_strip|" "outer_ipv4_cksum|macsec_strip|header_split|" - "vlan_filter|vlan_extend|jumbo_frame|crc_strip|" + "vlan_filter|vlan_extend|jumbo_frame|" "scatter|timestamp|security|keep_crc on|off\n" " Enable or disable a per queue Rx offloading" " only on a specific Rx queue\n\n" @@ -2041,112 +2042,24 @@ __attribute__((unused)) void *data) { struct cmd_config_rx_mode_flag *res = parsed_result; - portid_t pid; - int k; if (!all_ports_stopped()) { printf("Please stop all ports first\n"); return; } - RTE_ETH_FOREACH_DEV(pid) { - struct rte_port *port; - uint64_t rx_offloads; - - port = &ports[pid]; - rx_offloads = port->dev_conf.rxmode.offloads; - if (!strcmp(res->name, "crc-strip")) { - if (!strcmp(res->value, "on")) { - rx_offloads &= ~DEV_RX_OFFLOAD_KEEP_CRC; - } else if (!strcmp(res->value, "off")) { - rx_offloads |= DEV_RX_OFFLOAD_KEEP_CRC; - } else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "scatter")) { - if (!strcmp(res->value, "on")) { - rx_offloads |= DEV_RX_OFFLOAD_SCATTER; - } else if (!strcmp(res->value, "off")) { - rx_offloads &= ~DEV_RX_OFFLOAD_SCATTER; - } else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "rx-cksum")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_CHECKSUM; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_CHECKSUM; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "rx-timestamp")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_TIMESTAMP; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan")) { - if (!strcmp(res->value, "on")) { - rx_offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); - } else if (!strcmp(res->value, "off")) { - rx_offloads &= ~(DEV_RX_OFFLOAD_VLAN_FILTER | - DEV_RX_OFFLOAD_VLAN_STRIP); - } else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-filter")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-strip")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "hw-vlan-extend")) { - if (!strcmp(res->value, "on")) - rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND; - else if (!strcmp(res->value, "off")) - rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND; - else { - printf("Unknown parameter\n"); - return; - } - } else if (!strcmp(res->name, "drop-en")) { - if (!strcmp(res->value, "on")) - rx_drop_en = 1; - else if (!strcmp(res->value, "off")) - rx_drop_en = 0; - else { - printf("Unknown parameter\n"); - return; - } - } else { + if (!strcmp(res->name, "drop-en")) { + if (!strcmp(res->value, "on")) + rx_drop_en = 1; + else if (!strcmp(res->value, "off")) + rx_drop_en = 0; + else { printf("Unknown parameter\n"); return; } - port->dev_conf.rxmode.offloads = rx_offloads; - /* Apply Rx offloads configuration */ - for (k = 0; k < port->dev_info.max_rx_queues; k++) - port->rx_conf[k].offloads = - port->dev_conf.rxmode.offloads; + } else { + printf("Unknown parameter\n"); + return; } init_port_config(); @@ -2163,8 +2076,7 @@ TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, all, "all"); cmdline_parse_token_string_t cmd_config_rx_mode_flag_name = TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, name, - "crc-strip#scatter#rx-cksum#rx-timestamp#hw-vlan#" - "hw-vlan-filter#hw-vlan-strip#hw-vlan-extend"); + "drop-en"); cmdline_parse_token_string_t cmd_config_rx_mode_flag_value = TOKEN_STRING_INITIALIZER(struct cmd_config_rx_mode_flag, value, "on#off"); @@ -2172,8 +2084,7 @@ cmdline_parse_inst_t cmd_config_rx_mode_flag = { .f = cmd_config_rx_mode_flag_parsed, .data = NULL, - .help_str = "port config all crc-strip|scatter|rx-cksum|rx-timestamp|hw-vlan|" - "hw-vlan-filter|hw-vlan-strip|hw-vlan-extend on|off", + .help_str = "port config all drop-en on|off", .tokens = { (void *)&cmd_config_rx_mode_flag_port, (void *)&cmd_config_rx_mode_flag_keyword, @@ -2343,7 +2254,6 @@ uint8_t hash_key_size; uint32_t key_len; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.hash_key_size > 0 && dev_info.hash_key_size <= sizeof(hash_key)) @@ -2876,7 +2786,6 @@ struct rte_eth_rss_reta_entry64 reta_conf[8]; struct cmd_config_rss_reta *res = parsed_result; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); if (dev_info.reta_size == 0) { printf("Redirection table size is 0 which is " @@ -2996,7 +2905,6 @@ struct rte_eth_dev_info dev_info; uint16_t max_reta_size; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); max_reta_size = RTE_MIN(dev_info.reta_size, ETH_RSS_RETA_SIZE_512); if (res->size == 0 || res->size > max_reta_size) { @@ -11023,7 +10931,6 @@ else if (!strncmp(res->pf_vf, "vf", 2)) { struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(res->port_id, &dev_info); errno = 0; vf_id = strtoul(res->pf_vf + 2, &end, 10); @@ -17901,7 +17808,7 @@ offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#" "qinq_strip#outer_ipv4_cksum#macsec_strip#" "header_split#vlan_filter#vlan_extend#jumbo_frame#" - "crc_strip#scatter#timestamp#security#keep_crc"); + "scatter#timestamp#security#keep_crc"); cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_on_off = TOKEN_STRING_INITIALIZER (struct cmd_config_per_port_rx_offload_result, @@ -17977,7 +17884,7 @@ .help_str = "port config rx_offload vlan_strip|ipv4_cksum|" "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|" "macsec_strip|header_split|vlan_filter|vlan_extend|" - "jumbo_frame|crc_strip|scatter|timestamp|security|keep_crc " + "jumbo_frame|scatter|timestamp|security|keep_crc " "on|off", .tokens = { (void *)&cmd_config_per_port_rx_offload_result_port, @@ -18027,7 +17934,7 @@ offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#" "qinq_strip#outer_ipv4_cksum#macsec_strip#" "header_split#vlan_filter#vlan_extend#jumbo_frame#" - "crc_strip#scatter#timestamp#security#keep_crc"); + "scatter#timestamp#security#keep_crc"); cmdline_parse_token_string_t cmd_config_per_queue_rx_offload_result_on_off = TOKEN_STRING_INITIALIZER (struct cmd_config_per_queue_rx_offload_result, @@ -18079,7 +17986,7 @@ "vlan_strip|ipv4_cksum|" "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|" "macsec_strip|header_split|vlan_filter|vlan_extend|" - "jumbo_frame|crc_strip|scatter|timestamp|security|keep_crc " + "jumbo_frame|scatter|timestamp|security|keep_crc " "on|off", .tokens = { (void *)&cmd_config_per_queue_rx_offload_result_port, diff -Nru dpdk-18.11.5/app/test-pmd/config.c dpdk-18.11.6/app/test-pmd/config.c --- dpdk-18.11.5/app/test-pmd/config.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-pmd/config.c 2020-01-31 09:55:30.000000000 +0000 @@ -219,6 +219,10 @@ int cnt_xstats, idx_xstat; struct rte_eth_xstat_name *xstats_names; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + print_valid_ports(); + return; + } printf("###### NIC extended statistics for port %-2d\n", port_id); if (!rte_eth_dev_is_valid_port(port_id)) { printf("Error: Invalid port number %i\n", port_id); @@ -274,6 +278,10 @@ void nic_xstats_clear(portid_t port_id) { + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + print_valid_ports(); + return; + } rte_eth_xstats_reset(port_id); } @@ -406,7 +414,6 @@ } port = &ports[port_id]; rte_eth_link_get_nowait(port_id, &link); - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); printf("\n%s Infos for port %-2d %s\n", info_border, port_id, info_border); @@ -1544,7 +1551,6 @@ #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC struct rte_eth_dev_info dev_info; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); if (strstr(dev_info.driver_name, "i40e") != NULL) { /* 32 bytes RX descriptor, i40e only */ diff -Nru dpdk-18.11.5/app/test-pmd/csumonly.c dpdk-18.11.6/app/test-pmd/csumonly.c --- dpdk-18.11.5/app/test-pmd/csumonly.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-pmd/csumonly.c 2020-01-31 09:55:30.000000000 +0000 @@ -472,6 +472,9 @@ if (info->outer_l4_proto != IPPROTO_UDP) return ol_flags; + if (tso_enabled) + ol_flags |= PKT_TX_TCP_SEG; + /* Skip SW outer UDP checksum generation if HW supports it */ if (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) { ol_flags |= PKT_TX_OUTER_UDP_CKSUM; diff -Nru dpdk-18.11.5/app/test-pmd/parameters.c dpdk-18.11.6/app/test-pmd/parameters.c --- dpdk-18.11.5/app/test-pmd/parameters.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-pmd/parameters.c 2020-01-31 09:55:30.000000000 +0000 @@ -139,8 +139,8 @@ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n"); printf(" --enable-drop-en: enable per queue packet drop.\n"); printf(" --disable-rss: disable rss.\n"); - printf(" --port-topology=N: set port topology (N: paired (default) or " - "chained).\n"); + printf(" --port-topology=: set port topology (paired " + "is default).\n"); printf(" --forward-mode=N: set forwarding mode (N: %s).\n", list_pkt_forwarding_modes()); printf(" --rss-ip: set RSS functions to IPv4/IPv6 only .\n"); @@ -1245,12 +1245,19 @@ break; default: usage(argv[0]); + printf("Invalid option: %s\n", argv[optind]); rte_exit(EXIT_FAILURE, "Command line is incomplete or incorrect\n"); break; } } + if (optind != argc) { + usage(argv[0]); + printf("Invalid parameter: %s\n", argv[optind]); + rte_exit(EXIT_FAILURE, "Command line is incorrect\n"); + } + /* Set offload configuration from command line parameters. */ rx_mode.offloads = rx_offloads; tx_mode.offloads = tx_offloads; diff -Nru dpdk-18.11.5/app/test-pmd/testpmd.c dpdk-18.11.6/app/test-pmd/testpmd.c --- dpdk-18.11.5/app/test-pmd/testpmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/app/test-pmd/testpmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -2246,6 +2246,12 @@ if (port_id_is_invalid(pid, ENABLED_WARN)) return; + if ((pid == (portid_t)RTE_PORT_ALL && !all_ports_stopped()) || + (pid != (portid_t)RTE_PORT_ALL && !port_is_stopped(pid))) { + printf("Can not reset port(s), please stop port(s) first.\n"); + return; + } + printf("Resetting ports...\n"); RTE_ETH_FOREACH_DEV(pi) { @@ -2344,6 +2350,9 @@ printf("Removing a device...\n"); + if (port_id_is_invalid(port_id, ENABLED_WARN)) + return; + dev = rte_eth_devices[port_id].device; if (dev == NULL) { printf("Device already removed\n"); diff -Nru dpdk-18.11.5/buildtools/check-experimental-syms.sh dpdk-18.11.6/buildtools/check-experimental-syms.sh --- dpdk-18.11.5/buildtools/check-experimental-syms.sh 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/buildtools/check-experimental-syms.sh 2020-01-31 09:55:30.000000000 +0000 @@ -22,9 +22,9 @@ /.*;/ {if (found == 1) print $1}' $MAPFILE` do SYM=`echo $i | sed -e"s/;//"` - objdump -t $OBJFILE | grep -q "\.text.*$SYM$" + objdump -t $OBJFILE | grep -q "\.text.*[[:space:]]$SYM$" IN_TEXT=$? - objdump -t $OBJFILE | grep -q "\.text\.experimental.*$SYM$" + objdump -t $OBJFILE | grep -q "\.text\.experimental.*[[:space:]]$SYM$" IN_EXP=$? if [ $IN_TEXT -eq 0 -a $IN_EXP -ne 0 ] then diff -Nru dpdk-18.11.5/buildtools/pmdinfogen/meson.build dpdk-18.11.6/buildtools/pmdinfogen/meson.build --- dpdk-18.11.5/buildtools/pmdinfogen/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/buildtools/pmdinfogen/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -3,6 +3,11 @@ pmdinfogen_inc = eal_inc pmdinfogen_inc += include_directories('../../lib/librte_pci') + +if host_machine.system() == 'freebsd' + pmdinfogen_inc += include_directories('../../lib/librte_compat') +endif + pmdinfogen = executable('pmdinfogen', 'pmdinfogen.c', include_directories: pmdinfogen_inc, diff -Nru dpdk-18.11.5/config/common_base dpdk-18.11.6/config/common_base --- dpdk-18.11.5/config/common_base 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/config/common_base 2020-01-31 09:55:30.000000000 +0000 @@ -88,7 +88,6 @@ CONFIG_RTE_LOG_HISTORY=256 CONFIG_RTE_BACKTRACE=y CONFIG_RTE_LIBEAL_USE_HPET=n -CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n CONFIG_RTE_EAL_IGB_UIO=n CONFIG_RTE_EAL_VFIO=n diff -Nru dpdk-18.11.5/config/meson.build dpdk-18.11.6/config/meson.build --- dpdk-18.11.5/config/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/config/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -53,7 +53,6 @@ dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8) add_project_link_arguments('-Wl,--no-as-needed', language: 'c') -dpdk_extra_ldflags += '-Wl,--no-as-needed' # use pthreads add_project_link_arguments('-pthread', language: 'c') @@ -90,6 +89,19 @@ dpdk_extra_ldflags += '-lbsd' 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 = cc.find_library('pcap', required: false) +endif +if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) + dpdk_conf.set('RTE_PORT_PCAP', 1) + dpdk_extra_ldflags += '-lpcap' +endif + # add -include rte_config to cflags add_project_arguments('-include', 'rte_config.h', language: 'c') @@ -113,7 +125,6 @@ dpdk_conf.set('RTE_MAX_LCORE', get_option('max_lcores')) dpdk_conf.set('RTE_MAX_NUMA_NODES', get_option('max_numa_nodes')) dpdk_conf.set('RTE_LIBEAL_USE_HPET', get_option('use_hpet')) -dpdk_conf.set('RTE_EAL_ALLOW_INV_SOCKET_ID', get_option('allow_invalid_socket_id')) # values which have defaults which may be overridden dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64) dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64) diff -Nru dpdk-18.11.5/debian/.gitlab-ci.yml dpdk-18.11.6/debian/.gitlab-ci.yml --- dpdk-18.11.5/debian/.gitlab-ci.yml 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/.gitlab-ci.yml 2020-03-13 11:21:31.000000000 +0000 @@ -2,3 +2,6 @@ include: - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +variables: + RELEASE: 'buster' diff -Nru dpdk-18.11.5/debian/changelog dpdk-18.11.6/debian/changelog --- dpdk-18.11.5/debian/changelog 2019-11-26 09:47:49.000000000 +0000 +++ dpdk-18.11.6/debian/changelog 2020-03-13 11:21:31.000000000 +0000 @@ -1,3 +1,30 @@ +dpdk (18.11.6-1~deb10u1) buster; urgency=medium + + * Merge tag 'debian/18.11.6-1' into buster. + + -- Luca Boccassi Fri, 13 Mar 2020 11:21:31 +0000 + +dpdk (18.11.6-1) unstable; urgency=medium + + [ Luca Boccassi ] + * New upstream version 18.11.6; For a list of changes see + http://doc.dpdk.org/guides-18.11/rel_notes/release_18_11.html + * Drop avoid-as-needed-as-it-causes-overlinking.patch, merged upstream. + * Refresh remaining patches to remove fuzz from 18.11.6. + * Add patch to avoid changing stable symbol version, breaking ABI. + * Update librte-eal18.11.symbols with new experimental symbol from + 18.11.6 + + [ Christian Ehrhardt ] + * d/*.lintian-overrides: add overrides for a few known but accepted + deficiencies + + [ Luca Boccassi ] + * Use chrpath to strip RPATH from dpdk-test binary + * Add missing librte-gro symbols file + + -- Luca Boccassi Sat, 29 Feb 2020 11:58:26 +0000 + dpdk (18.11.5-1~deb10u1) buster; urgency=medium * Merge tag 'debian/18.11.5-1' into buster. diff -Nru dpdk-18.11.5/debian/control dpdk-18.11.6/debian/control --- dpdk-18.11.5/debian/control 2019-11-26 09:47:49.000000000 +0000 +++ dpdk-18.11.6/debian/control 2020-03-13 11:21:31.000000000 +0000 @@ -4,7 +4,8 @@ Uploaders: Luca Boccassi , Christian Ehrhardt , Santiago Ruano Rincón , -Build-Depends: debhelper (>= 10.3~), +Build-Depends: chrpath, + debhelper (>= 10.3~), dh-python, dkms, doxygen , diff -Nru dpdk-18.11.5/debian/dpdk-dev.lintian-overrides dpdk-18.11.6/debian/dpdk-dev.lintian-overrides --- dpdk-18.11.5/debian/dpdk-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ dpdk-18.11.6/debian/dpdk-dev.lintian-overrides 2020-03-13 11:19:19.000000000 +0000 @@ -0,0 +1,13 @@ +# admin only test tools, documentation only maintained on the web (if at all) by upstream +dpdk-dev: binary-without-manpage usr/bin/dpdk-pdump +dpdk-dev: binary-without-manpage usr/bin/dpdk-proc-info +dpdk-dev: binary-without-manpage usr/bin/dpdk-test +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-acl +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-bbdev +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-cmdline +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-compress-perf +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-crypto-perf +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-eventdev +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-pipeline +dpdk-dev: binary-without-manpage usr/bin/dpdk-test-sad +dpdk-dev: binary-without-manpage usr/bin/dpdk-testpmd diff -Nru dpdk-18.11.5/debian/dpdk.lintian-overrides dpdk-18.11.6/debian/dpdk.lintian-overrides --- dpdk-18.11.5/debian/dpdk.lintian-overrides 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/dpdk.lintian-overrides 2020-03-13 11:19:19.000000000 +0000 @@ -1,3 +1,9 @@ # upstream ships these, and changing them now would be backward incompatible dpdk: script-with-language-extension usr/bin/dpdk-devbind.py dpdk: script-with-language-extension usr/bin/dpdk-pmdinfo.py +# those admin only helper tools only come with internal -h documentation +dpdk: binary-without-manpage usr/bin/dpdk-devbind.py +dpdk: binary-without-manpage usr/bin/dpdk-pmdinfo.py +# dpdk is a massive package by the way as defined by upstream +# accept the long lists +dpdk: field-too-long diff -Nru dpdk-18.11.5/debian/libdpdk-dev.lintian-overrides dpdk-18.11.6/debian/libdpdk-dev.lintian-overrides --- dpdk-18.11.5/debian/libdpdk-dev.lintian-overrides 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/libdpdk-dev.lintian-overrides 2020-03-13 11:19:19.000000000 +0000 @@ -1,2 +1,7 @@ -# upstream includes flags which are actually necessary +# dpdk is a massive package by the way as defined by upstream +# accept the long depends list +libdpdk-dev: field-too-long +# This is a long discussion Upstream for being >common-baseline and for +# even bleeding into dependent projects. Long term hope is that upstream will +# get all code to properly runtime-detect but for now this is as it is. libdpdk-dev: pkg-config-bad-directive diff -Nru dpdk-18.11.5/debian/librte-eal18.11.symbols dpdk-18.11.6/debian/librte-eal18.11.symbols --- dpdk-18.11.5/debian/librte-eal18.11.symbols 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/librte-eal18.11.symbols 2020-03-13 11:19:19.000000000 +0000 @@ -134,6 +134,7 @@ rte_hexdump@DPDK_2.0 16.04 rte_hypervisor_get@DPDK_18.02 18.02 rte_hypervisor_get_name@DPDK_18.02 18.02 + rte_intr_ack@EXPERIMENTAL 18.11.6 rte_intr_allow_others@DPDK_2.1 16.04 rte_intr_callback_register@DPDK_2.0 16.04 rte_intr_callback_unregister@DPDK_2.0 16.04 diff -Nru dpdk-18.11.5/debian/librte-gro18.11.symbols dpdk-18.11.6/debian/librte-gro18.11.symbols --- dpdk-18.11.5/debian/librte-gro18.11.symbols 1970-01-01 00:00:00.000000000 +0000 +++ dpdk-18.11.6/debian/librte-gro18.11.symbols 2020-03-13 11:19:19.000000000 +0000 @@ -0,0 +1,8 @@ +librte_gro.so.18.11 librte-gro18.11 #MINVER# + DPDK_17.08@DPDK_17.08 18.11 + rte_gro_ctx_create@DPDK_17.08 18.11 + rte_gro_ctx_destroy@DPDK_17.08 18.11 + rte_gro_get_pkt_count@DPDK_17.08 18.11 + rte_gro_reassemble@DPDK_17.08 18.11 + rte_gro_reassemble_burst@DPDK_17.08 18.11 + rte_gro_timeout_flush@DPDK_17.08 18.11 diff -Nru dpdk-18.11.5/debian/patches/0004-build-bump-minimum-Meson-version-to-0.47.1.patch dpdk-18.11.6/debian/patches/0004-build-bump-minimum-Meson-version-to-0.47.1.patch --- dpdk-18.11.5/debian/patches/0004-build-bump-minimum-Meson-version-to-0.47.1.patch 2019-11-26 09:42:41.000000000 +0000 +++ dpdk-18.11.6/debian/patches/0004-build-bump-minimum-Meson-version-to-0.47.1.patch 2020-03-13 11:19:19.000000000 +0000 @@ -35,7 +35,7 @@ --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ - version: '18.11.5', + version: '18.11.6', license: 'BSD', default_options: ['buildtype=release', 'default_library=static'], - meson_version: '>= 0.41' diff -Nru dpdk-18.11.5/debian/patches/0005-build-use-dependency-instead-of-find_library.patch dpdk-18.11.6/debian/patches/0005-build-use-dependency-instead-of-find_library.patch --- dpdk-18.11.5/debian/patches/0005-build-use-dependency-instead-of-find_library.patch 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/patches/0005-build-use-dependency-instead-of-find_library.patch 2020-03-13 11:19:19.000000000 +0000 @@ -12,21 +12,21 @@ Origin: https://patches.dpdk.org/patch/49996/ --- a/drivers/crypto/ccp/meson.build +++ b/drivers/crypto/ccp/meson.build -@@ -18,4 +18,3 @@ sources = files('rte_ccp_pmd.c', +@@ -18,4 +18,3 @@ 'ccp_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lcrypto' --- a/drivers/crypto/openssl/meson.build +++ b/drivers/crypto/openssl/meson.build -@@ -8,4 +8,3 @@ endif +@@ -8,4 +8,3 @@ deps += 'bus_vdev' sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lcrypto' --- a/drivers/crypto/qat/meson.build +++ b/drivers/crypto/qat/meson.build -@@ -13,6 +13,5 @@ if dep.found() +@@ -13,6 +13,5 @@ 'qat_sym.c', 'qat_sym_session.c') qat_ext_deps += dep @@ -35,7 +35,7 @@ endif --- a/drivers/meson.build +++ b/drivers/meson.build -@@ -46,10 +46,11 @@ foreach class:driver_classes +@@ -43,10 +43,11 @@ # set up internal deps. Drivers can append/override as necessary deps = std_deps # ext_deps: Stores external library dependency got @@ -64,24 +64,22 @@ cflags += '-DZLIB_CONST' --- a/drivers/net/mlx4/meson.build +++ b/drivers/net/mlx4/meson.build -@@ -14,9 +14,9 @@ if pmd_dlopen - ] +@@ -22,8 +22,8 @@ endif + libs = [ -- cc.find_library('mnl', required:false), - cc.find_library('mlx4', required:false), - cc.find_library('ibverbs', required:false), -+ dependency('libmnl', required:false), + dependency('libmlx4', required:false), + dependency('libibverbs', required:false), ] - build = true foreach lib:libs + if not lib.found() --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build -@@ -14,9 +14,9 @@ if pmd_dlopen - ] +@@ -22,9 +22,9 @@ endif + libs = [ - cc.find_library('mnl', required:false), - cc.find_library('mlx5', required:false), @@ -90,28 +88,11 @@ + dependency('libmlx5', required:false), + dependency('libibverbs', required:false), ] - build = true foreach lib:libs ---- a/drivers/net/pcap/meson.build -+++ b/drivers/net/pcap/meson.build -@@ -1,12 +1,11 @@ - # SPDX-License-Identifier: BSD-3-Clause - # Copyright(c) 2017 Intel Corporation - --pcap_dep = cc.find_library('pcap', required: false) --if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) -+pcap_dep = dependency('pcap', required: false) -+if pcap_dep.found() - build = true - else - build = false - endif - sources = files('rte_eth_pcap.c') - ext_deps += pcap_dep --pkgconfig_extra_libs += '-lpcap' + if not lib.found() --- a/lib/librte_bpf/meson.build +++ b/lib/librte_bpf/meson.build -@@ -18,8 +18,8 @@ install_headers = files('bpf_def.h', +@@ -18,8 +18,8 @@ deps += ['mbuf', 'net', 'ethdev'] @@ -124,7 +105,7 @@ endif --- a/lib/librte_telemetry/meson.build +++ b/lib/librte_telemetry/meson.build -@@ -6,7 +6,7 @@ headers = files('rte_telemetry.h', 'rte_ +@@ -6,7 +6,7 @@ deps += ['metrics', 'ethdev'] cflags += '-DALLOW_EXPERIMENTAL_API' @@ -135,7 +116,7 @@ dpdk_app_link_libraries += ['telemetry'] --- a/drivers/compress/zlib/meson.build +++ b/drivers/compress/zlib/meson.build -@@ -9,6 +9,5 @@ endif +@@ -9,6 +9,5 @@ deps += 'bus_vdev' sources = files('zlib_pmd.c', 'zlib_pmd_ops.c') ext_deps += dep diff -Nru dpdk-18.11.5/debian/patches/0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch dpdk-18.11.6/debian/patches/0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch --- dpdk-18.11.5/debian/patches/0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/patches/0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch 2020-03-13 11:19:19.000000000 +0000 @@ -5,7 +5,7 @@ Origin: https://patches.dpdk.org/patch/49998/ --- a/config/meson.build +++ b/config/meson.build -@@ -74,11 +74,11 @@ if numa_dep.found() and cc.has_header('n +@@ -82,11 +82,11 @@ endif # check for strlcpy @@ -21,10 +21,10 @@ + endif endif - # add -include rte_config to cflags + # check for pcap --- a/lib/librte_eal/meson.build +++ b/lib/librte_eal/meson.build -@@ -25,6 +25,9 @@ version = 9 # the version of the EAL AP +@@ -25,6 +25,9 @@ allow_experimental_apis = true deps += 'compat' deps += 'kvargs' diff -Nru dpdk-18.11.5/debian/patches/0008-Revert-common-octeontx-add-missing-public-symbol.patch dpdk-18.11.6/debian/patches/0008-Revert-common-octeontx-add-missing-public-symbol.patch --- dpdk-18.11.5/debian/patches/0008-Revert-common-octeontx-add-missing-public-symbol.patch 1970-01-01 00:00:00.000000000 +0000 +++ dpdk-18.11.6/debian/patches/0008-Revert-common-octeontx-add-missing-public-symbol.patch 2020-03-13 11:19:19.000000000 +0000 @@ -0,0 +1,16 @@ +Author: Luca Boccassi +Description: Revert "common/octeontx: add missing public symbol" + This reverts commit bd979fff652326e042c21aaaf3df1f515ffdff6e. + It changed the version of the symbol from @Base to @DPDK_18.05 + which breaks ABI compatibility. +Forwarded: yes +--- a/drivers/common/octeontx/rte_common_octeontx_version.map ++++ b/drivers/common/octeontx/rte_common_octeontx_version.map +@@ -1,7 +1,6 @@ + DPDK_18.05 { + global: + +- octeontx_logtype_mbox; + octeontx_mbox_set_ram_mbox_base; + octeontx_mbox_set_reg; + octeontx_mbox_send; diff -Nru dpdk-18.11.5/debian/patches/avoid-as-needed-as-it-causes-overlinking.patch dpdk-18.11.6/debian/patches/avoid-as-needed-as-it-causes-overlinking.patch --- dpdk-18.11.5/debian/patches/avoid-as-needed-as-it-causes-overlinking.patch 2019-11-26 09:42:41.000000000 +0000 +++ dpdk-18.11.6/debian/patches/avoid-as-needed-as-it-causes-overlinking.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From c2519d428e225dd4539379c3f2fc1fc707d113f8 Mon Sep 17 00:00:00 2001 -From: Christian Ehrhardt -Date: Wed, 28 Aug 2019 14:19:36 +0200 -Subject: [PATCH] build: avoid --as-needed as it causes overlinking - -A while ago telemetry was added in 57ae0ec6 and it also added as-needed -to config/meson.build. This seems no more needed these days as due to other -build changes the ordering in buildlogs is: - [...] -lrte_telemetry [...] -Wl,--no-as-needed [...] -Which means telemetry no more benefits from --no-as-needed anyway. - -Overlinking problems get triggered by the meson generated pkgconfig which -will have: - [...] -Wl,--no-as-needed -This will overlink and in addition anything that follows -as it also doesn't wrap back to --as-needed. So if a projects includes -dpdk libs + it will also consider with --no-as-needed. - -Fixes: https://bugs.launchpad.net/ubuntu/+source/dpdk/+bug/1841759 - -Signed-off-by: Christian Ehrhardt -Acked-by: Luca Boccassi -Forwarded: yes (http://mails.dpdk.org/archives/dev/2019-August/141875.html) -Author: Christian Ehrhardt -Bug-Ubuntu: https://bugs.launchpad.net/bugs/1841759 -Last-Update: 2019-09-04 - ---- - config/meson.build | 1 - - 1 file changed, 1 deletion(-) - ---- a/config/meson.build -+++ b/config/meson.build -@@ -53,7 +53,6 @@ dpdk_conf.set('RTE_TOOLCHAIN_' + toolcha - dpdk_conf.set('RTE_ARCH_64', cc.sizeof('void *') == 8) - - add_project_link_arguments('-Wl,--no-as-needed', language: 'c') --dpdk_extra_ldflags += '-Wl,--no-as-needed' - - # use pthreads - add_project_link_arguments('-pthread', language: 'c') diff -Nru dpdk-18.11.5/debian/patches/series dpdk-18.11.6/debian/patches/series --- dpdk-18.11.5/debian/patches/series 2019-11-26 09:44:55.000000000 +0000 +++ dpdk-18.11.6/debian/patches/series 2020-03-13 11:19:19.000000000 +0000 @@ -2,4 +2,4 @@ 0005-build-use-dependency-instead-of-find_library.patch 0006-build-reorder-libraries-and-build-eal-before-cmdline.patch 0007-build-use-dependency-for-libbsd-instead-of-manual-ap.patch -avoid-as-needed-as-it-causes-overlinking.patch +0008-Revert-common-octeontx-add-missing-public-symbol.patch diff -Nru dpdk-18.11.5/debian/rules dpdk-18.11.6/debian/rules --- dpdk-18.11.5/debian/rules 2019-11-20 16:10:41.000000000 +0000 +++ dpdk-18.11.6/debian/rules 2020-03-13 11:19:19.000000000 +0000 @@ -166,6 +166,8 @@ # Package: dpdk-modules- dh_install -p dpdk-modules-$(KVERS) lib/modules endif + # Strip RPATH, hard-coded in test/test/meson.build at the moment + chrpath --delete $(CURDIR)/debian/tmp/usr/bin/dpdk-test override_dh_dkms: dh_dkms -V $(DEB_VERSION_UPSTREAM) diff -Nru dpdk-18.11.5/devtools/checkpatches.sh dpdk-18.11.6/devtools/checkpatches.sh --- dpdk-18.11.5/devtools/checkpatches.sh 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/devtools/checkpatches.sh 2020-01-31 09:55:30.000000000 +0000 @@ -23,14 +23,6 @@ LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\ NEW_TYPEDEFS,COMPARISON_TO_NULL" -clean_tmp_files() { - if echo $tmpinput | grep -q '^checkpatches\.' ; then - rm -f "$tmpinput" - fi -} - -trap "clean_tmp_files" INT - print_usage () { cat <<- END_OF_HELP usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] @@ -104,13 +96,16 @@ ! $verbose || print_headline "$3" if [ -n "$1" ] ; then tmpinput=$1 - elif [ -n "$2" ] ; then - tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX) - git format-patch --find-renames \ - --no-stat --stdout -1 $commit > "$tmpinput" else tmpinput=$(mktemp -t dpdk.checkpatches.XXXXXX) - cat > "$tmpinput" + trap "rm -f '$tmpinput'" INT + + if [ -n "$2" ] ; then + git format-patch --find-renames \ + --no-stat --stdout -1 $commit > "$tmpinput" + else + cat > "$tmpinput" + fi fi ! $verbose || printf 'Running checkpatch.pl:\n' @@ -137,7 +132,10 @@ ret=1 fi - clean_tmp_files + if [ "$tmpinput" != "$1" ]; then + rm -f "$tmpinput" + trap - INT + fi [ $ret -eq 0 ] && return 0 status=$(($status + 1)) diff -Nru dpdk-18.11.5/devtools/test-null.sh dpdk-18.11.6/devtools/test-null.sh --- dpdk-18.11.5/devtools/test-null.sh 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/devtools/test-null.sh 2020-01-31 09:55:30.000000000 +0000 @@ -8,6 +8,7 @@ coremask=${2:-3} # default using cores 0 and 1 if grep -q SHARED_LIB=y $build/.config; then + export LD_LIBRARY_PATH=$build/lib:$LD_LIBRARY_PATH pmd='-d librte_pmd_null.so' fi diff -Nru dpdk-18.11.5/doc/guides/contributing/coding_style.rst dpdk-18.11.6/doc/guides/contributing/coding_style.rst --- dpdk-18.11.5/doc/guides/contributing/coding_style.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/contributing/coding_style.rst 2020-01-31 09:55:30.000000000 +0000 @@ -631,10 +631,10 @@ /* log in debug level */ rte_log_set_global_level(RTE_LOG_DEBUG); - RTE_LOG(DEBUG, my_logtype1, "this is is a debug level message\n"); - RTE_LOG(INFO, my_logtype1, "this is is a info level message\n"); - RTE_LOG(WARNING, my_logtype1, "this is is a warning level message\n"); - RTE_LOG(WARNING, my_logtype2, "this is is a debug level message (not displayed)\n"); + RTE_LOG(DEBUG, my_logtype1, "this is a debug level message\n"); + RTE_LOG(INFO, my_logtype1, "this is a info level message\n"); + RTE_LOG(WARNING, my_logtype1, "this is a warning level message\n"); + RTE_LOG(WARNING, my_logtype2, "this is a debug level message (not displayed)\n"); /* log in info level */ rte_log_set_global_level(RTE_LOG_INFO); diff -Nru dpdk-18.11.5/doc/guides/contributing/versioning.rst dpdk-18.11.6/doc/guides/contributing/versioning.rst --- dpdk-18.11.5/doc/guides/contributing/versioning.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/contributing/versioning.rst 2020-01-31 09:55:30.000000000 +0000 @@ -176,11 +176,11 @@ The macros exported are: * ``VERSION_SYMBOL(b, e, n)``: Creates a symbol version table entry binding - versioned symbol ``b@DPDK_n`` to the internal function ``b_e``. + versioned symbol ``b@DPDK_n`` to the internal function ``be``. * ``BIND_DEFAULT_SYMBOL(b, e, n)``: Creates a symbol version entry instructing the linker to bind references to symbol ``b`` to the internal symbol - ``b_e``. + ``be``. * ``MAP_STATIC_SYMBOL(f, p)``: Declare the prototype ``f``, and map it to the fully qualified function ``p``, so that if a symbol becomes versioned, it diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/aesni_gcm.rst dpdk-18.11.6/doc/guides/cryptodevs/aesni_gcm.rst --- dpdk-18.11.5/doc/guides/cryptodevs/aesni_gcm.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/aesni_gcm.rst 2020-01-31 09:55:30.000000000 +0000 @@ -22,11 +22,12 @@ * RTE_CRYPTO_AEAD_AES_GCM - Limitations ----------- * Chained mbufs are supported but only out-of-place (destination mbuf must be contiguous). +* Chained mbufs are only supported by RTE_CRYPTO_AEAD_AES_GCM algorithm, + not RTE_CRYPTO_AUTH_AES_GMAC. * Cipher only is not supported. diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/aesni_mb.rst dpdk-18.11.6/doc/guides/cryptodevs/aesni_mb.rst --- dpdk-18.11.5/doc/guides/cryptodevs/aesni_mb.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/aesni_mb.rst 2020-01-31 09:55:30.000000000 +0000 @@ -62,7 +62,7 @@ library from `here `_ and compile it on their user system before building DPDK. The latest version of the library supported by this PMD is v0.51, which -can be downloaded from ``. +can be downloaded from ``_. .. code-block:: console diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/ccp.rst dpdk-18.11.6/doc/guides/cryptodevs/ccp.rst --- dpdk-18.11.5/doc/guides/cryptodevs/ccp.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/ccp.rst 2020-01-31 09:55:30.000000000 +0000 @@ -109,14 +109,14 @@ .. code-block:: console - sudo ./build/l2fwd-crypto -l 1 -n 4 --vdev "crypto_ccp" -- -p 0x1 - --chain CIPHER_HASH --cipher_op ENCRYPT --cipher_algo AES_CBC - --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f - --iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff - --auth_op GENERATE --auth_algo SHA1_HMAC - --auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 - :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 - :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + sudo ./build/l2fwd-crypto -l 1 -n 4 --vdev "crypto_ccp" -- -p 0x1 + --chain CIPHER_HASH --cipher_op ENCRYPT --cipher_algo aes-cbc + --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f + --cipher_iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff + --auth_op GENERATE --auth_algo sha1-hmac + --auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 The CCP PMD also supports computing authentication over CPU with cipher offloaded to CCP. To enable this feature, pass an additional argument as ccp_auth_opt=1 to --vdev parameters as @@ -124,14 +124,14 @@ .. code-block:: console - sudo ./build/l2fwd-crypto -l 1 -n 4 --vdev "crypto_ccp,ccp_auth_opt=1" -- -p 0x1 - --chain CIPHER_HASH --cipher_op ENCRYPT --cipher_algo AES_CBC - --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f - --iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff - --auth_op GENERATE --auth_algo SHA1_HMAC - --auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 - :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 - :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + sudo ./build/l2fwd-crypto -l 1 -n 4 --vdev "crypto_ccp,ccp_auth_opt=1" -- -p 0x1 + --chain CIPHER_HASH --cipher_op ENCRYPT --cipher_algo aes-cbc + --cipher_key 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f + --cipher_iv 00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:ff + --auth_op GENERATE --auth_algo sha1-hmac + --auth_key 11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 + :11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11:11 Limitations ----------- diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/dpaa_sec.rst dpdk-18.11.6/doc/guides/cryptodevs/dpaa_sec.rst --- dpdk-18.11.5/doc/guides/cryptodevs/dpaa_sec.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/dpaa_sec.rst 2020-01-31 09:55:30.000000000 +0000 @@ -85,11 +85,11 @@ .. code-block:: console - -b "dpaa_bus:dpaa-secX" -- ... - e.g. "dpaa_bus:dpaa-sec0" + -b "dpaa:dpaa_sec-X" -- ... + e.g. "dpaa:dpaa_sec-1" or to disable all 4 SEC devices - -b "dpaa_sec:dpaa-sec0" -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3" + -b "dpaa:dpaa_sec-1" -b "dpaa:dpaa_sec-2" -b "dpaa:dpaa_sec-3" -b "dpaa:dpaa_sec-4" Limitations ----------- diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/qat.rst dpdk-18.11.6/doc/guides/cryptodevs/qat.rst --- dpdk-18.11.5/doc/guides/cryptodevs/qat.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/qat.rst 2020-01-31 09:55:30.000000000 +0000 @@ -7,7 +7,7 @@ QAT documentation consists of three parts: * Details of the symmetric crypto service below. -* Details of the `compression service `_ +* Details of the :doc:`compression service <../compressdevs/qat_comp>` in the compressdev drivers section. * Details of building the common QAT infrastructure and the PMDs to support the above services. See :ref:`building_qat` below. @@ -123,7 +123,7 @@ Further information on configuring, building and installing DPDK is described -`here `_. +:doc:`here <../linux_gsg/build_dpdk>`. Quick instructions for QAT cryptodev PMD are as follows: diff -Nru dpdk-18.11.5/doc/guides/cryptodevs/zuc.rst dpdk-18.11.6/doc/guides/cryptodevs/zuc.rst --- dpdk-18.11.5/doc/guides/cryptodevs/zuc.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/cryptodevs/zuc.rst 2020-01-31 09:55:30.000000000 +0000 @@ -28,7 +28,7 @@ * ZUC (EIA3) supported only if hash offset field is byte-aligned. * ZUC (EEA3) supported only if cipher length, cipher offset fields are byte-aligned. * ZUC PMD cannot be built as a shared library, due to limitations in - in the underlying library. + the underlying library. Installation diff -Nru dpdk-18.11.5/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst dpdk-18.11.6/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst --- dpdk-18.11.5/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst 2020-01-31 09:55:30.000000000 +0000 @@ -16,19 +16,21 @@ The latest cross compile tool chain can be downloaded from: https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads. -Following is the step to get the version 8.2, latest one at the time of this writing. +It is always recommended to check and get the latest compiler tool from the page and use +it to generate better code. As of this writing 8.3-2019.03 is the newest, the following +description is an example of this version. .. code-block:: console - wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz + wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz Unzip and add into the PATH --------------------------- .. code-block:: console - tar -xvf gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz - export PATH=$PATH:/gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu/bin + tar -xvf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz + export PATH=$PATH:/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin .. note:: @@ -69,9 +71,9 @@ .. code-block:: console - cp /include/numa*.h /gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu/bin/../aarch64-linux-gnu/libc/usr/include/ - cp /lib/libnuma.a /gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/8.2/ - cp /lib/libnuma.so /gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/8.2/ + cp /include/numa*.h /gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/aarch64-linux-gnu/libc/usr/include/ + cp /lib/libnuma.a /gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/8.3.0/ + cp /lib/libnuma.so /gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/lib/gcc/aarch64-linux-gnu/8.3.0/ .. _configure_and_cross_compile_dpdk_build: diff -Nru dpdk-18.11.5/doc/guides/linux_gsg/nic_perf_intel_platform.rst dpdk-18.11.6/doc/guides/linux_gsg/nic_perf_intel_platform.rst --- dpdk-18.11.5/doc/guides/linux_gsg/nic_perf_intel_platform.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/linux_gsg/nic_perf_intel_platform.rst 2020-01-31 09:55:30.000000000 +0000 @@ -152,7 +152,7 @@ # Mount to the specific folder. mount -t hugetlbfs nodev /mnt/huge -2. Check the CPU layout using using the DPDK ``cpu_layout`` utility: +2. Check the CPU layout using the DPDK ``cpu_layout`` utility: .. code-block:: console diff -Nru dpdk-18.11.5/doc/guides/nics/fm10k.rst dpdk-18.11.6/doc/guides/nics/fm10k.rst --- dpdk-18.11.5/doc/guides/nics/fm10k.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/fm10k.rst 2020-01-31 09:55:30.000000000 +0000 @@ -119,7 +119,7 @@ The Intel FM10000 family of NICs integrate a hardware switch and multiple host interfaces. The FM10000 PMD driver only manages host interfaces. For the -switch component another switch driver has to be loaded prior to to the +switch component another switch driver has to be loaded prior to the FM10000 PMD driver. The switch driver can be acquired from Intel support. Only Testpoint is validated with DPDK, the latest version that has been validated with DPDK is 4.1.6. @@ -135,8 +135,8 @@ sent to the app, which can then restart the FM10000 port to resume network processing. -CRC striping -~~~~~~~~~~~~ +CRC stripping +~~~~~~~~~~~~~ The FM10000 family of NICs strip the CRC for every packets coming into the host interface. So, keeping CRC is not supported. diff -Nru dpdk-18.11.5/doc/guides/nics/liquidio.rst dpdk-18.11.6/doc/guides/nics/liquidio.rst --- dpdk-18.11.5/doc/guides/nics/liquidio.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/liquidio.rst 2020-01-31 09:55:30.000000000 +0000 @@ -190,7 +190,7 @@ Number of descriptors for Rx/Tx ring should be in the range 128 to 512. -CRC striping -~~~~~~~~~~~~ +CRC stripping +~~~~~~~~~~~~~ LiquidIO adapters strip ethernet FCS of every packet coming to the host interface. diff -Nru dpdk-18.11.5/doc/guides/nics/octeontx.rst dpdk-18.11.6/doc/guides/nics/octeontx.rst --- dpdk-18.11.5/doc/guides/nics/octeontx.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/octeontx.rst 2020-01-31 09:55:30.000000000 +0000 @@ -161,8 +161,8 @@ as it is the most performance effective way for packet allocation and Tx buffer recycling on OCTEON TX SoC platform. -CRC striping -~~~~~~~~~~~~ +CRC stripping +~~~~~~~~~~~~~ The OCTEON TX SoC family NICs strip the CRC for every packets coming into the host interface irrespective of the offload configuration. diff -Nru dpdk-18.11.5/doc/guides/nics/tap.rst dpdk-18.11.6/doc/guides/nics/tap.rst --- dpdk-18.11.5/doc/guides/nics/tap.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/tap.rst 2020-01-31 09:55:30.000000000 +0000 @@ -76,7 +76,7 @@ If routing is enabled on the host you can also communicate with the DPDK App over the internet via a standard socket layer application as long as you -account for the protocol handing in the application. +account for the protocol handling in the application. If you have a Network Stack in your DPDK application or something like it you can utilize that stack to handle the network protocols. Plus you would be able @@ -132,9 +132,9 @@ Examples of testpmd flow rules ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Drop packets for destination IP 192.168.0.1:: +Drop packets for destination IP 192.0.2.1:: - testpmd> flow create 0 priority 1 ingress pattern eth / ipv4 dst is 1.1.1.1 \ + testpmd> flow create 0 priority 1 ingress pattern eth / ipv4 dst is 192.0.2.1 \ / end actions drop / end Ensure packets from a given MAC address are received on a queue 2:: diff -Nru dpdk-18.11.5/doc/guides/nics/thunderx.rst dpdk-18.11.6/doc/guides/nics/thunderx.rst --- dpdk-18.11.5/doc/guides/nics/thunderx.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/thunderx.rst 2020-01-31 09:55:30.000000000 +0000 @@ -331,8 +331,8 @@ Limitations ----------- -CRC striping -~~~~~~~~~~~~ +CRC stripping +~~~~~~~~~~~~~ The ThunderX SoC family NICs strip the CRC for every packets coming into the host interface irrespective of the offload configuration. diff -Nru dpdk-18.11.5/doc/guides/nics/virtio.rst dpdk-18.11.6/doc/guides/nics/virtio.rst --- dpdk-18.11.5/doc/guides/nics/virtio.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/nics/virtio.rst 2020-01-31 09:55:30.000000000 +0000 @@ -7,7 +7,6 @@ Virtio is a para-virtualization framework initiated by IBM, and supported by KVM hypervisor. In the Data Plane Development Kit (DPDK), we provide a virtio Poll Mode Driver (PMD) as a software solution, comparing to SRIOV hardware solution, - for fast guest VM to guest VM communication and guest VM to host communication. Vhost is a kernel acceleration module for virtio qemu backend. @@ -201,7 +200,7 @@ Virtio PMD Rx/Tx Callbacks -------------------------- -Virtio driver has 4 Rx callbacks and 3 Tx callbacks. +Virtio driver has 4 Rx callbacks and 2 Tx callbacks. Rx callbacks: @@ -223,9 +222,6 @@ #. ``virtio_xmit_pkts``: Regular version. -#. ``virtio_xmit_pkts_simple``: - Vector version fixes the available ring indexes to optimize performance. - #. ``virtio_xmit_pkts_inorder``: In-order version. @@ -239,30 +235,22 @@ Vector callbacks will be used when: -* ``txmode.offloads`` is set to ``0x0``, which implies: - - * Single segment is specified. - - * No offload support is needed. - * Mergeable Rx buffers is disabled. The corresponding callbacks are: * For Rx: ``virtio_recv_pkts_vec``. -* For Tx: ``virtio_xmit_pkts_simple``. - Example of using the vector version of the virtio poll mode driver in ``testpmd``:: - testpmd -l 0-2 -n 4 -- -i --tx-offloads=0x0 --rxq=1 --txq=1 --nb-cores=1 + testpmd -l 0-2 -n 4 -- -i --rxq=1 --txq=1 --nb-cores=1 In-order callbacks only work on simulated virtio user vdev. * For Rx: If mergeable Rx buffers is enabled and in-order is enabled then - ``virtio_xmit_pkts_inorder`` is used. + ``virtio_recv_mergeable_pkts_inorder`` is used. * For Tx: If in-order is enabled then ``virtio_xmit_pkts_inorder`` is used. diff -Nru dpdk-18.11.5/doc/guides/prog_guide/env_abstraction_layer.rst dpdk-18.11.6/doc/guides/prog_guide/env_abstraction_layer.rst --- dpdk-18.11.5/doc/guides/prog_guide/env_abstraction_layer.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/env_abstraction_layer.rst 2020-01-31 09:55:30.000000000 +0000 @@ -220,7 +220,7 @@ (e.g. through a call to ``rte_malloc``) or indirectly (through data structure-specific allocation API's such as ``rte_ring_create``). -Since there is no way DPDK can verify whether memory are is available or valid, +Since there is no way DPDK can verify whether memory is available or valid, this responsibility falls on the shoulders of the user. All multiprocess synchronization is also user's responsibility, as well as ensuring that all calls to add/attach/detach/remove memory are done in the correct order. It is diff -Nru dpdk-18.11.5/doc/guides/prog_guide/event_timer_adapter.rst dpdk-18.11.6/doc/guides/prog_guide/event_timer_adapter.rst --- dpdk-18.11.5/doc/guides/prog_guide/event_timer_adapter.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/event_timer_adapter.rst 2020-01-31 09:55:30.000000000 +0000 @@ -4,8 +4,7 @@ Event Timer Adapter Library =========================== -The DPDK -`Event Device library `_ +The DPDK :doc:`Event Device library ` introduces an event driven programming model which presents applications with an alternative to the polling model traditionally used in DPDK applications. Event devices can be coupled with arbitrary components to provide @@ -21,7 +20,7 @@ software implementations of the timer mechanism; it will query an eventdev PMD to determine which implementation should be used. The default software implementation manages timers using the DPDK -`Timer library `_. +:doc:`Timer library `. Examples of using the API are presented in the `API Overview`_ and `Processing Timer Expiry Events`_ sections. Code samples are abstracted and diff -Nru dpdk-18.11.5/doc/guides/prog_guide/generic_segmentation_offload_lib.rst dpdk-18.11.6/doc/guides/prog_guide/generic_segmentation_offload_lib.rst --- dpdk-18.11.5/doc/guides/prog_guide/generic_segmentation_offload_lib.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/generic_segmentation_offload_lib.rst 2020-01-31 09:55:30.000000000 +0000 @@ -206,7 +206,7 @@ 2. Set the appropriate ol_flags in the mbuf. - The GSO library use the value of an mbuf's ``ol_flags`` attribute to - to determine how a packet should be segmented. It is the application's + determine how a packet should be segmented. It is the application's responsibility to ensure that these flags are set. - For example, in order to segment TCP/IPv4 packets, the application should diff -Nru dpdk-18.11.5/doc/guides/prog_guide/kernel_nic_interface.rst dpdk-18.11.6/doc/guides/prog_guide/kernel_nic_interface.rst --- dpdk-18.11.5/doc/guides/prog_guide/kernel_nic_interface.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/kernel_nic_interface.rst 2020-01-31 09:55:30.000000000 +0000 @@ -243,7 +243,7 @@ The KNI interfaces can be deleted by a DPDK application with ``rte_kni_release()``. All KNI interfaces not explicitly deleted will be -deleted when the the ``/dev/kni`` device is closed, either explicitly with +deleted when the ``/dev/kni`` device is closed, either explicitly with ``rte_kni_close()`` or when the DPDK application is closed. DPDK mbuf Flow diff -Nru dpdk-18.11.5/doc/guides/prog_guide/packet_classif_access_ctrl.rst dpdk-18.11.6/doc/guides/prog_guide/packet_classif_access_ctrl.rst --- dpdk-18.11.5/doc/guides/prog_guide/packet_classif_access_ctrl.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/packet_classif_access_ctrl.rst 2020-01-31 09:55:30.000000000 +0000 @@ -154,7 +154,7 @@ .. code-block:: c - struct struct ipv6_hdr { + struct ipv6_hdr { uint32_t vtc_flow; /* IP version, traffic class & flow label. */ uint16_t payload_len; /* IP packet length - includes sizeof(ip_header). */ uint8_t proto; /* Protocol, next header. */ @@ -167,7 +167,7 @@ .. code-block:: c - struct struct rte_acl_field_def ipv6_2tuple_defs[5] = { + struct rte_acl_field_def ipv6_2tuple_defs[5] = { { .type = RTE_ACL_FIELD_TYPE_BITMASK, .size = sizeof (uint8_t), diff -Nru dpdk-18.11.5/doc/guides/prog_guide/rte_flow.rst dpdk-18.11.6/doc/guides/prog_guide/rte_flow.rst --- dpdk-18.11.5/doc/guides/prog_guide/rte_flow.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/rte_flow.rst 2020-01-31 09:55:30.000000000 +0000 @@ -1524,7 +1524,7 @@ The shared flag indicates whether the counter is unique to the flow rule the action is specified with, or whether it is a shared counter. -For a count action with the shared flag set, then then a global device +For a count action with the shared flag set, then a global device namespace is assumed for the counter id, so that any matched flow rules using a count action with the same counter id on the same port will contribute to that counter. diff -Nru dpdk-18.11.5/doc/guides/prog_guide/rte_security.rst dpdk-18.11.6/doc/guides/prog_guide/rte_security.rst --- dpdk-18.11.5/doc/guides/prog_guide/rte_security.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/rte_security.rst 2020-01-31 09:55:30.000000000 +0000 @@ -51,7 +51,7 @@ packet. e.g. In case of IPsec, the IPsec tunnel headers (if any), ESP/AH headers will remain in the packet but the received packet contains the decrypted data where the encrypted data was when the packet -arrived. The driver Rx path check the descriptors and and based on the +arrived. The driver Rx path check the descriptors and based on the crypto status sets additional flags in the rte_mbuf.ol_flags field. .. note:: @@ -65,7 +65,7 @@ relevant security protocol headers. Only the data will not be encrypted by the software. The driver will accordingly configure the tx descriptors. The hardware device will encrypt the data before sending the -the packet out. +packet out. .. note:: diff -Nru dpdk-18.11.5/doc/guides/prog_guide/switch_representation.rst dpdk-18.11.6/doc/guides/prog_guide/switch_representation.rst --- dpdk-18.11.5/doc/guides/prog_guide/switch_representation.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/prog_guide/switch_representation.rst 2020-01-31 09:55:30.000000000 +0000 @@ -348,8 +348,7 @@ interconnection without introducing new concepts and whole new API to implement them. This is described in `flow API (rte_flow)`_. -.. [6] `Generic flow API (rte_flow) - `_ +.. [6] :doc:`Generic flow API (rte_flow) ` Flow API (rte_flow) ------------------- @@ -736,8 +735,7 @@ Examples in subsequent sections apply to hypervisor applications only and are based on port representors **A**, **B** and **C**. -.. [2] `Flow syntax - `_ +.. [2] :ref:`Flow syntax ` Associating VF 1 with Physical Port 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -Nru dpdk-18.11.5/doc/guides/rel_notes/release_17_11.rst dpdk-18.11.6/doc/guides/rel_notes/release_17_11.rst --- dpdk-18.11.5/doc/guides/rel_notes/release_17_11.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/rel_notes/release_17_11.rst 2020-01-31 09:55:30.000000000 +0000 @@ -475,7 +475,7 @@ * **Added mbuf flags PKT_RX_VLAN and PKT_RX_QINQ.** Two ``mbuf`` flags have been added to indicate that the VLAN - identifier has been saved in in the ``mbuf`` structure. For instance: + identifier has been saved in the ``mbuf`` structure. For instance: - If VLAN is not stripped and TCI is saved: ``PKT_RX_VLAN`` - If VLAN is stripped and TCI is saved: ``PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED`` diff -Nru dpdk-18.11.5/doc/guides/rel_notes/release_18_02.rst dpdk-18.11.6/doc/guides/rel_notes/release_18_02.rst --- dpdk-18.11.5/doc/guides/rel_notes/release_18_02.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/rel_notes/release_18_02.rst 2020-01-31 09:55:30.000000000 +0000 @@ -210,7 +210,7 @@ A set of northbound APIs have been defined which encompass a generic set of operations by allowing applications to interact with device using opaque structures/buffers. Also, southbound APIs provide a means of integrating devices - either as as part of a physical bus (PCI, FSLMC etc) or through ``vdev``. + either as part of a physical bus (PCI, FSLMC etc) or through ``vdev``. See the :doc:`../prog_guide/rawdev` programmer's guide for more details. diff -Nru dpdk-18.11.5/doc/guides/rel_notes/release_18_11.rst dpdk-18.11.6/doc/guides/rel_notes/release_18_11.rst --- dpdk-18.11.5/doc/guides/rel_notes/release_18_11.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/rel_notes/release_18_11.rst 2020-01-31 09:55:30.000000000 +0000 @@ -2263,3 +2263,444 @@ * dbda2092d net/i40e: fix request queue in VF * 721c95301 net/mlx5: fix Rx scatter mode validation * aa2c00702 net/bnxt: fix traffic stall on Rx queue stop/start + +18.11.6 Release Notes +--------------------- + +18.11.6 Fixes +~~~~~~~~~~~~~ + +* app/crypto-perf: fix input of AEAD decrypt +* app/eventdev: check function errors +* app/eventdev: fix divide by zero +* app/procinfo: use strlcpy for copying string +* app/testpmd: block xstats for hidden ports +* app/testpmd: fix crash on port reset +* app/testpmd: fix CRC strip command +* app/testpmd: fix help for loop topology option +* app/testpmd: fix invalid port detaching +* app/testpmd: fix Tx checksum when TSO enabled +* app/testpmd: remove duplicated Rx offload commands +* app/testpmd: report invalid command line parameter +* build: avoid overlinking +* build: remove redundant libs from pkgconfig +* build: remove unneeded meson option +* buildtools: fix build with coverage +* bus/dpaa: fix dpaa_sec blacklist +* bus/fslmc: fix global variable multiple definitions +* bus/pci: align next mapping address on page boundary +* bus/pci: fix Intel IOMMU sysfs access check +* bus/pci: remove useless link dependency on ethdev +* ci: add missing dependencies for documentation +* ci: use meson 0.47.1 +* common/cpt: fix possible null dereference +* common/dpaax: fallback to check separate memory node for VM +* common/octeontx: add missing public symbol +* compress/octeontx: fix global variable multiple definitions +* compress/octeontx: remove commented out code +* crypto/ccp: fix CPU authentication crash +* crypto/ccp: fix digest size capabilities +* crypto/ccp: fix maximum queues and burst size +* crypto/ccp: fix scheduling of burst +* cryptodev: fix checks related to device id +* cryptodev: fix initialization on multi-process +* crypto/dpaa2_sec: fix length retrieved from hardware +* crypto/dpaa_sec: fix auth-cipher check for AEAD +* crypto/dpaa_sec: fix IOVA table +* crypto/null: fix global variable multiple definitions +* crypto/octeontx: enable unbinding +* crypto/openssl: use local copy for session contexts +* crypto/qat: fix AES CMAC mininum digest size +* crypto/qat: fix digest length in XCBC capability +* crypto/qat: fix null auth when using VFIO +* crypto/virtio: fix global variable multiple definitions +* devtools: fix cleanup of checkpatch temporary file +* doc: fix a common typo in NIC guides +* doc: fix AESNI-GCM limitations in crypto guide +* doc: fix description of links to EAL options pages +* doc: fix description of versioning macros +* doc: fix format in virtio guide +* doc: fix internal links for older releases +* doc: fix l2fwd-crypto usage in CCP guide +* doc: fix link to AESNI mb external library +* doc: fix tap guide +* doc: fix typo in l2fwd-crypto guide +* doc: fix typo in virtio in-order Rx function name +* doc/guides: clean repeated words +* doc: update arm64 cross build tool version +* drivers/crypto: remove some invalid comments +* eal: add ack interrupt API +* eal: drop unused macros for primary process check +* eal: fix header file install with meson +* eal/linux: restore specific hugepage ordering for ppc +* eal/ppc: fix 64-bit atomic exchange operation +* eal: remove dead code on NUMA node detection +* eal: remove legacy PMD log macro +* eal/x86: force inlining of all memcpy and mov helpers +* ethdev: avoid undefined behaviour on configuration copy +* ethdev: fix doc reference to FDIR disabled mode +* ethdev: fix expand RSS flows +* ethdev: fix include of ethernet header file +* ethdev: fix item expansion for RSS flow +* ethdev: fix last item detection on RSS flow expand +* ethdev: fix typos for ENOTSUP +* ethdev: limit maximum number of queues +* ethdev: remove redundant device info cleanup before get +* eventdev: fix possible use of uninitialized var +* eventdev: use same log macro for all unsupported calls +* event/dpaa2: fix default queue configuration +* event/dpaa: fix number of supported atomic flows +* event/octeontx: fix partial Rx packet handling +* event/opdl: remove commented out code +* event/sw: fix xstats reset value +* examples/fips_validation: fix auth verify +* examples/fips_validation: fix null dereferences +* examples: hide error for missing pkg-config path flag +* examples/ipsec-secgw: fix access to freed packet +* examples/ipsec-secgw: fix default configuration +* examples/ipsec-secgw: fix GCM IV length +* examples/ipsec-secgw: fix SHA256-HMAC digest length +* examples/ipsec-secgw: fix unchecked return value +* examples/l3fwd-power: fix Rx interrupt disabling +* examples/multi_process: check server port validity +* examples/multi_process: fix client crash with sparse ports +* examples/vm_power: fix build without i40e +* examples/vm_power: fix OOB frequency oscillations +* examples/vm_power: fix type of cmdline token in cli +* kni: fix ethtool build for gcc 9 +* lib/distributor: fix deadlock on aarch64 +* lib: fix doxygen typos +* lib: fix log typos +* malloc: fix memory element size in case of padding +* malloc: fix realloc copy size +* malloc: fix realloc padded element size +* mempool: use actual IOVA addresses when populating +* mk: fix build on arm64 +* mk: remove library search path from binary +* net/af_packet: fix stale sockets +* net/af_packet: improve Tx statistics accuracy +* net/atlantic: add FW mailbox guard mutex +* net/atlantic: remove double function declaration +* net/axgbe: fix double unlock +* net/bnxt: advertise scatter Rx offload capability +* net/bnxt: cleanup comments +* net/bnxt: enforce IO barrier for doorbell command +* net/bnxt: expose some missing counters in port stats +* net/bnxt: fix accessing variable before null check +* net/bnxt: fix async link handling and update +* net/bnxt: fix check of address mapping +* net/bnxt: fix coding style +* net/bnxt: fix crash after removing and adding slaves +* net/bnxt: fix crash in xstats get +* net/bnxt: fix debug log level +* net/bnxt: fix deferred start of Tx queues +* net/bnxt: fix dereference before null check +* net/bnxt: fix doorbell register offset for Tx ring +* net/bnxt: fix error checking of FW commands +* net/bnxt: fix extended port counter statistics +* net/bnxt: fix flow flush handling +* net/bnxt: fix flow steering +* net/bnxt: fix forwarding with higher mbuf size +* net/bnxt: fix IP checksum error indication +* net/bnxt: fix L4 checksum indication in non-vector Rx +* net/bnxt: fix MAC/VLAN filter allocation +* net/bnxt: fix mbuf free when clearing Tx queue +* net/bnxt: fix multicast filter programming +* net/bnxt: fix ping with MTU change +* net/bnxt: fix resource qcaps with older FW +* net/bnxt: fix Rx queue count +* net/bnxt: fix rx queue start/stop +* net/bnxt: fix setting default MAC address +* net/bnxt: fix setting max RSS contexts +* net/bnxt: fix stats errors handling +* net/bnxt: fix VF probe when MAC address is zero +* net/bnxt: fix writing MTU to FW +* net/bnxt: get default HWRM command timeout from FW +* net/bnxt: move macro definitions to header file +* net/bnxt: remove commented out code +* net/bnxt: remove duplicate barrier +* net/bnxt: remove unnecessary variable assignment +* net/bnxt: replace memory barrier for doorbell response +* net/bnxt: return error if setting link up fails +* net/bnxt: update trusted VF status only when it changes +* net/bonding: fix LACP fast queue Rx handler +* net/bonding: fix link speed update in broadcast mode +* net/bonding: fix OOB access in other aggregator modes +* net/bonding: fix out of bound access in LACP mode +* net/bonding: fix port ID check +* net/bonding: fix selection logic +* net/bonding: fix slave id types +* net/bonding: fix unicast packets filtering +* net/bonding: use non deprecated PCI API +* net/cxgbe: add prefix to global functions +* net/cxgbe: avoid polling link status before device start +* net/cxgbe: fix null access when allocating CLIP entry +* net/cxgbe: fix parsing VLAN ID rewrite action +* net/cxgbe: fix prefetch for non-coalesced Tx packets +* net/cxgbe: fix races on flow API operations +* net/cxgbe: fix slot allocation for IPv6 flows +* net/dpaa2: add retry and timeout in packet enqueue API +* net/dpaa2: fix possible use of uninitialized vars +* net/dpaa2: fix Rx offload flags on jumbo MTU set +* net/dpaa2: set port in mbuf +* net/e1000: fix i219 hang on reset/close +* net/e1000: fix link status +* net/e1000: fix link status update +* net/e1000: fix memory barrier usage in Tx +* net/e1000: fix zeroing of RSS config +* net/enetc: fix BD ring alignment +* net/enic: fix crash in secondary process +* net/enic: fix probe for secondary process +* net/enic: re-enable link status change interrupt +* net/fm10k: fix mbuf free in vector Rx +* net/i40e: downgrade error log +* net/i40e: fix address of first segment +* net/i40e: fix exception with multi-driver +* net/i40e: fix integer overflow +* net/i40e: fix VF runtime queues RSS config +* net/i40e: remove compiler barrier from NEON Rx +* net/i40e: remove memory barrier from NEON Rx +* net/i40e: set speed to undefined for default case +* net/ifc: check VFIO query error +* net/igb: fix global variable multiple definitions +* net/igb: fix PHY status if PHY reset is not blocked +* net/ixgbe: enable new PF host mbox version +* net/ixgbe: fix address of first segment +* net/ixgbe: fix link status +* net/ixgbe: fix link status +* net/ixgbe: fix MACsec setting +* net/ixgbe: fix performance drop caused by MACsec +* net/ixgbe: fix queue interrupt for X552/557 +* net/ixgbe: fix VF RSS offloads configuration +* net/ixgbe: fix X553 speed capability +* net/ixgbe: fix zeroing of RSS config +* net/ixgbe: remove memory barrier from NEON Rx +* net/ixgbe: remove redundant assignment +* net/ixgbe: support packet type with NEON +* net/mlx4: fix build on ppc64 +* net/mlx4: remove dependency on libmnl in meson +* net/mlx5: allow pattern start from IP +* net/mlx5: block RSS action without Rx queue +* net/mlx5: fix BlueField VF type recognition +* net/mlx5: fix check of RSS queue index +* net/mlx5: fix crash on hash Rx queue handling for drop +* net/mlx5: fix Rx CQ doorbell synchronization on aarch64 +* net/mlx5: improve flow item IP validation +* net/mlx5: validate flow rule item order +* net/mlx: allow build only on Linux +* net/mlx: fix build with clang 9 +* net/mlx: fix build with make and recent gcc +* net/mlx: fix debug build with icc +* net/mlx: fix meson build with custom dependency path +* net/null: fix multi-process Rx and Tx +* net/qede/base: fix page index for PBL chains +* net/qede: fix odd number of queues usage in 100G mode +* net/qede: fix RSS configuration as per new allocation method +* net/qede: fix setting MTU +* net/qede: fix setting VLAN strip mode +* net/qede: fix stats flow as per new allocation method +* net/qede: limit Rx ring index read for debug +* net/qede: refactor Rx and Tx queue setup +* net/qede: use ack in interrupt handlers +* net/sfc: fix adapter lock usage on rule creation +* net/sfc: fix missing notification on link status change +* net/szedata2: fix dependency check +* net/tap: fix blocked Rx packets +* net/vhost: fix redundant queue state event +* net/virtio: fix Rx stats with vectorized functions +* net/virtio: get all pending Rx packets in vectorized paths +* net/virtio: reject deferred Rx start +* net/virtio: reject deferred Tx start +* net/virtio: reject unsupported Rx multi-queue modes +* net/virtio: reject unsupported Tx multi-queue modes +* net/virtio: remove remaining simple Tx related stuff +* net/virtio-user: drop attribute unused for memory callback +* net/virtio-user: fix setting filters +* net/vmxnet3: remove IP checksum from capabilities +* pmdinfogen: fix freebsd build +* port: fix pcap support with meson +* power: fix socket indicator value +* power: handle frequency increase with turbo disabled +* raw/dpaa2_cmdif: add retry and timeout in packet enqueue API +* reciprocal: fix off-by-one with 32-bit divisor +* Revert "eal/freebsd: fix config creation" +* security: fix doxygen fields +* service: use log for error messages +* test/bonding: fix LSC related cases +* test/bonding: fix LSC timeout unit +* test/crypto: fix checks for null digest in null auth +* test/crypto: fix session init failure for wireless case +* test/distributor: fix spurious failure +* test: fix global variable multiple definitions +* test/interrupt: account for race with callback +* test/lpm: fix measured cycles for delete +* test/mbuf: fix forged mbuf in clone test +* test: optimise fd closing in forks +* test/service: fix wait for service core +* usertools: fix pmdinfo with python 3 and pyelftools>=0.24 +* usertools: fix telemetry client with python 3 +* usertools: fix typo in SPDX tag of telemetry script +* version: 18.11.6-rc1 +* version: 18.11.6-rc2 +* vfio: fix leak with multiprocess +* vfio: fix truncated BAR offset for 32-bit +* vhost: batch used descs chains write-back with packed ring +* vhost: convert buffer addresses to GPA for logging +* vhost: do not inline packed and split functions +* vhost: do not inline unlikely fragmented buffers code +* vhost: do not limit packed ring size +* vhost: fix build dependency on hash lib +* vhost: fix build on RHEL 7.6 for Power +* vhost: fix IPv4 checksum +* vhost: fix slave request fd leak +* vhost: fix virtqueue not accessible +* vhost: fix vring address handling during live migration +* vhost: fix vring memory partially mapped +* vhost: forbid reallocation when running +* vhost: prevent zero copy mode if IOMMU is on +* vhost: protect vring access done by application +* vhost: simplify descriptor buffer prefetching +* vhost: translate incoming log address to GPA +* vhost: un-inline dirty pages logging functions + +18.11.6 Validation +~~~~~~~~~~~~~~~~~~ + +* Intel(R) Testing + + * Basic Intel(R) NIC(ixgbe and i40e) testing + + * PF (i40e) + * PF (ixgbe) + * VF + * Compile Testing + * Intel NIC single core/NIC performance + + * Basic cryptodev and virtio testing + + * cryptodev + * vhost/virtio basic loopback, PVP and performance test + +* Red Hat(R) Testing + + * RHEL 7.8 + * Functionality + + * PF assignment + * VF assignment + * vhost single/multi queues and cross-NUMA + * vhostclient reconnect + * vhost live migration with single/multi queues and cross-NUMA + * OVS PVP + + * Tested NICs + + * X540-AT2 NIC(ixgbe, 10G) + +* Mellanox(R) Testing + + * Basic functionality with testpmd + + * Tx/Rx + * xstats + * Timestamps + * Link status + * RTE flow and flow_director + * RSS + * VLAN stripping and insertion + * Checksum/TSO + * ptype + * Multi-process + + * ConnectX-5 + + * RHEL 7.4 + * Kernel 3.10.0-693.el7.x86_64 + * Driver MLNX_OFED_LINUX-4.7-3.2.9.0 + * fw 16.26.4012 + + * ConnectX-4 Lx + + * RHEL 7.4 + * Kernel 3.10.0-693.el7.x86_64 + * Driver MLNX_OFED_LINUX-4.7-3.2.9.0 + * fw 14.26.4012 + +* Microsoft(R) Azure Testing + + * Images + + * Canonical UbuntuServer 16.04-LTS + * Canonical UbuntuServer 18.04-DAILY-LTS + * Canonical UbuntuServer 19.10 + * Red Hat RHEL 7-RAW + * SUSE SLES 15 + * RedHat RHEL 7.5 + * CentOS 7.5 + * Red Hat RHEL 8 + * CentOS 8 + + * Drivers + + * Mellanox and netvsc poll-mode drivers + + * Functionality + + * VM to VM traffic + * SRIOV/Failsafe + * Single core performance + * Multicore performance - one multicore test borderline. Not a regression. + +* Intel(R) Testing with Open vSwitch + + * OVS testing with OVS branches 2.12 and 2.11 with VSPERF + + * Tested NICs + + * i40e (X710) + * ixgbe (82599ES) + + * Functionality + + * P2P + * PVP + * Hotplug + * Multiqueue + * Vhostuserclient reconnect + * Vhost cross-NUMA awareness + * Jumbo frames + * Rate limiting + * QoS policer + +18.11.6 Known Issues +~~~~~~~~~~~~~~~~~~~~ + +* DPDK 18.11.6 contains fixes up to DPDK v19.11. Issues identified/fixed in DPDK master branch after DPDK v19.11 may be present in DPDK 18.11.6 + +18.11.6 Fixes skipped and status unresolved +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* 21b1f1abe4 net/bnxt: fix COS queue mapping +* 6d3f9917ff eal: fix memory config allocation for multi-process +* b149a70642 eal/freebsd: add config reattach in secondary process +* 6080796f65 mem: make base address hint OS specific +* be048a1aaa net/virtio: fix descriptor addressed in Tx +* 1526dd0532 net/virtio: fix Tx checksum offloads +* ea81c1b816 net/mlx5: fix NVGRE matching +* 9d10f53e40 test/metrics: fix second run +* 05817057fa net/ena: fix indication of bad L4 Rx checksums +* e0d865357e net/bnxt: enable interrupts according interface status +* 9bc556e3ec net/bnxt: fix error handling in xstats +* dc177579d6 net/bnxt: fix L2 context calculation for Thor +* f5019a53d7 net/bnxt: fix memory leak +* a135e050ad examples/ipsec-secgw: fix packet length +* e76097f848 net/virtio: cleanup on demand when in-order Tx +* 1ae55ad38e net/virtio: fix mbuf data and packet length mismatch +* 721c953018 net/mlx5: fix Rx scatter mode validation +* 9e0d81c1a1 net/mlx5: fix selection between encap and decap +* 7392ad06f5 app/testpmd: use better randomness for Tx split +* f0617163b8 mempool/dpaa2: report error on endless loop in mbuf release +* f35eaaca5f net/bnxt: fix crash in secondary process +* dcfbc594f7 net/iavf: fix queue interrupt for ice +* 6977f14517 app/testpmd: fix missing GENEVE item in raw encap +* e6d3c0928 eal/freebsd: fix config creation diff -Nru dpdk-18.11.5/doc/guides/sample_app_ug/ethtool.rst dpdk-18.11.6/doc/guides/sample_app_ug/ethtool.rst --- dpdk-18.11.5/doc/guides/sample_app_ug/ethtool.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/sample_app_ug/ethtool.rst 2020-01-31 09:55:30.000000000 +0000 @@ -40,7 +40,7 @@ EthApp> From this interface the available commands and descriptions of what -they do as as follows: +they do as follows: * ``drvinfo``: Print driver info * ``eeprom``: Dump EEPROM to file diff -Nru dpdk-18.11.5/doc/guides/sample_app_ug/intro.rst dpdk-18.11.6/doc/guides/sample_app_ug/intro.rst --- dpdk-18.11.5/doc/guides/sample_app_ug/intro.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/sample_app_ug/intro.rst 2020-01-31 09:55:30.000000000 +0000 @@ -15,9 +15,9 @@ Some sample applications may have their own command-line parameters described in their respective guides, however all of them also share the same EAL parameters. -Please refer to :doc:`../linux_gsg/linux_eal_parameters` or -:doc:`../freebsd_gsg/freebsd_eal_parameters` for a list of available EAL -command-line options. +Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>` +or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for +a list of available EAL command-line options. The DPDK Sample Applications diff -Nru dpdk-18.11.5/doc/guides/sample_app_ug/l2_forward_crypto.rst dpdk-18.11.6/doc/guides/sample_app_ug/l2_forward_crypto.rst --- dpdk-18.11.5/doc/guides/sample_app_ug/l2_forward_crypto.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/sample_app_ug/l2_forward_crypto.rst 2020-01-31 09:55:30.000000000 +0000 @@ -204,7 +204,7 @@ All the packets received in all the ports get transformed by the crypto device/s (ciphering and/or authentication). The crypto operation to be performed on the packet is parsed from the command line -(go to "Running the Application section for all the options). +(go to "Running the Application" section for all the options). If no parameter is passed, the default crypto operation is: diff -Nru dpdk-18.11.5/doc/guides/sample_app_ug/performance_thread.rst dpdk-18.11.6/doc/guides/sample_app_ug/performance_thread.rst --- dpdk-18.11.5/doc/guides/sample_app_ug/performance_thread.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/sample_app_ug/performance_thread.rst 2020-01-31 09:55:30.000000000 +0000 @@ -280,7 +280,7 @@ interconnected via software rings. On initialization an L-thread scheduler is started on every EAL thread. On all -but the master EAL thread only a a dummy L-thread is initially started. +but the master EAL thread only a dummy L-thread is initially started. The L-thread started on the master EAL thread then spawns other L-threads on different L-thread schedulers according the command line parameters. diff -Nru dpdk-18.11.5/doc/guides/testpmd_app_ug/run_app.rst dpdk-18.11.6/doc/guides/testpmd_app_ug/run_app.rst --- dpdk-18.11.5/doc/guides/testpmd_app_ug/run_app.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/testpmd_app_ug/run_app.rst 2020-01-31 09:55:30.000000000 +0000 @@ -7,9 +7,9 @@ EAL Command-line Options ------------------------ -Please refer to :doc:`../linux_gsg/linux_eal_parameters` or -:doc:`../freebsd_gsg/freebsd_eal_parameters` for a list of available EAL -command-line options. +Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>` +or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for +a list of available EAL command-line options. Testpmd Command-line Options diff -Nru dpdk-18.11.5/doc/guides/testpmd_app_ug/testpmd_funcs.rst dpdk-18.11.6/doc/guides/testpmd_app_ug/testpmd_funcs.rst --- dpdk-18.11.5/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/testpmd_app_ug/testpmd_funcs.rst 2020-01-31 09:55:30.000000000 +0000 @@ -33,7 +33,7 @@ .. note:: - Some examples in this document are too long to fit on one line are are shown wrapped at `"\\"` for display purposes:: + Some examples in this document are too long to fit on one line are shown wrapped at `"\\"` for display purposes:: testpmd> set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \ (pause_time) (send_xon) (port_id) @@ -1601,7 +1601,7 @@ vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro, qinq_strip, outer_ipv4_cksum, macsec_strip, header_split, vlan_filter, vlan_extend, jumbo_frame, - crc_strip, scatter, timestamp, security, keep_crc + scatter, timestamp, security, keep_crc This command should be run when the port is stopped, or else it will fail. @@ -1616,7 +1616,7 @@ vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro, qinq_strip, outer_ipv4_cksum, macsec_strip, header_split, vlan_filter, vlan_extend, jumbo_frame, - crc_strip, scatter, timestamp, security, keep_crc + scatter, timestamp, security, keep_crc This command should be run when the port is stopped, or else it will fail. @@ -1951,6 +1951,15 @@ testpmd> port close (port_id|all) +port reset +~~~~~~~~~~ + +Reset all ports or a specific port:: + + testpmd> port reset (port_id|all) + +User should stop port(s) before resetting and (re-)start after reset. + port config - queue ring size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2009,91 +2018,14 @@ This is equivalent to the ``--max-pkt-len`` command-line option. -port config - CRC Strip -~~~~~~~~~~~~~~~~~~~~~~~ - -Set hardware CRC stripping on or off for all ports:: - - testpmd> port config all crc-strip (on|off) - -CRC stripping is on by default. - -The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option. - -port config - scatter -~~~~~~~~~~~~~~~~~~~~~~~ - -Set RX scatter mode on or off for all ports:: - - testpmd> port config all scatter (on|off) - -RX scatter mode is off by default. - -The ``on`` option is equivalent to the ``--enable-scatter`` command-line option. - -port config - RX Checksum -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Set hardware RX checksum offload to on or off for all ports:: - - testpmd> port config all rx-cksum (on|off) - -Checksum offload is off by default. - -The ``on`` option is equivalent to the ``--enable-rx-cksum`` command-line option. - -port config - VLAN -~~~~~~~~~~~~~~~~~~ - -Set hardware VLAN on or off for all ports:: - - testpmd> port config all hw-vlan (on|off) - -Hardware VLAN is off by default. - -The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option. - -port config - VLAN filter -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Set hardware VLAN filter on or off for all ports:: - - testpmd> port config all hw-vlan-filter (on|off) - -Hardware VLAN filter is off by default. - -The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option. - -port config - VLAN strip -~~~~~~~~~~~~~~~~~~~~~~~~ - -Set hardware VLAN strip on or off for all ports:: - - testpmd> port config all hw-vlan-strip (on|off) - -Hardware VLAN strip is off by default. - -The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option. - -port config - VLAN extend -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Set hardware VLAN extend on or off for all ports:: - - testpmd> port config all hw-vlan-extend (on|off) - -Hardware VLAN extend is off by default. - -The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option. - port config - Drop Packets ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Set packet drop for packets with no descriptors on or off for all ports:: +Enable or disable packet drop on all RX queues of all ports when no receive buffers available:: testpmd> port config all drop-en (on|off) -Packet dropping for packets with no descriptors is off by default. +Packet dropping when no receive buffers available is off by default. The ``on`` option is equivalent to the ``--enable-drop-en`` command-line option. @@ -2642,7 +2574,7 @@ ------------------ The following section shows functions for configuring traffic management on -on the ethernet device through the use of generic TM API. +the ethernet device through the use of generic TM API. show port traffic management capability ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -Nru dpdk-18.11.5/doc/guides/tools/testbbdev.rst dpdk-18.11.6/doc/guides/tools/testbbdev.rst --- dpdk-18.11.5/doc/guides/tools/testbbdev.rst 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/doc/guides/tools/testbbdev.rst 2020-01-31 09:55:30.000000000 +0000 @@ -62,8 +62,7 @@ ``-e EAL_PARAMS, --eal_params EAL_PARAMS`` Specifies EAL arguments which are passed to the test app. For more details, - refer to DPDK documentation at - http://doc.dpdk.org/guides/linux_gsg/linux_eal_parameters.html. + refer to DPDK documentation at :doc:`../linux_gsg/linux_eal_parameters`. ``-t TIMEOUT, --timeout TIMEOUT`` Specifies timeout in seconds. If not specified timeout is set to 300 seconds. diff -Nru dpdk-18.11.5/drivers/bus/dpaa/dpaa_bus.c dpdk-18.11.6/drivers/bus/dpaa/dpaa_bus.c --- dpdk-18.11.5/drivers/bus/dpaa/dpaa_bus.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/dpaa/dpaa_bus.c 2020-01-31 09:55:30.000000000 +0000 @@ -218,7 +218,7 @@ * allocated for dev->name/ */ memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); - sprintf(dev->name, "dpaa-sec%d", i); + sprintf(dev->name, "dpaa_sec-%d", i+1); DPAA_BUS_LOG(INFO, "%s cryptodev added", dev->name); dev->device.name = dev->name; dev->device.devargs = dpaa_devargs_lookup(dev); @@ -416,7 +416,7 @@ for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) { char sec_name[16]; - snprintf(sec_name, 16, "dpaa-sec%d", i); + snprintf(sec_name, 16, "dpaa_sec-%d", i+1); if (strcmp(sec_name, sep) == 0) { if (out_name) strcpy(out_name, sep); diff -Nru dpdk-18.11.5/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h dpdk-18.11.6/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h --- dpdk-18.11.5/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h 2020-01-31 09:55:30.000000000 +0000 @@ -54,6 +54,8 @@ #define DPAA2_SWP_CINH_REGION 1 #define DPAA2_SWP_CENA_MEM_REGION 2 +#define DPAA2_MAX_TX_RETRY_COUNT 10000 + #define MC_PORTAL_INDEX 0 #define NUM_DPIO_REGIONS 2 #define NUM_DQS_PER_QUEUE 2 diff -Nru dpdk-18.11.5/drivers/bus/fslmc/qbman/qbman_portal.c dpdk-18.11.6/drivers/bus/fslmc/qbman/qbman_portal.c --- dpdk-18.11.5/drivers/bus/fslmc/qbman/qbman_portal.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/fslmc/qbman/qbman_portal.c 2020-01-31 09:55:30.000000000 +0000 @@ -61,6 +61,8 @@ #define MAX_QBMAN_PORTALS 64 static struct qbman_swp *portal_idx_map[MAX_QBMAN_PORTALS]; +uint32_t qman_version; + /* Internal Function declaration */ static int qbman_swp_enqueue_array_mode_direct(struct qbman_swp *s, diff -Nru dpdk-18.11.5/drivers/bus/fslmc/qbman/qbman_portal.h dpdk-18.11.6/drivers/bus/fslmc/qbman/qbman_portal.h --- dpdk-18.11.5/drivers/bus/fslmc/qbman/qbman_portal.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/fslmc/qbman/qbman_portal.h 2020-01-31 09:55:30.000000000 +0000 @@ -11,7 +11,7 @@ #include "qbman_sys.h" #include -uint32_t qman_version; +extern uint32_t qman_version; #define QMAN_REV_4000 0x04000000 #define QMAN_REV_4100 0x04010000 #define QMAN_REV_4101 0x04010001 diff -Nru dpdk-18.11.5/drivers/bus/pci/Makefile dpdk-18.11.6/drivers/bus/pci/Makefile --- dpdk-18.11.5/drivers/bus/pci/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/pci/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -26,7 +26,7 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring -LDLIBS += -lrte_ethdev -lrte_pci -lrte_kvargs +LDLIBS += -lrte_pci -lrte_kvargs include $(RTE_SDK)/drivers/bus/pci/$(SYSTEM)/Makefile SRCS-$(CONFIG_RTE_LIBRTE_PCI_BUS) := $(addprefix $(SYSTEM)/,$(SRCS)) diff -Nru dpdk-18.11.5/drivers/bus/pci/linux/pci.c dpdk-18.11.6/drivers/bus/pci/linux/pci.c --- dpdk-18.11.5/drivers/bus/pci/linux/pci.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/pci/linux/pci.c 2020-01-31 09:55:30.000000000 +0000 @@ -592,18 +592,19 @@ "%s/" PCI_PRI_FMT "/iommu/intel-iommu/cap", rte_pci_get_sysfs_path(), addr->domain, addr->bus, addr->devid, addr->function); - if (access(filename, F_OK) == -1) { - /* We don't have an Intel IOMMU, assume VA supported*/ - return true; - } - /* We have an intel IOMMU */ fp = fopen(filename, "r"); if (fp == NULL) { - RTE_LOG(ERR, EAL, "%s(): can't open %s\n", __func__, filename); + /* We don't have an Intel IOMMU, assume VA supported */ + if (errno == ENOENT) + return true; + + RTE_LOG(ERR, EAL, "%s(): can't open %s: %s\n", + __func__, filename, strerror(errno)); return false; } + /* We have an Intel IOMMU */ if (fscanf(fp, "%" PRIx64, &vtd_cap_reg) != 1) { RTE_LOG(ERR, EAL, "%s(): can't read %s\n", __func__, filename); fclose(fp); diff -Nru dpdk-18.11.5/drivers/bus/pci/linux/pci_uio.c dpdk-18.11.6/drivers/bus/pci/linux/pci_uio.c --- dpdk-18.11.5/drivers/bus/pci/linux/pci_uio.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/pci/linux/pci_uio.c 2020-01-31 09:55:30.000000000 +0000 @@ -351,6 +351,8 @@ pci_map_addr = RTE_PTR_ADD(mapaddr, (size_t)dev->mem_resource[res_idx].len); + pci_map_addr = RTE_PTR_ALIGN(pci_map_addr, sysconf(_SC_PAGE_SIZE)); + maps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr; maps[map_idx].size = dev->mem_resource[res_idx].len; maps[map_idx].addr = mapaddr; diff -Nru dpdk-18.11.5/drivers/bus/pci/linux/pci_vfio.c dpdk-18.11.6/drivers/bus/pci/linux/pci_vfio.c --- dpdk-18.11.5/drivers/bus/pci/linux/pci_vfio.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/bus/pci/linux/pci_vfio.c 2020-01-31 09:55:30.000000000 +0000 @@ -451,7 +451,8 @@ int bar_index, int additional_flags) { struct memreg { - unsigned long offset, size; + uint64_t offset; + size_t size; } memreg[2] = {}; void *bar_addr; struct pci_msix_table *msix_table = &vfio_res->msix_table; @@ -487,7 +488,8 @@ RTE_LOG(DEBUG, EAL, "Trying to map BAR%d that contains the MSI-X " "table. Trying offsets: " - "0x%04lx:0x%04lx, 0x%04lx:0x%04lx\n", bar_index, + "0x%04" PRIx64 ":0x%04zx, 0x%04" PRIx64 ":0x%04zx\n", + bar_index, memreg[0].offset, memreg[0].size, memreg[1].offset, memreg[1].size); } else { @@ -512,8 +514,8 @@ if (map_addr != MAP_FAILED && memreg[1].offset && memreg[1].size) { void *second_addr = RTE_PTR_ADD(bar_addr, - memreg[1].offset - - (uintptr_t)bar->offset); + (uintptr_t)(memreg[1].offset - + bar->offset)); map_addr = pci_map_resource(second_addr, vfio_dev_fd, memreg[1].offset, @@ -731,6 +733,9 @@ bar_addr = pci_map_addr; pci_map_addr = RTE_PTR_ADD(bar_addr, (size_t) reg->size); + pci_map_addr = RTE_PTR_ALIGN(pci_map_addr, + sysconf(_SC_PAGE_SIZE)); + maps[i].addr = bar_addr; maps[i].offset = reg->offset; maps[i].size = reg->size; diff -Nru dpdk-18.11.5/drivers/common/cpt/cpt_ucode.h dpdk-18.11.6/drivers/common/cpt/cpt_ucode.h --- dpdk-18.11.5/drivers/common/cpt/cpt_ucode.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/common/cpt/cpt_ucode.h 2020-01-31 09:55:30.000000000 +0000 @@ -315,7 +315,8 @@ memcpy(fctx->enc.encr_key, key, key_len); fc_success: - *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags); + if (ctrl_flags != NULL) + *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags); success: cpt_ctx->enc_cipher = type; diff -Nru dpdk-18.11.5/drivers/common/dpaax/dpaax_iova_table.c dpdk-18.11.6/drivers/common/dpaax/dpaax_iova_table.c --- dpdk-18.11.5/drivers/common/dpaax/dpaax_iova_table.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/common/dpaax/dpaax_iova_table.c 2020-01-31 09:55:30.000000000 +0000 @@ -68,9 +68,12 @@ *count = 0; ret = glob(MEM_NODE_PATH_GLOB, 0, NULL, &result); + if (ret != 0) + ret = glob(MEM_NODE_PATH_GLOB_VM, 0, NULL, &result); + if (ret != 0) { - DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)", - MEM_NODE_PATH_GLOB, ret); + DPAAX_DEBUG("Unable to glob device-tree memory node (err: %d)", + ret); goto out; } diff -Nru dpdk-18.11.5/drivers/common/dpaax/dpaax_iova_table.h dpdk-18.11.6/drivers/common/dpaax/dpaax_iova_table.h --- dpdk-18.11.5/drivers/common/dpaax/dpaax_iova_table.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/common/dpaax/dpaax_iova_table.h 2020-01-31 09:55:30.000000000 +0000 @@ -45,6 +45,8 @@ * is SoC dependent, or even Uboot fixup dependent. */ #define MEM_NODE_PATH_GLOB "/proc/device-tree/memory[@0-9]*/reg" +/* For Virtual Machines memory node is at different path (below) */ +#define MEM_NODE_PATH_GLOB_VM "/proc/device-tree/memory/reg" /* Device file should be multiple of 16 bytes, each containing 8 byte of addr * and its length. Assuming max of 5 entries. */ diff -Nru dpdk-18.11.5/drivers/common/octeontx/rte_common_octeontx_version.map dpdk-18.11.6/drivers/common/octeontx/rte_common_octeontx_version.map --- dpdk-18.11.5/drivers/common/octeontx/rte_common_octeontx_version.map 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/common/octeontx/rte_common_octeontx_version.map 2020-01-31 09:55:30.000000000 +0000 @@ -1,6 +1,7 @@ DPDK_18.05 { global: + octeontx_logtype_mbox; octeontx_mbox_set_ram_mbox_base; octeontx_mbox_set_reg; octeontx_mbox_send; diff -Nru dpdk-18.11.5/drivers/compress/isal/meson.build dpdk-18.11.6/drivers/compress/isal/meson.build --- dpdk-18.11.5/drivers/compress/isal/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/compress/isal/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -9,6 +9,5 @@ deps += 'bus_vdev' sources = files('isal_compress_pmd.c', 'isal_compress_pmd_ops.c') ext_deps += dep -pkgconfig_extra_libs += '-lisal' allow_experimental_apis = true diff -Nru dpdk-18.11.5/drivers/compress/octeontx/include/zip_regs.h dpdk-18.11.6/drivers/compress/octeontx/include/zip_regs.h --- dpdk-18.11.5/drivers/compress/octeontx/include/zip_regs.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/compress/octeontx/include/zip_regs.h 2020-01-31 09:55:30.000000000 +0000 @@ -36,7 +36,6 @@ uint64_t reserved_1_63 : 63; #endif /* Word 0 - End */ } s; - /* struct zip_vqx_ena_s cn; */ } zip_vqx_ena_t; /** @@ -64,7 +63,6 @@ uint64_t reserved_49_63 : 15; #endif /* Word 0 - End */ } s; - /* struct zip_vqx_sbuf_addr_s cn; */ } zip_vqx_sbuf_addr_t; /** @@ -84,7 +82,6 @@ uint64_t reserved_20_63 : 44; #endif /* Word 0 - End */ } s; - /* struct zip_quex_doorbell_s cn; */ } zip_quex_doorbell_t; /** @@ -104,7 +101,6 @@ uint64_t addr : 64; #endif /* Word 0 - End */ } s; - /* struct zip_nptr_s_s cn83xx; */ }; /** @@ -197,7 +193,6 @@ uint64_t ef : 1; /** Beginning of file */ uint64_t bf : 1; - // uint64_t reserved_3_4 : 2; /** Comp/decomp operation */ uint64_t op : 2; /** Data sactter */ @@ -210,7 +205,6 @@ uint64_t hg : 1; uint64_t dg : 1; uint64_t ds : 1; - //uint64_t reserved_3_4 : 2; uint64_t op : 2; uint64_t bf : 1; uint64_t ef : 1; @@ -615,8 +609,6 @@ uint64_t hash3 : 64; #endif /* Word 7 - End */ } /** ZIP Result Structure */s; - - /* struct zip_zres_s_s cn83xx; */ }; /** diff -Nru dpdk-18.11.5/drivers/compress/octeontx/otx_zip.h dpdk-18.11.6/drivers/compress/octeontx/otx_zip.h --- dpdk-18.11.5/drivers/compress/octeontx/otx_zip.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/compress/octeontx/otx_zip.h 2020-01-31 09:55:30.000000000 +0000 @@ -17,7 +17,7 @@ #include -int octtx_zip_logtype_driver; +extern int octtx_zip_logtype_driver; /* ZIP VF Control/Status registers (CSRs): */ /* VF_BAR0: */ diff -Nru dpdk-18.11.5/drivers/compress/octeontx/otx_zip_pmd.c dpdk-18.11.6/drivers/compress/octeontx/otx_zip_pmd.c --- dpdk-18.11.5/drivers/compress/octeontx/otx_zip_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/compress/octeontx/otx_zip_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -11,6 +11,8 @@ #include "otx_zip.h" +int octtx_zip_logtype_driver; + static const struct rte_compressdev_capabilities octtx_zip_pmd_capabilities[] = { { .algo = RTE_COMP_ALGO_DEFLATE, diff -Nru dpdk-18.11.5/drivers/crypto/armv8/rte_armv8_pmd.c dpdk-18.11.6/drivers/crypto/armv8/rte_armv8_pmd.c --- dpdk-18.11.5/drivers/crypto/armv8/rte_armv8_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/armv8/rte_armv8_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -775,7 +775,6 @@ RTE_CRYPTODEV_FF_CPU_NEON | RTE_CRYPTODEV_FF_CPU_ARM_CE; - /* Set vector instructions mode supported */ internals = dev->data->dev_private; internals->max_nb_qpairs = init_params->max_nb_queue_pairs; diff -Nru dpdk-18.11.5/drivers/crypto/ccp/ccp_crypto.c dpdk-18.11.6/drivers/crypto/ccp/ccp_crypto.c --- dpdk-18.11.5/drivers/crypto/ccp/ccp_crypto.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/ccp_crypto.c 2020-01-31 09:55:30.000000000 +0000 @@ -2680,7 +2680,9 @@ struct rte_crypto_op **op, struct ccp_queue *cmd_q, uint16_t nb_ops, - int slots_req) + uint16_t total_nb_ops, + int slots_req, + uint16_t b_idx) { int i, result = 0; struct ccp_batch_info *b_info; @@ -2701,6 +2703,7 @@ /* populate batch info necessary for dequeue */ b_info->op_idx = 0; + b_info->b_idx = 0; b_info->lsb_buf_idx = 0; b_info->desccnt = 0; b_info->cmd_q = cmd_q; @@ -2710,7 +2713,7 @@ b_info->head_offset = (uint32_t)(cmd_q->qbase_phys_addr + cmd_q->qidx * Q_DESC_SIZE); - for (i = 0; i < nb_ops; i++) { + for (i = b_idx; i < (nb_ops+b_idx); i++) { session = (struct ccp_session *)get_sym_session_private_data( op[i]->sym->session, ccp_cryptodev_driver_id); @@ -2738,7 +2741,7 @@ session, auth_ctx); if (op[i]->status != RTE_CRYPTO_OP_STATUS_SUCCESS) - continue; + CCP_LOG_ERR("RTE_CRYPTO_OP_STATUS_AUTH_FAILED"); } else result = ccp_crypto_auth(op[i], cmd_q, b_info); @@ -2762,6 +2765,8 @@ } b_info->opcnt = i; + b_info->b_idx = b_idx; + b_info->total_nb_ops = total_nb_ops; b_info->tail_offset = (uint32_t)(cmd_q->qbase_phys_addr + cmd_q->qidx * Q_DESC_SIZE); @@ -2776,7 +2781,7 @@ rte_ring_enqueue(qp->processed_pkts, (void *)b_info); EVP_MD_CTX_destroy(auth_ctx); - return i; + return i-b_idx; } static inline void ccp_auth_dq_prepare(struct rte_crypto_op *op) @@ -2861,8 +2866,8 @@ } min_ops = RTE_MIN(nb_ops, b_info->opcnt); - for (i = 0; i < min_ops; i++) { - op_d[i] = b_info->op[b_info->op_idx++]; + for (i = b_info->b_idx; i < min_ops; i++) { + op_d[i] = b_info->op[b_info->b_idx + b_info->op_idx++]; session = (struct ccp_session *)get_sym_session_private_data( op_d[i]->sym->session, ccp_cryptodev_driver_id); @@ -2903,7 +2908,8 @@ int process_ops_to_dequeue(struct ccp_qp *qp, struct rte_crypto_op **op, - uint16_t nb_ops) + uint16_t nb_ops, + uint16_t *total_nb_ops) { struct ccp_batch_info *b_info; uint32_t cur_head_offset; @@ -2918,6 +2924,7 @@ if (b_info->auth_ctr == b_info->opcnt) goto success; + *total_nb_ops = b_info->total_nb_ops; cur_head_offset = CCP_READ_REG(b_info->cmd_q->reg_base, CMD_Q_HEAD_LO_BASE); @@ -2927,7 +2934,7 @@ qp->b_info = b_info; return 0; } - } else { + } else if (b_info->tail_offset != b_info->head_offset) { if ((cur_head_offset >= b_info->head_offset) || (cur_head_offset < b_info->tail_offset)) { qp->b_info = b_info; @@ -2937,6 +2944,7 @@ success: + *total_nb_ops = b_info->total_nb_ops; nb_ops = ccp_prepare_ops(qp, op, b_info, nb_ops); rte_atomic64_add(&b_info->cmd_q->free_slots, b_info->desccnt); b_info->desccnt = 0; diff -Nru dpdk-18.11.5/drivers/crypto/ccp/ccp_crypto.h dpdk-18.11.6/drivers/crypto/ccp/ccp_crypto.h --- dpdk-18.11.5/drivers/crypto/ccp/ccp_crypto.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/ccp_crypto.h 2020-01-31 09:55:30.000000000 +0000 @@ -353,7 +353,9 @@ struct rte_crypto_op **op, struct ccp_queue *cmd_q, uint16_t nb_ops, - int slots_req); + uint16_t total_nb_ops, + int slots_req, + uint16_t b_idx); /** * process crypto ops to be dequeued @@ -365,7 +367,8 @@ */ int process_ops_to_dequeue(struct ccp_qp *qp, struct rte_crypto_op **op, - uint16_t nb_ops); + uint16_t nb_ops, + uint16_t *total_nb_ops); /** diff -Nru dpdk-18.11.5/drivers/crypto/ccp/ccp_dev.h dpdk-18.11.6/drivers/crypto/ccp/ccp_dev.h --- dpdk-18.11.5/drivers/crypto/ccp/ccp_dev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/ccp_dev.h 2020-01-31 09:55:30.000000000 +0000 @@ -59,7 +59,7 @@ #define CMD_Q_RUN 0x1 #define CMD_Q_SIZE 0x1F #define CMD_Q_SHIFT 3 -#define COMMANDS_PER_QUEUE 2048 +#define COMMANDS_PER_QUEUE 8192 #define QUEUE_SIZE_VAL ((ffs(COMMANDS_PER_QUEUE) - 2) & \ CMD_Q_SIZE) diff -Nru dpdk-18.11.5/drivers/crypto/ccp/ccp_pmd_ops.c dpdk-18.11.6/drivers/crypto/ccp/ccp_pmd_ops.c --- dpdk-18.11.5/drivers/crypto/ccp/ccp_pmd_ops.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/ccp_pmd_ops.c 2020-01-31 09:55:30.000000000 +0000 @@ -47,9 +47,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 20, \ + .min = 1, \ .max = 20, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -89,9 +89,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 28, \ + .min = 1, \ .max = 28, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -173,9 +173,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 32, \ + .min = 1, \ .max = 32, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -257,9 +257,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 48, \ + .min = 1, \ .max = 48, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -341,9 +341,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 64, \ + .min = 1, \ .max = 64, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -383,9 +383,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 64, \ + .min = 1, \ .max = 64, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ @@ -536,9 +536,9 @@ .increment = 1 \ }, \ .digest_size = { \ - .min = 16, \ + .min = 1, \ .max = 16, \ - .increment = 0 \ + .increment = 1 \ }, \ .aad_size = { 0 } \ }, } \ diff -Nru dpdk-18.11.5/drivers/crypto/ccp/ccp_pmd_private.h dpdk-18.11.6/drivers/crypto/ccp/ccp_pmd_private.h --- dpdk-18.11.5/drivers/crypto/ccp/ccp_pmd_private.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/ccp_pmd_private.h 2020-01-31 09:55:30.000000000 +0000 @@ -31,9 +31,9 @@ #endif /**< Maximum queue pairs supported by CCP PMD */ -#define CCP_PMD_MAX_QUEUE_PAIRS 1 +#define CCP_PMD_MAX_QUEUE_PAIRS 8 #define CCP_NB_MAX_DESCRIPTORS 1024 -#define CCP_MAX_BURST 64 +#define CCP_MAX_BURST 256 #include "ccp_dev.h" @@ -50,8 +50,10 @@ struct rte_crypto_op *op[CCP_MAX_BURST]; /**< optable populated at enque time from app*/ int op_idx; + uint16_t b_idx; struct ccp_queue *cmd_q; uint16_t opcnt; + uint16_t total_nb_ops; /**< no. of crypto ops in batch*/ int desccnt; /**< no. of ccp queue descriptors*/ diff -Nru dpdk-18.11.5/drivers/crypto/ccp/rte_ccp_pmd.c dpdk-18.11.6/drivers/crypto/ccp/rte_ccp_pmd.c --- dpdk-18.11.5/drivers/crypto/ccp/rte_ccp_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/ccp/rte_ccp_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -21,6 +21,7 @@ */ static unsigned int ccp_pmd_init_done; uint8_t ccp_cryptodev_driver_id; +uint8_t cryptodev_cnt; struct ccp_pmd_init_params { struct rte_cryptodev_pmd_init_params def_p; @@ -200,30 +201,46 @@ struct ccp_queue *cmd_q; struct rte_cryptodev *dev = qp->dev; uint16_t i, enq_cnt = 0, slots_req = 0; + uint16_t tmp_ops = nb_ops, b_idx, cur_ops = 0; if (nb_ops == 0) return 0; if (unlikely(rte_ring_full(qp->processed_pkts) != 0)) return 0; + if (tmp_ops >= cryptodev_cnt) + cur_ops = nb_ops / cryptodev_cnt + (nb_ops)%cryptodev_cnt; + else + cur_ops = tmp_ops; + while (tmp_ops) { + b_idx = nb_ops - tmp_ops; + slots_req = 0; + if (cur_ops <= tmp_ops) { + tmp_ops -= cur_ops; + } else { + cur_ops = tmp_ops; + tmp_ops = 0; + } + for (i = 0; i < cur_ops; i++) { + sess = get_ccp_session(qp, ops[i + b_idx]); + if (unlikely(sess == NULL) && (i == 0)) { + qp->qp_stats.enqueue_err_count++; + return 0; + } else if (sess == NULL) { + cur_ops = i; + break; + } + slots_req += ccp_compute_slot_count(sess); + } - for (i = 0; i < nb_ops; i++) { - sess = get_ccp_session(qp, ops[i]); - if (unlikely(sess == NULL) && (i == 0)) { - qp->qp_stats.enqueue_err_count++; + cmd_q = ccp_allot_queue(dev, slots_req); + if (unlikely(cmd_q == NULL)) return 0; - } else if (sess == NULL) { - nb_ops = i; - break; - } - slots_req += ccp_compute_slot_count(sess); + enq_cnt += process_ops_to_enqueue(qp, ops, cmd_q, cur_ops, + nb_ops, slots_req, b_idx); + i++; } - cmd_q = ccp_allot_queue(dev, slots_req); - if (unlikely(cmd_q == NULL)) - return 0; - - enq_cnt = process_ops_to_enqueue(qp, ops, cmd_q, nb_ops, slots_req); qp->qp_stats.enqueued_count += enq_cnt; return enq_cnt; } @@ -233,9 +250,16 @@ uint16_t nb_ops) { struct ccp_qp *qp = queue_pair; - uint16_t nb_dequeued = 0, i; + uint16_t nb_dequeued = 0, i, total_nb_ops; + + nb_dequeued = process_ops_to_dequeue(qp, ops, nb_ops, &total_nb_ops); - nb_dequeued = process_ops_to_dequeue(qp, ops, nb_ops); + if (total_nb_ops) { + while (nb_dequeued != total_nb_ops) { + nb_dequeued = process_ops_to_dequeue(qp, + ops, nb_ops, &total_nb_ops); + } + } /* Free session if a session-less crypto op */ for (i = 0; i < nb_dequeued; i++) @@ -288,7 +312,6 @@ { struct rte_cryptodev *dev; struct ccp_private *internals; - uint8_t cryptodev_cnt = 0; if (init_params->def_p.name[0] == '\0') snprintf(init_params->def_p.name, diff -Nru dpdk-18.11.5/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c dpdk-18.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c --- dpdk-18.11.5/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 2020-01-31 09:55:30.000000000 +0000 @@ -1301,7 +1301,7 @@ { struct rte_crypto_op *op; uint16_t len = DPAA2_GET_FD_LEN(fd); - uint16_t diff = 0; + int16_t diff = 0; dpaa2_sec_session *sess_priv; struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF( diff -Nru dpdk-18.11.5/drivers/crypto/dpaa_sec/dpaa_sec.c dpdk-18.11.6/drivers/crypto/dpaa_sec/dpaa_sec.c --- dpdk-18.11.5/drivers/crypto/dpaa_sec/dpaa_sec.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/dpaa_sec/dpaa_sec.c 2020-01-31 09:55:30.000000000 +0000 @@ -37,6 +37,7 @@ #include #include #include +#include enum rta_sec_era rta_sec_era; @@ -99,8 +100,10 @@ const struct rte_memseg *ms; ms = rte_mem_virt2memseg(vaddr, NULL); - if (ms) + if (ms) { + dpaax_iova_table_update(ms->iova, ms->addr, ms->len); return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr); + } return (size_t)NULL; } @@ -258,7 +261,8 @@ { return ((ses->cipher_alg != RTE_CRYPTO_CIPHER_NULL) && (ses->auth_alg != RTE_CRYPTO_AUTH_NULL) && - (ses->proto_alg != RTE_SECURITY_PROTOCOL_IPSEC)); + (ses->proto_alg != RTE_SECURITY_PROTOCOL_IPSEC) && + (ses->aead_alg == 0)); } static inline int is_proto_ipsec(dpaa_sec_session *ses) @@ -2391,8 +2395,7 @@ int retval; - snprintf(cryptodev_name, sizeof(cryptodev_name), "dpaa_sec-%d", - dpaa_dev->id.dev_id); + snprintf(cryptodev_name, sizeof(cryptodev_name), "%s", dpaa_dev->name); cryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id()); if (cryptodev == NULL) diff -Nru dpdk-18.11.5/drivers/crypto/mvsam/rte_mrvl_pmd.c dpdk-18.11.6/drivers/crypto/mvsam/rte_mrvl_pmd.c --- dpdk-18.11.5/drivers/crypto/mvsam/rte_mrvl_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/mvsam/rte_mrvl_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -786,7 +786,6 @@ RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT; - /* Set vector instructions mode supported */ internals = dev->data->dev_private; internals->max_nb_qpairs = init_params->common.max_nb_queue_pairs; diff -Nru dpdk-18.11.5/drivers/crypto/null/null_crypto_pmd.c dpdk-18.11.6/drivers/crypto/null/null_crypto_pmd.c --- dpdk-18.11.5/drivers/crypto/null/null_crypto_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/null/null_crypto_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -10,6 +10,7 @@ #include "null_crypto_pmd_private.h" static uint8_t cryptodev_driver_id; +int null_logtype_driver; /** verify and set session parameters */ int diff -Nru dpdk-18.11.5/drivers/crypto/null/null_crypto_pmd_private.h dpdk-18.11.6/drivers/crypto/null/null_crypto_pmd_private.h --- dpdk-18.11.5/drivers/crypto/null/null_crypto_pmd_private.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/null/null_crypto_pmd_private.h 2020-01-31 09:55:30.000000000 +0000 @@ -8,7 +8,7 @@ #define CRYPTODEV_NAME_NULL_PMD crypto_null /**< Null crypto PMD device name */ -int null_logtype_driver; +extern int null_logtype_driver; #define NULL_LOG(level, fmt, ...) \ rte_log(RTE_LOG_ ## level, null_logtype_driver, \ diff -Nru dpdk-18.11.5/drivers/crypto/octeontx/otx_cryptodev.c dpdk-18.11.6/drivers/crypto/octeontx/otx_cryptodev.c --- dpdk-18.11.5/drivers/crypto/octeontx/otx_cryptodev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/octeontx/otx_cryptodev.c 2020-01-31 09:55:30.000000000 +0000 @@ -121,6 +121,7 @@ RTE_PMD_REGISTER_PCI(CRYPTODEV_NAME_OCTEONTX_PMD, otx_cryptodev_pmd); RTE_PMD_REGISTER_PCI_TABLE(CRYPTODEV_NAME_OCTEONTX_PMD, pci_id_cpt_table); +RTE_PMD_REGISTER_KMOD_DEP(CRYPTODEV_NAME_OCTEONTX_PMD, "vfio-pci"); RTE_PMD_REGISTER_CRYPTO_DRIVER(otx_cryptodev_drv, otx_cryptodev_pmd.driver, otx_cryptodev_driver_id); diff -Nru dpdk-18.11.5/drivers/crypto/openssl/rte_openssl_pmd.c dpdk-18.11.6/drivers/crypto/openssl/rte_openssl_pmd.c --- dpdk-18.11.5/drivers/crypto/openssl/rte_openssl_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/openssl/rte_openssl_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -1289,6 +1289,7 @@ int srclen, aadlen, status = -1; uint32_t offset; uint8_t taglen; + EVP_CIPHER_CTX *ctx_copy; /* * Segmented destination buffer is not supported for @@ -1325,6 +1326,8 @@ } taglen = sess->auth.digest_length; + ctx_copy = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_copy(ctx_copy, sess->cipher.ctx); if (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT) { if (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC || @@ -1332,12 +1335,12 @@ status = process_openssl_auth_encryption_gcm( mbuf_src, offset, srclen, aad, aadlen, iv, - dst, tag, sess->cipher.ctx); + dst, tag, ctx_copy); else status = process_openssl_auth_encryption_ccm( mbuf_src, offset, srclen, aad, aadlen, iv, - dst, tag, taglen, sess->cipher.ctx); + dst, tag, taglen, ctx_copy); } else { if (sess->auth.algo == RTE_CRYPTO_AUTH_AES_GMAC || @@ -1345,14 +1348,15 @@ status = process_openssl_auth_decryption_gcm( mbuf_src, offset, srclen, aad, aadlen, iv, - dst, tag, sess->cipher.ctx); + dst, tag, ctx_copy); else status = process_openssl_auth_decryption_ccm( mbuf_src, offset, srclen, aad, aadlen, iv, - dst, tag, taglen, sess->cipher.ctx); + dst, tag, taglen, ctx_copy); } + EVP_CIPHER_CTX_free(ctx_copy); if (status != 0) { if (status == (-EFAULT) && sess->auth.operation == @@ -1371,6 +1375,7 @@ { uint8_t *dst, *iv; int srclen, status; + EVP_CIPHER_CTX *ctx_copy; /* * Segmented destination buffer is not supported for @@ -1387,22 +1392,25 @@ iv = rte_crypto_op_ctod_offset(op, uint8_t *, sess->iv.offset); + ctx_copy = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_copy(ctx_copy, sess->cipher.ctx); if (sess->cipher.mode == OPENSSL_CIPHER_LIB) if (sess->cipher.direction == RTE_CRYPTO_CIPHER_OP_ENCRYPT) status = process_openssl_cipher_encrypt(mbuf_src, dst, op->sym->cipher.data.offset, iv, - srclen, sess->cipher.ctx); + srclen, ctx_copy); else status = process_openssl_cipher_decrypt(mbuf_src, dst, op->sym->cipher.data.offset, iv, - srclen, sess->cipher.ctx); + srclen, ctx_copy); else status = process_openssl_cipher_des3ctr(mbuf_src, dst, op->sym->cipher.data.offset, iv, sess->cipher.key.data, srclen, - sess->cipher.ctx); + ctx_copy); + EVP_CIPHER_CTX_free(ctx_copy); if (status != 0) op->status = RTE_CRYPTO_OP_STATUS_ERROR; } @@ -1506,6 +1514,8 @@ { uint8_t *dst; int srclen, status; + EVP_MD_CTX *ctx_a; + HMAC_CTX *ctx_h; srclen = op->sym->auth.data.length; @@ -1513,14 +1523,20 @@ switch (sess->auth.mode) { case OPENSSL_AUTH_AS_AUTH: + ctx_a = EVP_MD_CTX_create(); + EVP_MD_CTX_copy_ex(ctx_a, sess->auth.auth.ctx); status = process_openssl_auth(mbuf_src, dst, op->sym->auth.data.offset, NULL, NULL, srclen, - sess->auth.auth.ctx, sess->auth.auth.evp_algo); + ctx_a, sess->auth.auth.evp_algo); + EVP_MD_CTX_destroy(ctx_a); break; case OPENSSL_AUTH_AS_HMAC: + ctx_h = HMAC_CTX_new(); + HMAC_CTX_copy(ctx_h, sess->auth.hmac.ctx); status = process_openssl_auth_hmac(mbuf_src, dst, op->sym->auth.data.offset, srclen, - sess->auth.hmac.ctx); + ctx_h); + HMAC_CTX_free(ctx_h); break; default: status = -1; @@ -2125,7 +2141,6 @@ RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO; - /* Set vector instructions mode supported */ internals = dev->data->dev_private; internals->max_nb_qpairs = init_params->max_nb_queue_pairs; diff -Nru dpdk-18.11.5/drivers/crypto/qat/qat_sym.c dpdk-18.11.6/drivers/crypto/qat/qat_sym.c --- dpdk-18.11.5/drivers/crypto/qat/qat_sym.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/qat/qat_sym.c 2020-01-31 09:55:30.000000000 +0000 @@ -306,9 +306,8 @@ } min_ofs = auth_ofs; - if (likely(ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL)) - auth_param->auth_res_addr = - op->sym->auth.digest.phys_addr; + auth_param->auth_res_addr = + op->sym->auth.digest.phys_addr; } diff -Nru dpdk-18.11.5/drivers/crypto/qat/qat_sym_capabilities.h dpdk-18.11.6/drivers/crypto/qat/qat_sym_capabilities.h --- dpdk-18.11.5/drivers/crypto/qat/qat_sym_capabilities.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/qat/qat_sym_capabilities.h 2020-01-31 09:55:30.000000000 +0000 @@ -145,8 +145,8 @@ .increment = 0 \ }, \ .digest_size = { \ - .min = 16, \ - .max = 16, \ + .min = 12, \ + .max = 12, \ .increment = 0 \ }, \ .aad_size = { 0 }, \ @@ -167,7 +167,7 @@ .increment = 0 \ }, \ .digest_size = { \ - .min = 12, \ + .min = 4, \ .max = 16, \ .increment = 4 \ } \ diff -Nru dpdk-18.11.5/drivers/crypto/virtio/virtio_pci.c dpdk-18.11.6/drivers/crypto/virtio/virtio_pci.c --- dpdk-18.11.5/drivers/crypto/virtio/virtio_pci.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/virtio/virtio_pci.c 2020-01-31 09:55:30.000000000 +0000 @@ -31,7 +31,7 @@ #define VIRTIO_PCI_CONFIG(hw) \ (((hw)->use_msix == VIRTIO_MSIX_ENABLED) ? 24 : 20) -struct virtio_hw_internal virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO]; +struct virtio_hw_internal crypto_virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO]; static inline int check_vq_phys_addr_ok(struct virtqueue *vq) @@ -452,7 +452,7 @@ */ if (virtio_read_caps(dev, hw) == 0) { VIRTIO_CRYPTO_INIT_LOG_INFO("modern virtio pci detected."); - virtio_hw_internal[hw->dev_id].vtpci_ops = + crypto_virtio_hw_internal[hw->dev_id].vtpci_ops = &virtio_crypto_modern_ops; hw->modern = 1; return 0; diff -Nru dpdk-18.11.5/drivers/crypto/virtio/virtio_pci.h dpdk-18.11.6/drivers/crypto/virtio/virtio_pci.h --- dpdk-18.11.5/drivers/crypto/virtio/virtio_pci.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/crypto/virtio/virtio_pci.h 2020-01-31 09:55:30.000000000 +0000 @@ -201,10 +201,10 @@ struct rte_pci_ioport io; }; -#define VTPCI_OPS(hw) (virtio_hw_internal[(hw)->dev_id].vtpci_ops) -#define VTPCI_IO(hw) (&virtio_hw_internal[(hw)->dev_id].io) +#define VTPCI_OPS(hw) (crypto_virtio_hw_internal[(hw)->dev_id].vtpci_ops) +#define VTPCI_IO(hw) (&crypto_virtio_hw_internal[(hw)->dev_id].io) -extern struct virtio_hw_internal virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO]; +extern struct virtio_hw_internal crypto_virtio_hw_internal[RTE_MAX_VIRTIO_CRYPTO]; /* * How many bits to shift physical queue address written to QUEUE_PFN. diff -Nru dpdk-18.11.5/drivers/event/dpaa/dpaa_eventdev.c dpdk-18.11.6/drivers/event/dpaa/dpaa_eventdev.c --- dpdk-18.11.5/drivers/event/dpaa/dpaa_eventdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/dpaa/dpaa_eventdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -469,6 +469,7 @@ RTE_SET_USED(queue_id); memset(queue_conf, 0, sizeof(struct rte_event_queue_conf)); + queue_conf->nb_atomic_flows = DPAA_EVENT_QUEUE_ATOMIC_FLOWS; queue_conf->schedule_type = RTE_SCHED_TYPE_PARALLEL; queue_conf->priority = RTE_EVENT_DEV_PRIORITY_HIGHEST; } diff -Nru dpdk-18.11.5/drivers/event/dpaa/dpaa_eventdev.h dpdk-18.11.6/drivers/event/dpaa/dpaa_eventdev.h --- dpdk-18.11.5/drivers/event/dpaa/dpaa_eventdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/dpaa/dpaa_eventdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -32,7 +32,7 @@ RTE_EVENT_DEV_CAP_BURST_MODE; \ } while (0) -#define DPAA_EVENT_QUEUE_ATOMIC_FLOWS 0 +#define DPAA_EVENT_QUEUE_ATOMIC_FLOWS 2048 #define DPAA_EVENT_QUEUE_ORDER_SEQUENCES 2048 #define RTE_EVENT_ETH_RX_ADAPTER_DPAA_CAP \ diff -Nru dpdk-18.11.5/drivers/event/dpaa2/dpaa2_eventdev.c dpdk-18.11.6/drivers/event/dpaa2/dpaa2_eventdev.c --- dpdk-18.11.5/drivers/event/dpaa2/dpaa2_eventdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/dpaa2/dpaa2_eventdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright 2017 NXP - * + * Copyright 2017,2019 NXP */ #include @@ -470,8 +468,7 @@ RTE_SET_USED(queue_conf); queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS; - queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC | - RTE_SCHED_TYPE_PARALLEL; + queue_conf->schedule_type = RTE_SCHED_TYPE_PARALLEL; queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL; } diff -Nru dpdk-18.11.5/drivers/event/octeontx/ssovf_worker.h dpdk-18.11.6/drivers/event/octeontx/ssovf_worker.h --- dpdk-18.11.5/drivers/event/octeontx/ssovf_worker.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/octeontx/ssovf_worker.h 2020-01-31 09:55:30.000000000 +0000 @@ -30,8 +30,7 @@ octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; /* Get mbuf from wqe */ - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - OCTTX_PACKET_WQE_SKIP); + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); rte_prefetch_non_temporal(mbuf); mbuf->packet_type = ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]; @@ -46,6 +45,16 @@ return mbuf; } +static __rte_always_inline void +ssovf_octeontx_wqe_free(uint64_t work) +{ + octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; + struct rte_mbuf *mbuf; + + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); + rte_pktmbuf_free(mbuf); +} + static __rte_always_inline uint16_t ssows_get_work(struct ssows *ws, struct rte_event *ev) { @@ -59,9 +68,13 @@ ws->cur_grp = sched_type_queue >> 2; sched_type_queue = sched_type_queue << 38; ev->event = sched_type_queue | (get_work0 & 0xffffffff); + if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) { ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1, (ev->event >> 20) & 0x7F); + } else if (unlikely((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF)) { + ssovf_octeontx_wqe_free(get_work1); + return 0; } else { ev->u64 = get_work1; } diff -Nru dpdk-18.11.5/drivers/event/opdl/opdl_test.c dpdk-18.11.6/drivers/event/opdl/opdl_test.c --- dpdk-18.11.5/drivers/event/opdl/opdl_test.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/opdl/opdl_test.c 2020-01-31 09:55:30.000000000 +0000 @@ -695,9 +695,6 @@ static int single_link(struct test *t) { - /* const uint8_t rx_port = 0; */ - /* const uint8_t w1_port = 1; */ - /* const uint8_t w3_port = 3; */ const uint8_t tx_port = 2; int err; struct rte_mbuf *mbufs[3]; diff -Nru dpdk-18.11.5/drivers/event/sw/sw_evdev_xstats.c dpdk-18.11.6/drivers/event/sw/sw_evdev_xstats.c --- dpdk-18.11.5/drivers/event/sw/sw_evdev_xstats.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/event/sw/sw_evdev_xstats.c 2020-01-31 09:55:30.000000000 +0000 @@ -491,7 +491,7 @@ values[xidx] = val; if (xs->reset_allowed && reset) - xs->reset_value = val; + xs->reset_value += val; xidx++; } @@ -544,8 +544,7 @@ if (!xs->reset_allowed) continue; - uint64_t val = xs->fn(sw, xs->obj_idx, xs->stat, xs->extra_arg) - - xs->reset_value; + uint64_t val = xs->fn(sw, xs->obj_idx, xs->stat, xs->extra_arg); xs->reset_value = val; } } diff -Nru dpdk-18.11.5/drivers/net/af_packet/rte_eth_af_packet.c dpdk-18.11.6/drivers/net/af_packet/rte_eth_af_packet.c --- dpdk-18.11.5/drivers/net/af_packet/rte_eth_af_packet.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/af_packet/rte_eth_af_packet.c 2020-01-31 09:55:30.000000000 +0000 @@ -239,8 +239,14 @@ } /* kick-off transmits */ - if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1) { - /* error sending -- no packets transmitted */ + if (sendto(pkt_q->sockfd, NULL, 0, MSG_DONTWAIT, NULL, 0) == -1 && + errno != ENOBUFS && errno != EAGAIN) { + /* + * In case of a ENOBUFS/EAGAIN error all of the enqueued + * packets will be considered successful even though only some + * are sent. + */ + num_tx = 0; num_tx_bytes = 0; } @@ -970,6 +976,7 @@ { struct rte_eth_dev *eth_dev = NULL; struct pmd_internals *internals; + struct tpacket_req *req; unsigned q; PMD_LOG(INFO, "Closing AF_PACKET ethdev on numa socket %u", @@ -990,7 +997,10 @@ return rte_eth_dev_release_port(eth_dev); internals = eth_dev->data->dev_private; + req = &internals->req; for (q = 0; q < internals->nb_queues; q++) { + munmap(internals->rx_queue[q].map, + 2 * req->tp_block_size * req->tp_block_nr); rte_free(internals->rx_queue[q].rd); rte_free(internals->tx_queue[q].rd); } diff -Nru dpdk-18.11.5/drivers/net/atlantic/atl_ethdev.c dpdk-18.11.6/drivers/net/atlantic/atl_ethdev.c --- dpdk-18.11.5/drivers/net/atlantic/atl_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/atlantic/atl_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -43,9 +43,6 @@ static int atl_fw_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size); -static void atl_dev_info_get(struct rte_eth_dev *dev, - struct rte_eth_dev_info *dev_info); - static const uint32_t *atl_dev_supported_ptypes_get(struct rte_eth_dev *dev); static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); @@ -362,6 +359,8 @@ hw->aq_nic_cfg = &adapter->hw_cfg; + pthread_mutex_init(&hw->mbox_mutex, NULL); + /* disable interrupt */ atl_disable_intr(hw); @@ -425,6 +424,8 @@ rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = NULL; + pthread_mutex_destroy(&hw->mbox_mutex); + return 0; } diff -Nru dpdk-18.11.5/drivers/net/atlantic/atl_types.h dpdk-18.11.6/drivers/net/atlantic/atl_types.h --- dpdk-18.11.5/drivers/net/atlantic/atl_types.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/atlantic/atl_types.h 2020-01-31 09:55:30.000000000 +0000 @@ -10,6 +10,7 @@ #include #include #include +#include typedef uint8_t u8; typedef int8_t s8; @@ -103,6 +104,8 @@ u32 rpc_addr; u32 rpc_tid; struct hw_aq_atl_utils_fw_rpc rpc; + + pthread_mutex_t mbox_mutex; }; struct aq_fw_ops { diff -Nru dpdk-18.11.5/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c dpdk-18.11.6/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c --- dpdk-18.11.5/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c 2020-01-31 09:55:30.000000000 +0000 @@ -6,6 +6,7 @@ */ #include +#include #include "../atl_hw_regs.h" #include "../atl_types.h" @@ -213,13 +214,15 @@ u32 mac_addr[2] = { 0 }; u32 efuse_addr = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_EFUSE_ADDR); + pthread_mutex_lock(&self->mbox_mutex); + if (efuse_addr != 0) { err = hw_atl_utils_fw_downld_dwords(self, efuse_addr + (40U * 4U), mac_addr, ARRAY_SIZE(mac_addr)); if (err) - return err; + goto exit; mac_addr[0] = rte_constant_bswap32(mac_addr[0]); mac_addr[1] = rte_constant_bswap32(mac_addr[1]); } @@ -248,6 +251,10 @@ h >>= 8; mac[0] = (u8)(0xFFU & h); } + +exit: + pthread_mutex_unlock(&self->mbox_mutex); + return err; } @@ -257,6 +264,9 @@ u32 mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR); u32 orig_stats_val = mpi_opts & BIT(CAPS_HI_STATISTICS); + + pthread_mutex_lock(&self->mbox_mutex); + /* Toggle statistics bit for FW to update */ mpi_opts = mpi_opts ^ BIT(CAPS_HI_STATISTICS); aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts); @@ -267,9 +277,15 @@ BIT(CAPS_HI_STATISTICS)), 1U, 10000U); if (err) - return err; + goto exit; + + err = hw_atl_utils_update_stats(self); + +exit: + pthread_mutex_unlock(&self->mbox_mutex); + + return err; - return hw_atl_utils_update_stats(self); } static int aq_fw2x_get_temp(struct aq_hw_s *self, int *temp) @@ -279,6 +295,8 @@ u32 temp_val = mpi_opts & BIT(CAPS_HI_TEMPERATURE); u32 temp_res; + pthread_mutex_lock(&self->mbox_mutex); + /* Toggle statistics bit for FW to 0x36C.18 (CAPS_HI_TEMPERATURE) */ mpi_opts = mpi_opts ^ BIT(CAPS_HI_TEMPERATURE); aq_hw_write_reg(self, HW_ATL_FW2X_MPI_CONTROL2_ADDR, mpi_opts); @@ -294,6 +312,9 @@ &temp_res, sizeof(temp_res) / sizeof(u32)); + + pthread_mutex_unlock(&self->mbox_mutex); + if (err) return err; @@ -511,6 +532,8 @@ if ((self->caps_lo & BIT(CAPS_LO_SMBUS_READ)) == 0) return -EOPNOTSUPP; + pthread_mutex_lock(&self->mbox_mutex); + request.msg_id = 0; request.device_id = dev_addr; request.address = offset; @@ -522,7 +545,7 @@ sizeof(request) / sizeof(u32)); if (err < 0) - return err; + goto exit; /* Toggle 0x368.CAPS_LO_SMBUS_READ bit */ mpi_opts = aq_hw_read_reg(self, HW_ATL_FW2X_MPI_CONTROL_ADDR); @@ -537,17 +560,19 @@ 10U, 10000U); if (err < 0) - return err; + goto exit; err = hw_atl_utils_fw_downld_dwords(self, self->rpc_addr + sizeof(u32), &result, sizeof(result) / sizeof(u32)); if (err < 0) - return err; + goto exit; - if (result) - return -EIO; + if (result) { + err = -EIO; + goto exit; + } if (num_dwords) { err = hw_atl_utils_fw_downld_dwords(self, @@ -556,7 +581,7 @@ num_dwords); if (err < 0) - return err; + goto exit; } if (bytes_remains) { @@ -569,13 +594,16 @@ 1); if (err < 0) - return err; + goto exit; rte_memcpy((u8 *)data + len - bytes_remains, &val, bytes_remains); } - return 0; +exit: + pthread_mutex_unlock(&self->mbox_mutex); + + return err; } @@ -594,13 +622,15 @@ request.address = offset; request.length = len; + pthread_mutex_lock(&self->mbox_mutex); + /* Write SMBUS request to cfg memory */ err = hw_atl_utils_fw_upload_dwords(self, self->rpc_addr, (u32 *)(void *)&request, sizeof(request) / sizeof(u32)); if (err < 0) - return err; + goto exit; /* Write SMBUS data to cfg memory */ u32 num_dwords = len / sizeof(u32); @@ -613,7 +643,7 @@ num_dwords); if (err < 0) - return err; + goto exit; } if (bytes_remains) { @@ -629,7 +659,7 @@ 1); if (err < 0) - return err; + goto exit; } /* Toggle 0x368.CAPS_LO_SMBUS_WRITE bit */ @@ -644,7 +674,7 @@ 10U, 10000U); if (err < 0) - return err; + goto exit; /* Read status of write operation */ err = hw_atl_utils_fw_downld_dwords(self, self->rpc_addr + sizeof(u32), @@ -652,12 +682,17 @@ sizeof(result) / sizeof(u32)); if (err < 0) - return err; + goto exit; - if (result) - return -EIO; + if (result) { + err = -EIO; + goto exit; + } - return 0; +exit: + pthread_mutex_unlock(&self->mbox_mutex); + + return err; } const struct aq_fw_ops aq_fw_2x_ops = { diff -Nru dpdk-18.11.5/drivers/net/axgbe/axgbe_phy_impl.c dpdk-18.11.6/drivers/net/axgbe/axgbe_phy_impl.c --- dpdk-18.11.5/drivers/net/axgbe/axgbe_phy_impl.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/axgbe/axgbe_phy_impl.c 2020-01-31 09:55:30.000000000 +0000 @@ -412,15 +412,15 @@ uint64_t timeout; unsigned int mutex_id; - if (phy_data->comm_owned) - return 0; - /* The I2C and MDIO/GPIO bus is multiplexed between multiple devices, * the driver needs to take the software mutex and then the hardware * mutexes before being able to use the busses. */ pthread_mutex_lock(&pdata->phy_mutex); + if (phy_data->comm_owned) + return 0; + /* Clear the mutexes */ XP_IOWRITE(pdata, XP_I2C_MUTEX, AXGBE_MUTEX_RELEASE); XP_IOWRITE(pdata, XP_MDIO_MUTEX, AXGBE_MUTEX_RELEASE); diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt.h dpdk-18.11.6/drivers/net/bnxt/bnxt.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt.h 2020-01-31 09:55:30.000000000 +0000 @@ -20,14 +20,65 @@ #include "bnxt_cpr.h" +/* Vendor ID */ +#define PCI_VENDOR_ID_BROADCOM 0x14E4 + +/* Device IDs */ +#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606 +#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609 +#define BROADCOM_DEV_ID_STRATUS_NIC 0x1614 +#define BROADCOM_DEV_ID_57414_VF 0x16c1 +#define BROADCOM_DEV_ID_57301 0x16c8 +#define BROADCOM_DEV_ID_57302 0x16c9 +#define BROADCOM_DEV_ID_57304_PF 0x16ca +#define BROADCOM_DEV_ID_57304_VF 0x16cb +#define BROADCOM_DEV_ID_57417_MF 0x16cc +#define BROADCOM_DEV_ID_NS2 0x16cd +#define BROADCOM_DEV_ID_57311 0x16ce +#define BROADCOM_DEV_ID_57312 0x16cf +#define BROADCOM_DEV_ID_57402 0x16d0 +#define BROADCOM_DEV_ID_57404 0x16d1 +#define BROADCOM_DEV_ID_57406_PF 0x16d2 +#define BROADCOM_DEV_ID_57406_VF 0x16d3 +#define BROADCOM_DEV_ID_57402_MF 0x16d4 +#define BROADCOM_DEV_ID_57407_RJ45 0x16d5 +#define BROADCOM_DEV_ID_57412 0x16d6 +#define BROADCOM_DEV_ID_57414 0x16d7 +#define BROADCOM_DEV_ID_57416_RJ45 0x16d8 +#define BROADCOM_DEV_ID_57417_RJ45 0x16d9 +#define BROADCOM_DEV_ID_5741X_VF 0x16dc +#define BROADCOM_DEV_ID_57412_MF 0x16de +#define BROADCOM_DEV_ID_57314 0x16df +#define BROADCOM_DEV_ID_57317_RJ45 0x16e0 +#define BROADCOM_DEV_ID_5731X_VF 0x16e1 +#define BROADCOM_DEV_ID_57417_SFP 0x16e2 +#define BROADCOM_DEV_ID_57416_SFP 0x16e3 +#define BROADCOM_DEV_ID_57317_SFP 0x16e4 +#define BROADCOM_DEV_ID_57404_MF 0x16e7 +#define BROADCOM_DEV_ID_57406_MF 0x16e8 +#define BROADCOM_DEV_ID_57407_SFP 0x16e9 +#define BROADCOM_DEV_ID_57407_MF 0x16ea +#define BROADCOM_DEV_ID_57414_MF 0x16ec +#define BROADCOM_DEV_ID_57416_MF 0x16ee +#define BROADCOM_DEV_ID_58802 0xd802 +#define BROADCOM_DEV_ID_58804 0xd804 +#define BROADCOM_DEV_ID_58808 0x16f0 +#define BROADCOM_DEV_ID_58802_VF 0xd800 + #define BNXT_MAX_MTU 9574 #define VLAN_TAG_SIZE 4 +#define BNXT_NUM_VLANS 2 +#define BNXT_MAX_PKT_LEN (BNXT_MAX_MTU + ETHER_HDR_LEN + \ + ETHER_CRC_LEN + \ + (BNXT_NUM_VLANS * VLAN_TAG_SIZE)) +/* FW adds extra 4 bytes for FCS */ +#define BNXT_VNIC_MRU(mtu)\ + ((mtu) + ETHER_HDR_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS) #define BNXT_VF_RSV_NUM_RSS_CTX 1 #define BNXT_VF_RSV_NUM_L2_CTX 4 /* TODO: For now, do not support VMDq/RFS on VFs. */ #define BNXT_VF_RSV_NUM_VNIC 1 #define BNXT_MAX_LED 4 -#define BNXT_NUM_VLANS 2 #define BNXT_MIN_RING_DESC 16 #define BNXT_MAX_TX_RING_DESC 4096 #define BNXT_MAX_RX_RING_DESC 8192 @@ -300,6 +351,7 @@ unsigned int nr_vnics; +#define BNXT_GET_DEFAULT_VNIC(bp) (&(bp)->vnic_info[0]) struct bnxt_vnic_info *vnic_info; STAILQ_HEAD(, bnxt_vnic_info) free_vnic_list; @@ -321,6 +373,11 @@ uint16_t max_req_len; uint16_t max_resp_len; + /* default command timeout value of 50ms */ +#define HWRM_CMD_TIMEOUT 50000 + /* default HWRM request timeout value */ + uint32_t hwrm_cmd_timeout; + struct bnxt_link_info link_info; struct bnxt_cos_queue_info cos_queue[BNXT_COS_QUEUE_COUNT]; uint8_t tx_cosq_id; @@ -354,6 +411,7 @@ uint16_t vf_resv_strategy; }; +int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu); int bnxt_link_update_op(struct rte_eth_dev *eth_dev, int wait_to_complete); int bnxt_rcv_msg_from_vf(struct bnxt *bp, uint16_t vf_id, void *msg); diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_cpr.c dpdk-18.11.6/drivers/net/bnxt/bnxt_cpr.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_cpr.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_cpr.c 2020-01-31 09:55:30.000000000 +0000 @@ -21,14 +21,12 @@ (struct hwrm_async_event_cmpl *)cmp; uint16_t event_id = rte_le_to_cpu_16(async_cmp->event_id); - /* TODO: HWRM async events are not defined yet */ - /* Needs to handle: link events, error events, etc. */ switch (event_id) { case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE: case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE: /* FALLTHROUGH */ - bnxt_link_update_op(bp->eth_dev, 1); + bnxt_link_update_op(bp->eth_dev, 0); break; case HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD: PMD_DRV_LOG(INFO, "Async event: PF driver unloaded\n"); diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_ethdev.c dpdk-18.11.6/drivers/net/bnxt/bnxt_ethdev.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -33,49 +33,9 @@ "Broadcom NetXtreme driver " DRV_MODULE_NAME "\n"; int bnxt_logtype_driver; -#define PCI_VENDOR_ID_BROADCOM 0x14E4 - -#define BROADCOM_DEV_ID_STRATUS_NIC_VF1 0x1606 -#define BROADCOM_DEV_ID_STRATUS_NIC_VF2 0x1609 -#define BROADCOM_DEV_ID_STRATUS_NIC 0x1614 -#define BROADCOM_DEV_ID_57414_VF 0x16c1 -#define BROADCOM_DEV_ID_57301 0x16c8 -#define BROADCOM_DEV_ID_57302 0x16c9 -#define BROADCOM_DEV_ID_57304_PF 0x16ca -#define BROADCOM_DEV_ID_57304_VF 0x16cb -#define BROADCOM_DEV_ID_57417_MF 0x16cc -#define BROADCOM_DEV_ID_NS2 0x16cd -#define BROADCOM_DEV_ID_57311 0x16ce -#define BROADCOM_DEV_ID_57312 0x16cf -#define BROADCOM_DEV_ID_57402 0x16d0 -#define BROADCOM_DEV_ID_57404 0x16d1 -#define BROADCOM_DEV_ID_57406_PF 0x16d2 -#define BROADCOM_DEV_ID_57406_VF 0x16d3 -#define BROADCOM_DEV_ID_57402_MF 0x16d4 -#define BROADCOM_DEV_ID_57407_RJ45 0x16d5 -#define BROADCOM_DEV_ID_57412 0x16d6 -#define BROADCOM_DEV_ID_57414 0x16d7 -#define BROADCOM_DEV_ID_57416_RJ45 0x16d8 -#define BROADCOM_DEV_ID_57417_RJ45 0x16d9 -#define BROADCOM_DEV_ID_5741X_VF 0x16dc -#define BROADCOM_DEV_ID_57412_MF 0x16de -#define BROADCOM_DEV_ID_57314 0x16df -#define BROADCOM_DEV_ID_57317_RJ45 0x16e0 -#define BROADCOM_DEV_ID_5731X_VF 0x16e1 -#define BROADCOM_DEV_ID_57417_SFP 0x16e2 -#define BROADCOM_DEV_ID_57416_SFP 0x16e3 -#define BROADCOM_DEV_ID_57317_SFP 0x16e4 -#define BROADCOM_DEV_ID_57404_MF 0x16e7 -#define BROADCOM_DEV_ID_57406_MF 0x16e8 -#define BROADCOM_DEV_ID_57407_SFP 0x16e9 -#define BROADCOM_DEV_ID_57407_MF 0x16ea -#define BROADCOM_DEV_ID_57414_MF 0x16ec -#define BROADCOM_DEV_ID_57416_MF 0x16ee -#define BROADCOM_DEV_ID_58802 0xd802 -#define BROADCOM_DEV_ID_58804 0xd804 -#define BROADCOM_DEV_ID_58808 0x16f0 -#define BROADCOM_DEV_ID_58802_VF 0xd800 - +/* + * The set of PCI devices this driver supports + */ static const struct rte_pci_id bnxt_pci_id_map[] = { { RTE_PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, BROADCOM_DEV_ID_STRATUS_NIC_VF1) }, @@ -150,11 +110,11 @@ DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ DEV_RX_OFFLOAD_KEEP_CRC | \ - DEV_RX_OFFLOAD_TCP_LRO) + DEV_RX_OFFLOAD_TCP_LRO | \ + DEV_RX_OFFLOAD_SCATTER) static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask); static void bnxt_print_link_info(struct rte_eth_dev *eth_dev); -static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu); static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev); /***********************/ @@ -465,8 +425,7 @@ /* Fast path specifics */ dev_info->min_rx_bufsize = 1; - dev_info->max_rx_pktlen = BNXT_MAX_MTU + ETHER_HDR_LEN + ETHER_CRC_LEN - + VLAN_TAG_SIZE * 2; + dev_info->max_rx_pktlen = BNXT_MAX_PKT_LEN; dev_info->rx_offload_capa = BNXT_DEV_RX_OFFLOAD_SUPPORT; if (bp->flags & BNXT_FLAG_PTP_SUPPORTED) @@ -628,12 +587,19 @@ int vlan_mask = 0; int rc; + if (!eth_dev->data->nb_tx_queues || !eth_dev->data->nb_rx_queues) { + PMD_DRV_LOG(ERR, "Queues are not configured yet!\n"); + return -EINVAL; + } + if (bp->rx_cp_nr_rings > RTE_ETHDEV_QUEUE_STAT_CNTRS) { PMD_DRV_LOG(ERR, "RxQ cnt %d > CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS %d\n", bp->rx_cp_nr_rings, RTE_ETHDEV_QUEUE_STAT_CNTRS); } + bnxt_enable_int(bp); + rc = bnxt_init_chip(bp); if (rc) goto error; @@ -648,7 +614,6 @@ if (rc) goto error; - bnxt_enable_int(bp); bp->flags |= BNXT_FLAG_INIT_DONE; bp->dev_stopped = 0; return 0; @@ -671,7 +636,7 @@ eth_dev->data->dev_link.link_status = 1; bnxt_print_link_info(eth_dev); - return 0; + return rc; } static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev) @@ -702,7 +667,9 @@ /* TBD: STOP HW queues DMA */ eth_dev->data->dev_link.link_status = 0; } - bnxt_set_hwrm_link_config(bp, false); + bnxt_dev_set_link_down_op(eth_dev); + /* Wait for link to be reset and the async notification to process. */ + rte_delay_ms(BNXT_LINK_WAIT_INTERVAL * 2); /* Clean queue intr-vector mapping */ rte_intr_efd_disable(intr_handle); @@ -714,6 +681,8 @@ bnxt_hwrm_port_clr_stats(bp); bnxt_free_tx_mbufs(bp); bnxt_free_rx_mbufs(bp); + /* Process any remaining notifications in default completion queue */ + bnxt_int_handler(eth_dev); bnxt_shutdown_nic(bp); bp->dev_stopped = 1; } @@ -848,8 +817,7 @@ /* Timed out or success */ if (new.link_status != eth_dev->data->dev_link.link_status || new.link_speed != eth_dev->data->dev_link.link_speed) { - memcpy(ð_dev->data->dev_link, &new, - sizeof(struct rte_eth_link)); + rte_eth_linkstatus_set(eth_dev, &new); _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, @@ -1340,141 +1308,97 @@ static int bnxt_del_vlan_filter(struct bnxt *bp, uint16_t vlan_id) { - struct bnxt_filter_info *filter, *temp_filter, *new_filter; + struct bnxt_filter_info *filter; struct bnxt_vnic_info *vnic; - unsigned int i; int rc = 0; - uint32_t chk = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN; - - /* Cycle through all VNICs */ - for (i = 0; i < bp->nr_vnics; i++) { - /* - * For each VNIC and each associated filter(s) - * if VLAN exists && VLAN matches vlan_id - * remove the MAC+VLAN filter - * add a new MAC only filter - * else - * VLAN filter doesn't exist, just skip and continue - */ - vnic = &bp->vnic_info[i]; - filter = STAILQ_FIRST(&vnic->filter); - while (filter) { - temp_filter = STAILQ_NEXT(filter, next); - - if (filter->enables & chk && - filter->l2_ovlan == vlan_id) { - /* Must delete the filter */ - STAILQ_REMOVE(&vnic->filter, filter, - bnxt_filter_info, next); - bnxt_hwrm_clear_l2_filter(bp, filter); - STAILQ_INSERT_TAIL(&bp->free_filter_list, - filter, next); + uint32_t chk = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN; - /* - * Need to examine to see if the MAC - * filter already existed or not before - * allocating a new one - */ - - new_filter = bnxt_alloc_filter(bp); - if (!new_filter) { - PMD_DRV_LOG(ERR, - "MAC/VLAN filter alloc failed\n"); - rc = -ENOMEM; - goto exit; - } - STAILQ_INSERT_TAIL(&vnic->filter, - new_filter, next); - /* Inherit MAC from previous filter */ - new_filter->mac_index = - filter->mac_index; - memcpy(new_filter->l2_addr, filter->l2_addr, - ETHER_ADDR_LEN); - /* MAC only filter */ - rc = bnxt_hwrm_set_l2_filter(bp, - vnic->fw_vnic_id, - new_filter); - if (rc) - goto exit; - PMD_DRV_LOG(INFO, - "Del Vlan filter for %d\n", - vlan_id); - } - filter = temp_filter; + /* if VLAN exists && VLAN matches vlan_id + * remove the MAC+VLAN filter + * add a new MAC only filter + * else + * VLAN filter doesn't exist, just skip and continue + */ + vnic = BNXT_GET_DEFAULT_VNIC(bp); + filter = STAILQ_FIRST(&vnic->filter); + while (filter) { + /* Search for this matching MAC+VLAN filter */ + if (filter->enables & chk && filter->l2_ivlan == vlan_id && + !memcmp(filter->l2_addr, + bp->mac_addr, + ETHER_ADDR_LEN)) { + /* Delete the filter */ + rc = bnxt_hwrm_clear_l2_filter(bp, filter); + if (rc) + return rc; + STAILQ_REMOVE(&vnic->filter, filter, + bnxt_filter_info, next); + STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next); + PMD_DRV_LOG(INFO, + "Del vlan filter for %d\n", + vlan_id); + return rc; } + filter = STAILQ_NEXT(filter, next); } -exit: - return rc; + return -ENOENT; } static int bnxt_add_vlan_filter(struct bnxt *bp, uint16_t vlan_id) { - struct bnxt_filter_info *filter, *temp_filter, *new_filter; + struct bnxt_filter_info *filter; struct bnxt_vnic_info *vnic; - unsigned int i; int rc = 0; uint32_t en = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN | HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN_MASK; uint32_t chk = HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_IVLAN; - /* Cycle through all VNICs */ - for (i = 0; i < bp->nr_vnics; i++) { - /* - * For each VNIC and each associated filter(s) - * if VLAN exists: - * if VLAN matches vlan_id - * VLAN filter already exists, just skip and continue - * else - * add a new MAC+VLAN filter - * else - * Remove the old MAC only filter - * Add a new MAC+VLAN filter - */ - vnic = &bp->vnic_info[i]; - filter = STAILQ_FIRST(&vnic->filter); - while (filter) { - temp_filter = STAILQ_NEXT(filter, next); + /* Implementation notes on the use of VNIC in this command: + * + * By default, these filters belong to default vnic for the function. + * Once these filters are set up, only destination VNIC can be modified. + * If the destination VNIC is not specified in this command, + * then the HWRM shall only create an l2 context id. + */ - if (filter->enables & chk) { - if (filter->l2_ivlan == vlan_id) - goto cont; - } else { - /* Must delete the MAC filter */ - STAILQ_REMOVE(&vnic->filter, filter, - bnxt_filter_info, next); - bnxt_hwrm_clear_l2_filter(bp, filter); - filter->l2_ovlan = 0; - STAILQ_INSERT_TAIL(&bp->free_filter_list, - filter, next); - } - new_filter = bnxt_alloc_filter(bp); - if (!new_filter) { - PMD_DRV_LOG(ERR, - "MAC/VLAN filter alloc failed\n"); - rc = -ENOMEM; - goto exit; - } - STAILQ_INSERT_TAIL(&vnic->filter, new_filter, next); - /* Inherit MAC from the previous filter */ - new_filter->mac_index = filter->mac_index; - memcpy(new_filter->l2_addr, filter->l2_addr, - ETHER_ADDR_LEN); - /* MAC + VLAN ID filter */ - new_filter->l2_ivlan = vlan_id; - new_filter->l2_ivlan_mask = 0xF000; - new_filter->enables |= en; - rc = bnxt_hwrm_set_l2_filter(bp, - vnic->fw_vnic_id, - new_filter); - if (rc) - goto exit; - PMD_DRV_LOG(INFO, - "Added Vlan filter for %d\n", vlan_id); -cont: - filter = temp_filter; - } + vnic = BNXT_GET_DEFAULT_VNIC(bp); + filter = STAILQ_FIRST(&vnic->filter); + /* Check if the VLAN has already been added */ + while (filter) { + if (filter->enables & chk && filter->l2_ivlan == vlan_id && + !memcmp(filter->l2_addr, bp->mac_addr, ETHER_ADDR_LEN)) + return -EEXIST; + + filter = STAILQ_NEXT(filter, next); } -exit: + + /* No match found. Alloc a fresh filter and issue the L2_FILTER_ALLOC + * command to create MAC+VLAN filter with the right flags, enables set. + */ + filter = bnxt_alloc_filter(bp); + if (!filter) { + PMD_DRV_LOG(ERR, + "MAC/VLAN filter alloc failed\n"); + return -ENOMEM; + } + /* MAC + VLAN ID filter */ + filter->l2_ivlan = vlan_id; + filter->l2_ivlan_mask = 0x0FFF; + filter->enables |= en; + rc = bnxt_hwrm_set_l2_filter(bp, vnic->fw_vnic_id, filter); + if (rc) { + /* Free the newly allocated filter as we were + * not able to create the filter in hardware. + */ + filter->fw_l2_filter_id = UINT64_MAX; + STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next); + return rc; + } + + /* Add this new filter to the list */ + STAILQ_INSERT_TAIL(&vnic->filter, filter, next); + PMD_DRV_LOG(INFO, + "Added Vlan filter for %d\n", vlan_id); return rc; } @@ -1547,7 +1471,7 @@ if (filter->mac_index != 0) continue; - memcpy(filter->l2_addr, bp->mac_addr, ETHER_ADDR_LEN); + memcpy(filter->l2_addr, addr, ETHER_ADDR_LEN); memset(filter->l2_addr_mask, 0xff, ETHER_ADDR_LEN); filter->flags |= HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX; filter->enables |= @@ -1555,8 +1479,10 @@ HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK; rc = bnxt_hwrm_set_l2_filter(bp, vnic->fw_vnic_id, filter); - if (rc) + if (rc) { + memcpy(filter->l2_addr, bp->mac_addr, ETHER_ADDR_LEN); return rc; + } memcpy(bp->mac_addr, addr, ETHER_ADDR_LEN); PMD_DRV_LOG(DEBUG, "Set MAC addr\n"); @@ -1591,6 +1517,10 @@ } vnic->mc_addr_cnt = i; + if (vnic->mc_addr_cnt) + vnic->flags |= BNXT_VNIC_INFO_MCAST; + else + vnic->flags &= ~BNXT_VNIC_INFO_MCAST; allmulti: return bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL); @@ -1629,7 +1559,7 @@ qinfo->conf.rx_free_thresh = rxq->rx_free_thresh; qinfo->conf.rx_drop_en = 0; - qinfo->conf.rx_deferred_start = 0; + qinfo->conf.rx_deferred_start = rxq->rx_deferred_start; } static void @@ -1651,13 +1581,18 @@ qinfo->conf.tx_deferred_start = txq->tx_deferred_start; } -static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) +int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu) { struct bnxt *bp = eth_dev->data->dev_private; struct rte_eth_dev_info dev_info; + uint32_t new_pkt_size; uint32_t rc = 0; uint32_t i; + /* Exit if receive queues are not configured yet */ + if (!eth_dev->data->nb_rx_queues) + return rc; + bnxt_dev_info_get_op(eth_dev, &dev_info); if (new_mtu < ETHER_MIN_MTU || new_mtu > BNXT_MAX_MTU) { @@ -1665,6 +1600,8 @@ ETHER_MIN_MTU, BNXT_MAX_MTU); return -EINVAL; } + new_pkt_size = new_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + + VLAN_TAG_SIZE * BNXT_NUM_VLANS; if (new_mtu > ETHER_MTU) { bp->flags |= BNXT_FLAG_JUMBO; @@ -1676,18 +1613,15 @@ bp->flags &= ~BNXT_FLAG_JUMBO; } - eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = - new_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; - - eth_dev->data->mtu = new_mtu; - PMD_DRV_LOG(INFO, "New MTU is %d\n", eth_dev->data->mtu); + /* Is there a change in mtu setting? */ + if (eth_dev->data->dev_conf.rxmode.max_rx_pkt_len == new_pkt_size) + return rc; for (i = 0; i < bp->nr_vnics; i++) { struct bnxt_vnic_info *vnic = &bp->vnic_info[i]; uint16_t size = 0; - vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE * 2; + vnic->mru = BNXT_VNIC_MRU(new_mtu); rc = bnxt_hwrm_vnic_cfg(bp, vnic); if (rc) break; @@ -1702,6 +1636,12 @@ } } + if (!rc) { + eth_dev->data->mtu = new_mtu; + eth_dev->data->dev_conf.rxmode.max_rx_pkt_len = new_pkt_size; + PMD_DRV_LOG(INFO, "New MTU is %d\n", new_mtu); + } + return rc; } @@ -1748,39 +1688,22 @@ struct bnxt_cp_ring_info *cpr; struct bnxt_rx_queue *rxq; struct rx_pkt_cmpl *rxcmp; - uint16_t cmp_type; - uint8_t cmp = 1; - bool valid; rxq = dev->data->rx_queues[rx_queue_id]; cpr = rxq->cp_ring; - valid = cpr->valid; + raw_cons = cpr->cp_raw_cons; - while (raw_cons < rxq->nb_rx_desc) { + while (1) { cons = RING_CMP(cpr->cp_ring_struct, raw_cons); + rte_prefetch0(&cpr->cp_desc_ring[cons]); rxcmp = (struct rx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; - if (!CMPL_VALID(rxcmp, valid)) - goto nothing_to_do; - valid = FLIP_VALID(cons, cpr->cp_ring_struct->ring_mask, valid); - cmp_type = CMP_TYPE(rxcmp); - if (cmp_type == RX_TPA_END_CMPL_TYPE_RX_TPA_END) { - cmp = (rte_le_to_cpu_32( - ((struct rx_tpa_end_cmpl *) - (rxcmp))->agg_bufs_v1) & - RX_TPA_END_CMPL_AGG_BUFS_MASK) >> - RX_TPA_END_CMPL_AGG_BUFS_SFT; - desc++; - } else if (cmp_type == 0x11) { - desc++; - cmp = (rxcmp->agg_bufs_v1 & - RX_PKT_CMPL_AGG_BUFS_MASK) >> - RX_PKT_CMPL_AGG_BUFS_SFT; + if (!CMP_VALID(rxcmp, raw_cons, cpr->cp_ring_struct)) { + break; } else { - cmp = 1; + raw_cons++; + desc++; } -nothing_to_do: - raw_cons += cmp ? cmp : 2; } return desc; @@ -2093,9 +2016,6 @@ return -EINVAL; } - //TODO Priority - //nfilter->priority = (uint8_t)filter->priority; - bfilter->enables = en; return 0; } @@ -2462,7 +2382,6 @@ return -EINVAL; } - if (fdir_mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) { rte_memcpy(filter->dst_macaddr, fdir->input.flow.mac_vlan_flow.mac_addr.addr_bytes, 6); @@ -3223,6 +3142,45 @@ return 0; } +static int bnxt_setup_mac_addr(struct rte_eth_dev *eth_dev) +{ + struct bnxt *bp = eth_dev->data->dev_private; + int rc = 0; + + eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl", + ETHER_ADDR_LEN * + bp->max_l2_ctx, + 0); + if (eth_dev->data->mac_addrs == NULL) { + PMD_DRV_LOG(ERR, "Failed to alloc MAC addr tbl\n"); + return -ENOMEM; + } + + if (bnxt_check_zero_bytes(bp->dflt_mac_addr, ETHER_ADDR_LEN)) { + if (BNXT_PF(bp)) + return -EINVAL; + + /* Generate a random MAC address, if none was assigned by PF */ + PMD_DRV_LOG(INFO, "VF MAC address not assigned by Host PF\n"); + bnxt_eth_hw_addr_random(bp->mac_addr); + PMD_DRV_LOG(INFO, + "Assign random MAC:%02X:%02X:%02X:%02X:%02X:%02X\n", + bp->mac_addr[0], bp->mac_addr[1], bp->mac_addr[2], + bp->mac_addr[3], bp->mac_addr[4], bp->mac_addr[5]); + + rc = bnxt_hwrm_set_mac(bp); + if (!rc) + memcpy(&bp->eth_dev->data->mac_addrs[0], bp->mac_addr, + ETHER_ADDR_LEN); + return rc; + } + + /* Copy the permanent MAC from the FUNC_QCAPS response */ + memcpy(bp->mac_addr, bp->dflt_mac_addr, ETHER_ADDR_LEN); + memcpy(ð_dev->data->mac_addrs[0], bp->mac_addr, ETHER_ADDR_LEN); + + return rc; +} #define ALLOW_FUNC(x) \ { \ @@ -3230,15 +3188,126 @@ bp->pf.vf_req_fwd[((arg) >> 5)] &= \ ~rte_cpu_to_le_32(1 << ((arg) & 0x1f)); \ } -static int -bnxt_dev_init(struct rte_eth_dev *eth_dev) + +static int bnxt_alloc_stats_mem(struct bnxt *bp) { - struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + struct rte_pci_device *pci_dev = bp->pdev; char mz_name[RTE_MEMZONE_NAMESIZE]; const struct rte_memzone *mz = NULL; - static int version_printed; uint32_t total_alloc_len; rte_iova_t mz_phys_addr; + + if (pci_dev->id.device_id == BROADCOM_DEV_ID_NS2) + return 0; + + snprintf(mz_name, RTE_MEMZONE_NAMESIZE, + "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain, + pci_dev->addr.bus, pci_dev->addr.devid, + pci_dev->addr.function, "rx_port_stats"); + mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; + total_alloc_len = + RTE_CACHE_LINE_ROUNDUP(sizeof(struct rx_port_stats) + + sizeof(struct rx_port_stats_ext) + + 512); + mz = rte_memzone_lookup(mz_name); + if (!mz) { + mz = rte_memzone_reserve(mz_name, total_alloc_len, + SOCKET_ID_ANY, + RTE_MEMZONE_2MB | + RTE_MEMZONE_SIZE_HINT_ONLY | + RTE_MEMZONE_IOVA_CONTIG); + if (mz == NULL) + return -ENOMEM; + } + memset(mz->addr, 0, mz->len); + mz_phys_addr = mz->iova; + if ((unsigned long)mz->addr == mz_phys_addr) { + PMD_DRV_LOG(DEBUG, + "Memzone physical address same as virtual.\n"); + PMD_DRV_LOG(DEBUG, + "Using rte_mem_virt2iova()\n"); + mz_phys_addr = rte_mem_virt2iova(mz->addr); + if (mz_phys_addr == RTE_BAD_IOVA) { + PMD_DRV_LOG(ERR, + "Can't map address to physical memory\n"); + return -ENOMEM; + } + } + + bp->rx_mem_zone = (const void *)mz; + bp->hw_rx_port_stats = mz->addr; + bp->hw_rx_port_stats_map = mz_phys_addr; + + snprintf(mz_name, RTE_MEMZONE_NAMESIZE, + "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain, + pci_dev->addr.bus, pci_dev->addr.devid, + pci_dev->addr.function, "tx_port_stats"); + mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; + total_alloc_len = + RTE_CACHE_LINE_ROUNDUP(sizeof(struct tx_port_stats) + + sizeof(struct tx_port_stats_ext) + + 512); + mz = rte_memzone_lookup(mz_name); + if (!mz) { + mz = rte_memzone_reserve(mz_name, + total_alloc_len, + SOCKET_ID_ANY, + RTE_MEMZONE_2MB | + RTE_MEMZONE_SIZE_HINT_ONLY | + RTE_MEMZONE_IOVA_CONTIG); + if (mz == NULL) + return -ENOMEM; + } + memset(mz->addr, 0, mz->len); + mz_phys_addr = mz->iova; + if ((unsigned long)mz->addr == mz_phys_addr) { + PMD_DRV_LOG(DEBUG, + "Memzone physical address same as virtual.\n"); + PMD_DRV_LOG(DEBUG, + "Using rte_mem_virt2iova()\n"); + mz_phys_addr = rte_mem_virt2iova(mz->addr); + if (mz_phys_addr == RTE_BAD_IOVA) { + PMD_DRV_LOG(ERR, + "Can't map address to physical memory\n"); + return -ENOMEM; + } + } + + bp->tx_mem_zone = (const void *)mz; + bp->hw_tx_port_stats = mz->addr; + bp->hw_tx_port_stats_map = mz_phys_addr; + bp->flags |= BNXT_FLAG_PORT_STATS; + + /* Display extended statistics if FW supports it */ + if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 || + bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0) + return 0; + + bp->hw_rx_port_stats_ext = (void *) + ((uint8_t *)bp->hw_rx_port_stats + + sizeof(struct rx_port_stats)); + bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map + + sizeof(struct rx_port_stats); + bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS; + + if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) { + bp->hw_tx_port_stats_ext = (void *) + ((uint8_t *)bp->hw_tx_port_stats + + sizeof(struct tx_port_stats)); + bp->hw_tx_port_stats_ext_map = + bp->hw_tx_port_stats_map + + sizeof(struct tx_port_stats); + bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS; + } + + return 0; +} + +static int +bnxt_dev_init(struct rte_eth_dev *eth_dev) +{ + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); + static int version_printed; struct bnxt *bp; int rc; @@ -3272,109 +3341,6 @@ goto error; } - if (pci_dev->id.device_id != BROADCOM_DEV_ID_NS2) { - snprintf(mz_name, RTE_MEMZONE_NAMESIZE, - "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain, - pci_dev->addr.bus, pci_dev->addr.devid, - pci_dev->addr.function, "rx_port_stats"); - mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; - mz = rte_memzone_lookup(mz_name); - total_alloc_len = RTE_CACHE_LINE_ROUNDUP( - sizeof(struct rx_port_stats) + - sizeof(struct rx_port_stats_ext) + - 512); - if (!mz) { - mz = rte_memzone_reserve(mz_name, total_alloc_len, - SOCKET_ID_ANY, - RTE_MEMZONE_2MB | - RTE_MEMZONE_SIZE_HINT_ONLY | - RTE_MEMZONE_IOVA_CONTIG); - if (mz == NULL) - return -ENOMEM; - } - memset(mz->addr, 0, mz->len); - mz_phys_addr = mz->iova; - if ((unsigned long)mz->addr == mz_phys_addr) { - PMD_DRV_LOG(INFO, - "Memzone physical address same as virtual using rte_mem_virt2iova()\n"); - mz_phys_addr = rte_mem_virt2iova(mz->addr); - if (mz_phys_addr == 0) { - PMD_DRV_LOG(ERR, - "unable to map address to physical memory\n"); - return -ENOMEM; - } - } - - bp->rx_mem_zone = (const void *)mz; - bp->hw_rx_port_stats = mz->addr; - bp->hw_rx_port_stats_map = mz_phys_addr; - - snprintf(mz_name, RTE_MEMZONE_NAMESIZE, - "bnxt_%04x:%02x:%02x:%02x-%s", pci_dev->addr.domain, - pci_dev->addr.bus, pci_dev->addr.devid, - pci_dev->addr.function, "tx_port_stats"); - mz_name[RTE_MEMZONE_NAMESIZE - 1] = 0; - mz = rte_memzone_lookup(mz_name); - total_alloc_len = RTE_CACHE_LINE_ROUNDUP( - sizeof(struct tx_port_stats) + - sizeof(struct tx_port_stats_ext) + - 512); - if (!mz) { - mz = rte_memzone_reserve(mz_name, - total_alloc_len, - SOCKET_ID_ANY, - RTE_MEMZONE_2MB | - RTE_MEMZONE_SIZE_HINT_ONLY | - RTE_MEMZONE_IOVA_CONTIG); - if (mz == NULL) - return -ENOMEM; - } - memset(mz->addr, 0, mz->len); - mz_phys_addr = mz->iova; - if ((unsigned long)mz->addr == mz_phys_addr) { - PMD_DRV_LOG(WARNING, - "Memzone physical address same as virtual.\n"); - PMD_DRV_LOG(WARNING, - "Using rte_mem_virt2iova()\n"); - mz_phys_addr = rte_mem_virt2iova(mz->addr); - if (mz_phys_addr == 0) { - PMD_DRV_LOG(ERR, - "unable to map address to physical memory\n"); - return -ENOMEM; - } - } - - bp->tx_mem_zone = (const void *)mz; - bp->hw_tx_port_stats = mz->addr; - bp->hw_tx_port_stats_map = mz_phys_addr; - - bp->flags |= BNXT_FLAG_PORT_STATS; - - /* Display extended statistics if FW supports it */ - if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_8_4 || - bp->hwrm_spec_code == HWRM_SPEC_CODE_1_9_0) - goto skip_ext_stats; - - bp->hw_rx_port_stats_ext = (void *) - ((uint8_t *)bp->hw_rx_port_stats + - sizeof(struct rx_port_stats)); - bp->hw_rx_port_stats_ext_map = bp->hw_rx_port_stats_map + - sizeof(struct rx_port_stats); - bp->flags |= BNXT_FLAG_EXT_RX_PORT_STATS; - - - if (bp->hwrm_spec_code < HWRM_SPEC_CODE_1_9_2) { - bp->hw_tx_port_stats_ext = (void *) - ((uint8_t *)bp->hw_tx_port_stats + - sizeof(struct tx_port_stats)); - bp->hw_tx_port_stats_ext_map = - bp->hw_tx_port_stats_map + - sizeof(struct tx_port_stats); - bp->flags |= BNXT_FLAG_EXT_TX_PORT_STATS; - } - } - -skip_ext_stats: rc = bnxt_alloc_hwrm_resources(bp); if (rc) { PMD_DRV_LOG(ERR, @@ -3402,33 +3368,20 @@ PMD_DRV_LOG(ERR, "hwrm query capability failure rc: %x\n", rc); goto error_free; } + + rc = bnxt_alloc_stats_mem(bp); + if (rc) + goto error_free; + if (bp->max_tx_rings == 0) { PMD_DRV_LOG(ERR, "No TX rings available!\n"); rc = -EBUSY; goto error_free; } - eth_dev->data->mac_addrs = rte_zmalloc("bnxt_mac_addr_tbl", - ETHER_ADDR_LEN * bp->max_l2_ctx, 0); - if (eth_dev->data->mac_addrs == NULL) { - PMD_DRV_LOG(ERR, - "Failed to alloc %u bytes needed to store MAC addr tbl", - ETHER_ADDR_LEN * bp->max_l2_ctx); - rc = -ENOMEM; - goto error_free; - } - if (bnxt_check_zero_bytes(bp->dflt_mac_addr, ETHER_ADDR_LEN)) { - PMD_DRV_LOG(ERR, - "Invalid MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n", - bp->dflt_mac_addr[0], bp->dflt_mac_addr[1], - bp->dflt_mac_addr[2], bp->dflt_mac_addr[3], - bp->dflt_mac_addr[4], bp->dflt_mac_addr[5]); - rc = -EINVAL; + rc = bnxt_setup_mac_addr(eth_dev); + if (rc) goto error_free; - } - /* Copy the permanent MAC from the qcap response address now. */ - memcpy(bp->mac_addr, bp->dflt_mac_addr, sizeof(bp->mac_addr)); - memcpy(ð_dev->data->mac_addrs[0], bp->mac_addr, ETHER_ADDR_LEN); if (bp->max_ring_grps < bp->rx_cp_nr_rings) { /* 1 ring is for default completion ring */ diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_filter.c dpdk-18.11.6/drivers/net/bnxt/bnxt_filter.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_filter.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_filter.c 2020-01-31 09:55:30.000000000 +0000 @@ -82,7 +82,6 @@ struct bnxt_filter_info *filter, *temp_filter; unsigned int i; -// for (i = 0; i < MAX_FF_POOLS; i++) { for (i = 0; i < bp->nr_vnics; i++) { vnic = &bp->vnic_info[i]; filter = STAILQ_FIRST(&vnic->filter); diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_flow.c dpdk-18.11.6/drivers/net/bnxt/bnxt_flow.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -968,6 +968,10 @@ sizeof(nf->dst_ipaddr_mask))) { if (mf->dst_id == nf->dst_id) return -EEXIST; + /* Clear the new L2 filter that was created + * earlier in bnxt_validate_and_parse_flow. + */ + bnxt_hwrm_clear_l2_filter(bp, nf); /* * Same Flow, Different queue * Clear the old ntuple filter @@ -1070,7 +1074,7 @@ ret = -EXDEV; goto free_flow; } - PMD_DRV_LOG(ERR, "Successfully created flow.\n"); + PMD_DRV_LOG(DEBUG, "Successfully created flow.\n"); STAILQ_INSERT_TAIL(&vnic->flow_list, flow, next); return flow; } @@ -1129,6 +1133,7 @@ bnxt_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) { struct bnxt *bp = dev->data->dev_private; + struct bnxt_filter_info *filter = NULL; struct bnxt_vnic_info *vnic; struct rte_flow *flow; unsigned int i; @@ -1136,14 +1141,20 @@ for (i = 0; i < bp->nr_vnics; i++) { vnic = &bp->vnic_info[i]; - STAILQ_FOREACH(flow, &vnic->flow_list, next) { - struct bnxt_filter_info *filter = flow->filter; + if (vnic && vnic->fw_vnic_id == (uint16_t)-1) + continue; + + while (!STAILQ_EMPTY(&vnic->flow_list)) { + flow = STAILQ_FIRST(&vnic->flow_list); + filter = flow->filter; if (filter->filter_type == HWRM_CFA_EM_FILTER) ret = bnxt_hwrm_clear_em_filter(bp, filter); if (filter->filter_type == HWRM_CFA_NTUPLE_FILTER) ret = bnxt_hwrm_clear_ntuple_filter(bp, filter); + ret = bnxt_hwrm_clear_l2_filter(bp, filter); + if (ret) { rte_flow_error_set (error, @@ -1154,9 +1165,13 @@ return -rte_errno; } + bnxt_free_filter(bp, filter); + STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next); + rte_free(flow); + } } diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_hwrm.c dpdk-18.11.6/drivers/net/bnxt/bnxt_hwrm.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_hwrm.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_hwrm.c 2020-01-31 09:55:30.000000000 +0000 @@ -11,6 +11,7 @@ #include #include #include +#include #include "bnxt.h" #include "bnxt_cpr.h" @@ -24,9 +25,6 @@ #include "bnxt_vnic.h" #include "hsi_struct_def_dpdk.h" -#include - -#define HWRM_CMD_TIMEOUT 6000000 #define HWRM_SPEC_CODE_1_8_3 0x10803 #define HWRM_VERSION_1_9_1 0x10901 @@ -64,9 +62,9 @@ /* * HWRM Functions (sent to HWRM) - * These are named bnxt_hwrm_*() and return -1 if bnxt_hwrm_send_message() - * fails (ie: a timeout), and a positive non-zero HWRM error code if the HWRM - * command was failed by the ChiMP. + * These are named bnxt_hwrm_*() and return 0 on success or -110 if the + * HWRM command times out, or a negative error code if the HWRM + * command was failed by the FW. */ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, @@ -84,6 +82,13 @@ GRCPF_REG_KONG_CHANNEL_OFFSET : GRCPF_REG_CHIMP_CHANNEL_OFFSET; uint16_t mb_trigger_offset = use_kong_mb ? GRCPF_REG_KONG_COMM_TRIGGER : GRCPF_REG_CHIMP_COMM_TRIGGER; + uint32_t timeout; + + /* For VER_GET command, set timeout as 50ms */ + if (rte_cpu_to_le_16(req->req_type) == HWRM_VER_GET) + timeout = HWRM_CMD_TIMEOUT; + else + timeout = bp->hwrm_cmd_timeout; if (bp->flags & BNXT_FLAG_SHORT_CMD) { void *short_cmd_req = bp->hwrm_short_cmd_req_addr; @@ -101,9 +106,6 @@ data = (uint32_t *)&short_input; msg_len = sizeof(short_input); - /* Sync memory write before updating doorbell */ - rte_wmb(); - max_req_len = BNXT_HWRM_SHORT_REQ_LEN; } @@ -123,11 +125,17 @@ /* Ring channel doorbell */ bar = (uint8_t *)bp->bar0 + mb_trigger_offset; rte_write32(1, bar); + /* + * Make sure the channel doorbell ring command complete before + * reading the response to avoid getting stale or invalid + * responses. + */ + rte_io_mb(); /* Poll for the valid bit */ - for (i = 0; i < HWRM_CMD_TIMEOUT; i++) { + for (i = 0; i < timeout; i++) { /* Sanity check on the resp->resp_len */ - rte_rmb(); + rte_cio_rmb(); if (resp->resp_len && resp->resp_len <= bp->max_resp_len) { /* Last byte of resp contains the valid key */ @@ -138,7 +146,7 @@ rte_delay_us(1); } - if (i >= HWRM_CMD_TIMEOUT) { + if (i >= timeout) { PMD_DRV_LOG(ERR, "Error(timeout) sending msg 0x%04x\n", req->req_type); return -ETIMEDOUT; @@ -147,11 +155,11 @@ } /* - * HWRM_PREP() should be used to prepare *ALL* HWRM commands. It grabs the + * HWRM_PREP() should be used to prepare *ALL* HWRM commands. It grabs the * spinlock, and does initial processing. * * HWRM_CHECK_RESULT() returns errors on failure and may not be used. It - * releases the spinlock only if it returns. If the regular int return codes + * releases the spinlock only if it returns. If the regular int return codes * are not used by the function, HWRM_CHECK_RESULT() should not be used * directly, rather it should be copied and modified to suit the function. * @@ -250,20 +258,17 @@ HWRM_PREP(req, CFA_L2_SET_RX_MASK, BNXT_USE_CHIMP_MB); req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); - /* FIXME add multicast flag, when multicast adding options is supported - * by ethtool. - */ if (vnic->flags & BNXT_VNIC_INFO_BCAST) mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_BCAST; if (vnic->flags & BNXT_VNIC_INFO_UNTAGGED) mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_VLAN_NONVLAN; + if (vnic->flags & BNXT_VNIC_INFO_PROMISC) mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_PROMISCUOUS; - if (vnic->flags & BNXT_VNIC_INFO_ALLMULTI) + + if (vnic->flags & BNXT_VNIC_INFO_ALLMULTI) { mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_ALL_MCAST; - if (vnic->flags & BNXT_VNIC_INFO_MCAST) - mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST; - if (vnic->mc_addr_cnt) { + } else if (vnic->flags & BNXT_VNIC_INFO_MCAST) { mask |= HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST; req.num_mc_entries = rte_cpu_to_le_32(vnic->mc_addr_cnt); req.mc_tbl_addr = rte_cpu_to_le_64(vnic->mc_list_dma_addr); @@ -464,7 +469,6 @@ struct hwrm_port_mac_ptp_qcfg_output *resp = bp->hwrm_cmd_resp_addr; struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; -/* if (bp->hwrm_spec_code < 0x10801 || ptp) TBD */ if (ptp) return 0; @@ -612,7 +616,12 @@ bp->flags |= BNXT_FLAG_NEW_RM; } - return rc; + /* On older FW, + * bnxt_hwrm_func_resc_qcaps can fail and cause init failure. + * But the error can be ignored. Return success. + */ + + return 0; } int bnxt_hwrm_func_reset(struct bnxt *bp) @@ -702,7 +711,7 @@ HWRM_PREP(req, FUNC_VF_CFG, BNXT_USE_CHIMP_MB); - req.enables = rte_cpu_to_le_32 + enables = rte_cpu_to_le_32 (HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RX_RINGS | HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_TX_RINGS | HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_STAT_CTXS | @@ -723,10 +732,13 @@ enables = HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_VNICS | HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_L2_CTXS | HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS; - req.enables |= rte_cpu_to_le_32(enables); req.num_rsscos_ctxs = rte_cpu_to_le_16(BNXT_VF_RSV_NUM_RSS_CTX); req.num_l2_ctxs = rte_cpu_to_le_16(BNXT_VF_RSV_NUM_L2_CTX); req.num_vnics = rte_cpu_to_le_16(BNXT_VF_RSV_NUM_VNIC); + } else if (bp->vf_resv_strategy == + HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MAXIMAL) { + enables |= HWRM_FUNC_VF_CFG_INPUT_ENABLES_NUM_RSSCOS_CTXS; + req.num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx); } if (test) @@ -738,6 +750,7 @@ HWRM_FUNC_VF_CFG_INPUT_FLAGS_VNIC_ASSETS_TEST; req.flags = rte_cpu_to_le_32(flags); + req.enables |= rte_cpu_to_le_32(enables); rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); @@ -761,7 +774,7 @@ rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); - HWRM_CHECK_RESULT(); + HWRM_CHECK_RESULT_SILENT(); if (BNXT_VF(bp)) { bp->max_rsscos_ctx = rte_le_to_cpu_16(resp->max_rsscos_ctx); @@ -825,6 +838,13 @@ fw_version |= resp->hwrm_intf_upd_8b; bp->hwrm_spec_code = fw_version; + /* def_req_timeout value is in milliseconds */ + bp->hwrm_cmd_timeout = rte_le_to_cpu_16(resp->def_req_timeout); + /* convert timeout to usec */ + bp->hwrm_cmd_timeout *= 1000; + if (!bp->hwrm_cmd_timeout) + bp->hwrm_cmd_timeout = HWRM_CMD_TIMEOUT; + if (resp->hwrm_intf_maj_8b != HWRM_VERSION_MAJOR) { PMD_DRV_LOG(ERR, "Unsupported firmware API version\n"); rc = -EINVAL; @@ -1225,8 +1245,7 @@ HWRM_CHECK_RESULT(); - bp->grp_info[idx].fw_grp_id = - rte_le_to_cpu_16(resp->ring_group_id); + bp->grp_info[idx].fw_grp_id = rte_le_to_cpu_16(resp->ring_group_id); HWRM_UNLOCK(); @@ -1284,8 +1303,7 @@ req.update_period_ms = rte_cpu_to_le_32(0); - req.stats_dma_addr = - rte_cpu_to_le_64(cpr->hw_stats_map); + req.stats_dma_addr = rte_cpu_to_le_64(cpr->hw_stats_map); rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); @@ -1333,8 +1351,7 @@ vnic->rss_rule = (uint16_t)HWRM_NA_SIGNATURE; vnic->cos_rule = (uint16_t)HWRM_NA_SIGNATURE; vnic->lb_rule = (uint16_t)HWRM_NA_SIGNATURE; - vnic->mru = bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE; + vnic->mru = BNXT_VNIC_MRU(bp->eth_dev->data->mtu); HWRM_PREP(req, VNIC_ALLOC, BNXT_USE_CHIMP_MB); if (vnic->func_default) @@ -1649,6 +1666,7 @@ size = rte_pktmbuf_data_room_size(bp->rx_queues[0]->mb_pool); size -= RTE_PKTMBUF_HEADROOM; + size = RTE_MIN(BNXT_MAX_PKT_LEN, size); req.jumbo_thresh = rte_cpu_to_le_16(size); req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); @@ -1799,10 +1817,6 @@ return rc; } -/* - * HWRM utility functions - */ - int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp) { unsigned int i; @@ -1994,6 +2008,10 @@ return rc; } +/* + * HWRM utility functions + */ + void bnxt_free_hwrm_resources(struct bnxt *bp) { /* Release memzone */ @@ -2042,8 +2060,6 @@ else rc = bnxt_hwrm_clear_l2_filter(bp, filter); STAILQ_REMOVE(&vnic->filter, filter, bnxt_filter_info, next); - //if (rc) - //break; } return rc; } @@ -2067,8 +2083,6 @@ STAILQ_REMOVE(&vnic->flow_list, flow, rte_flow, next); rte_free(flow); - //if (rc) - //break; } return rc; } @@ -2466,9 +2480,16 @@ if (BNXT_PF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_MULTI_HOST)) bp->flags |= BNXT_FLAG_MULTI_HOST; - if (BNXT_VF(bp) && (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) { + if (BNXT_VF(bp) && + !BNXT_VF_IS_TRUSTED(bp) && + (flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) { bp->flags |= BNXT_FLAG_TRUSTED_VF_EN; PMD_DRV_LOG(INFO, "Trusted VF cap enabled\n"); + } else if (BNXT_VF(bp) && + BNXT_VF_IS_TRUSTED(bp) && + !(flags & HWRM_FUNC_QCFG_OUTPUT_FLAGS_TRUSTED_VF)) { + bp->flags &= ~BNXT_FLAG_TRUSTED_VF_EN; + PMD_DRV_LOG(INFO, "Trusted VF cap disabled\n"); } switch (resp->port_partition_type) { @@ -2531,10 +2552,9 @@ HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS | HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS); req.flags = rte_cpu_to_le_32(bp->pf.func_cfg_flags); - req.mtu = rte_cpu_to_le_16(BNXT_MAX_MTU); - req.mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE * - BNXT_NUM_VLANS); + req.mtu = rte_cpu_to_le_16(RTE_MIN(bp->eth_dev->data->mtu, + BNXT_MAX_MTU)); //FW adds hdr sizes + req.mru = rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu)); req.num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx); req.num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx); req.num_cmpl_rings = rte_cpu_to_le_16(bp->max_cp_rings); @@ -2573,9 +2593,7 @@ req->mtu = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE * BNXT_NUM_VLANS); - req->mru = rte_cpu_to_le_16(bp->eth_dev->data->mtu + ETHER_HDR_LEN + - ETHER_CRC_LEN + VLAN_TAG_SIZE * - BNXT_NUM_VLANS); + req->mru = rte_cpu_to_le_16(BNXT_VNIC_MRU(bp->eth_dev->data->mtu)); req->num_rsscos_ctxs = rte_cpu_to_le_16(bp->max_rsscos_ctx / (num_vfs + 1)); req->num_stat_ctxs = rte_cpu_to_le_16(bp->max_stat_ctx / (num_vfs + 1)); @@ -3201,7 +3219,6 @@ stats->q_errors[idx] += rte_le_to_cpu_64(resp->tx_err_pkts); } - HWRM_UNLOCK(); return rc; @@ -3444,7 +3461,6 @@ return rc; } - int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type, uint16_t dir_ordinal, uint16_t dir_ext, uint16_t dir_attr, const uint8_t *data, @@ -3533,16 +3549,8 @@ return -ENOMEM; } rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); - if (rc) { - HWRM_UNLOCK(); - PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query failed rc:%d\n", rc); - return -1; - } else if (resp->error_code) { - rc = rte_le_to_cpu_16(resp->error_code); - HWRM_UNLOCK(); - PMD_DRV_LOG(ERR, "hwrm_func_vf_vnic_query error %d\n", rc); - return -1; - } + HWRM_CHECK_RESULT(); + rc = rte_le_to_cpu_32(resp->vnic_id_cnt); HWRM_UNLOCK(); @@ -3795,7 +3803,6 @@ HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_ID; req.dst_id = rte_cpu_to_le_16(dst_id); - if (filter->ip_addr_type) { req.ip_addr_type = filter->ip_addr_type; enables |= @@ -3808,10 +3815,6 @@ HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR) memcpy(req.src_macaddr, filter->src_macaddr, ETHER_ADDR_LEN); - //if (enables & - //HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR) - //memcpy(req.dst_macaddr, filter->dst_macaddr, - //ETHER_ADDR_LEN); if (enables & HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE) req.ethertype = rte_cpu_to_be_16(filter->ethertype); @@ -3980,13 +3983,13 @@ req.port_id = rte_cpu_to_le_16(pf->port_id); if (bp->flags & BNXT_FLAG_EXT_TX_PORT_STATS) { req.tx_stat_host_addr = - rte_cpu_to_le_64(bp->hw_tx_port_stats_map); + rte_cpu_to_le_64(bp->hw_tx_port_stats_ext_map); req.tx_stat_size = rte_cpu_to_le_16(sizeof(struct tx_port_stats_ext)); } if (bp->flags & BNXT_FLAG_EXT_RX_PORT_STATS) { req.rx_stat_host_addr = - rte_cpu_to_le_64(bp->hw_rx_port_stats_map); + rte_cpu_to_le_64(bp->hw_rx_port_stats_ext_map); req.rx_stat_size = rte_cpu_to_le_16(sizeof(struct rx_port_stats_ext)); } @@ -4006,4 +4009,29 @@ HWRM_UNLOCK(); return rc; +} + +int bnxt_hwrm_set_mac(struct bnxt *bp) +{ + struct hwrm_func_vf_cfg_output *resp = bp->hwrm_cmd_resp_addr; + struct hwrm_func_vf_cfg_input req = {0}; + int rc = 0; + + if (!BNXT_VF(bp)) + return 0; + + HWRM_PREP(req, FUNC_VF_CFG, BNXT_USE_CHIMP_MB); + + req.enables = + rte_cpu_to_le_32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_DFLT_MAC_ADDR); + memcpy(req.dflt_mac_addr, bp->mac_addr, ETHER_ADDR_LEN); + + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT(); + + memcpy(bp->dflt_mac_addr, bp->mac_addr, ETHER_ADDR_LEN); + HWRM_UNLOCK(); + + return rc; } diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_hwrm.h dpdk-18.11.6/drivers/net/bnxt/bnxt_hwrm.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt_hwrm.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_hwrm.h 2020-01-31 09:55:30.000000000 +0000 @@ -31,6 +31,8 @@ #define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MINIMAL_STATIC \ HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MINIMAL_STATIC +#define HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESV_STRATEGY_MAXIMAL \ + HWRM_FUNC_RESOURCE_QCAPS_OUTPUT_VF_RESERVATION_STRATEGY_MAXIMAL #define HWRM_SPEC_CODE_1_8_4 0x10804 #define HWRM_SPEC_CODE_1_9_0 0x10900 @@ -179,4 +181,5 @@ struct bnxt_coal *coal, uint16_t ring_id); int bnxt_hwrm_check_vf_rings(struct bnxt *bp); int bnxt_hwrm_ext_port_qstats(struct bnxt *bp); +int bnxt_hwrm_set_mac(struct bnxt *bp); #endif diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_irq.c dpdk-18.11.6/drivers/net/bnxt/bnxt_irq.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_irq.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_irq.c 2020-01-31 09:55:30.000000000 +0000 @@ -18,7 +18,7 @@ * Interrupts */ -static void bnxt_int_handler(void *param) +void bnxt_int_handler(void *param) { struct rte_eth_dev *eth_dev = (struct rte_eth_dev *)param; struct bnxt *bp = eth_dev->data->dev_private; diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_irq.h dpdk-18.11.6/drivers/net/bnxt/bnxt_irq.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt_irq.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_irq.h 2020-01-31 09:55:30.000000000 +0000 @@ -22,5 +22,6 @@ void bnxt_enable_int(struct bnxt *bp); int bnxt_setup_int(struct bnxt *bp); int bnxt_request_int(struct bnxt *bp); +void bnxt_int_handler(void *param); #endif diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_ring.c dpdk-18.11.6/drivers/net/bnxt/bnxt_ring.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_ring.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_ring.c 2020-01-31 09:55:30.000000000 +0000 @@ -344,11 +344,7 @@ bp->grp_info[queue_index].ag_fw_ring_id = ring->fw_ring_id; B_RX_DB(rxr->ag_doorbell, rxr->ag_prod); - rxq->rx_buf_use_size = BNXT_MAX_MTU + ETHER_HDR_LEN + - ETHER_CRC_LEN + (2 * VLAN_TAG_SIZE); - - if (bp->eth_dev->data->rx_queue_state[queue_index] == - RTE_ETH_QUEUE_STATE_STARTED) { + if (rxq->rx_started) { if (bnxt_init_one_rx_ring(rxq)) { RTE_LOG(ERR, PMD, "bnxt_init_one_rx_ring failed!\n"); @@ -452,8 +448,6 @@ bp->grp_info[i].ag_fw_ring_id = ring->fw_ring_id; B_RX_DB(rxr->ag_doorbell, rxr->ag_prod); - rxq->rx_buf_use_size = BNXT_MAX_MTU + ETHER_HDR_LEN + - ETHER_CRC_LEN + (2 * VLAN_TAG_SIZE); if (bnxt_init_one_rx_ring(rxq)) { PMD_DRV_LOG(ERR, "bnxt_init_one_rx_ring failed!\n"); bnxt_rx_queue_release_op(rxq); @@ -486,12 +480,12 @@ /* Tx ring */ rc = bnxt_hwrm_ring_alloc(bp, ring, HWRM_RING_ALLOC_INPUT_RING_TYPE_TX, - idx, cpr->hw_stats_ctx_id, + i, cpr->hw_stats_ctx_id, cp_ring->fw_ring_id); if (rc) goto err_out; - txr->tx_doorbell = (char *)bp->doorbell_base + idx * 0x80; + txr->tx_doorbell = (char *)bp->doorbell_base + i * 0x80; txq->index = idx; bnxt_hwrm_set_ring_coal(bp, &coal, cp_ring->fw_ring_id); } diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_rxq.c dpdk-18.11.6/drivers/net/bnxt/bnxt_rxq.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_rxq.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_rxq.c 2020-01-31 09:55:30.000000000 +0000 @@ -207,39 +207,40 @@ struct bnxt_tpa_info *tpa_info; uint16_t i; + if (!rxq) + return; + rte_spinlock_lock(&rxq->lock); - if (rxq) { - sw_ring = rxq->rx_ring->rx_buf_ring; - if (sw_ring) { - for (i = 0; - i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { - if (sw_ring[i].mbuf) { - rte_pktmbuf_free_seg(sw_ring[i].mbuf); - sw_ring[i].mbuf = NULL; - } + sw_ring = rxq->rx_ring->rx_buf_ring; + if (sw_ring) { + for (i = 0; + i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { + if (sw_ring[i].mbuf) { + rte_pktmbuf_free_seg(sw_ring[i].mbuf); + sw_ring[i].mbuf = NULL; } } - /* Free up mbufs in Agg ring */ - sw_ring = rxq->rx_ring->ag_buf_ring; - if (sw_ring) { - for (i = 0; - i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { - if (sw_ring[i].mbuf) { - rte_pktmbuf_free_seg(sw_ring[i].mbuf); - sw_ring[i].mbuf = NULL; - } + } + /* Free up mbufs in Agg ring */ + sw_ring = rxq->rx_ring->ag_buf_ring; + if (sw_ring) { + for (i = 0; + i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { + if (sw_ring[i].mbuf) { + rte_pktmbuf_free_seg(sw_ring[i].mbuf); + sw_ring[i].mbuf = NULL; } } + } - /* Free up mbufs in TPA */ - tpa_info = rxq->rx_ring->tpa_info; - if (tpa_info) { - for (i = 0; i < BNXT_TPA_MAX; i++) { - if (tpa_info[i].mbuf) { - rte_pktmbuf_free_seg(tpa_info[i].mbuf); - tpa_info[i].mbuf = NULL; - } + /* Free up mbufs in TPA */ + tpa_info = rxq->rx_ring->tpa_info; + if (tpa_info) { + for (i = 0; i < BNXT_TPA_MAX; i++) { + if (tpa_info[i].mbuf) { + rte_pktmbuf_free_seg(tpa_info[i].mbuf); + tpa_info[i].mbuf = NULL; } } } @@ -324,13 +325,13 @@ rxq->nb_rx_desc = nb_desc; rxq->rx_free_thresh = rx_conf->rx_free_thresh; - PMD_DRV_LOG(DEBUG, "RX Buf size is %d\n", rxq->rx_buf_use_size); PMD_DRV_LOG(DEBUG, "RX Buf MTU %d\n", eth_dev->data->mtu); rc = bnxt_init_rx_ring_struct(rxq, socket_id); if (rc) goto out; + PMD_DRV_LOG(DEBUG, "RX Buf size is %d\n", rxq->rx_buf_size); rxq->queue_id = queue_idx; rxq->port_id = eth_dev->data->port_id; if (rx_offloads & DEV_RX_OFFLOAD_KEEP_CRC) @@ -350,11 +351,26 @@ } rte_atomic64_init(&rxq->rx_mbuf_alloc_fail); - rxq->rx_deferred_start = rx_conf->rx_deferred_start; - queue_state = rxq->rx_deferred_start ? RTE_ETH_QUEUE_STATE_STOPPED : - RTE_ETH_QUEUE_STATE_STARTED; + /* rxq 0 must not be stopped when used as async CPR */ + if (queue_idx == 0) + rxq->rx_deferred_start = false; + else + rxq->rx_deferred_start = rx_conf->rx_deferred_start; + + if (rxq->rx_deferred_start) { + queue_state = RTE_ETH_QUEUE_STATE_STOPPED; + rxq->rx_started = false; + } else { + queue_state = RTE_ETH_QUEUE_STATE_STARTED; + rxq->rx_started = true; + } + eth_dev->data->rx_queue_state[queue_idx] = queue_state; rte_spinlock_init(&rxq->lock); + + /* Configure mtu if it is different from what was configured before */ + if (!queue_idx) + bnxt_mtu_set_op(eth_dev, eth_dev->data->mtu); out: return rc; } @@ -368,10 +384,9 @@ if (eth_dev->data->rx_queues) { rxq = eth_dev->data->rx_queues[queue_id]; - if (!rxq) { - rc = -EINVAL; - return rc; - } + if (!rxq) + return -EINVAL; + cpr = rxq->cp_ring; B_CP_DB_REARM(cpr, cpr->cp_raw_cons); } @@ -387,10 +402,9 @@ if (eth_dev->data->rx_queues) { rxq = eth_dev->data->rx_queues[queue_id]; - if (!rxq) { - rc = -EINVAL; - return rc; - } + if (!rxq) + return -EINVAL; + cpr = rxq->cp_ring; B_CP_DB_DISARM(cpr); } @@ -410,7 +424,12 @@ return -EINVAL; } + /* Set the queue state to started here. + * We check the status of the queue while posting buffer. + * If queue is it started, we do not post buffers for Rx. + */ dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; + rxq->rx_started = true; bnxt_free_hwrm_rx_ring(bp, rx_queue_id); bnxt_alloc_hwrm_rx_ring(bp, rx_queue_id); @@ -431,8 +450,11 @@ rc = bnxt_vnic_rss_configure(bp, vnic); } - if (rc == 0) - rxq->rx_deferred_start = false; + if (rc != 0) { + dev->data->rx_queue_state[rx_queue_id] = + RTE_ETH_QUEUE_STATE_STOPPED; + rxq->rx_started = false; + } return rc; } @@ -459,7 +481,7 @@ } dev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; - rxq->rx_deferred_start = true; + rxq->rx_started = false; PMD_DRV_LOG(DEBUG, "Rx queue stopped\n"); if (dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) { diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_rxq.h dpdk-18.11.6/drivers/net/bnxt/bnxt_rxq.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt_rxq.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_rxq.h 2020-01-31 09:55:30.000000000 +0000 @@ -26,13 +26,13 @@ uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ uint8_t rx_deferred_start; /* not in global dev start */ + uint8_t rx_started; /* RX queue is started */ struct bnxt *bp; int index; struct bnxt_vnic_info *vnic; uint32_t rx_buf_size; - uint32_t rx_buf_use_size; /* useable size */ struct bnxt_rx_ring_info *rx_ring; struct bnxt_cp_ring_info *cp_ring; rte_atomic64_t rx_mbuf_alloc_fail; diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_rxr.c dpdk-18.11.6/drivers/net/bnxt/bnxt_rxr.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_rxr.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_rxr.c 2020-01-31 09:55:30.000000000 +0000 @@ -61,18 +61,22 @@ struct bnxt_sw_rx_bd *rx_buf = &rxr->ag_buf_ring[prod]; struct rte_mbuf *mbuf; + if (rxbd == NULL) { + PMD_DRV_LOG(ERR, "Jumbo Frame. rxbd is NULL\n"); + return -EINVAL; + } + + if (rx_buf == NULL) { + PMD_DRV_LOG(ERR, "Jumbo Frame. rx_buf is NULL\n"); + return -EINVAL; + } + mbuf = __bnxt_alloc_rx_data(rxq->mb_pool); if (!mbuf) { rte_atomic64_inc(&rxq->rx_mbuf_alloc_fail); return -ENOMEM; } - if (rxbd == NULL) - PMD_DRV_LOG(ERR, "Jumbo Frame. rxbd is NULL\n"); - if (rx_buf == NULL) - PMD_DRV_LOG(ERR, "Jumbo Frame. rx_buf is NULL\n"); - - rx_buf->mbuf = mbuf; mbuf->data_off = RTE_PKTMBUF_HEADROOM; @@ -443,15 +447,21 @@ flags2_f = flags2_0xf(rxcmp1); /* IP Checksum */ - if (unlikely(((IS_IP_NONTUNNEL_PKT(flags2_f)) && - (RX_CMP_IP_CS_ERROR(rxcmp1))) || - (IS_IP_TUNNEL_PKT(flags2_f) && - (RX_CMP_IP_OUTER_CS_ERROR(rxcmp1))))) { - mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; - } else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) { - mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN; - } else { - mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + if (likely(IS_IP_NONTUNNEL_PKT(flags2_f))) { + if (unlikely(RX_CMP_IP_CS_ERROR(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN; + else + mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; + } else if (IS_IP_TUNNEL_PKT(flags2_f)) { + if (unlikely(RX_CMP_IP_OUTER_CS_ERROR(rxcmp1) || + RX_CMP_IP_CS_ERROR(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD; + else if (unlikely(RX_CMP_IP_CS_UNKNOWN(rxcmp1))) + mbuf->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN; + else + mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD; } /* L4 Checksum */ @@ -540,7 +550,7 @@ bool evt = false; /* If Rx Q was stopped return. RxQ0 cannot be stopped. */ - if (unlikely(((rxq->rx_deferred_start || + if (unlikely(((!rxq->rx_started || !rte_spinlock_trylock(&rxq->lock)) && rxq->queue_id))) return 0; @@ -663,10 +673,7 @@ struct bnxt_rx_ring_info *rxr; struct bnxt_ring *ring; - rxq->rx_buf_use_size = BNXT_MAX_MTU + ETHER_HDR_LEN + ETHER_CRC_LEN + - (2 * VLAN_TAG_SIZE); - rxq->rx_buf_size = rxq->rx_buf_use_size + sizeof(struct rte_mbuf); - + rxq->rx_buf_size = BNXT_MAX_PKT_LEN + sizeof(struct rte_mbuf); rxr = rte_zmalloc_socket("bnxt_rx_ring", sizeof(struct bnxt_rx_ring_info), RTE_CACHE_LINE_SIZE, socket_id); @@ -750,8 +757,7 @@ uint16_t size; size = rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM; - if (rxq->rx_buf_use_size <= size) - size = rxq->rx_buf_use_size; + size = RTE_MIN(BNXT_MAX_PKT_LEN, size); type = RX_PROD_PKT_BD_TYPE_RX_PROD_PKT | RX_PROD_PKT_BD_FLAGS_EOP_PAD; diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_stats.c dpdk-18.11.6/drivers/net/bnxt/bnxt_stats.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_stats.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_stats.c 2020-01-31 09:55:30.000000000 +0000 @@ -80,6 +80,22 @@ rx_runt_bytes)}, {"rx_runt_frames", offsetof(struct rx_port_stats, rx_runt_frames)}, + {"rx_pfc_ena_frames_pri0", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri0)}, + {"rx_pfc_ena_frames_pri1", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri1)}, + {"rx_pfc_ena_frames_pri2", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri2)}, + {"rx_pfc_ena_frames_pri3", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri3)}, + {"rx_pfc_ena_frames_pri4", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri4)}, + {"rx_pfc_ena_frames_pri5", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri5)}, + {"rx_pfc_ena_frames_pri6", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri6)}, + {"rx_pfc_ena_frames_pri7", offsetof(struct rx_port_stats, + rx_pfc_ena_frames_pri7)}, }; static const struct bnxt_xstats_name_off bnxt_tx_stats_strings[] = { @@ -135,6 +151,22 @@ tx_total_collisions)}, {"tx_bytes", offsetof(struct tx_port_stats, tx_bytes)}, + {"tx_pfc_ena_frames_pri0", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri0)}, + {"tx_pfc_ena_frames_pri1", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri1)}, + {"tx_pfc_ena_frames_pri2", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri2)}, + {"tx_pfc_ena_frames_pri3", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri3)}, + {"tx_pfc_ena_frames_pri4", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri4)}, + {"tx_pfc_ena_frames_pri5", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri5)}, + {"tx_pfc_ena_frames_pri6", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri6)}, + {"tx_pfc_ena_frames_pri7", offsetof(struct tx_port_stats, + tx_pfc_ena_frames_pri7)}, }; static const struct bnxt_xstats_name_off bnxt_func_stats_strings[] = { @@ -355,7 +387,7 @@ memset(bnxt_stats, 0, sizeof(*bnxt_stats)); if (!(bp->flags & BNXT_FLAG_INIT_DONE)) { PMD_DRV_LOG(ERR, "Device Initialization not complete!\n"); - return -1; + return -EIO; } num_q_stats = RTE_MIN(bp->rx_cp_nr_rings, @@ -386,8 +418,6 @@ return rc; } rc = bnxt_hwrm_func_qstats(bp, 0xffff, bnxt_stats); - if (unlikely(rc)) - return rc; return rc; } @@ -421,6 +451,9 @@ unsigned int stat_size = sizeof(uint64_t); unsigned int stat_count; + if (xstats == NULL) + return 0; + memset(xstats, 0, sizeof(*xstats)); bnxt_hwrm_port_qstats(bp); @@ -550,16 +583,20 @@ void bnxt_dev_xstats_reset_op(struct rte_eth_dev *eth_dev) { struct bnxt *bp = eth_dev->data->dev_private; + int ret; - if (bp->flags & BNXT_FLAG_PORT_STATS && BNXT_SINGLE_PF(bp)) - bnxt_hwrm_port_clr_stats(bp); - - if (BNXT_VF(bp)) - PMD_DRV_LOG(ERR, "Operation not supported on a VF device\n"); - if (!BNXT_SINGLE_PF(bp)) - PMD_DRV_LOG(ERR, "Operation not supported on a MF device\n"); - if (!(bp->flags & BNXT_FLAG_PORT_STATS)) + if (BNXT_VF(bp) || !BNXT_SINGLE_PF(bp) || + !(bp->flags & BNXT_FLAG_PORT_STATS)) { PMD_DRV_LOG(ERR, "Operation not supported\n"); + return; + } + + ret = bnxt_hwrm_port_clr_stats(bp); + if (ret != 0) + PMD_DRV_LOG(ERR, "Failed to reset xstats: %s\n", + strerror(-ret)); + + return; } int bnxt_dev_xstats_get_by_id_op(struct rte_eth_dev *dev, const uint64_t *ids, @@ -581,7 +618,7 @@ for (i = 0; i < limit; i++) { if (ids[i] >= stat_cnt) { PMD_DRV_LOG(ERR, "id value isn't valid"); - return -1; + return -EINVAL; } values[i] = values_copy[ids[i]]; } @@ -609,7 +646,7 @@ for (i = 0; i < limit; i++) { if (ids[i] >= stat_cnt) { PMD_DRV_LOG(ERR, "id value isn't valid"); - return -1; + return -EINVAL; } strcpy(xstats_names[i].name, xstats_names_copy[ids[i]].name); diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_txq.c dpdk-18.11.6/drivers/net/bnxt/bnxt_txq.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_txq.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_txq.c 2020-01-31 09:55:30.000000000 +0000 @@ -35,7 +35,7 @@ if (sw_ring) { for (i = 0; i < txq->tx_ring->tx_ring_struct->ring_size; i++) { if (sw_ring[i].mbuf) { - rte_pktmbuf_free(sw_ring[i].mbuf); + rte_pktmbuf_free_seg(sw_ring[i].mbuf); sw_ring[i].mbuf = NULL; } } @@ -113,6 +113,7 @@ txq->bp = bp; txq->nb_tx_desc = nb_desc; txq->tx_free_thresh = tx_conf->tx_free_thresh; + txq->tx_deferred_start = tx_conf->tx_deferred_start; rc = bnxt_init_tx_ring_struct(txq, socket_id); if (rc) @@ -139,6 +140,11 @@ eth_dev->data->tx_queues[queue_idx] = txq; + if (txq->tx_deferred_start) + txq->tx_started = false; + else + txq->tx_started = true; + out: return rc; } diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_txq.h dpdk-18.11.6/drivers/net/bnxt/bnxt_txq.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt_txq.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_txq.h 2020-01-31 09:55:30.000000000 +0000 @@ -24,6 +24,7 @@ uint8_t wthresh; /* Write-back threshold reg */ uint32_t ctx_curr; /* Hardware context states */ uint8_t tx_deferred_start; /* not in global dev start */ + uint8_t tx_started; /* TX queue is started */ struct bnxt *bp; int index; diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_txr.c dpdk-18.11.6/drivers/net/bnxt/bnxt_txr.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_txr.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_txr.c 2020-01-31 09:55:30.000000000 +0000 @@ -418,7 +418,7 @@ bnxt_handle_tx_cp(txq); /* Tx queue was stopped; wait for it to be restarted */ - if (txq->tx_deferred_start) { + if (unlikely(!txq->tx_started)) { PMD_DRV_LOG(DEBUG, "Tx q stopped;return\n"); return 0; } @@ -448,7 +448,7 @@ struct bnxt_tx_queue *txq = bp->tx_queues[tx_queue_id]; dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STARTED; - txq->tx_deferred_start = false; + txq->tx_started = true; PMD_DRV_LOG(DEBUG, "Tx queue started\n"); return 0; @@ -463,7 +463,7 @@ bnxt_handle_tx_cp(txq); dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; - txq->tx_deferred_start = true; + txq->tx_started = false; PMD_DRV_LOG(DEBUG, "Tx queue stopped\n"); return 0; diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_util.c dpdk-18.11.6/drivers/net/bnxt/bnxt_util.c --- dpdk-18.11.5/drivers/net/bnxt/bnxt_util.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_util.c 2020-01-31 09:55:30.000000000 +0000 @@ -4,6 +4,7 @@ */ #include +#include #include "bnxt_util.h" @@ -16,3 +17,13 @@ return 0; return 1; } + +void bnxt_eth_hw_addr_random(uint8_t *mac_addr) +{ + eth_random_addr(mac_addr); + + /* Set Organizationally Unique Identifier (OUI) prefix */ + mac_addr[0] = 0x00; + mac_addr[1] = 0x0a; + mac_addr[2] = 0xf7; +} diff -Nru dpdk-18.11.5/drivers/net/bnxt/bnxt_util.h dpdk-18.11.6/drivers/net/bnxt/bnxt_util.h --- dpdk-18.11.5/drivers/net/bnxt/bnxt_util.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bnxt/bnxt_util.h 2020-01-31 09:55:30.000000000 +0000 @@ -7,5 +7,6 @@ #define _BNXT_UTIL_H_ int bnxt_check_zero_bytes(const uint8_t *bytes, int len); +void bnxt_eth_hw_addr_random(uint8_t *mac_addr); #endif /* _BNXT_UTIL_H_ */ diff -Nru dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_8023ad.c dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_8023ad.c --- dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_8023ad.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_8023ad.c 2020-01-31 09:55:30.000000000 +0000 @@ -638,7 +638,7 @@ SM_FLAG_CLR(port, NTT); } -static uint8_t +static uint16_t max_index(uint64_t *a, int n) { if (n <= 0) @@ -669,11 +669,11 @@ struct port *agg, *port; uint16_t slaves_count, new_agg_id, i, j = 0; uint16_t *slaves; - uint64_t agg_bandwidth[8] = {0}; - uint64_t agg_count[8] = {0}; + uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0}; + uint64_t agg_count[RTE_MAX_ETHPORTS] = {0}; uint16_t default_slave = 0; - uint8_t mode_count_id, mode_band_id; struct rte_eth_link link_info; + uint16_t agg_new_idx = 0; slaves = internals->active_slaves; slaves_count = internals->active_slave_count; @@ -686,9 +686,9 @@ if (agg->aggregator_port_id != slaves[i]) continue; - agg_count[agg->aggregator_port_id] += 1; + agg_count[i] += 1; rte_eth_link_get_nowait(slaves[i], &link_info); - agg_bandwidth[agg->aggregator_port_id] += link_info.link_speed; + agg_bandwidth[i] += link_info.link_speed; /* Actors system ID is not checked since all slave device have the same * ID (MAC address). */ @@ -708,24 +708,22 @@ switch (internals->mode4.agg_selection) { case AGG_COUNT: - mode_count_id = max_index( - (uint64_t *)agg_count, slaves_count); - new_agg_id = mode_count_id; + agg_new_idx = max_index(agg_count, slaves_count); + new_agg_id = slaves[agg_new_idx]; break; case AGG_BANDWIDTH: - mode_band_id = max_index( - (uint64_t *)agg_bandwidth, slaves_count); - new_agg_id = mode_band_id; + agg_new_idx = max_index(agg_bandwidth, slaves_count); + new_agg_id = slaves[agg_new_idx]; break; case AGG_STABLE: if (default_slave == slaves_count) - new_agg_id = slave_id; + new_agg_id = slaves[slave_id]; else new_agg_id = slaves[default_slave]; break; default: if (default_slave == slaves_count) - new_agg_id = slave_id; + new_agg_id = slaves[slave_id]; else new_agg_id = slaves[default_slave]; break; @@ -1301,11 +1299,12 @@ struct bond_dev_private *internals; struct mode8023ad_private *mode4; + if (valid_bonded_port_id(port_id) != 0) + return -EINVAL; + bond_dev = &rte_eth_devices[port_id]; internals = bond_dev->data->dev_private; - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; if (internals->mode != 4) return -EINVAL; @@ -1322,11 +1321,12 @@ struct bond_dev_private *internals; struct mode8023ad_private *mode4; + if (valid_bonded_port_id(port_id) != 0) + return -EINVAL; + bond_dev = &rte_eth_devices[port_id]; internals = bond_dev->data->dev_private; - if (valid_bonded_port_id(port_id) != 0) - return -EINVAL; if (internals->mode != 4) return -EINVAL; mode4 = &internals->mode4; @@ -1579,9 +1579,14 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) { int retval = 0; - struct rte_eth_dev *dev = &rte_eth_devices[port]; - struct bond_dev_private *internals = (struct bond_dev_private *) - dev->data->dev_private; + struct rte_eth_dev *dev; + struct bond_dev_private *internals; + + if (valid_bonded_port_id(port) != 0) + return -EINVAL; + + dev = &rte_eth_devices[port]; + internals = dev->data->dev_private; if (check_for_bonded_ethdev(dev) != 0) return -1; @@ -1603,9 +1608,14 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) { int retval = 0; - struct rte_eth_dev *dev = &rte_eth_devices[port]; - struct bond_dev_private *internals = (struct bond_dev_private *) - dev->data->dev_private; + struct rte_eth_dev *dev; + struct bond_dev_private *internals; + + if (valid_bonded_port_id(port) != 0) + return -EINVAL; + + dev = &rte_eth_devices[port]; + internals = dev->data->dev_private; if (check_for_bonded_ethdev(dev) != 0) return -1; diff -Nru dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_args.c dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_args.c --- dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_args.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_args.c 2020-01-31 09:55:30.000000000 +0000 @@ -63,11 +63,10 @@ static inline int bond_pci_addr_cmp(const struct rte_device *dev, const void *_pci_addr) { - struct rte_pci_device *pdev; + const struct rte_pci_device *pdev = RTE_DEV_TO_PCI_CONST(dev); const struct rte_pci_addr *paddr = _pci_addr; - pdev = RTE_DEV_TO_PCI(*(struct rte_device **)(void *)&dev); - return rte_eal_compare_pci_addr(&pdev->addr, paddr); + return rte_pci_addr_cmp(&pdev->addr, paddr); } /** diff -Nru dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_pmd.c dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_pmd.c --- dpdk-18.11.5/drivers/net/bonding/rte_eth_bond_pmd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/bonding/rte_eth_bond_pmd.c 2020-01-31 09:55:30.000000000 +0000 @@ -2,6 +2,7 @@ * Copyright(c) 2010-2017 Intel Corporation */ #include +#include #include #include @@ -251,139 +252,9 @@ return 0; } -static uint16_t -bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, - uint16_t nb_pkts) -{ - struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; - struct bond_dev_private *internals = bd_rx_q->dev_private; - uint16_t num_rx_total = 0; /* Total number of received packets */ - uint16_t slaves[RTE_MAX_ETHPORTS]; - uint16_t slave_count; - uint16_t active_slave; - uint16_t i; - - /* Copy slave list to protect against slave up/down changes during tx - * bursting */ - slave_count = internals->active_slave_count; - active_slave = internals->active_slave; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * slave_count); - - for (i = 0; i < slave_count && nb_pkts; i++) { - uint16_t num_rx_slave; - - /* Read packets from this slave */ - num_rx_slave = rte_eth_rx_burst(slaves[active_slave], - bd_rx_q->queue_id, - bufs + num_rx_total, nb_pkts); - num_rx_total += num_rx_slave; - nb_pkts -= num_rx_slave; - - if (++active_slave == slave_count) - active_slave = 0; - } - - if (++internals->active_slave >= slave_count) - internals->active_slave = 0; - - return num_rx_total; -} - -static uint16_t -bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, - uint16_t nb_bufs) -{ - struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; - struct bond_dev_private *internals = bd_tx_q->dev_private; - - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; - - uint16_t dist_slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t dist_slave_count; - - /* 2-D array to sort mbufs for transmission on each slave into */ - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_bufs]; - /* Number of mbufs for transmission on each slave */ - uint16_t slave_nb_bufs[RTE_MAX_ETHPORTS] = { 0 }; - /* Mapping array generated by hash function to map mbufs to slaves */ - uint16_t bufs_slave_port_idxs[RTE_MAX_ETHPORTS] = { 0 }; - - uint16_t slave_tx_count; - uint16_t total_tx_count = 0, total_tx_fail_count = 0; - - uint16_t i; - - if (unlikely(nb_bufs == 0)) - return 0; - - /* Copy slave list to protect against slave up/down changes during tx - * bursting */ - slave_count = internals->active_slave_count; - if (unlikely(slave_count < 1)) - return 0; - - memcpy(slave_port_ids, internals->active_slaves, - sizeof(slave_port_ids[0]) * slave_count); - - - dist_slave_count = 0; - for (i = 0; i < slave_count; i++) { - struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; - - if (ACTOR_STATE(port, DISTRIBUTING)) - dist_slave_port_ids[dist_slave_count++] = - slave_port_ids[i]; - } - - if (unlikely(dist_slave_count < 1)) - return 0; - - /* - * Populate slaves mbuf with the packets which are to be sent on it - * selecting output slave using hash based on xmit policy - */ - internals->burst_xmit_hash(bufs, nb_bufs, dist_slave_count, - bufs_slave_port_idxs); - - for (i = 0; i < nb_bufs; i++) { - /* Populate slave mbuf arrays with mbufs for that slave. */ - uint16_t slave_idx = bufs_slave_port_idxs[i]; - - slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = bufs[i]; - } - - - /* Send packet burst on each slave device */ - for (i = 0; i < dist_slave_count; i++) { - if (slave_nb_bufs[i] == 0) - continue; - - slave_tx_count = rte_eth_tx_burst(dist_slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_bufs[i]); - - total_tx_count += slave_tx_count; - - /* If tx burst fails move packets to end of bufs */ - if (unlikely(slave_tx_count < slave_nb_bufs[i])) { - int slave_tx_fail_count = slave_nb_bufs[i] - - slave_tx_count; - total_tx_fail_count += slave_tx_fail_count; - memcpy(&bufs[nb_bufs - total_tx_fail_count], - &slave_bufs[i][slave_tx_count], - slave_tx_fail_count * sizeof(bufs[0])); - } - } - - return total_tx_count; -} - - -static uint16_t -bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, - uint16_t nb_pkts) +static inline uint16_t +rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, + bool dedicated_rxq) { /* Cast to structure, containing bonded device's port id and queue id */ struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; @@ -430,23 +301,22 @@ /* Handle slow protocol packets. */ while (j < num_rx_total) { - - /* If packet is not pure L2 and is known, skip it */ - if ((bufs[j]->packet_type & ~RTE_PTYPE_L2_ETHER) != 0) { - j++; - continue; - } - if (j + 3 < num_rx_total) rte_prefetch0(rte_pktmbuf_mtod(bufs[j + 3], void *)); hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *); subtype = ((struct slow_protocol_frame *)hdr)->slow_protocol.subtype; - /* Remove packet from array if it is slow packet or slave is not - * in collecting state or bonding interface is not in promiscuous - * mode and packet address does not match. */ - if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) || + /* Remove packet from array if: + * - it is slow packet but no dedicated rxq is present, + * - slave is not in collecting state, + * - bonding interface is not in promiscuous mode and + * packet is not multicast and address does not match, + */ + if (unlikely( + (!dedicated_rxq && + is_lacp_packets(hdr->ether_type, subtype, + bufs[j])) || !collecting || (!promisc && !is_multicast_ether_addr(&hdr->d_addr) && @@ -478,6 +348,20 @@ return num_rx_total; } +static uint16_t +bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, + uint16_t nb_pkts) +{ + return rx_burst_8023ad(queue, bufs, nb_pkts, false); +} + +static uint16_t +bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, + uint16_t nb_pkts) +{ + return rx_burst_8023ad(queue, bufs, nb_pkts, true); +} + #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) uint32_t burstnumberRX; uint32_t burstnumberTX; @@ -1196,16 +1080,13 @@ return num_tx_total; } -static uint16_t -bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, - uint16_t nb_bufs) +static inline uint16_t +tx_burst_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, + uint16_t *slave_port_ids, uint16_t slave_count) { struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; - /* Array to sort mbufs for transmission on each slave into */ struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_bufs]; /* Number of mbufs for transmission on each slave */ @@ -1218,18 +1099,6 @@ uint16_t i; - if (unlikely(nb_bufs == 0)) - return 0; - - /* Copy slave list to protect against slave up/down changes during tx - * bursting */ - slave_count = internals->active_slave_count; - if (unlikely(slave_count < 1)) - return 0; - - memcpy(slave_port_ids, internals->active_slaves, - sizeof(slave_port_ids[0]) * slave_count); - /* * Populate slaves mbuf with the packets which are to be sent on it * selecting output slave using hash based on xmit policy @@ -1270,7 +1139,7 @@ } static uint16_t -bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, +bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs) { struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; @@ -1279,18 +1148,36 @@ uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; uint16_t slave_count; + if (unlikely(nb_bufs == 0)) + return 0; + + /* Copy slave list to protect against slave up/down changes during tx + * bursting + */ + slave_count = internals->active_slave_count; + if (unlikely(slave_count < 1)) + return 0; + + memcpy(slave_port_ids, internals->active_slaves, + sizeof(slave_port_ids[0]) * slave_count); + return tx_burst_balance(queue, bufs, nb_bufs, slave_port_ids, + slave_count); +} + +static inline uint16_t +tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, + bool dedicated_txq) +{ + struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; + struct bond_dev_private *internals = bd_tx_q->dev_private; + + uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; + uint16_t slave_count; + uint16_t dist_slave_port_ids[RTE_MAX_ETHPORTS]; uint16_t dist_slave_count; - /* 2-D array to sort mbufs for transmission on each slave into */ - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_bufs]; - /* Number of mbufs for transmission on each slave */ - uint16_t slave_nb_bufs[RTE_MAX_ETHPORTS] = { 0 }; - /* Mapping array generated by hash function to map mbufs to slaves */ - uint16_t bufs_slave_port_idxs[RTE_MAX_ETHPORTS] = { 0 }; - uint16_t slave_tx_count; - uint16_t total_tx_count = 0, total_tx_fail_count = 0; uint16_t i; @@ -1303,6 +1190,9 @@ memcpy(slave_port_ids, internals->active_slaves, sizeof(slave_port_ids[0]) * slave_count); + if (dedicated_txq) + goto skip_tx_ring; + /* Check for LACP control packets and send if available */ for (i = 0; i < slave_count; i++) { struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; @@ -1324,6 +1214,7 @@ } } +skip_tx_ring: if (unlikely(nb_bufs == 0)) return 0; @@ -1336,53 +1227,25 @@ slave_port_ids[i]; } - if (likely(dist_slave_count > 0)) { - - /* - * Populate slaves mbuf with the packets which are to be sent - * on it, selecting output slave using hash based on xmit policy - */ - internals->burst_xmit_hash(bufs, nb_bufs, dist_slave_count, - bufs_slave_port_idxs); - - for (i = 0; i < nb_bufs; i++) { - /* - * Populate slave mbuf arrays with mbufs for that - * slave - */ - uint16_t slave_idx = bufs_slave_port_idxs[i]; - - slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = - bufs[i]; - } - + if (unlikely(dist_slave_count < 1)) + return 0; - /* Send packet burst on each slave device */ - for (i = 0; i < dist_slave_count; i++) { - if (slave_nb_bufs[i] == 0) - continue; + return tx_burst_balance(queue, bufs, nb_bufs, dist_slave_port_ids, + dist_slave_count); +} - slave_tx_count = rte_eth_tx_burst( - dist_slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_bufs[i]); - - total_tx_count += slave_tx_count; - - /* If tx burst fails move packets to end of bufs */ - if (unlikely(slave_tx_count < slave_nb_bufs[i])) { - int slave_tx_fail_count = slave_nb_bufs[i] - - slave_tx_count; - total_tx_fail_count += slave_tx_fail_count; - - memcpy(&bufs[nb_bufs - total_tx_fail_count], - &slave_bufs[i][slave_tx_count], - slave_tx_fail_count * sizeof(bufs[0])); - } - } - } +static uint16_t +bond_ethdev_tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, + uint16_t nb_bufs) +{ + return tx_burst_8023ad(queue, bufs, nb_bufs, false); +} - return total_tx_count; +static uint16_t +bond_ethdev_tx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs, + uint16_t nb_bufs) +{ + return tx_burst_8023ad(queue, bufs, nb_bufs, true); } static uint16_t @@ -2483,8 +2346,8 @@ * packet loss will occur on this slave if transmission at rates * greater than this are attempted */ - for (idx = 1; idx < bond_ctx->active_slave_count; idx++) { - link_update(bond_ctx->active_slaves[0], &slave_link); + for (idx = 0; idx < bond_ctx->active_slave_count; idx++) { + link_update(bond_ctx->active_slaves[idx], &slave_link); if (slave_link.link_speed < ethdev->data->dev_link.link_speed) diff -Nru dpdk-18.11.5/drivers/net/cxgbe/base/adapter.h dpdk-18.11.6/drivers/net/cxgbe/base/adapter.h --- dpdk-18.11.5/drivers/net/cxgbe/base/adapter.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/base/adapter.h 2020-01-31 09:55:30.000000000 +0000 @@ -322,6 +322,8 @@ int use_unpacked_mode; /* unpacked rx mode state */ rte_spinlock_t win0_lock; + rte_spinlock_t flow_lock; /* Serialize access for rte_flow ops */ + unsigned int clipt_start; /* CLIP table start */ unsigned int clipt_end; /* CLIP table end */ unsigned int l2t_start; /* Layer 2 table start */ diff -Nru dpdk-18.11.5/drivers/net/cxgbe/cxgbe_ethdev.c dpdk-18.11.6/drivers/net/cxgbe/cxgbe_ethdev.c --- dpdk-18.11.5/drivers/net/cxgbe/cxgbe_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/cxgbe_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -65,6 +65,7 @@ struct sge_eth_txq *txq = (struct sge_eth_txq *)tx_queue; uint16_t pkts_sent, pkts_remain; uint16_t total_sent = 0; + uint16_t idx = 0; int ret = 0; CXGBE_DEBUG_TX(adapter, "%s: txq = %p; tx_pkts = %p; nb_pkts = %d\n", @@ -73,12 +74,16 @@ t4_os_lock(&txq->txq_lock); /* free up desc from already completed tx */ reclaim_completed_tx(&txq->q); + rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *)); while (total_sent < nb_pkts) { pkts_remain = nb_pkts - total_sent; for (pkts_sent = 0; pkts_sent < pkts_remain; pkts_sent++) { - ret = t4_eth_xmit(txq, tx_pkts[total_sent + pkts_sent], - nb_pkts); + idx = total_sent + pkts_sent; + if ((idx + 1) < nb_pkts) + rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[idx + 1], + volatile void *)); + ret = t4_eth_xmit(txq, tx_pkts[idx], nb_pkts); if (ret < 0) break; } @@ -197,6 +202,9 @@ u8 old_link = pi->link_cfg.link_ok; for (i = 0; i < CXGBE_LINK_STATUS_POLL_CNT; i++) { + if (!s->fw_evtq.desc) + break; + cxgbe_poll(&s->fw_evtq, NULL, budget, &work_done); /* Exit if link status changed or always forced up */ @@ -230,6 +238,9 @@ struct sge *s = &adapter->sge; int ret; + if (!s->fw_evtq.desc) + return -ENOMEM; + /* Flush all link events */ cxgbe_poll(&s->fw_evtq, NULL, budget, &work_done); @@ -256,6 +267,9 @@ struct sge *s = &adapter->sge; int ret; + if (!s->fw_evtq.desc) + return -ENOMEM; + /* Flush all link events */ cxgbe_poll(&s->fw_evtq, NULL, budget, &work_done); diff -Nru dpdk-18.11.5/drivers/net/cxgbe/cxgbe_filter.c dpdk-18.11.6/drivers/net/cxgbe/cxgbe_filter.c --- dpdk-18.11.5/drivers/net/cxgbe/cxgbe_filter.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/cxgbe_filter.c 2020-01-31 09:55:30.000000000 +0000 @@ -13,7 +13,7 @@ /** * Initialize Hash Filters */ -int init_hash_filter(struct adapter *adap) +int cxgbe_init_hash_filter(struct adapter *adap) { unsigned int n_user_filters; unsigned int user_filter_perc; @@ -52,7 +52,8 @@ * Validate if the requested filter specification can be set by checking * if the requested features have been enabled */ -int validate_filter(struct adapter *adapter, struct ch_filter_specification *fs) +int cxgbe_validate_filter(struct adapter *adapter, + struct ch_filter_specification *fs) { u32 fconf; @@ -132,7 +133,7 @@ } /* Return an error number if the indicated filter isn't writable ... */ -int writable_filter(struct filter_entry *f) +static int writable_filter(struct filter_entry *f) { if (f->locked) return -EPERM; @@ -211,20 +212,32 @@ } /** - * Check if entry already filled. + * IPv6 requires 2 slots on T6 and 4 slots for cards below T6. + * IPv4 requires only 1 slot on all cards. */ -bool is_filter_set(struct tid_info *t, int fidx, int family) +u8 cxgbe_filter_slots(struct adapter *adap, u8 family) { - bool result = FALSE; - int i, max; + if (family == FILTER_TYPE_IPV6) { + if (CHELSIO_CHIP_VERSION(adap->params.chip) < CHELSIO_T6) + return 4; - /* IPv6 requires four slots and IPv4 requires only 1 slot. - * Ensure, there's enough slots available. - */ - max = family == FILTER_TYPE_IPV6 ? fidx + 3 : fidx; + return 2; + } + + return 1; +} + +/** + * Check if entries are already filled. + */ +bool cxgbe_is_filter_set(struct tid_info *t, u32 fidx, u8 nentries) +{ + bool result = FALSE; + u32 i; + /* Ensure there's enough slots available. */ t4_os_lock(&t->ftid_lock); - for (i = fidx; i <= max; i++) { + for (i = fidx; i < fidx + nentries; i++) { if (rte_bitmap_get(t->ftid_bmap, i)) { result = TRUE; break; @@ -235,17 +248,18 @@ } /** - * Allocate a available free entry + * Allocate available free entries. */ -int cxgbe_alloc_ftid(struct adapter *adap, unsigned int family) +int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries) { struct tid_info *t = &adap->tids; int pos; int size = t->nftids; t4_os_lock(&t->ftid_lock); - if (family == FILTER_TYPE_IPV6) - pos = cxgbe_bitmap_find_free_region(t->ftid_bmap, size, 4); + if (nentries > 1) + pos = cxgbe_bitmap_find_free_region(t->ftid_bmap, size, + nentries); else pos = cxgbe_find_first_zero_bit(t->ftid_bmap, size); t4_os_unlock(&t->ftid_lock); @@ -526,7 +540,7 @@ int atid, size; int ret = 0; - ret = validate_filter(adapter, fs); + ret = cxgbe_validate_filter(adapter, fs); if (ret) return ret; @@ -563,7 +577,7 @@ if (atid < 0) goto out_err; - if (f->fs.type) { + if (f->fs.type == FILTER_TYPE_IPV6) { /* IPv6 hash filter */ f->clipt = cxgbe_clip_alloc(f->dev, (u32 *)&f->fs.val.lip); if (!f->clipt) @@ -617,7 +631,7 @@ * Clear a filter and release any of its resources that we own. This also * clears the filter's "pending" status. */ -void clear_filter(struct filter_entry *f) +static void clear_filter(struct filter_entry *f) { if (f->clipt) cxgbe_clip_release(f->dev, f->clipt); @@ -689,7 +703,7 @@ return 0; } -int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx) +static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx) { struct adapter *adapter = ethdev2adap(dev); struct filter_entry *f = &adapter->tids.ftid_tab[fidx]; @@ -802,44 +816,34 @@ } /** - * Set the corresponding entry in the bitmap. 4 slots are - * marked for IPv6, whereas only 1 slot is marked for IPv4. + * Set the corresponding entries in the bitmap. */ -static int cxgbe_set_ftid(struct tid_info *t, int fidx, int family) +static int cxgbe_set_ftid(struct tid_info *t, u32 fidx, u8 nentries) { + u32 i; + t4_os_lock(&t->ftid_lock); if (rte_bitmap_get(t->ftid_bmap, fidx)) { t4_os_unlock(&t->ftid_lock); return -EBUSY; } - if (family == FILTER_TYPE_IPV4) { - rte_bitmap_set(t->ftid_bmap, fidx); - } else { - rte_bitmap_set(t->ftid_bmap, fidx); - rte_bitmap_set(t->ftid_bmap, fidx + 1); - rte_bitmap_set(t->ftid_bmap, fidx + 2); - rte_bitmap_set(t->ftid_bmap, fidx + 3); - } + for (i = fidx; i < fidx + nentries; i++) + rte_bitmap_set(t->ftid_bmap, i); t4_os_unlock(&t->ftid_lock); return 0; } /** - * Clear the corresponding entry in the bitmap. 4 slots are - * cleared for IPv6, whereas only 1 slot is cleared for IPv4. + * Clear the corresponding entries in the bitmap. */ -static void cxgbe_clear_ftid(struct tid_info *t, int fidx, int family) +static void cxgbe_clear_ftid(struct tid_info *t, u32 fidx, u8 nentries) { + u32 i; + t4_os_lock(&t->ftid_lock); - if (family == FILTER_TYPE_IPV4) { - rte_bitmap_clear(t->ftid_bmap, fidx); - } else { - rte_bitmap_clear(t->ftid_bmap, fidx); - rte_bitmap_clear(t->ftid_bmap, fidx + 1); - rte_bitmap_clear(t->ftid_bmap, fidx + 2); - rte_bitmap_clear(t->ftid_bmap, fidx + 3); - } + for (i = fidx; i < fidx + nentries; i++) + rte_bitmap_clear(t->ftid_bmap, i); t4_os_unlock(&t->ftid_lock); } @@ -857,6 +861,7 @@ struct adapter *adapter = pi->adapter; struct filter_entry *f; unsigned int chip_ver; + u8 nentries; int ret; if (is_hashfilter(adapter) && fs->cap) @@ -867,24 +872,25 @@ chip_ver = CHELSIO_CHIP_VERSION(adapter->params.chip); - ret = is_filter_set(&adapter->tids, filter_id, fs->type); - if (!ret) { - dev_warn(adap, "%s: could not find filter entry: %u\n", - __func__, filter_id); - return -EINVAL; - } - /* - * Ensure filter id is aligned on the 2 slot boundary for T6, + * Ensure IPv6 filter id is aligned on the 2 slot boundary for T6, * and 4 slot boundary for cards below T6. */ - if (fs->type) { + if (fs->type == FILTER_TYPE_IPV6) { if (chip_ver < CHELSIO_T6) filter_id &= ~(0x3); else filter_id &= ~(0x1); } + nentries = cxgbe_filter_slots(adapter, fs->type); + ret = cxgbe_is_filter_set(&adapter->tids, filter_id, nentries); + if (!ret) { + dev_warn(adap, "%s: could not find filter entry: %u\n", + __func__, filter_id); + return -EINVAL; + } + f = &adapter->tids.ftid_tab[filter_id]; ret = writable_filter(f); if (ret) @@ -894,8 +900,7 @@ f->ctx = ctx; cxgbe_clear_ftid(&adapter->tids, f->tid - adapter->tids.ftid_base, - f->fs.type ? FILTER_TYPE_IPV6 : - FILTER_TYPE_IPV4); + nentries); return del_filter_wr(dev, filter_id); } @@ -925,10 +930,10 @@ { struct port_info *pi = ethdev2pinfo(dev); struct adapter *adapter = pi->adapter; - unsigned int fidx, iq, fid_bit = 0; + unsigned int fidx, iq; struct filter_entry *f; unsigned int chip_ver; - uint8_t bitoff[16] = {0}; + u8 nentries, bitoff[16] = {0}; int ret; if (is_hashfilter(adapter) && fs->cap) @@ -939,84 +944,35 @@ chip_ver = CHELSIO_CHIP_VERSION(adapter->params.chip); - ret = validate_filter(adapter, fs); + ret = cxgbe_validate_filter(adapter, fs); if (ret) return ret; /* - * Ensure filter id is aligned on the 4 slot boundary for IPv6 - * maskfull filters. - */ - if (fs->type) - filter_id &= ~(0x3); - - ret = is_filter_set(&adapter->tids, filter_id, fs->type); - if (ret) - return -EBUSY; - - iq = get_filter_steerq(dev, fs); - - /* * IPv6 filters occupy four slots and must be aligned on four-slot * boundaries for T5. On T6, IPv6 filters occupy two-slots and * must be aligned on two-slot boundaries. * * IPv4 filters only occupy a single slot and have no alignment - * requirements but writing a new IPv4 filter into the middle - * of an existing IPv6 filter requires clearing the old IPv6 - * filter. + * requirements. */ - if (fs->type == FILTER_TYPE_IPV4) { /* IPv4 */ - /* - * For T6, If our IPv4 filter isn't being written to a - * multiple of two filter index and there's an IPv6 - * filter at the multiple of 2 base slot, then we need - * to delete that IPv6 filter ... - * For adapters below T6, IPv6 filter occupies 4 entries. - */ + fidx = filter_id; + if (fs->type == FILTER_TYPE_IPV6) { if (chip_ver < CHELSIO_T6) - fidx = filter_id & ~0x3; + fidx &= ~(0x3); else - fidx = filter_id & ~0x1; - - if (fidx != filter_id && adapter->tids.ftid_tab[fidx].fs.type) { - f = &adapter->tids.ftid_tab[fidx]; - if (f->valid) - return -EBUSY; - } - } else { /* IPv6 */ - unsigned int max_filter_id; - - if (chip_ver < CHELSIO_T6) { - /* - * Ensure that the IPv6 filter is aligned on a - * multiple of 4 boundary. - */ - if (filter_id & 0x3) - return -EINVAL; + fidx &= ~(0x1); + } - max_filter_id = filter_id + 4; - } else { - /* - * For T6, CLIP being enabled, IPv6 filter would occupy - * 2 entries. - */ - if (filter_id & 0x1) - return -EINVAL; + if (fidx != filter_id) + return -EINVAL; - max_filter_id = filter_id + 2; - } + nentries = cxgbe_filter_slots(adapter, fs->type); + ret = cxgbe_is_filter_set(&adapter->tids, filter_id, nentries); + if (ret) + return -EBUSY; - /* - * Check all except the base overlapping IPv4 filter - * slots. - */ - for (fidx = filter_id + 1; fidx < max_filter_id; fidx++) { - f = &adapter->tids.ftid_tab[fidx]; - if (f->valid) - return -EBUSY; - } - } + iq = get_filter_steerq(dev, fs); /* * Check to make sure that provided filter index is not @@ -1027,9 +983,7 @@ return -EBUSY; fidx = adapter->tids.ftid_base + filter_id; - fid_bit = filter_id; - ret = cxgbe_set_ftid(&adapter->tids, fid_bit, - fs->type ? FILTER_TYPE_IPV6 : FILTER_TYPE_IPV4); + ret = cxgbe_set_ftid(&adapter->tids, filter_id, nentries); if (ret) return ret; @@ -1039,9 +993,7 @@ ret = writable_filter(f); if (ret) { /* Clear the bits we have set above */ - cxgbe_clear_ftid(&adapter->tids, fid_bit, - fs->type ? FILTER_TYPE_IPV6 : - FILTER_TYPE_IPV4); + cxgbe_clear_ftid(&adapter->tids, filter_id, nentries); return ret; } @@ -1050,7 +1002,7 @@ */ if (chip_ver > CHELSIO_T5 && fs->type && memcmp(fs->val.lip, bitoff, sizeof(bitoff))) { - f->clipt = cxgbe_clip_alloc(f->dev, (u32 *)&f->fs.val.lip); + f->clipt = cxgbe_clip_alloc(dev, (u32 *)&fs->val.lip); if (!f->clipt) goto free_tid; } @@ -1072,17 +1024,13 @@ f->ctx = ctx; f->tid = fidx; /* Save the actual tid */ ret = set_filter_wr(dev, filter_id); - if (ret) { - fid_bit = f->tid - adapter->tids.ftid_base; + if (ret) goto free_tid; - } return ret; free_tid: - cxgbe_clear_ftid(&adapter->tids, fid_bit, - fs->type ? FILTER_TYPE_IPV6 : - FILTER_TYPE_IPV4); + cxgbe_clear_ftid(&adapter->tids, filter_id, nentries); clear_filter(f); return ret; } @@ -1090,7 +1038,8 @@ /** * Handle a Hash filter write reply. */ -void hash_filter_rpl(struct adapter *adap, const struct cpl_act_open_rpl *rpl) +void cxgbe_hash_filter_rpl(struct adapter *adap, + const struct cpl_act_open_rpl *rpl) { struct tid_info *t = &adap->tids; struct filter_entry *f; @@ -1158,7 +1107,7 @@ /** * Handle a LE-TCAM filter write/deletion reply. */ -void filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl) +void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl) { struct filter_entry *f = NULL; unsigned int tid = GET_TID(rpl); @@ -1307,8 +1256,8 @@ /** * Handle a Hash filter delete reply. */ -void hash_del_filter_rpl(struct adapter *adap, - const struct cpl_abort_rpl_rss *rpl) +void cxgbe_hash_del_filter_rpl(struct adapter *adap, + const struct cpl_abort_rpl_rss *rpl) { struct tid_info *t = &adap->tids; struct filter_entry *f; diff -Nru dpdk-18.11.5/drivers/net/cxgbe/cxgbe_filter.h dpdk-18.11.6/drivers/net/cxgbe/cxgbe_filter.h --- dpdk-18.11.5/drivers/net/cxgbe/cxgbe_filter.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/cxgbe_filter.h 2020-01-31 09:55:30.000000000 +0000 @@ -248,23 +248,23 @@ return idx; } -bool is_filter_set(struct tid_info *, int fidx, int family); -void filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl); -void clear_filter(struct filter_entry *f); -int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx); -int writable_filter(struct filter_entry *f); +u8 cxgbe_filter_slots(struct adapter *adap, u8 family); +bool cxgbe_is_filter_set(struct tid_info *t, u32 fidx, u8 nentries); +void cxgbe_filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl); int cxgbe_set_filter(struct rte_eth_dev *dev, unsigned int filter_id, struct ch_filter_specification *fs, struct filter_ctx *ctx); int cxgbe_del_filter(struct rte_eth_dev *dev, unsigned int filter_id, struct ch_filter_specification *fs, struct filter_ctx *ctx); -int cxgbe_alloc_ftid(struct adapter *adap, unsigned int family); -int init_hash_filter(struct adapter *adap); -void hash_filter_rpl(struct adapter *adap, const struct cpl_act_open_rpl *rpl); -void hash_del_filter_rpl(struct adapter *adap, - const struct cpl_abort_rpl_rss *rpl); -int validate_filter(struct adapter *adap, struct ch_filter_specification *fs); +int cxgbe_alloc_ftid(struct adapter *adap, u8 nentries); +int cxgbe_init_hash_filter(struct adapter *adap); +void cxgbe_hash_filter_rpl(struct adapter *adap, + const struct cpl_act_open_rpl *rpl); +void cxgbe_hash_del_filter_rpl(struct adapter *adap, + const struct cpl_abort_rpl_rss *rpl); +int cxgbe_validate_filter(struct adapter *adap, + struct ch_filter_specification *fs); int cxgbe_get_filter_count(struct adapter *adapter, unsigned int fidx, u64 *c, int hash, bool get_byte); #endif /* _CXGBE_FILTER_H_ */ diff -Nru dpdk-18.11.5/drivers/net/cxgbe/cxgbe_flow.c dpdk-18.11.6/drivers/net/cxgbe/cxgbe_flow.c --- dpdk-18.11.5/drivers/net/cxgbe/cxgbe_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/cxgbe_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -304,12 +304,15 @@ { struct adapter *adap = ethdev2adap(f->dev); struct ch_filter_specification fs = f->fs; + u8 nentries; if (fidx >= adap->tids.nftids) { dev_err(adap, "invalid flow index %d.\n", fidx); return -EINVAL; } - if (!is_filter_set(&adap->tids, fidx, fs.type)) { + + nentries = cxgbe_filter_slots(adap, fs.type); + if (!cxgbe_is_filter_set(&adap->tids, fidx, nentries)) { dev_err(adap, "Already free fidx:%d f:%p\n", fidx, f); return -EINVAL; } @@ -321,10 +324,14 @@ cxgbe_validate_fidxonadd(struct ch_filter_specification *fs, struct adapter *adap, unsigned int fidx) { - if (is_filter_set(&adap->tids, fidx, fs->type)) { + u8 nentries; + + nentries = cxgbe_filter_slots(adap, fs->type); + if (cxgbe_is_filter_set(&adap->tids, fidx, nentries)) { dev_err(adap, "filter index: %d is busy.\n", fidx); return -EBUSY; } + if (fidx >= adap->tids.nftids) { dev_err(adap, "filter index (%u) >= max(%u)\n", fidx, adap->tids.nftids); @@ -351,9 +358,11 @@ /* For tcam get the next available slot, if default value specified */ if (flow->fidx == FILTER_ID_MAX) { + u8 nentries; int idx; - idx = cxgbe_alloc_ftid(adap, fs->type); + nentries = cxgbe_filter_slots(adap, fs->type); + idx = cxgbe_alloc_ftid(adap, nentries); if (idx < 0) { dev_err(adap, "unable to get a filter index in tcam\n"); return -ENOMEM; @@ -437,18 +446,27 @@ const struct rte_flow_action_set_tp *tp_port; const struct rte_flow_action_phy_port *port; int item_index; + u16 tmp_vlan; switch (a->type) { case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: vlanid = (const struct rte_flow_action_of_set_vlan_vid *) a->conf; - fs->newvlan = VLAN_REWRITE; - fs->vlan = vlanid->vlan_vid; + /* If explicitly asked to push a new VLAN header, + * then don't set rewrite mode. Otherwise, the + * incoming VLAN packets will get their VLAN fields + * rewritten, instead of adding an additional outer + * VLAN header. + */ + if (fs->newvlan != VLAN_INSERT) + fs->newvlan = VLAN_REWRITE; + tmp_vlan = fs->vlan & 0xe000; + fs->vlan = (be16_to_cpu(vlanid->vlan_vid) & 0xfff) | tmp_vlan; break; case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: pushvlan = (const struct rte_flow_action_of_push_vlan *) a->conf; - if (pushvlan->ethertype != ETHER_TYPE_VLAN) + if (be16_to_cpu(pushvlan->ethertype) != ETHER_TYPE_VLAN) return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, a, "only ethertype 0x8100 " @@ -832,6 +850,7 @@ const struct rte_flow_action action[], struct rte_flow_error *e) { + struct adapter *adap = ethdev2adap(dev); struct rte_flow *flow; int ret; @@ -852,8 +871,10 @@ return NULL; } + t4_os_lock(&adap->flow_lock); /* go, interact with cxgbe_filter */ ret = __cxgbe_flow_create(dev, flow); + t4_os_unlock(&adap->flow_lock); if (ret) { rte_flow_error_set(e, ret, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "Unable to create flow rule"); @@ -918,9 +939,12 @@ cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *e) { + struct adapter *adap = ethdev2adap(dev); int ret; + t4_os_lock(&adap->flow_lock); ret = __cxgbe_flow_destroy(dev, flow); + t4_os_unlock(&adap->flow_lock); if (ret) return rte_flow_error_set(e, ret, RTE_FLOW_ERROR_TYPE_HANDLE, flow, "error destroying filter."); @@ -947,6 +971,7 @@ const struct rte_flow_action *action, void *data, struct rte_flow_error *e) { + struct adapter *adap = ethdev2adap(flow->dev); struct ch_filter_specification fs; struct rte_flow_query_count *c; struct filter_entry *f; @@ -976,17 +1001,22 @@ " enabled during filter creation"); c = (struct rte_flow_query_count *)data; + + t4_os_lock(&adap->flow_lock); ret = __cxgbe_flow_query(flow, &c->hits, &c->bytes); - if (ret) - return rte_flow_error_set(e, -ret, RTE_FLOW_ERROR_TYPE_ACTION, - f, "cxgbe pmd failed to" - " perform query"); + if (ret) { + rte_flow_error_set(e, -ret, RTE_FLOW_ERROR_TYPE_ACTION, + f, "cxgbe pmd failed to perform query"); + goto out; + } /* Query was successful */ c->bytes_set = 1; c->hits_set = 1; - return 0; /* success / partial_success */ +out: + t4_os_unlock(&adap->flow_lock); + return ret; } static int @@ -999,7 +1029,7 @@ struct adapter *adap = ethdev2adap(dev); struct rte_flow *flow; unsigned int fidx; - int ret; + int ret = 0; flow = t4_os_alloc(sizeof(struct rte_flow)); if (!flow) @@ -1016,27 +1046,30 @@ return ret; } - if (validate_filter(adap, &flow->fs)) { + if (cxgbe_validate_filter(adap, &flow->fs)) { t4_os_free(flow); return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "validation failed. Check f/w config file."); } + t4_os_lock(&adap->flow_lock); if (cxgbe_get_fidx(flow, &fidx)) { - t4_os_free(flow); - return rte_flow_error_set(e, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, - NULL, "no memory in tcam."); + ret = rte_flow_error_set(e, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, "no memory in tcam."); + goto out; } if (cxgbe_verify_fidx(flow, fidx, 0)) { - t4_os_free(flow); - return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, - NULL, "validation failed"); + ret = rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_HANDLE, + NULL, "validation failed"); + goto out; } +out: + t4_os_unlock(&adap->flow_lock); t4_os_free(flow); - return 0; + return ret; } /* @@ -1045,14 +1078,12 @@ * == 1 filter not active / not found */ static int -cxgbe_check_n_destroy(struct filter_entry *f, struct rte_eth_dev *dev, - struct rte_flow_error *e) +cxgbe_check_n_destroy(struct filter_entry *f, struct rte_eth_dev *dev) { if (f && (f->valid || f->pending) && f->dev == dev && /* Only if user has asked for this port */ f->private) /* We (rte_flow) created this filter */ - return cxgbe_flow_destroy(dev, (struct rte_flow *)f->private, - e); + return __cxgbe_flow_destroy(dev, (struct rte_flow *)f->private); return 1; } @@ -1062,13 +1093,20 @@ unsigned int i; int ret = 0; + t4_os_lock(&adap->flow_lock); if (adap->tids.ftid_tab) { struct filter_entry *f = &adap->tids.ftid_tab[0]; for (i = 0; i < adap->tids.nftids; i++, f++) { - ret = cxgbe_check_n_destroy(f, dev, e); - if (ret < 0) + ret = cxgbe_check_n_destroy(f, dev); + if (ret < 0) { + rte_flow_error_set(e, ret, + RTE_FLOW_ERROR_TYPE_HANDLE, + f->private, + "error destroying TCAM " + "filter."); goto out; + } } } @@ -1078,13 +1116,20 @@ for (i = adap->tids.hash_base; i <= adap->tids.ntids; i++) { f = (struct filter_entry *)adap->tids.tid_tab[i]; - ret = cxgbe_check_n_destroy(f, dev, e); - if (ret < 0) + ret = cxgbe_check_n_destroy(f, dev); + if (ret < 0) { + rte_flow_error_set(e, ret, + RTE_FLOW_ERROR_TYPE_HANDLE, + f->private, + "error destroying HASH " + "filter."); goto out; + } } } out: + t4_os_unlock(&adap->flow_lock); return ret >= 0 ? 0 : ret; } diff -Nru dpdk-18.11.5/drivers/net/cxgbe/cxgbe_main.c dpdk-18.11.6/drivers/net/cxgbe/cxgbe_main.c --- dpdk-18.11.5/drivers/net/cxgbe/cxgbe_main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/cxgbe_main.c 2020-01-31 09:55:30.000000000 +0000 @@ -92,19 +92,19 @@ } else if (opcode == CPL_ABORT_RPL_RSS) { const struct cpl_abort_rpl_rss *p = (const void *)rsp; - hash_del_filter_rpl(q->adapter, p); + cxgbe_hash_del_filter_rpl(q->adapter, p); } else if (opcode == CPL_SET_TCB_RPL) { const struct cpl_set_tcb_rpl *p = (const void *)rsp; - filter_rpl(q->adapter, p); + cxgbe_filter_rpl(q->adapter, p); } else if (opcode == CPL_ACT_OPEN_RPL) { const struct cpl_act_open_rpl *p = (const void *)rsp; - hash_filter_rpl(q->adapter, p); + cxgbe_hash_filter_rpl(q->adapter, p); } else if (opcode == CPL_L2T_WRITE_RPL) { const struct cpl_l2t_write_rpl *p = (const void *)rsp; - do_l2t_write_rpl(q->adapter, p); + cxgbe_do_l2t_write_rpl(q->adapter, p); } else { dev_err(adapter, "unexpected CPL %#x on FW event queue\n", opcode); @@ -1179,7 +1179,7 @@ if ((caps_cmd.niccaps & cpu_to_be16(FW_CAPS_CONFIG_NIC_HASHFILTER)) && is_t6(adap->params.chip)) { - if (init_hash_filter(adap) < 0) + if (cxgbe_init_hash_filter(adap) < 0) goto bye; } @@ -1889,6 +1889,8 @@ "filter support disabled. Continuing\n"); } + t4_os_lock_init(&adapter->flow_lock); + adapter->mpstcam = t4_init_mpstcam(adapter); if (!adapter->mpstcam) dev_warn(adapter, "could not allocate mps tcam table." diff -Nru dpdk-18.11.5/drivers/net/cxgbe/l2t.c dpdk-18.11.6/drivers/net/cxgbe/l2t.c --- dpdk-18.11.5/drivers/net/cxgbe/l2t.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/l2t.c 2020-01-31 09:55:30.000000000 +0000 @@ -21,7 +21,8 @@ * Process a CPL_L2T_WRITE_RPL. Note that the TID in the reply is really * the L2T index it refers to. */ -void do_l2t_write_rpl(struct adapter *adap, const struct cpl_l2t_write_rpl *rpl) +void cxgbe_do_l2t_write_rpl(struct adapter *adap, + const struct cpl_l2t_write_rpl *rpl) { struct l2t_data *d = adap->l2t; unsigned int tid = GET_TID(rpl); diff -Nru dpdk-18.11.5/drivers/net/cxgbe/l2t.h dpdk-18.11.6/drivers/net/cxgbe/l2t.h --- dpdk-18.11.5/drivers/net/cxgbe/l2t.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/l2t.h 2020-01-31 09:55:30.000000000 +0000 @@ -53,5 +53,6 @@ struct l2t_entry *cxgbe_l2t_alloc_switching(struct rte_eth_dev *dev, u16 vlan, u8 port, u8 *dmac); void cxgbe_l2t_release(struct l2t_entry *e); -void do_l2t_write_rpl(struct adapter *p, const struct cpl_l2t_write_rpl *rpl); +void cxgbe_do_l2t_write_rpl(struct adapter *p, + const struct cpl_l2t_write_rpl *rpl); #endif /* _CXGBE_L2T_H_ */ diff -Nru dpdk-18.11.5/drivers/net/cxgbe/sge.c dpdk-18.11.6/drivers/net/cxgbe/sge.c --- dpdk-18.11.5/drivers/net/cxgbe/sge.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/cxgbe/sge.c 2020-01-31 09:55:30.000000000 +0000 @@ -1152,7 +1152,6 @@ txq->stats.mapping_err++; goto out_free; } - rte_prefetch0((volatile void *)addr); return tx_do_packet_coalesce(txq, mbuf, cflits, adap, pi, addr, nb_pkts); } else { diff -Nru dpdk-18.11.5/drivers/net/dpaa2/dpaa2_ethdev.c dpdk-18.11.6/drivers/net/dpaa2/dpaa2_ethdev.c --- dpdk-18.11.5/drivers/net/dpaa2/dpaa2_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/dpaa2/dpaa2_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -1030,7 +1030,7 @@ return -EINVAL; if (frame_size > ETHER_MAX_LEN) - dev->data->dev_conf.rxmode.offloads &= + dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else dev->data->dev_conf.rxmode.offloads &= diff -Nru dpdk-18.11.5/drivers/net/dpaa2/dpaa2_rxtx.c dpdk-18.11.6/drivers/net/dpaa2/dpaa2_rxtx.c --- dpdk-18.11.5/drivers/net/dpaa2/dpaa2_rxtx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/dpaa2/dpaa2_rxtx.c 2020-01-31 09:55:30.000000000 +0000 @@ -235,7 +235,8 @@ } static inline struct rte_mbuf *__attribute__((hot)) -eth_sg_fd_to_mbuf(const struct qbman_fd *fd) +eth_sg_fd_to_mbuf(const struct qbman_fd *fd, + int port_id) { struct qbman_sge *sgt, *sge; size_t sg_addr, fd_addr; @@ -261,6 +262,7 @@ first_seg->pkt_len = DPAA2_GET_FD_LEN(fd); first_seg->nb_segs = 1; first_seg->next = NULL; + first_seg->port = port_id; if (dpaa2_svr_family == SVR_LX2160A) dpaa2_dev_rx_parse_new(first_seg, fd); else @@ -294,7 +296,8 @@ } static inline struct rte_mbuf *__attribute__((hot)) -eth_fd_to_mbuf(const struct qbman_fd *fd) +eth_fd_to_mbuf(const struct qbman_fd *fd, + int port_id) { struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF( DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)), @@ -308,6 +311,7 @@ mbuf->data_off = DPAA2_GET_FD_OFFSET(fd); mbuf->data_len = DPAA2_GET_FD_LEN(fd); mbuf->pkt_len = mbuf->data_len; + mbuf->port = port_id; mbuf->next = NULL; rte_mbuf_refcnt_set(mbuf, 1); @@ -588,10 +592,9 @@ } if (unlikely(DPAA2_FD_GET_FORMAT(fd) == qbman_fd_sg)) - bufs[num_rx] = eth_sg_fd_to_mbuf(fd); + bufs[num_rx] = eth_sg_fd_to_mbuf(fd, dev->data->port_id); else - bufs[num_rx] = eth_fd_to_mbuf(fd); - bufs[num_rx]->port = dev->data->port_id; + bufs[num_rx] = eth_fd_to_mbuf(fd, dev->data->port_id); if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP) rte_vlan_strip(bufs[num_rx]); @@ -631,6 +634,8 @@ struct dpaa2_queue *rxq, struct rte_event *ev) { + struct rte_eth_dev *dev = rxq->dev; + rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd) + DPAA2_FD_PTA_SIZE + 16)); @@ -642,7 +647,7 @@ ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; - ev->mbuf = eth_fd_to_mbuf(fd); + ev->mbuf = eth_fd_to_mbuf(fd, dev->data->port_id); qbman_swp_dqrr_consume(swp, dq); } @@ -654,6 +659,7 @@ struct dpaa2_queue *rxq, struct rte_event *ev) { + struct rte_eth_dev *dev = rxq->dev; uint8_t dqrr_index; rte_prefetch0((void *)(size_t)(DPAA2_GET_FD_ADDR(fd) + @@ -667,7 +673,7 @@ ev->queue_id = rxq->ev.queue_id; ev->priority = rxq->ev.priority; - ev->mbuf = eth_fd_to_mbuf(fd); + ev->mbuf = eth_fd_to_mbuf(fd, dev->data->port_id); dqrr_index = qbman_get_dqrr_idx(dq); ev->mbuf->seqn = dqrr_index + 1; @@ -809,15 +815,28 @@ } bufs++; } + loop = 0; + retry_count = 0; while (loop < frames_to_send) { - loop += qbman_swp_enqueue_multiple(swp, &eqdesc, + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd_arr[loop], &flags[loop], frames_to_send - loop); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) { + num_tx += loop; + nb_pkts -= loop; + goto send_n_return; + } + } else { + loop += ret; + retry_count = 0; + } } - num_tx += frames_to_send; - nb_pkts -= frames_to_send; + num_tx += loop; + nb_pkts -= loop; } dpaa2_q->tx_pkts += num_tx; return num_tx; @@ -827,13 +846,22 @@ if (loop) { unsigned int i = 0; + retry_count = 0; while (i < loop) { - i += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[i], - &flags[loop], - loop - i); + ret = qbman_swp_enqueue_multiple(swp, &eqdesc, + &fd_arr[i], + &flags[i], + loop - i); + if (unlikely(ret < 0)) { + retry_count++; + if (retry_count > DPAA2_MAX_TX_RETRY_COUNT) + break; + } else { + i += ret; + retry_count = 0; + } } - num_tx += loop; + num_tx += i; } skip_tx: dpaa2_q->tx_pkts += num_tx; diff -Nru dpdk-18.11.5/drivers/net/dpaa2/mc/dpkg.c dpdk-18.11.6/drivers/net/dpaa2/mc/dpkg.c --- dpdk-18.11.5/drivers/net/dpaa2/mc/dpkg.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/dpaa2/mc/dpkg.c 2020-01-31 09:55:30.000000000 +0000 @@ -63,7 +63,10 @@ dpkg_set_field(extr->extract_type, EXTRACT_TYPE, cfg->extracts[i].type); - for (j = 0; j < DPKG_NUM_OF_MASKS; j++) { + if (extr->num_of_byte_masks > DPKG_NUM_OF_MASKS) + return -EINVAL; + + for (j = 0; j < extr->num_of_byte_masks; j++) { extr->masks[j].mask = cfg->extracts[i].masks[j].mask; extr->masks[j].offset = cfg->extracts[i].masks[j].offset; diff -Nru dpdk-18.11.5/drivers/net/e1000/e1000_ethdev.h dpdk-18.11.6/drivers/net/e1000/e1000_ethdev.h --- dpdk-18.11.5/drivers/net/e1000/e1000_ethdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/e1000/e1000_ethdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -35,6 +35,9 @@ #define IGB_MAX_RX_QUEUE_NUM 8 #define IGB_MAX_RX_QUEUE_NUM_82576 16 +#define E1000_I219_MAX_RX_QUEUE_NUM 2 +#define E1000_I219_MAX_TX_QUEUE_NUM 2 + #define E1000_SYN_FILTER_ENABLE 0x00000001 /* syn filter enable field */ #define E1000_SYN_FILTER_QUEUE 0x0000000E /* syn filter queue field */ #define E1000_SYN_FILTER_QUEUE_SHIFT 1 /* syn filter queue field */ @@ -341,17 +344,17 @@ }; TAILQ_HEAD(igb_ntuple_filter_list, igb_ntuple_filter_ele); -struct igb_ntuple_filter_list igb_filter_ntuple_list; +extern struct igb_ntuple_filter_list igb_filter_ntuple_list; TAILQ_HEAD(igb_ethertype_filter_list, igb_ethertype_filter_ele); -struct igb_ethertype_filter_list igb_filter_ethertype_list; +extern struct igb_ethertype_filter_list igb_filter_ethertype_list; TAILQ_HEAD(igb_syn_filter_list, igb_eth_syn_filter_ele); -struct igb_syn_filter_list igb_filter_syn_list; +extern struct igb_syn_filter_list igb_filter_syn_list; TAILQ_HEAD(igb_flex_filter_list, igb_flex_filter_ele); -struct igb_flex_filter_list igb_filter_flex_list; +extern struct igb_flex_filter_list igb_filter_flex_list; TAILQ_HEAD(igb_rss_filter_list, igb_rss_conf_ele); -struct igb_rss_filter_list igb_filter_rss_list; +extern struct igb_rss_filter_list igb_filter_rss_list; TAILQ_HEAD(igb_flow_mem_list, igb_flow_mem); -struct igb_flow_mem_list igb_flow_list; +extern struct igb_flow_mem_list igb_flow_list; extern const struct rte_flow_ops igb_flow_ops; @@ -515,5 +518,6 @@ int igb_config_rss_filter(struct rte_eth_dev *dev, struct igb_rte_flow_rss_conf *conf, bool add); +void em_flush_desc_rings(struct rte_eth_dev *dev); #endif /* _E1000_ETHDEV_H_ */ diff -Nru dpdk-18.11.5/drivers/net/e1000/em_ethdev.c dpdk-18.11.6/drivers/net/e1000/em_ethdev.c --- dpdk-18.11.5/drivers/net/e1000/em_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/e1000/em_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -737,6 +737,11 @@ em_lsc_intr_disable(hw); e1000_reset_hw(hw); + + /* Flush desc rings for i219 */ + if (hw->mac.type == e1000_pch_spt || hw->mac.type == e1000_pch_cnp) + em_flush_desc_rings(dev); + if (hw->mac.type >= e1000_82544) E1000_WRITE_REG(hw, E1000_WUC, 0); @@ -1110,9 +1115,9 @@ struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct rte_eth_link link; - int link_check, count; + int link_up, count; - link_check = 0; + link_up = 0; hw->mac.get_link_status = 1; /* possible wait-to-complete in up to 9 seconds */ @@ -1122,31 +1127,31 @@ case e1000_media_type_copper: /* Do the work to read phy */ e1000_check_for_link(hw); - link_check = !hw->mac.get_link_status; + link_up = !hw->mac.get_link_status; break; case e1000_media_type_fiber: e1000_check_for_link(hw); - link_check = (E1000_READ_REG(hw, E1000_STATUS) & + link_up = (E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU); break; case e1000_media_type_internal_serdes: e1000_check_for_link(hw); - link_check = hw->mac.serdes_has_link; + link_up = hw->mac.serdes_has_link; break; default: break; } - if (link_check || wait_to_complete == 0) + if (link_up || wait_to_complete == 0) break; rte_delay_ms(EM_LINK_UPDATE_CHECK_INTERVAL); } memset(&link, 0, sizeof(link)); /* Now we check if a transition has happened */ - if (link_check && (link.link_status == ETH_LINK_DOWN)) { + if (link_up) { uint16_t duplex, speed; hw->mac.ops.get_link_up_info(hw, &speed, &duplex); link.link_duplex = (duplex == FULL_DUPLEX) ? @@ -1156,7 +1161,7 @@ link.link_status = ETH_LINK_UP; link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); - } else if (!link_check && (link.link_status == ETH_LINK_UP)) { + } else { link.link_speed = ETH_SPEED_NUM_NONE; link.link_duplex = ETH_LINK_HALF_DUPLEX; link.link_status = ETH_LINK_DOWN; diff -Nru dpdk-18.11.5/drivers/net/e1000/em_rxtx.c dpdk-18.11.6/drivers/net/e1000/em_rxtx.c --- dpdk-18.11.5/drivers/net/e1000/em_rxtx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/e1000/em_rxtx.c 2020-01-31 09:55:30.000000000 +0000 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,11 @@ #define E1000_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ E1000_TX_OFFLOAD_MASK) +/* PCI offset for querying configuration status register */ +#define PCI_CFG_STATUS_REG 0x06 +#define FLUSH_DESC_REQUIRED 0x100 + + /** * Structure associated with each descriptor of the RX ring of a RX queue. */ @@ -2016,3 +2022,107 @@ qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh; qinfo->conf.offloads = txq->offloads; } + +static void +e1000_flush_tx_ring(struct rte_eth_dev *dev) +{ + struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + volatile struct e1000_data_desc *tx_desc; + volatile uint32_t *tdt_reg_addr; + uint32_t tdt, tctl, txd_lower = E1000_TXD_CMD_IFCS; + uint16_t size = 512; + struct em_tx_queue *txq; + int i; + + if (dev->data->tx_queues == NULL) + return; + tctl = E1000_READ_REG(hw, E1000_TCTL); + E1000_WRITE_REG(hw, E1000_TCTL, tctl | E1000_TCTL_EN); + for (i = 0; i < dev->data->nb_tx_queues && + i < E1000_I219_MAX_TX_QUEUE_NUM; i++) { + txq = dev->data->tx_queues[i]; + tdt = E1000_READ_REG(hw, E1000_TDT(i)); + if (tdt != txq->tx_tail) + return; + tx_desc = &txq->tx_ring[txq->tx_tail]; + tx_desc->buffer_addr = rte_cpu_to_le_64(txq->tx_ring_phys_addr); + tx_desc->lower.data = rte_cpu_to_le_32(txd_lower | size); + tx_desc->upper.data = 0; + + rte_cio_wmb(); + txq->tx_tail++; + if (txq->tx_tail == txq->nb_tx_desc) + txq->tx_tail = 0; + tdt_reg_addr = E1000_PCI_REG_ADDR(hw, E1000_TDT(i)); + E1000_PCI_REG_WRITE(tdt_reg_addr, txq->tx_tail); + usec_delay(250); + } +} + +static void +e1000_flush_rx_ring(struct rte_eth_dev *dev) +{ + uint32_t rctl, rxdctl; + struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + int i; + + rctl = E1000_READ_REG(hw, E1000_RCTL); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + + for (i = 0; i < dev->data->nb_rx_queues && + i < E1000_I219_MAX_RX_QUEUE_NUM; i++) { + rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(i)); + /* zero the lower 14 bits (prefetch and host thresholds) */ + rxdctl &= 0xffffc000; + + /* update thresholds: prefetch threshold to 31, + * host threshold to 1 and make sure the granularity + * is "descriptors" and not "cache lines" + */ + rxdctl |= (0x1F | (1UL << 8) | E1000_RXDCTL_THRESH_UNIT_DESC); + + E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); + } + /* momentarily enable the RX ring for the changes to take effect */ + E1000_WRITE_REG(hw, E1000_RCTL, rctl | E1000_RCTL_EN); + E1000_WRITE_FLUSH(hw); + usec_delay(150); + E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN); +} + +/** + * em_flush_desc_rings - remove all descriptors from the descriptor rings + * + * In i219, the descriptor rings must be emptied before resetting/closing the + * HW. Failure to do this will cause the HW to enter a unit hang state which + * can only be released by PCI reset on the device + * + */ + +void +em_flush_desc_rings(struct rte_eth_dev *dev) +{ + uint32_t fextnvm11, tdlen; + struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); + struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); + uint16_t pci_cfg_status = 0; + + fextnvm11 = E1000_READ_REG(hw, E1000_FEXTNVM11); + E1000_WRITE_REG(hw, E1000_FEXTNVM11, + fextnvm11 | E1000_FEXTNVM11_DISABLE_MULR_FIX); + tdlen = E1000_READ_REG(hw, E1000_TDLEN(0)); + rte_pci_read_config(pci_dev, &pci_cfg_status, sizeof(pci_cfg_status), + PCI_CFG_STATUS_REG); + + /* do nothing if we're not in faulty state, or if the queue is empty */ + if ((pci_cfg_status & FLUSH_DESC_REQUIRED) && tdlen) { + /* flush desc ring */ + e1000_flush_tx_ring(dev); + rte_pci_read_config(pci_dev, &pci_cfg_status, + sizeof(pci_cfg_status), PCI_CFG_STATUS_REG); + if (pci_cfg_status & FLUSH_DESC_REQUIRED) + e1000_flush_rx_ring(dev); + } +} diff -Nru dpdk-18.11.5/drivers/net/e1000/igb_ethdev.c dpdk-18.11.6/drivers/net/e1000/igb_ethdev.c --- dpdk-18.11.5/drivers/net/e1000/igb_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/e1000/igb_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -884,6 +884,8 @@ /* enable support intr */ igb_intr_enable(eth_dev); + eth_igb_dev_set_link_down(eth_dev); + /* initialize filter info */ memset(filter_info, 0, sizeof(struct e1000_filter_info)); @@ -1514,8 +1516,9 @@ igb_pf_reset_hw(hw); E1000_WRITE_REG(hw, E1000_WUC, 0); - /* Set bit for Go Link disconnect */ - if (hw->mac.type >= e1000_82580) { + /* Set bit for Go Link disconnect if PHY reset is not blocked */ + if (hw->mac.type >= e1000_82580 && + (e1000_check_reset_block(hw) != E1000_BLK_PHY_RESET)) { uint32_t phpm_reg; phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT); @@ -1589,8 +1592,9 @@ igb_release_manageability(hw); igb_hw_control_release(hw); - /* Clear bit for Go Link disconnect */ - if (hw->mac.type >= e1000_82580) { + /* Clear bit for Go Link disconnect if PHY reset is not blocked */ + if (hw->mac.type >= e1000_82580 && + (e1000_check_reset_block(hw) != E1000_BLK_PHY_RESET)) { uint32_t phpm_reg; phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT); diff -Nru dpdk-18.11.5/drivers/net/e1000/igb_flow.c dpdk-18.11.6/drivers/net/e1000/igb_flow.c --- dpdk-18.11.5/drivers/net/e1000/igb_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/e1000/igb_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -49,6 +49,13 @@ #define IGB_FLEX_RAW_NUM 12 +struct igb_flow_mem_list igb_flow_list; +struct igb_ntuple_filter_list igb_filter_ntuple_list; +struct igb_ethertype_filter_list igb_filter_ethertype_list; +struct igb_syn_filter_list igb_filter_syn_list; +struct igb_flex_filter_list igb_filter_flex_list; +struct igb_rss_filter_list igb_filter_rss_list; + /** * Please aware there's an asumption for all the parsers. * rte_flow_item is using big endian, rte_flow_attr and @@ -1374,7 +1381,7 @@ index++; NEXT_ITEM_OF_ACTION(act, actions, index); if (act->type != RTE_FLOW_ACTION_TYPE_END) { - memset(rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + memset(rss_conf, 0, sizeof(struct igb_rte_flow_rss_conf)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "Not supported action."); diff -Nru dpdk-18.11.5/drivers/net/enetc/base/enetc_hw.h dpdk-18.11.6/drivers/net/enetc/base/enetc_hw.h --- dpdk-18.11.5/drivers/net/enetc/base/enetc_hw.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enetc/base/enetc_hw.h 2020-01-31 09:55:30.000000000 +0000 @@ -12,6 +12,9 @@ #define ENETC_DEV_ID_VF 0xef00 #define ENETC_DEV_ID 0xe100 +/* BD RING ALIGNMENT */ +#define ENETC_BD_RING_ALIGN 128 + /* ENETC register block BAR */ #define ENETC_BAR_REGS 0x0 diff -Nru dpdk-18.11.5/drivers/net/enetc/enetc_ethdev.c dpdk-18.11.6/drivers/net/enetc/enetc_ethdev.c --- dpdk-18.11.5/drivers/net/enetc/enetc_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enetc/enetc_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -302,12 +302,12 @@ int size; size = nb_desc * sizeof(struct enetc_swbd); - txr->q_swbd = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); + txr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN); if (txr->q_swbd == NULL) return -ENOMEM; size = nb_desc * sizeof(struct enetc_tx_bd); - txr->bd_base = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); + txr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN); if (txr->bd_base == NULL) { rte_free(txr->q_swbd); txr->q_swbd = NULL; @@ -453,12 +453,12 @@ int size; size = nb_rx_desc * sizeof(struct enetc_swbd); - rxr->q_swbd = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); + rxr->q_swbd = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN); if (rxr->q_swbd == NULL) return -ENOMEM; size = nb_rx_desc * sizeof(union enetc_rx_bd); - rxr->bd_base = rte_malloc(NULL, size, RTE_CACHE_LINE_SIZE); + rxr->bd_base = rte_malloc(NULL, size, ENETC_BD_RING_ALIGN); if (rxr->bd_base == NULL) { rte_free(rxr->q_swbd); rxr->q_swbd = NULL; diff -Nru dpdk-18.11.5/drivers/net/enic/Makefile dpdk-18.11.6/drivers/net/enic/Makefile --- dpdk-18.11.5/drivers/net/enic/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -13,6 +13,8 @@ LIBABIVER := 1 +# Experimental APIs used: rte_intr_ack +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += -I$(SRCDIR)/base/ CFLAGS += -I$(SRCDIR) CFLAGS += -O3 diff -Nru dpdk-18.11.5/drivers/net/enic/enic.h dpdk-18.11.6/drivers/net/enic/enic.h --- dpdk-18.11.5/drivers/net/enic/enic.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/enic.h 2020-01-31 09:55:30.000000000 +0000 @@ -112,6 +112,7 @@ unsigned int port_id; bool overlay_offload; struct rte_eth_dev *rte_dev; + struct rte_eth_dev_data *dev_data; struct enic_fdir fdir; char bdf_name[ENICPMD_BDF_LENGTH]; int dev_fd; @@ -136,6 +137,7 @@ bool udp_rss_weak; /* Bodega style UDP RSS */ uint8_t ig_vlan_rewrite_mode; /* devargs ig-vlan-rewrite */ uint16_t vxlan_port; /* current vxlan port pushed to NIC */ + int use_simple_tx_handler; unsigned int flags; unsigned int priv_flags; @@ -330,8 +332,10 @@ uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); int enic_set_mtu(struct enic *enic, uint16_t new_mtu); -int enic_link_update(struct enic *enic); -bool enic_use_vector_rx_handler(struct enic *enic); +int enic_link_update(struct rte_eth_dev *eth_dev); +bool enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev); +void enic_pick_rx_handler(struct rte_eth_dev *eth_dev); +void enic_pick_tx_handler(struct rte_eth_dev *eth_dev); void enic_fdir_info(struct enic *enic); void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats); extern const struct rte_flow_ops enic_flow_ops; diff -Nru dpdk-18.11.5/drivers/net/enic/enic_ethdev.c dpdk-18.11.6/drivers/net/enic/enic_ethdev.c --- dpdk-18.11.5/drivers/net/enic/enic_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/enic_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -432,10 +432,8 @@ static int enicpmd_dev_link_update(struct rte_eth_dev *eth_dev, __rte_unused int wait_to_complete) { - struct enic *enic = pmd_priv(eth_dev); - ENICPMD_FUNC_TRACE(); - return enic_link_update(enic); + return enic_link_update(eth_dev); } static int enicpmd_dev_stats_get(struct rte_eth_dev *eth_dev, @@ -1042,12 +1040,19 @@ ENICPMD_FUNC_TRACE(); - enic->port_id = eth_dev->data->port_id; - enic->rte_dev = eth_dev; eth_dev->dev_ops = &enicpmd_eth_dev_ops; eth_dev->rx_pkt_burst = &enic_recv_pkts; eth_dev->tx_pkt_burst = &enic_xmit_pkts; eth_dev->tx_pkt_prepare = &enic_prep_pkts; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + enic_pick_tx_handler(eth_dev); + enic_pick_rx_handler(eth_dev); + return 0; + } + /* Only the primary sets up adapter and other data in shared memory */ + enic->port_id = eth_dev->data->port_id; + enic->rte_dev = eth_dev; + enic->dev_data = eth_dev->data; pdev = RTE_ETH_DEV_TO_PCI(eth_dev); rte_eth_copy_pci_info(eth_dev, pdev); diff -Nru dpdk-18.11.5/drivers/net/enic/enic_main.c dpdk-18.11.6/drivers/net/enic/enic_main.c --- dpdk-18.11.5/drivers/net/enic/enic_main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/enic_main.c 2020-01-31 09:55:30.000000000 +0000 @@ -417,9 +417,9 @@ rte_free(mze); } -int enic_link_update(struct enic *enic) +int enic_link_update(struct rte_eth_dev *eth_dev) { - struct rte_eth_dev *eth_dev = enic->rte_dev; + struct enic *enic = pmd_priv(eth_dev); struct rte_eth_link link; memset(&link, 0, sizeof(link)); @@ -438,9 +438,11 @@ vnic_intr_return_all_credits(&enic->intr[ENICPMD_LSC_INTR_OFFSET]); - enic_link_update(enic); + enic_link_update(dev); _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); enic_log_q_error(enic); + /* Re-enable irq in case of INTx */ + rte_intr_ack(&enic->pdev->intr_handle); } static int enic_rxq_intr_init(struct enic *enic) @@ -518,14 +520,14 @@ * used when that file is not compiled. */ __rte_weak bool -enic_use_vector_rx_handler(__rte_unused struct enic *enic) +enic_use_vector_rx_handler(__rte_unused struct rte_eth_dev *eth_dev) { return false; } -static void pick_rx_handler(struct enic *enic) +void enic_pick_rx_handler(struct rte_eth_dev *eth_dev) { - struct rte_eth_dev *eth_dev; + struct enic *enic = pmd_priv(eth_dev); /* * Preference order: @@ -533,8 +535,7 @@ * 2. The non-scatter, simplified handler if scatter Rx is not used. * 3. The default handler as a fallback. */ - eth_dev = enic->rte_dev; - if (enic_use_vector_rx_handler(enic)) + if (enic_use_vector_rx_handler(eth_dev)) return; if (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) { PMD_INIT_LOG(DEBUG, " use the non-scatter Rx handler"); @@ -545,6 +546,20 @@ } } +/* Secondary process uses this to set the Tx handler */ +void enic_pick_tx_handler(struct rte_eth_dev *eth_dev) +{ + struct enic *enic = pmd_priv(eth_dev); + + if (enic->use_simple_tx_handler) { + PMD_INIT_LOG(DEBUG, " use the simple tx handler"); + eth_dev->tx_pkt_burst = &enic_simple_xmit_pkts; + } else { + PMD_INIT_LOG(DEBUG, " use the default tx handler"); + eth_dev->tx_pkt_burst = &enic_xmit_pkts; + } +} + int enic_enable(struct enic *enic) { unsigned int index; @@ -622,12 +637,13 @@ eth_dev->tx_pkt_burst = &enic_simple_xmit_pkts; for (index = 0; index < enic->wq_count; index++) enic_prep_wq_for_simple_tx(enic, index); + enic->use_simple_tx_handler = 1; } else { PMD_INIT_LOG(DEBUG, " use the default tx handler"); eth_dev->tx_pkt_burst = &enic_xmit_pkts; } - pick_rx_handler(enic); + enic_pick_rx_handler(eth_dev); for (index = 0; index < enic->wq_count; index++) enic_start_wq(enic, index); @@ -717,31 +733,31 @@ void enic_start_wq(struct enic *enic, uint16_t queue_idx) { - struct rte_eth_dev *eth_dev = enic->rte_dev; + struct rte_eth_dev_data *data = enic->dev_data; vnic_wq_enable(&enic->wq[queue_idx]); - eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED; + data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED; } int enic_stop_wq(struct enic *enic, uint16_t queue_idx) { - struct rte_eth_dev *eth_dev = enic->rte_dev; + struct rte_eth_dev_data *data = enic->dev_data; int ret; ret = vnic_wq_disable(&enic->wq[queue_idx]); if (ret) return ret; - eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED; + data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED; return 0; } void enic_start_rq(struct enic *enic, uint16_t queue_idx) { + struct rte_eth_dev_data *data = enic->dev_data; struct vnic_rq *rq_sop; struct vnic_rq *rq_data; rq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)]; rq_data = &enic->rq[rq_sop->data_queue_idx]; - struct rte_eth_dev *eth_dev = enic->rte_dev; if (rq_data->in_use) { vnic_rq_enable(rq_data); @@ -750,13 +766,13 @@ rte_mb(); vnic_rq_enable(rq_sop); enic_initial_post_rx(enic, rq_sop); - eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED; + data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED; } int enic_stop_rq(struct enic *enic, uint16_t queue_idx) { + struct rte_eth_dev_data *data = enic->dev_data; int ret1 = 0, ret2 = 0; - struct rte_eth_dev *eth_dev = enic->rte_dev; struct vnic_rq *rq_sop; struct vnic_rq *rq_data; rq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)]; @@ -772,7 +788,7 @@ else if (ret1) return ret1; - eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED; + data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED; return 0; } @@ -1600,7 +1616,7 @@ /* put back the real receive function */ rte_mb(); - pick_rx_handler(enic); + enic_pick_rx_handler(eth_dev); rte_mb(); /* restart Rx traffic */ diff -Nru dpdk-18.11.5/drivers/net/enic/enic_rxtx_vec_avx2.c dpdk-18.11.6/drivers/net/enic/enic_rxtx_vec_avx2.c --- dpdk-18.11.5/drivers/net/enic/enic_rxtx_vec_avx2.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/enic_rxtx_vec_avx2.c 2020-01-31 09:55:30.000000000 +0000 @@ -806,12 +806,11 @@ } bool -enic_use_vector_rx_handler(struct enic *enic) +enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev) { - struct rte_eth_dev *eth_dev; + struct enic *enic = pmd_priv(eth_dev); struct rte_fdir_conf *fconf; - eth_dev = enic->rte_dev; /* User needs to request for the avx2 handler */ if (!enic->enable_avx2_rx) return false; diff -Nru dpdk-18.11.5/drivers/net/enic/meson.build dpdk-18.11.6/drivers/net/enic/meson.build --- dpdk-18.11.5/drivers/net/enic/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/enic/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Cisco Systems, Inc. +# Experimental APIs used: rte_intr_ack +cflags += ['-DALLOW_EXPERIMENTAL_API'] sources = files( 'base/vnic_cq.c', 'base/vnic_dev.c', diff -Nru dpdk-18.11.5/drivers/net/fm10k/fm10k_rxtx_vec.c dpdk-18.11.6/drivers/net/fm10k/fm10k_rxtx_vec.c --- dpdk-18.11.5/drivers/net/fm10k/fm10k_rxtx_vec.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/fm10k/fm10k_rxtx_vec.c 2020-01-31 09:55:30.000000000 +0000 @@ -359,8 +359,15 @@ return; /* free all mbufs that are valid in the ring */ - for (i = rxq->next_dd; i != rxq->rxrearm_start; i = (i + 1) & mask) - rte_pktmbuf_free_seg(rxq->sw_ring[i]); + if (rxq->rxrearm_nb == 0) { + for (i = 0; i < rxq->nb_desc; i++) + if (rxq->sw_ring[i] != NULL) + rte_pktmbuf_free_seg(rxq->sw_ring[i]); + } else { + for (i = rxq->next_dd; i != rxq->rxrearm_start; + i = (i + 1) & mask) + rte_pktmbuf_free_seg(rxq->sw_ring[i]); + } rxq->rxrearm_nb = rxq->nb_desc; /* set all entries to NULL */ diff -Nru dpdk-18.11.5/drivers/net/i40e/i40e_ethdev.c dpdk-18.11.6/drivers/net/i40e/i40e_ethdev.c --- dpdk-18.11.5/drivers/net/i40e/i40e_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/i40e/i40e_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -2742,7 +2742,7 @@ status = i40e_aq_get_link_info(hw, enable_lse, &link_status, NULL); if (unlikely(status != I40E_SUCCESS)) { - link->link_speed = ETH_SPEED_NUM_100M; + link->link_speed = ETH_SPEED_NUM_NONE; link->link_duplex = ETH_LINK_FULL_DUPLEX; PMD_DRV_LOG(ERR, "Failed to get link info"); return; @@ -2776,7 +2776,7 @@ link->link_speed = ETH_SPEED_NUM_40G; break; default: - link->link_speed = ETH_SPEED_NUM_100M; + link->link_speed = ETH_SPEED_NUM_NONE; break; } } diff -Nru dpdk-18.11.5/drivers/net/i40e/i40e_ethdev_vf.c dpdk-18.11.6/drivers/net/i40e/i40e_ethdev_vf.c --- dpdk-18.11.5/drivers/net/i40e/i40e_ethdev_vf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/i40e/i40e_ethdev_vf.c 2020-01-31 09:55:30.000000000 +0000 @@ -1359,7 +1359,7 @@ } break; default: - PMD_DRV_LOG(ERR, "Request %u is not supported yet", + PMD_DRV_LOG(DEBUG, "Request %u is not supported yet", aq_opc); break; } @@ -2073,13 +2073,15 @@ new_link.link_speed = ETH_SPEED_NUM_40G; break; default: - new_link.link_speed = ETH_SPEED_NUM_100M; + new_link.link_speed = ETH_SPEED_NUM_NONE; break; } /* full duplex only */ new_link.link_duplex = ETH_LINK_FULL_DUPLEX; - new_link.link_status = vf->link_up ? ETH_LINK_UP : - ETH_LINK_DOWN; + new_link.link_status = vf->link_up && + new_link.link_speed != ETH_SPEED_NUM_NONE + ? ETH_LINK_UP + : ETH_LINK_DOWN; new_link.link_autoneg = !(dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED); @@ -2526,7 +2528,10 @@ struct i40e_hw *hw = I40E_VF_TO_HW(vf); struct rte_eth_rss_conf rss_conf; uint32_t i, j, lut = 0, nb_q = (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; + uint32_t rss_lut_size = (I40E_VFQF_HLUT1_MAX_INDEX + 1) * 4; uint16_t num; + uint8_t *lut_info; + int ret; if (vf->dev_data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) { i40evf_disable_rss(vf); @@ -2536,12 +2541,29 @@ num = RTE_MIN(vf->dev_data->nb_rx_queues, I40E_MAX_QP_NUM_PER_VF); /* Fill out the look up table */ - for (i = 0, j = 0; i < nb_q; i++, j++) { - if (j >= num) - j = 0; - lut = (lut << 8) | j; - if ((i & 3) == 3) - I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut); + if (!(vf->flags & I40E_FLAG_RSS_AQ_CAPABLE)) { + for (i = 0, j = 0; i < nb_q; i++, j++) { + if (j >= num) + j = 0; + lut = (lut << 8) | j; + if ((i & 3) == 3) + I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut); + } + } else { + lut_info = rte_zmalloc("i40e_rss_lut", rss_lut_size, 0); + if (!lut_info) { + PMD_DRV_LOG(ERR, "No memory can be allocated"); + return -ENOMEM; + } + + for (i = 0; i < rss_lut_size; i++) + lut_info[i] = i % vf->num_queue_pairs; + + ret = i40evf_set_rss_lut(&vf->vsi, lut_info, + rss_lut_size); + rte_free(lut_info); + if (ret) + return ret; } rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf; diff -Nru dpdk-18.11.5/drivers/net/i40e/i40e_flow.c dpdk-18.11.6/drivers/net/i40e/i40e_flow.c --- dpdk-18.11.5/drivers/net/i40e/i40e_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/i40e/i40e_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -2350,6 +2350,37 @@ if (num < 0) return -EINVAL; + if (pf->support_multi_driver) { + for (i = 0; i < num; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != + mask_reg[i]) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + if (i40e_read_rx_ctl(hw, + I40E_GLQF_FD_MSK(i, pctype)) != 0) { + PMD_DRV_LOG(ERR, "Input set setting is not" + " supported with" + " `support-multi-driver`" + " enabled!"); + return -EPERM; + } + + } else { + for (i = 0; i < num; i++) + i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), + mask_reg[i]); + /*clear unused mask registers of the pctype */ + for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) + i40e_check_write_reg(hw, + I40E_GLQF_FD_MSK(i, pctype), 0); + } + inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set); i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), @@ -2358,13 +2389,6 @@ (uint32_t)((inset_reg >> I40E_32_BIT_WIDTH) & UINT32_MAX)); - for (i = 0; i < num; i++) - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), - mask_reg[i]); - - /*clear unused mask registers of the pctype */ - for (i = num; i < I40E_INSET_MASK_NUM_REG; i++) - i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0); I40E_WRITE_FLUSH(hw); pf->fdir.input_set[pctype] = input_set; diff -Nru dpdk-18.11.5/drivers/net/i40e/i40e_rxtx.c dpdk-18.11.6/drivers/net/i40e/i40e_rxtx.c --- dpdk-18.11.5/drivers/net/i40e/i40e_rxtx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/i40e/i40e_rxtx.c 2020-01-31 09:55:30.000000000 +0000 @@ -2608,7 +2608,7 @@ struct i40e_pf *pf = I40E_VSI_TO_PF(rxq->vsi); struct i40e_hw *hw = I40E_VSI_TO_HW(rxq->vsi); struct rte_eth_dev_data *data = pf->dev_data; - uint16_t buf_size, len; + uint16_t buf_size; buf_size = (uint16_t)(rte_pktmbuf_data_room_size(rxq->mp) - RTE_PKTMBUF_HEADROOM); @@ -2631,8 +2631,9 @@ break; } - len = hw->func_caps.rx_buf_chain_len * rxq->rx_buf_len; - rxq->max_pkt_len = RTE_MIN(len, data->dev_conf.rxmode.max_rx_pkt_len); + rxq->max_pkt_len = + RTE_MIN((uint32_t)(hw->func_caps.rx_buf_chain_len * + rxq->rx_buf_len), data->dev_conf.rxmode.max_rx_pkt_len); if (data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { if (rxq->max_pkt_len <= ETHER_MAX_LEN || rxq->max_pkt_len > I40E_FRAME_SIZE_MAX) { diff -Nru dpdk-18.11.5/drivers/net/i40e/i40e_rxtx_vec_neon.c dpdk-18.11.6/drivers/net/i40e/i40e_rxtx_vec_neon.c --- dpdk-18.11.5/drivers/net/i40e/i40e_rxtx_vec_neon.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/i40e/i40e_rxtx_vec_neon.c 2020-01-31 09:55:30.000000000 +0000 @@ -285,7 +285,6 @@ /* Read desc statuses backwards to avoid race condition */ /* A.1 load 4 pkts desc */ descs[3] = vld1q_u64((uint64_t *)(rxdp + 3)); - rte_rmb(); /* B.2 copy 2 mbuf point into rx_pkts */ vst1q_u64((uint64_t *)&rx_pkts[pos], mbp1); @@ -308,9 +307,6 @@ rte_mbuf_prefetch_part2(rx_pkts[pos + 3]); } - /* avoid compiler reorder optimization */ - rte_compiler_barrier(); - /* pkt 3,4 shift the pktlen field to be 16-bit aligned*/ uint32x4_t len3 = vshlq_u32(vreinterpretq_u32_u64(descs[3]), len_shl); @@ -478,6 +474,7 @@ i++; if (i == nb_bufs) return nb_bufs; + rxq->pkt_first_seg = rx_pkts[i]; } return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, &split_flags[i]); diff -Nru dpdk-18.11.5/drivers/net/ifc/ifcvf_vdpa.c dpdk-18.11.6/drivers/net/ifc/ifcvf_vdpa.c --- dpdk-18.11.5/drivers/net/ifc/ifcvf_vdpa.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ifc/ifcvf_vdpa.c 2020-01-31 09:55:30.000000000 +0000 @@ -112,15 +112,19 @@ struct rte_pci_device *dev = internal->pdev; char devname[RTE_DEV_NAME_MAX_LEN] = {0}; int iommu_group_num; - int i; + int i, ret; internal->vfio_dev_fd = -1; internal->vfio_group_fd = -1; internal->vfio_container_fd = -1; rte_pci_device_name(&dev->addr, devname, RTE_DEV_NAME_MAX_LEN); - rte_vfio_get_group_num(rte_pci_get_sysfs_path(), devname, + ret = rte_vfio_get_group_num(rte_pci_get_sysfs_path(), devname, &iommu_group_num); + if (ret <= 0) { + DRV_LOG(ERR, "%s failed to get IOMMU group", devname); + return -1; + } internal->vfio_container_fd = rte_vfio_container_create(); if (internal->vfio_container_fd < 0) diff -Nru dpdk-18.11.5/drivers/net/ixgbe/ixgbe_ethdev.c dpdk-18.11.6/drivers/net/ixgbe/ixgbe_ethdev.c --- dpdk-18.11.5/drivers/net/ixgbe/ixgbe_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/ixgbe_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -1078,6 +1078,8 @@ PMD_INIT_FUNC_TRACE(); + ixgbe_dev_macsec_setting_reset(eth_dev); + eth_dev->dev_ops = &ixgbe_eth_dev_ops; eth_dev->rx_pkt_burst = &ixgbe_recv_pkts; eth_dev->tx_pkt_burst = &ixgbe_xmit_pkts; @@ -1171,6 +1173,7 @@ diag = ixgbe_bypass_init_hw(hw); #else diag = ixgbe_init_hw(hw); + hw->mac.autotry_restart = false; #endif /* RTE_LIBRTE_IXGBE_BYPASS */ /* @@ -1276,6 +1279,8 @@ /* enable support intr */ ixgbe_enable_intr(eth_dev); + ixgbe_dev_set_link_down(eth_dev); + /* initialize filter info */ memset(filter_info, 0, sizeof(struct ixgbe_filter_info)); @@ -2590,6 +2595,8 @@ uint32_t *link_speeds; struct ixgbe_tm_conf *tm_conf = IXGBE_DEV_PRIVATE_TO_TM_CONF(dev->data->dev_private); + struct ixgbe_macsec_setting *macsec_setting = + IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); PMD_INIT_FUNC_TRACE(); @@ -2830,6 +2837,10 @@ */ ixgbe_dev_link_update(dev, 0); + /* setup the macsec setting register */ + if (macsec_setting->offload_en) + ixgbe_dev_macsec_register_enable(dev, macsec_setting); + return 0; error: @@ -2935,6 +2946,7 @@ } else { /* Turn on the laser */ ixgbe_enable_tx_laser(hw); + ixgbe_dev_link_update(dev, 0); } return 0; @@ -2965,6 +2977,7 @@ } else { /* Turn off the laser */ ixgbe_disable_tx_laser(hw); + ixgbe_dev_link_update(dev, 0); } return 0; @@ -3825,6 +3838,11 @@ dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; dev_info->speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G; + if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T || + hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) + dev_info->speed_capa = ETH_LINK_SPEED_10M | + ETH_LINK_SPEED_100M | ETH_LINK_SPEED_1G; + if (hw->mac.type == ixgbe_mac_X540 || hw->mac.type == ixgbe_mac_X540_vf || hw->mac.type == ixgbe_mac_X550 || @@ -3876,7 +3894,7 @@ dev->rx_pkt_burst == ixgbe_recv_pkts_bulk_alloc) return ptypes; -#if defined(RTE_ARCH_X86) +#if defined(RTE_ARCH_X86) || defined(RTE_MACHINE_CPUFLAG_NEON) if (dev->rx_pkt_burst == ixgbe_recv_pkts_vec || dev->rx_pkt_burst == ixgbe_recv_scattered_pkts_vec) return ptypes; @@ -3909,6 +3927,7 @@ dev_info->tx_offload_capa = ixgbe_get_tx_port_offloads(dev); dev_info->hash_key_size = IXGBE_HKEY_MAX_INDEX * sizeof(uint32_t); dev_info->reta_size = ixgbe_reta_size_get(hw->mac.type); + dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { @@ -4072,6 +4091,7 @@ int link_up; int diag; int wait = 1; + u32 esdp_reg; memset(&link, 0, sizeof(link)); link.link_status = ETH_LINK_DOWN; @@ -4099,6 +4119,10 @@ return rte_eth_linkstatus_set(dev, &link); } + esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); + if ((esdp_reg & IXGBE_ESDP_SDP3)) + link_up = 0; + if (link_up == 0) { if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; @@ -4114,7 +4138,6 @@ switch (link_speed) { default: case IXGBE_LINK_SPEED_UNKNOWN: - link.link_duplex = ETH_LINK_FULL_DUPLEX; link.link_speed = ETH_SPEED_NUM_100M; break; @@ -5871,7 +5894,8 @@ IXGBE_WRITE_REG(hw, IXGBE_IVAR(idx), tmp); } else if ((hw->mac.type == ixgbe_mac_82599EB) || (hw->mac.type == ixgbe_mac_X540) || - (hw->mac.type == ixgbe_mac_X550)) { + (hw->mac.type == ixgbe_mac_X550) || + (hw->mac.type == ixgbe_mac_X550EM_x)) { if (direction == -1) { /* other causes */ idx = ((queue & 1) * 8); @@ -6001,6 +6025,7 @@ case ixgbe_mac_82599EB: case ixgbe_mac_X540: case ixgbe_mac_X550: + case ixgbe_mac_X550EM_x: ixgbe_set_ivar_map(hw, -1, 1, IXGBE_MISC_VEC_ID); break; default: @@ -8671,6 +8696,149 @@ return 0; } +void +ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev, + struct ixgbe_macsec_setting *macsec_setting) +{ + struct ixgbe_macsec_setting *macsec = + IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); + + macsec->offload_en = macsec_setting->offload_en; + macsec->encrypt_en = macsec_setting->encrypt_en; + macsec->replayprotect_en = macsec_setting->replayprotect_en; +} + +void +ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *dev) +{ + struct ixgbe_macsec_setting *macsec = + IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(dev->data->dev_private); + + macsec->offload_en = 0; + macsec->encrypt_en = 0; + macsec->replayprotect_en = 0; +} + +void +ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev, + struct ixgbe_macsec_setting *macsec_setting) +{ + struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t ctrl; + uint8_t en = macsec_setting->encrypt_en; + uint8_t rp = macsec_setting->replayprotect_en; + + /** + * Workaround: + * As no ixgbe_disable_sec_rx_path equivalent is + * implemented for tx in the base code, and we are + * not allowed to modify the base code in DPDK, so + * just call the hand-written one directly for now. + * The hardware support has been checked by + * ixgbe_disable_sec_rx_path(). + */ + ixgbe_disable_sec_tx_path_generic(hw); + + /* Enable Ethernet CRC (required by MACsec offload) */ + ctrl = IXGBE_READ_REG(hw, IXGBE_HLREG0); + ctrl |= IXGBE_HLREG0_TXCRCEN | IXGBE_HLREG0_RXCRCSTRP; + IXGBE_WRITE_REG(hw, IXGBE_HLREG0, ctrl); + + /* Enable the TX and RX crypto engines */ + ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); + ctrl &= ~IXGBE_SECTXCTRL_SECTX_DIS; + IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); + + ctrl = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); + ctrl &= ~IXGBE_SECRXCTRL_SECRX_DIS; + IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); + + ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG); + ctrl &= ~IXGBE_SECTX_MINSECIFG_MASK; + ctrl |= 0x3; + IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, ctrl); + + /* Enable SA lookup */ + ctrl = IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); + ctrl &= ~IXGBE_LSECTXCTRL_EN_MASK; + ctrl |= en ? IXGBE_LSECTXCTRL_AUTH_ENCRYPT : + IXGBE_LSECTXCTRL_AUTH; + ctrl |= IXGBE_LSECTXCTRL_AISCI; + ctrl &= ~IXGBE_LSECTXCTRL_PNTHRSH_MASK; + ctrl |= IXGBE_MACSEC_PNTHRSH & IXGBE_LSECTXCTRL_PNTHRSH_MASK; + IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); + + ctrl = IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); + ctrl &= ~IXGBE_LSECRXCTRL_EN_MASK; + ctrl |= IXGBE_LSECRXCTRL_STRICT << IXGBE_LSECRXCTRL_EN_SHIFT; + ctrl &= ~IXGBE_LSECRXCTRL_PLSH; + if (rp) + ctrl |= IXGBE_LSECRXCTRL_RP; + else + ctrl &= ~IXGBE_LSECRXCTRL_RP; + IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); + + /* Start the data paths */ + ixgbe_enable_sec_rx_path(hw); + /** + * Workaround: + * As no ixgbe_enable_sec_rx_path equivalent is + * implemented for tx in the base code, and we are + * not allowed to modify the base code in DPDK, so + * just call the hand-written one directly for now. + */ + ixgbe_enable_sec_tx_path_generic(hw); +} + +void +ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev) +{ + struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + uint32_t ctrl; + + /** + * Workaround: + * As no ixgbe_disable_sec_rx_path equivalent is + * implemented for tx in the base code, and we are + * not allowed to modify the base code in DPDK, so + * just call the hand-written one directly for now. + * The hardware support has been checked by + * ixgbe_disable_sec_rx_path(). + */ + ixgbe_disable_sec_tx_path_generic(hw); + + /* Disable the TX and RX crypto engines */ + ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); + ctrl |= IXGBE_SECTXCTRL_SECTX_DIS; + IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); + + ctrl = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); + ctrl |= IXGBE_SECRXCTRL_SECRX_DIS; + IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); + + /* Disable SA lookup */ + ctrl = IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); + ctrl &= ~IXGBE_LSECTXCTRL_EN_MASK; + ctrl |= IXGBE_LSECTXCTRL_DISABLE; + IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); + + ctrl = IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); + ctrl &= ~IXGBE_LSECRXCTRL_EN_MASK; + ctrl |= IXGBE_LSECRXCTRL_DISABLE << IXGBE_LSECRXCTRL_EN_SHIFT; + IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); + + /* Start the data paths */ + ixgbe_enable_sec_rx_path(hw); + /** + * Workaround: + * As no ixgbe_enable_sec_rx_path equivalent is + * implemented for tx in the base code, and we are + * not allowed to modify the base code in DPDK, so + * just call the hand-written one directly for now. + */ + ixgbe_enable_sec_tx_path_generic(hw); +} + RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci"); diff -Nru dpdk-18.11.5/drivers/net/ixgbe/ixgbe_ethdev.h dpdk-18.11.6/drivers/net/ixgbe/ixgbe_ethdev.h --- dpdk-18.11.5/drivers/net/ixgbe/ixgbe_ethdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/ixgbe_ethdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -360,6 +360,12 @@ void *rule; }; +struct ixgbe_macsec_setting { + uint8_t offload_en; + uint8_t encrypt_en; + uint8_t replayprotect_en; +}; + /* * Statistics counters collected by the MACsec */ @@ -466,6 +472,7 @@ struct ixgbe_hw hw; struct ixgbe_hw_stats stats; struct ixgbe_macsec_stats macsec_stats; + struct ixgbe_macsec_setting macsec_setting; struct ixgbe_hw_fdir_info fdir; struct ixgbe_interrupt intr; struct ixgbe_stat_mapping_registers stat_mappings; @@ -518,6 +525,9 @@ #define IXGBE_DEV_PRIVATE_TO_MACSEC_STATS(adapter) \ (&((struct ixgbe_adapter *)adapter)->macsec_stats) +#define IXGBE_DEV_PRIVATE_TO_MACSEC_SETTING(adapter) \ + (&((struct ixgbe_adapter *)adapter)->macsec_setting) + #define IXGBE_DEV_PRIVATE_TO_INTR(adapter) \ (&((struct ixgbe_adapter *)adapter)->intr) @@ -736,6 +746,16 @@ int ixgbe_config_rss_filter(struct rte_eth_dev *dev, struct ixgbe_rte_flow_rss_conf *conf, bool add); +void ixgbe_dev_macsec_register_enable(struct rte_eth_dev *dev, + struct ixgbe_macsec_setting *macsec_setting); + +void ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev); + +void ixgbe_dev_macsec_setting_save(struct rte_eth_dev *dev, + struct ixgbe_macsec_setting *macsec_setting); + +void ixgbe_dev_macsec_setting_reset(struct rte_eth_dev *dev); + static inline int ixgbe_ethertype_filter_lookup(struct ixgbe_filter_info *filter_info, uint16_t ethertype) diff -Nru dpdk-18.11.5/drivers/net/ixgbe/ixgbe_flow.c dpdk-18.11.6/drivers/net/ixgbe/ixgbe_flow.c --- dpdk-18.11.5/drivers/net/ixgbe/ixgbe_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/ixgbe_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -2874,7 +2874,7 @@ /* check if the next not void item is END */ act = next_no_void_action(actions, act); if (act->type != RTE_FLOW_ACTION_TYPE_END) { - memset(rss_conf, 0, sizeof(struct rte_eth_rss_conf)); + memset(rss_conf, 0, sizeof(struct ixgbe_rte_flow_rss_conf)); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, act, "Not supported action."); diff -Nru dpdk-18.11.5/drivers/net/ixgbe/ixgbe_pf.c dpdk-18.11.6/drivers/net/ixgbe/ixgbe_pf.c --- dpdk-18.11.5/drivers/net/ixgbe/ixgbe_pf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/ixgbe_pf.c 2020-01-31 09:55:30.000000000 +0000 @@ -632,6 +632,7 @@ case ixgbe_mbox_api_20: case ixgbe_mbox_api_11: case ixgbe_mbox_api_12: + case ixgbe_mbox_api_13: break; default: return -1; diff -Nru dpdk-18.11.5/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c dpdk-18.11.6/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c --- dpdk-18.11.5/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c 2020-01-31 09:55:30.000000000 +0000 @@ -145,6 +145,68 @@ #define IXGBE_VPMD_DESC_DD_MASK 0x01010101 #define IXGBE_VPMD_DESC_EOP_MASK 0x02020202 +static inline uint32_t +get_packet_type(uint32_t pkt_info, + uint32_t etqf_check, + uint32_t tunnel_check) +{ + if (etqf_check) + return RTE_PTYPE_UNKNOWN; + + if (tunnel_check) { + pkt_info &= IXGBE_PACKET_TYPE_MASK_TUNNEL; + return ptype_table_tn[pkt_info]; + } + + pkt_info &= IXGBE_PACKET_TYPE_MASK_82599; + return ptype_table[pkt_info]; +} + +static inline void +desc_to_ptype_v(uint64x2_t descs[4], uint16_t pkt_type_mask, + struct rte_mbuf **rx_pkts) +{ + uint32x4_t etqf_check, tunnel_check; + uint32x4_t etqf_mask = vdupq_n_u32(0x8000); + uint32x4_t tunnel_mask = vdupq_n_u32(0x10000); + uint32x4_t ptype_mask = vdupq_n_u32((uint32_t)pkt_type_mask); + uint32x4_t ptype0 = vzipq_u32(vreinterpretq_u32_u64(descs[0]), + vreinterpretq_u32_u64(descs[2])).val[0]; + uint32x4_t ptype1 = vzipq_u32(vreinterpretq_u32_u64(descs[1]), + vreinterpretq_u32_u64(descs[3])).val[0]; + + /* interleave low 32 bits, + * now we have 4 ptypes in a NEON register + */ + ptype0 = vzipq_u32(ptype0, ptype1).val[0]; + + /* mask etqf bits */ + etqf_check = vandq_u32(ptype0, etqf_mask); + /* mask tunnel bits */ + tunnel_check = vandq_u32(ptype0, tunnel_mask); + + /* shift right by IXGBE_PACKET_TYPE_SHIFT, and apply ptype mask */ + ptype0 = vandq_u32(vshrq_n_u32(ptype0, IXGBE_PACKET_TYPE_SHIFT), + ptype_mask); + + rx_pkts[0]->packet_type = + get_packet_type(vgetq_lane_u32(ptype0, 0), + vgetq_lane_u32(etqf_check, 0), + vgetq_lane_u32(tunnel_check, 0)); + rx_pkts[1]->packet_type = + get_packet_type(vgetq_lane_u32(ptype0, 1), + vgetq_lane_u32(etqf_check, 1), + vgetq_lane_u32(tunnel_check, 1)); + rx_pkts[2]->packet_type = + get_packet_type(vgetq_lane_u32(ptype0, 2), + vgetq_lane_u32(etqf_check, 2), + vgetq_lane_u32(tunnel_check, 2)); + rx_pkts[3]->packet_type = + get_packet_type(vgetq_lane_u32(ptype0, 3), + vgetq_lane_u32(etqf_check, 3), + vgetq_lane_u32(tunnel_check, 3)); +} + static inline uint16_t _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts, uint8_t *split_packet) @@ -214,13 +276,13 @@ uint32_t var = 0; uint32_t stat; - /* B.1 load 1 mbuf point */ + /* B.1 load 2 mbuf point */ mbp1 = vld1q_u64((uint64_t *)&sw_ring[pos]); /* B.2 copy 2 mbuf point into rx_pkts */ vst1q_u64((uint64_t *)&rx_pkts[pos], mbp1); - /* B.1 load 1 mbuf point */ + /* B.1 load 2 mbuf point */ mbp2 = vld1q_u64((uint64_t *)&sw_ring[pos + 2]); /* A. load 4 pkts descs */ @@ -228,7 +290,6 @@ descs[1] = vld1q_u64((uint64_t *)(rxdp + 1)); descs[2] = vld1q_u64((uint64_t *)(rxdp + 2)); descs[3] = vld1q_u64((uint64_t *)(rxdp + 3)); - rte_smp_rmb(); /* B.2 copy 2 mbuf point into rx_pkts */ vst1q_u64((uint64_t *)&rx_pkts[pos + 2], mbp2); @@ -297,6 +358,8 @@ vst1q_u8((uint8_t *)&rx_pkts[pos]->rx_descriptor_fields1, pkt_mb1); + desc_to_ptype_v(descs, rxq->pkt_type_mask, &rx_pkts[pos]); + stat &= IXGBE_VPMD_DESC_DD_MASK; /* C.4 calc avaialbe number of desc */ @@ -375,6 +438,7 @@ i++; if (i == nb_bufs) return nb_bufs; + rxq->pkt_first_seg = rx_pkts[i]; } return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i, &split_flags[i]); diff -Nru dpdk-18.11.5/drivers/net/ixgbe/rte_pmd_ixgbe.c dpdk-18.11.6/drivers/net/ixgbe/rte_pmd_ixgbe.c --- dpdk-18.11.5/drivers/net/ixgbe/rte_pmd_ixgbe.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/ixgbe/rte_pmd_ixgbe.c 2020-01-31 09:55:30.000000000 +0000 @@ -514,82 +514,20 @@ int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp) { - struct ixgbe_hw *hw; struct rte_eth_dev *dev; - uint32_t ctrl; + struct ixgbe_macsec_setting macsec_setting; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - if (!is_ixgbe_supported(dev)) - return -ENOTSUP; + macsec_setting.offload_en = 1; + macsec_setting.encrypt_en = en; + macsec_setting.replayprotect_en = rp; - hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); + ixgbe_dev_macsec_setting_save(dev, &macsec_setting); - /* Stop the data paths */ - if (ixgbe_disable_sec_rx_path(hw) != IXGBE_SUCCESS) - return -ENOTSUP; - /** - * Workaround: - * As no ixgbe_disable_sec_rx_path equivalent is - * implemented for tx in the base code, and we are - * not allowed to modify the base code in DPDK, so - * just call the hand-written one directly for now. - * The hardware support has been checked by - * ixgbe_disable_sec_rx_path(). - */ - ixgbe_disable_sec_tx_path_generic(hw); - - /* Enable Ethernet CRC (required by MACsec offload) */ - ctrl = IXGBE_READ_REG(hw, IXGBE_HLREG0); - ctrl |= IXGBE_HLREG0_TXCRCEN | IXGBE_HLREG0_RXCRCSTRP; - IXGBE_WRITE_REG(hw, IXGBE_HLREG0, ctrl); - - /* Enable the TX and RX crypto engines */ - ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); - ctrl &= ~IXGBE_SECTXCTRL_SECTX_DIS; - IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); - - ctrl = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); - ctrl &= ~IXGBE_SECRXCTRL_SECRX_DIS; - IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); - - ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXMINIFG); - ctrl &= ~IXGBE_SECTX_MINSECIFG_MASK; - ctrl |= 0x3; - IXGBE_WRITE_REG(hw, IXGBE_SECTXMINIFG, ctrl); - - /* Enable SA lookup */ - ctrl = IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); - ctrl &= ~IXGBE_LSECTXCTRL_EN_MASK; - ctrl |= en ? IXGBE_LSECTXCTRL_AUTH_ENCRYPT : - IXGBE_LSECTXCTRL_AUTH; - ctrl |= IXGBE_LSECTXCTRL_AISCI; - ctrl &= ~IXGBE_LSECTXCTRL_PNTHRSH_MASK; - ctrl |= IXGBE_MACSEC_PNTHRSH & IXGBE_LSECTXCTRL_PNTHRSH_MASK; - IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); - - ctrl = IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); - ctrl &= ~IXGBE_LSECRXCTRL_EN_MASK; - ctrl |= IXGBE_LSECRXCTRL_STRICT << IXGBE_LSECRXCTRL_EN_SHIFT; - ctrl &= ~IXGBE_LSECRXCTRL_PLSH; - if (rp) - ctrl |= IXGBE_LSECRXCTRL_RP; - else - ctrl &= ~IXGBE_LSECRXCTRL_RP; - IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); - - /* Start the data paths */ - ixgbe_enable_sec_rx_path(hw); - /** - * Workaround: - * As no ixgbe_enable_sec_rx_path equivalent is - * implemented for tx in the base code, and we are - * not allowed to modify the base code in DPDK, so - * just call the hand-written one directly for now. - */ - ixgbe_enable_sec_tx_path_generic(hw); + ixgbe_dev_macsec_register_enable(dev, &macsec_setting); return 0; } @@ -597,63 +535,15 @@ int rte_pmd_ixgbe_macsec_disable(uint16_t port) { - struct ixgbe_hw *hw; struct rte_eth_dev *dev; - uint32_t ctrl; RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); dev = &rte_eth_devices[port]; - if (!is_ixgbe_supported(dev)) - return -ENOTSUP; + ixgbe_dev_macsec_setting_reset(dev); - hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - - /* Stop the data paths */ - if (ixgbe_disable_sec_rx_path(hw) != IXGBE_SUCCESS) - return -ENOTSUP; - /** - * Workaround: - * As no ixgbe_disable_sec_rx_path equivalent is - * implemented for tx in the base code, and we are - * not allowed to modify the base code in DPDK, so - * just call the hand-written one directly for now. - * The hardware support has been checked by - * ixgbe_disable_sec_rx_path(). - */ - ixgbe_disable_sec_tx_path_generic(hw); - - /* Disable the TX and RX crypto engines */ - ctrl = IXGBE_READ_REG(hw, IXGBE_SECTXCTRL); - ctrl |= IXGBE_SECTXCTRL_SECTX_DIS; - IXGBE_WRITE_REG(hw, IXGBE_SECTXCTRL, ctrl); - - ctrl = IXGBE_READ_REG(hw, IXGBE_SECRXCTRL); - ctrl |= IXGBE_SECRXCTRL_SECRX_DIS; - IXGBE_WRITE_REG(hw, IXGBE_SECRXCTRL, ctrl); - - /* Disable SA lookup */ - ctrl = IXGBE_READ_REG(hw, IXGBE_LSECTXCTRL); - ctrl &= ~IXGBE_LSECTXCTRL_EN_MASK; - ctrl |= IXGBE_LSECTXCTRL_DISABLE; - IXGBE_WRITE_REG(hw, IXGBE_LSECTXCTRL, ctrl); - - ctrl = IXGBE_READ_REG(hw, IXGBE_LSECRXCTRL); - ctrl &= ~IXGBE_LSECRXCTRL_EN_MASK; - ctrl |= IXGBE_LSECRXCTRL_DISABLE << IXGBE_LSECRXCTRL_EN_SHIFT; - IXGBE_WRITE_REG(hw, IXGBE_LSECRXCTRL, ctrl); - - /* Start the data paths */ - ixgbe_enable_sec_rx_path(hw); - /** - * Workaround: - * As no ixgbe_enable_sec_rx_path equivalent is - * implemented for tx in the base code, and we are - * not allowed to modify the base code in DPDK, so - * just call the hand-written one directly for now. - */ - ixgbe_enable_sec_tx_path_generic(hw); + ixgbe_dev_macsec_register_disable(dev); return 0; } diff -Nru dpdk-18.11.5/drivers/net/mlx4/Makefile dpdk-18.11.6/drivers/net/mlx4/Makefile --- dpdk-18.11.5/drivers/net/mlx4/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx4/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -64,7 +64,11 @@ # User-defined CFLAGS. ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DEBUG),y) -CFLAGS += -pedantic -UNDEBUG -DPEDANTIC +CFLAGS += -pedantic -UNDEBUG +ifneq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) +CFLAGS += -DPEDANTIC +endif +AUTO_CONFIG_CFLAGS += -Wno-pedantic else CFLAGS += -DNDEBUG -UPEDANTIC endif @@ -74,7 +78,7 @@ # Generate and clean-up mlx4_autoconf.h. export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS -export AUTO_CONFIG_CFLAGS = -Wno-error +export AUTO_CONFIG_CFLAGS += -Wno-error ifndef V AUTOCONF_OUTPUT := >/dev/null diff -Nru dpdk-18.11.5/drivers/net/mlx4/meson.build dpdk-18.11.6/drivers/net/mlx4/meson.build --- dpdk-18.11.5/drivers/net/mlx4/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx4/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -2,6 +2,13 @@ # Copyright 2018 6WIND S.A. # Copyright 2018 Mellanox Technologies, Ltd +if host_machine.system() != 'linux' + build = false + reason = 'only supported on Linux' + subdir_done() +endif +build = true + pmd_dlopen = get_option('enable_driver_mlx_glue') LIB_GLUE_BASE = 'librte_pmd_mlx4_glue.so' LIB_GLUE_VERSION = '18.02.0' @@ -13,18 +20,17 @@ '-DMLX4_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION), ] endif + libs = [ - cc.find_library('mnl', required:false), cc.find_library('mlx4', required:false), cc.find_library('ibverbs', required:false), ] -build = true foreach lib:libs if not lib.found() build = false endif endforeach -# Compile PMD + if build allow_experimental_apis = true ext_deps += libs @@ -64,7 +70,7 @@ # mlx4_autoconf.h file is still generated. # input array for meson member search: # [ "MACRO to define if found", "header for the search", - # "symbol to search","struct member to search" ] + # "symbol to search", "struct member to search" ] # has_member_args = [ [ 'HAVE_IBV_MLX4_WQE_LSO_SEG', 'infiniband/mlx4dv.h', @@ -72,9 +78,9 @@ ] config = configuration_data() foreach arg:has_member_args - file_prefix = '#include<' + arg[1] + '>' + file_prefix = '#include <' + arg[1] + '>' config.set(arg[0], cc.has_member(arg[2], arg[3], - prefix : file_prefix)) + prefix: file_prefix, dependencies: libs)) endforeach configure_file(output : 'mlx4_autoconf.h', configuration : config) endif diff -Nru dpdk-18.11.5/drivers/net/mlx4/mlx4_utils.h dpdk-18.11.6/drivers/net/mlx4/mlx4_utils.h --- dpdk-18.11.5/drivers/net/mlx4/mlx4_utils.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx4/mlx4_utils.h 2020-01-31 09:55:30.000000000 +0000 @@ -15,6 +15,16 @@ #include "mlx4.h" +/* + * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. + * Otherwise there would be a type conflict between stdbool and altivec. + */ +#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) +#undef bool +/* redefine as in stdbool.h */ +#define bool _Bool +#endif + #ifndef NDEBUG /* @@ -67,9 +77,10 @@ /** Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ - char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ + int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ + char name[mkstr_size_##name + 1]; \ \ - snprintf(name, sizeof(name), __VA_ARGS__) + snprintf(name, sizeof(name), "" __VA_ARGS__) /** Generate a string out of the provided arguments. */ #define MLX4_STR(...) # __VA_ARGS__ diff -Nru dpdk-18.11.5/drivers/net/mlx5/Makefile dpdk-18.11.6/drivers/net/mlx5/Makefile --- dpdk-18.11.5/drivers/net/mlx5/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -82,7 +82,11 @@ # User-defined CFLAGS. ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DEBUG),y) -CFLAGS += -pedantic -UNDEBUG -DPEDANTIC +CFLAGS += -pedantic -UNDEBUG +ifneq ($(CONFIG_RTE_TOOLCHAIN_ICC),y) +CFLAGS += -DPEDANTIC +endif +AUTO_CONFIG_CFLAGS += -Wno-pedantic else CFLAGS += -DNDEBUG -UPEDANTIC endif @@ -92,7 +96,7 @@ # Generate and clean-up mlx5_autoconf.h. export CC CFLAGS CPPFLAGS EXTRA_CFLAGS EXTRA_CPPFLAGS -export AUTO_CONFIG_CFLAGS = -Wno-error +export AUTO_CONFIG_CFLAGS += -Wno-error ifndef V AUTOCONF_OUTPUT := >/dev/null diff -Nru dpdk-18.11.5/drivers/net/mlx5/meson.build dpdk-18.11.6/drivers/net/mlx5/meson.build --- dpdk-18.11.5/drivers/net/mlx5/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -2,6 +2,13 @@ # Copyright 2018 6WIND S.A. # Copyright 2018 Mellanox Technologies, Ltd +if host_machine.system() != 'linux' + build = false + reason = 'only supported on Linux' + subdir_done() +endif +build = true + pmd_dlopen = get_option('enable_driver_mlx_glue') LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so' LIB_GLUE_VERSION = '18.11.0' @@ -13,17 +20,18 @@ '-DMLX5_GLUE_VERSION="@0@"'.format(LIB_GLUE_VERSION), ] endif + libs = [ cc.find_library('mnl', required:false), cc.find_library('mlx5', required:false), cc.find_library('ibverbs', required:false), ] -build = true foreach lib:libs if not lib.found() build = false endif endforeach + if build allow_experimental_apis = true ext_deps += libs @@ -249,12 +257,13 @@ ] config = configuration_data() foreach arg:has_sym_args - config.set(arg[0], cc.has_header_symbol(arg[1], arg[2])) + config.set(arg[0], cc.has_header_symbol(arg[1], arg[2], + dependencies: libs)) endforeach foreach arg:has_member_args - file_prefix = '#include<' + arg[1] + '>' + file_prefix = '#include <' + arg[1] + '>' config.set(arg[0], cc.has_member(arg[2], arg[3], - prefix : file_prefix)) + prefix : file_prefix, dependencies: libs)) endforeach configure_file(output : 'mlx5_autoconf.h', configuration : config) endif diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5.c dpdk-18.11.6/drivers/net/mlx5/mlx5.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5.c 2020-01-31 09:55:30.000000000 +0000 @@ -1478,6 +1478,7 @@ case PCI_DEVICE_ID_MELLANOX_CONNECTX4LXVF: case PCI_DEVICE_ID_MELLANOX_CONNECTX5VF: case PCI_DEVICE_ID_MELLANOX_CONNECTX5EXVF: + case PCI_DEVICE_ID_MELLANOX_CONNECTX5BFVF: dev_config.vf = 1; break; default: diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_flow.c dpdk-18.11.6/drivers/net/mlx5/mlx5_flow.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -943,7 +943,16 @@ &rss->types, "some RSS protocols are not" " supported"); + if (!rss->queue_num) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, + NULL, "No queues configured"); for (i = 0; i != rss->queue_num; ++i) { + if (rss->queue[i] >= priv->rxqs_n) + return rte_flow_error_set + (error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION_CONF, + &rss->queue[i], "queue index out of range"); if (!(*priv->rxqs)[rss->queue[i]]) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION_CONF, @@ -1068,6 +1077,17 @@ return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, "multiple L2 layers not supported"); + if ((!tunnel && (item_flags & MLX5_FLOW_LAYER_OUTER_L3)) || + (tunnel && (item_flags & MLX5_FLOW_LAYER_INNER_L3))) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "L2 layer should not follow " + "L3 layers"); + if ((!tunnel && (item_flags & MLX5_FLOW_LAYER_OUTER_VLAN)) || + (tunnel && (item_flags & MLX5_FLOW_LAYER_INNER_VLAN))) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "L2 layer should not follow VLAN"); if (!mask) mask = &rte_flow_item_eth_mask; ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask, @@ -1118,7 +1138,7 @@ else if ((item_flags & l34m) != 0) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, - "L2 layer cannot follow L3/L4 layer"); + "VLAN cannot follow L3/L4 layer"); if (!mask) mask = &rte_flow_item_vlan_mask; ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask, @@ -1159,6 +1179,8 @@ int mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, uint64_t item_flags, + uint64_t last_item, + uint16_t ether_type, struct rte_flow_error *error) { const struct rte_flow_item_ipv4 *mask = item->mask; @@ -1176,7 +1198,16 @@ const uint64_t l4m = tunnel ? MLX5_FLOW_LAYER_INNER_L4 : MLX5_FLOW_LAYER_OUTER_L4; int ret; + const uint64_t l2_vlan = (MLX5_FLOW_LAYER_L2 | + MLX5_FLOW_LAYER_OUTER_VLAN | + MLX5_FLOW_LAYER_INNER_VLAN); + if ((last_item & l2_vlan) && ether_type && + ether_type != ETHER_TYPE_IPv4) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "IPv4 cannot follow L2/VLAN layer " + "which ether type is not IPv4"); if (item_flags & l3m) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -1218,6 +1249,8 @@ int mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, uint64_t item_flags, + uint64_t last_item, + uint16_t ether_type, struct rte_flow_error *error) { const struct rte_flow_item_ipv6 *mask = item->mask; @@ -1240,7 +1273,16 @@ const uint64_t l4m = tunnel ? MLX5_FLOW_LAYER_INNER_L4 : MLX5_FLOW_LAYER_OUTER_L4; int ret; + const uint64_t l2_vlan = (MLX5_FLOW_LAYER_L2 | + MLX5_FLOW_LAYER_OUTER_VLAN | + MLX5_FLOW_LAYER_INNER_VLAN); + if ((last_item & l2_vlan) && ether_type && + ether_type != ETHER_TYPE_IPv6) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, item, + "IPv6 cannot follow L2/VLAN layer " + "which ether type is not IPv6"); if (item_flags & l3m) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_flow.h dpdk-18.11.6/drivers/net/mlx5/mlx5_flow.h --- dpdk-18.11.5/drivers/net/mlx5/mlx5_flow.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_flow.h 2020-01-31 09:55:30.000000000 +0000 @@ -69,6 +69,10 @@ (MLX5_FLOW_LAYER_INNER_L2 | MLX5_FLOW_LAYER_INNER_L3 | \ MLX5_FLOW_LAYER_INNER_L4) +/* Layer Masks. */ +#define MLX5_FLOW_LAYER_L2 \ + (MLX5_FLOW_LAYER_OUTER_L2 | MLX5_FLOW_LAYER_INNER_L2) + /* Actions */ #define MLX5_FLOW_ACTION_DROP (1u << 0) #define MLX5_FLOW_ACTION_QUEUE (1u << 1) @@ -382,9 +386,13 @@ struct rte_flow_error *error); int mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, uint64_t item_flags, + uint64_t last_item, + uint16_t ether_type, struct rte_flow_error *error); int mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, uint64_t item_flags, + uint64_t last_item, + uint16_t ether_type, struct rte_flow_error *error); int mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev, const struct rte_flow_item *item, diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_dv.c dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_dv.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_dv.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_dv.c 2020-01-31 09:55:30.000000000 +0000 @@ -783,6 +783,7 @@ uint64_t item_flags = 0; uint64_t last_item = 0; uint8_t next_protocol = 0xff; + uint16_t ether_type = 0; int actions_n = 0; if (items == NULL) @@ -802,6 +803,17 @@ return ret; last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L2 : MLX5_FLOW_LAYER_OUTER_L2; + if (items->mask != NULL && items->spec != NULL) { + ether_type = + ((const struct rte_flow_item_eth *) + items->spec)->type; + ether_type &= + ((const struct rte_flow_item_eth *) + items->mask)->type; + ether_type = rte_be_to_cpu_16(ether_type); + } else { + ether_type = 0; + } break; case RTE_FLOW_ITEM_TYPE_VLAN: ret = mlx5_flow_validate_item_vlan(items, item_flags, @@ -810,9 +822,22 @@ return ret; last_item = tunnel ? MLX5_FLOW_LAYER_INNER_VLAN : MLX5_FLOW_LAYER_OUTER_VLAN; + if (items->mask != NULL && items->spec != NULL) { + ether_type = + ((const struct rte_flow_item_vlan *) + items->spec)->inner_type; + ether_type &= + ((const struct rte_flow_item_vlan *) + items->mask)->inner_type; + ether_type = rte_be_to_cpu_16(ether_type); + } else { + ether_type = 0; + } break; case RTE_FLOW_ITEM_TYPE_IPV4: ret = mlx5_flow_validate_item_ipv4(items, item_flags, + last_item, + ether_type, error); if (ret < 0) return ret; @@ -834,6 +859,8 @@ break; case RTE_FLOW_ITEM_TYPE_IPV6: ret = mlx5_flow_validate_item_ipv6(items, item_flags, + last_item, + ether_type, error); if (ret < 0) return ret; diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_tcf.c dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_tcf.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_tcf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_tcf.c 2020-01-31 09:55:30.000000000 +0000 @@ -1529,7 +1529,7 @@ break; case RTE_FLOW_ITEM_TYPE_IPV4: ret = mlx5_flow_validate_item_ipv4(items, item_flags, - error); + 0, 0, error); if (ret < 0) return ret; ret = flow_tcf_validate_vxlan_encap_ipv4(items, error); @@ -1539,7 +1539,7 @@ break; case RTE_FLOW_ITEM_TYPE_IPV6: ret = mlx5_flow_validate_item_ipv6(items, item_flags, - error); + 0, 0, error); if (ret < 0) return ret; ret = flow_tcf_validate_vxlan_encap_ipv6(items, error); @@ -2059,7 +2059,7 @@ break; case RTE_FLOW_ITEM_TYPE_IPV4: ret = mlx5_flow_validate_item_ipv4(items, item_flags, - error); + 0, 0, error); if (ret < 0) return ret; item_flags |= (item_flags & MLX5_FLOW_LAYER_TUNNEL) ? @@ -2119,7 +2119,7 @@ break; case RTE_FLOW_ITEM_TYPE_IPV6: ret = mlx5_flow_validate_item_ipv6(items, item_flags, - error); + 0, 0, error); if (ret < 0) return ret; item_flags |= (item_flags & MLX5_FLOW_LAYER_TUNNEL) ? diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_verbs.c dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_verbs.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5_flow_verbs.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_flow_verbs.c 2020-01-31 09:55:30.000000000 +0000 @@ -1020,6 +1020,7 @@ uint64_t item_flags = 0; uint64_t last_item = 0; uint8_t next_protocol = 0xff; + uint16_t ether_type = 0; if (items == NULL) return -1; @@ -1040,6 +1041,17 @@ return ret; last_item = tunnel ? MLX5_FLOW_LAYER_INNER_L2 : MLX5_FLOW_LAYER_OUTER_L2; + if (items->mask != NULL && items->spec != NULL) { + ether_type = + ((const struct rte_flow_item_eth *) + items->spec)->type; + ether_type &= + ((const struct rte_flow_item_eth *) + items->mask)->type; + ether_type = rte_be_to_cpu_16(ether_type); + } else { + ether_type = 0; + } break; case RTE_FLOW_ITEM_TYPE_VLAN: ret = mlx5_flow_validate_item_vlan(items, item_flags, @@ -1050,9 +1062,22 @@ MLX5_FLOW_LAYER_INNER_VLAN) : (MLX5_FLOW_LAYER_OUTER_L2 | MLX5_FLOW_LAYER_OUTER_VLAN); + if (items->mask != NULL && items->spec != NULL) { + ether_type = + ((const struct rte_flow_item_vlan *) + items->spec)->inner_type; + ether_type &= + ((const struct rte_flow_item_vlan *) + items->mask)->inner_type; + ether_type = rte_be_to_cpu_16(ether_type); + } else { + ether_type = 0; + } break; case RTE_FLOW_ITEM_TYPE_IPV4: ret = mlx5_flow_validate_item_ipv4(items, item_flags, + last_item, + ether_type, error); if (ret < 0) return ret; @@ -1074,6 +1099,8 @@ break; case RTE_FLOW_ITEM_TYPE_IPV6: ret = mlx5_flow_validate_item_ipv6(items, item_flags, + last_item, + ether_type, error); if (ret < 0) return ret; diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_rxq.c dpdk-18.11.6/drivers/net/mlx5/mlx5_rxq.c --- dpdk-18.11.5/drivers/net/mlx5/mlx5_rxq.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_rxq.c 2020-01-31 09:55:30.000000000 +0000 @@ -2140,17 +2140,27 @@ mlx5_hrxq_drop_new(struct rte_eth_dev *dev) { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_ind_table_ibv *ind_tbl; - struct ibv_qp *qp; - struct mlx5_hrxq *hrxq; + struct mlx5_ind_table_ibv *ind_tbl = NULL; + struct ibv_qp *qp = NULL; + struct mlx5_hrxq *hrxq = NULL; if (priv->drop_queue.hrxq) { rte_atomic32_inc(&priv->drop_queue.hrxq->refcnt); return priv->drop_queue.hrxq; } + hrxq = rte_calloc(__func__, 1, sizeof(*hrxq), 0); + if (!hrxq) { + DRV_LOG(WARNING, + "port %u cannot allocate memory for drop queue", + dev->data->port_id); + rte_errno = ENOMEM; + goto error; + } + priv->drop_queue.hrxq = hrxq; ind_tbl = mlx5_ind_table_ibv_drop_new(dev); if (!ind_tbl) - return NULL; + goto error; + hrxq->ind_table = ind_tbl; qp = mlx5_glue->create_qp_ex(priv->ctx, &(struct ibv_qp_init_attr_ex){ .qp_type = IBV_QPT_RAW_PACKET, @@ -2174,22 +2184,18 @@ rte_errno = errno; goto error; } - hrxq = rte_calloc(__func__, 1, sizeof(*hrxq), 0); - if (!hrxq) { - DRV_LOG(WARNING, - "port %u cannot allocate memory for drop queue", - dev->data->port_id); - rte_errno = ENOMEM; - goto error; - } - hrxq->ind_table = ind_tbl; hrxq->qp = qp; - priv->drop_queue.hrxq = hrxq; rte_atomic32_set(&hrxq->refcnt, 1); return hrxq; error: + if (qp) + claim_zero(mlx5_glue->destroy_qp(hrxq->qp)); if (ind_tbl) mlx5_ind_table_ibv_drop_release(dev); + if (hrxq) { + priv->drop_queue.hrxq = NULL; + rte_free(hrxq); + } return NULL; } diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_rxtx_vec_neon.h dpdk-18.11.6/drivers/net/mlx5/mlx5_rxtx_vec_neon.h --- dpdk-18.11.5/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_rxtx_vec_neon.h 2020-01-31 09:55:30.000000000 +0000 @@ -1014,7 +1014,7 @@ rcvd_pkt += n; } } - rte_compiler_barrier(); + rte_cio_wmb(); *rxq->cq_db = rte_cpu_to_be_32(rxq->cq_ci); return rcvd_pkt; } diff -Nru dpdk-18.11.5/drivers/net/mlx5/mlx5_utils.h dpdk-18.11.6/drivers/net/mlx5/mlx5_utils.h --- dpdk-18.11.5/drivers/net/mlx5/mlx5_utils.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/mlx5/mlx5_utils.h 2020-01-31 09:55:30.000000000 +0000 @@ -146,9 +146,10 @@ /* Allocate a buffer on the stack and fill it with a printf format string. */ #define MKSTR(name, ...) \ - char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \ + int mkstr_size_##name = snprintf(NULL, 0, "" __VA_ARGS__); \ + char name[mkstr_size_##name + 1]; \ \ - snprintf(name, sizeof(name), __VA_ARGS__) + snprintf(name, sizeof(name), "" __VA_ARGS__) /** * Return nearest power of two above input value. diff -Nru dpdk-18.11.5/drivers/net/null/rte_eth_null.c dpdk-18.11.6/drivers/net/null/rte_eth_null.c --- dpdk-18.11.5/drivers/net/null/rte_eth_null.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/null/rte_eth_null.c 2020-01-31 09:55:30.000000000 +0000 @@ -621,6 +621,13 @@ /* TODO: request info from primary to set up Rx and Tx */ eth_dev->dev_ops = &ops; eth_dev->device = &dev->device; + if (packet_copy) { + eth_dev->rx_pkt_burst = eth_null_copy_rx; + eth_dev->tx_pkt_burst = eth_null_copy_tx; + } else { + eth_dev->rx_pkt_burst = eth_null_rx; + eth_dev->tx_pkt_burst = eth_null_tx; + } rte_eth_dev_probing_finish(eth_dev); return 0; } diff -Nru dpdk-18.11.5/drivers/net/pcap/meson.build dpdk-18.11.6/drivers/net/pcap/meson.build --- dpdk-18.11.5/drivers/net/pcap/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/pcap/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -1,11 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -pcap_dep = cc.find_library('pcap', required: false) -if pcap_dep.found() and cc.has_header('pcap.h', dependencies: pcap_dep) - build = true -else +if not dpdk_conf.has('RTE_PORT_PCAP') build = false + reason = 'missing dependency, "libpcap"' endif sources = files('rte_eth_pcap.c') ext_deps += pcap_dep diff -Nru dpdk-18.11.5/drivers/net/qede/Makefile dpdk-18.11.6/drivers/net/qede/Makefile --- dpdk-18.11.5/drivers/net/qede/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -12,6 +12,7 @@ CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs LDLIBS += -lrte_bus_pci diff -Nru dpdk-18.11.5/drivers/net/qede/base/ecore_chain.h dpdk-18.11.6/drivers/net/qede/base/ecore_chain.h --- dpdk-18.11.5/drivers/net/qede/base/ecore_chain.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/base/ecore_chain.h 2020-01-31 09:55:30.000000000 +0000 @@ -86,8 +86,8 @@ void **pp_virt_addr_tbl; union { - struct ecore_chain_pbl_u16 u16; - struct ecore_chain_pbl_u32 u32; + struct ecore_chain_pbl_u16 pbl_u16; + struct ecore_chain_pbl_u32 pbl_u32; } c; } pbl; @@ -405,7 +405,7 @@ if ((p_chain->u.chain16.prod_idx & p_chain->elem_per_page_mask) == p_chain->next_page_mask) { p_prod_idx = &p_chain->u.chain16.prod_idx; - p_prod_page_idx = &p_chain->pbl.c.u16.prod_page_idx; + p_prod_page_idx = &p_chain->pbl.c.pbl_u16.prod_page_idx; ecore_chain_advance_page(p_chain, &p_chain->p_prod_elem, p_prod_idx, p_prod_page_idx); } @@ -414,7 +414,7 @@ if ((p_chain->u.chain32.prod_idx & p_chain->elem_per_page_mask) == p_chain->next_page_mask) { p_prod_idx = &p_chain->u.chain32.prod_idx; - p_prod_page_idx = &p_chain->pbl.c.u32.prod_page_idx; + p_prod_page_idx = &p_chain->pbl.c.pbl_u32.prod_page_idx; ecore_chain_advance_page(p_chain, &p_chain->p_prod_elem, p_prod_idx, p_prod_page_idx); } @@ -479,7 +479,7 @@ if ((p_chain->u.chain16.cons_idx & p_chain->elem_per_page_mask) == p_chain->next_page_mask) { p_cons_idx = &p_chain->u.chain16.cons_idx; - p_cons_page_idx = &p_chain->pbl.c.u16.cons_page_idx; + p_cons_page_idx = &p_chain->pbl.c.pbl_u16.cons_page_idx; ecore_chain_advance_page(p_chain, &p_chain->p_cons_elem, p_cons_idx, p_cons_page_idx); } @@ -488,7 +488,7 @@ if ((p_chain->u.chain32.cons_idx & p_chain->elem_per_page_mask) == p_chain->next_page_mask) { p_cons_idx = &p_chain->u.chain32.cons_idx; - p_cons_page_idx = &p_chain->pbl.c.u32.cons_page_idx; + p_cons_page_idx = &p_chain->pbl.c.pbl_u32.cons_page_idx; ecore_chain_advance_page(p_chain, &p_chain->p_cons_elem, p_cons_idx, p_cons_page_idx); } @@ -532,11 +532,11 @@ u32 reset_val = p_chain->page_cnt - 1; if (is_chain_u16(p_chain)) { - p_chain->pbl.c.u16.prod_page_idx = (u16)reset_val; - p_chain->pbl.c.u16.cons_page_idx = (u16)reset_val; + p_chain->pbl.c.pbl_u16.prod_page_idx = (u16)reset_val; + p_chain->pbl.c.pbl_u16.cons_page_idx = (u16)reset_val; } else { - p_chain->pbl.c.u32.prod_page_idx = reset_val; - p_chain->pbl.c.u32.cons_page_idx = reset_val; + p_chain->pbl.c.pbl_u32.prod_page_idx = reset_val; + p_chain->pbl.c.pbl_u32.cons_page_idx = reset_val; } } @@ -725,18 +725,34 @@ u32 prod_idx, void *p_prod_elem) { if (p_chain->mode == ECORE_CHAIN_MODE_PBL) { - /* Use "prod_idx-1" since ecore_chain_produce() advances the - * page index before the producer index when getting to - * "next_page_mask". + u32 cur_prod, page_mask, page_cnt, page_diff; + + cur_prod = is_chain_u16(p_chain) ? p_chain->u.chain16.prod_idx + : p_chain->u.chain32.prod_idx; + + /* Assume that number of elements in a page is power of 2 */ + page_mask = ~p_chain->elem_per_page_mask; + + /* Use "cur_prod - 1" and "prod_idx - 1" since producer index + * reaches the first element of next page before the page index + * is incremented. See ecore_chain_produce(). + * Index wrap around is not a problem because the difference + * between current and given producer indexes is always + * positive and lower than the chain's capacity. */ - u32 elem_idx = - (prod_idx - 1 + p_chain->capacity) % p_chain->capacity; - u32 page_idx = elem_idx / p_chain->elem_per_page; + page_diff = (((cur_prod - 1) & page_mask) - + ((prod_idx - 1) & page_mask)) / + p_chain->elem_per_page; + page_cnt = ecore_chain_get_page_cnt(p_chain); if (is_chain_u16(p_chain)) - p_chain->pbl.c.u16.prod_page_idx = (u16)page_idx; + p_chain->pbl.c.pbl_u16.prod_page_idx = + (p_chain->pbl.c.pbl_u16.prod_page_idx - + page_diff + page_cnt) % page_cnt; else - p_chain->pbl.c.u32.prod_page_idx = page_idx; + p_chain->pbl.c.pbl_u32.prod_page_idx = + (p_chain->pbl.c.pbl_u32.prod_page_idx - + page_diff + page_cnt) % page_cnt; } if (is_chain_u16(p_chain)) @@ -756,18 +772,34 @@ u32 cons_idx, void *p_cons_elem) { if (p_chain->mode == ECORE_CHAIN_MODE_PBL) { - /* Use "cons_idx-1" since ecore_chain_consume() advances the - * page index before the consumer index when getting to - * "next_page_mask". + u32 cur_cons, page_mask, page_cnt, page_diff; + + cur_cons = is_chain_u16(p_chain) ? p_chain->u.chain16.cons_idx + : p_chain->u.chain32.cons_idx; + + /* Assume that number of elements in a page is power of 2 */ + page_mask = ~p_chain->elem_per_page_mask; + + /* Use "cur_cons - 1" and "cons_idx - 1" since consumer index + * reaches the first element of next page before the page index + * is incremented. See ecore_chain_consume(). + * Index wrap around is not a problem because the difference + * between current and given consumer indexes is always + * positive and lower than the chain's capacity. */ - u32 elem_idx = - (cons_idx - 1 + p_chain->capacity) % p_chain->capacity; - u32 page_idx = elem_idx / p_chain->elem_per_page; + page_diff = (((cur_cons - 1) & page_mask) - + ((cons_idx - 1) & page_mask)) / + p_chain->elem_per_page; + page_cnt = ecore_chain_get_page_cnt(p_chain); if (is_chain_u16(p_chain)) - p_chain->pbl.c.u16.cons_page_idx = (u16)page_idx; + p_chain->pbl.c.pbl_u16.cons_page_idx = + (p_chain->pbl.c.pbl_u16.cons_page_idx - + page_diff + page_cnt) % page_cnt; else - p_chain->pbl.c.u32.cons_page_idx = page_idx; + p_chain->pbl.c.pbl_u32.cons_page_idx = + (p_chain->pbl.c.pbl_u32.cons_page_idx - + page_diff + page_cnt) % page_cnt; } if (is_chain_u16(p_chain)) diff -Nru dpdk-18.11.5/drivers/net/qede/meson.build dpdk-18.11.6/drivers/net/qede/meson.build --- dpdk-18.11.5/drivers/net/qede/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -1,6 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Luca Boccassi +allow_experimental_apis = true + subdir('base') objs = [base_objs] diff -Nru dpdk-18.11.5/drivers/net/qede/qede_ethdev.c dpdk-18.11.6/drivers/net/qede/qede_ethdev.c --- dpdk-18.11.5/drivers/net/qede/qede_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/qede_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -5,6 +5,7 @@ */ #include "qede_ethdev.h" +#include #include #include #include @@ -247,8 +248,8 @@ if (status & 0x1) { qede_interrupt_action(ECORE_LEADING_HWFN(edev)); - if (rte_intr_enable(eth_dev->intr_handle)) - DP_ERR(edev, "rte_intr_enable failed\n"); + if (rte_intr_ack(eth_dev->intr_handle)) + DP_ERR(edev, "rte_intr_ack failed\n"); } } @@ -260,8 +261,8 @@ struct ecore_dev *edev = &qdev->edev; qede_interrupt_action(ECORE_LEADING_HWFN(edev)); - if (rte_intr_enable(eth_dev->intr_handle)) - DP_ERR(edev, "rte_intr_enable failed\n"); + if (rte_intr_ack(eth_dev->intr_handle)) + DP_ERR(edev, "rte_intr_ack failed\n"); } static void @@ -303,6 +304,7 @@ static void qede_reset_queue_stats(struct qede_dev *qdev, bool xstats) { + struct rte_eth_dev *dev = (struct rte_eth_dev *)qdev->ethdev; struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); unsigned int i = 0, j = 0, qid; unsigned int rxq_stat_cntrs, txq_stat_cntrs; @@ -310,12 +312,12 @@ DP_VERBOSE(edev, ECORE_MSG_DEBUG, "Clearing queue stats\n"); - rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(qdev), + rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(dev), RTE_ETHDEV_QUEUE_STAT_CNTRS); - txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(qdev), + txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(dev), RTE_ETHDEV_QUEUE_STAT_CNTRS); - for_each_rss(qid) { + for (qid = 0; qid < qdev->num_rx_queues; qid++) { OSAL_MEMSET(((char *)(qdev->fp_array[qid].rxq)) + offsetof(struct qede_rx_queue, rcv_pkts), 0, sizeof(uint64_t)); @@ -341,7 +343,7 @@ i = 0; - for_each_tss(qid) { + for (qid = 0; qid < qdev->num_tx_queues; qid++) { txq = qdev->fp_array[qid].txq; OSAL_MEMSET((uint64_t *)(uintptr_t) @@ -813,6 +815,8 @@ } } + qdev->vlan_strip_flg = flg; + DP_INFO(edev, "VLAN stripping %s\n", flg ? "enabled" : "disabled"); return 0; } @@ -988,7 +992,7 @@ for (i = 0; i < ECORE_RSS_IND_TABLE_SIZE; i++) { id = i / RTE_RETA_GROUP_SIZE; pos = i % RTE_RETA_GROUP_SIZE; - q = i % QEDE_RSS_COUNT(qdev); + q = i % QEDE_RSS_COUNT(eth_dev); reta_conf[id].reta[pos] = q; } if (qede_rss_reta_update(eth_dev, &reta_conf[0], @@ -1018,9 +1022,11 @@ PMD_INIT_FUNC_TRACE(edev); /* Update MTU only if it has changed */ - if (eth_dev->data->mtu != qdev->mtu) { - if (qede_update_mtu(eth_dev, qdev->mtu)) + if (qdev->new_mtu && qdev->new_mtu != qdev->mtu) { + if (qede_update_mtu(eth_dev, qdev->new_mtu)) goto err; + qdev->mtu = qdev->new_mtu; + qdev->new_mtu = 0; } /* Configure TPA parameters */ @@ -1162,22 +1168,6 @@ PMD_INIT_FUNC_TRACE(edev); - /* Check requirements for 100G mode */ - if (ECORE_IS_CMT(edev)) { - if (eth_dev->data->nb_rx_queues < 2 || - eth_dev->data->nb_tx_queues < 2) { - DP_ERR(edev, "100G mode needs min. 2 RX/TX queues\n"); - return -EINVAL; - } - - if ((eth_dev->data->nb_rx_queues % 2 != 0) || - (eth_dev->data->nb_tx_queues % 2 != 0)) { - DP_ERR(edev, - "100G mode needs even no. of RX/TX queues\n"); - return -EINVAL; - } - } - /* We need to have min 1 RX queue.There is no min check in * rte_eth_dev_configure(), so we are checking it here. */ @@ -1204,8 +1194,9 @@ return -ENOTSUP; qede_dealloc_fp_resc(eth_dev); - qdev->num_tx_queues = eth_dev->data->nb_tx_queues; - qdev->num_rx_queues = eth_dev->data->nb_rx_queues; + qdev->num_tx_queues = eth_dev->data->nb_tx_queues * edev->num_hwfns; + qdev->num_rx_queues = eth_dev->data->nb_rx_queues * edev->num_hwfns; + if (qede_alloc_fp_resc(qdev)) return -ENOMEM; @@ -1230,7 +1221,12 @@ return ret; DP_INFO(edev, "Device configured with RSS=%d TSS=%d\n", - QEDE_RSS_COUNT(qdev), QEDE_TSS_COUNT(qdev)); + QEDE_RSS_COUNT(eth_dev), QEDE_TSS_COUNT(eth_dev)); + + if (ECORE_IS_CMT(edev)) + DP_INFO(edev, "Actual HW queues for CMT mode - RX = %d TX = %d\n", + qdev->num_rx_queues, qdev->num_tx_queues); + return 0; } @@ -1272,6 +1268,10 @@ else dev_info->max_rx_queues = (uint16_t)RTE_MIN( QEDE_MAX_RSS_CNT(qdev), ECORE_MAX_VF_CHAINS_PER_PF); + /* Since CMT mode internally doubles the number of queues */ + if (ECORE_IS_CMT(edev)) + dev_info->max_rx_queues = dev_info->max_rx_queues / 2; + dev_info->max_tx_queues = dev_info->max_rx_queues; dev_info->max_mac_addrs = qdev->dev_info.num_mac_filters; @@ -1479,7 +1479,7 @@ struct qede_dev *qdev = eth_dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; struct ecore_eth_stats stats; - unsigned int i = 0, j = 0, qid; + unsigned int i = 0, j = 0, qid, idx, hw_fn; unsigned int rxq_stat_cntrs, txq_stat_cntrs; struct qede_tx_queue *txq; @@ -1515,44 +1515,59 @@ eth_stats->oerrors = stats.common.tx_err_drop_pkts; /* Queue stats */ - rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(qdev), + rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(eth_dev), RTE_ETHDEV_QUEUE_STAT_CNTRS); - txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(qdev), + txq_stat_cntrs = RTE_MIN(QEDE_TSS_COUNT(eth_dev), RTE_ETHDEV_QUEUE_STAT_CNTRS); - if ((rxq_stat_cntrs != (unsigned int)QEDE_RSS_COUNT(qdev)) || - (txq_stat_cntrs != (unsigned int)QEDE_TSS_COUNT(qdev))) + if (rxq_stat_cntrs != (unsigned int)QEDE_RSS_COUNT(eth_dev) || + txq_stat_cntrs != (unsigned int)QEDE_TSS_COUNT(eth_dev)) DP_VERBOSE(edev, ECORE_MSG_DEBUG, "Not all the queue stats will be displayed. Set" " RTE_ETHDEV_QUEUE_STAT_CNTRS config param" " appropriately and retry.\n"); - for_each_rss(qid) { - eth_stats->q_ipackets[i] = - *(uint64_t *)( - ((char *)(qdev->fp_array[qid].rxq)) + - offsetof(struct qede_rx_queue, - rcv_pkts)); - eth_stats->q_errors[i] = - *(uint64_t *)( - ((char *)(qdev->fp_array[qid].rxq)) + - offsetof(struct qede_rx_queue, - rx_hw_errors)) + - *(uint64_t *)( - ((char *)(qdev->fp_array[qid].rxq)) + - offsetof(struct qede_rx_queue, - rx_alloc_errors)); + for (qid = 0; qid < eth_dev->data->nb_rx_queues; qid++) { + eth_stats->q_ipackets[i] = 0; + eth_stats->q_errors[i] = 0; + + for_each_hwfn(edev, hw_fn) { + idx = qid * edev->num_hwfns + hw_fn; + + eth_stats->q_ipackets[i] += + *(uint64_t *) + (((char *)(qdev->fp_array[idx].rxq)) + + offsetof(struct qede_rx_queue, + rcv_pkts)); + eth_stats->q_errors[i] += + *(uint64_t *) + (((char *)(qdev->fp_array[idx].rxq)) + + offsetof(struct qede_rx_queue, + rx_hw_errors)) + + *(uint64_t *) + (((char *)(qdev->fp_array[idx].rxq)) + + offsetof(struct qede_rx_queue, + rx_alloc_errors)); + } + i++; if (i == rxq_stat_cntrs) break; } - for_each_tss(qid) { - txq = qdev->fp_array[qid].txq; - eth_stats->q_opackets[j] = - *((uint64_t *)(uintptr_t) - (((uint64_t)(uintptr_t)(txq)) + - offsetof(struct qede_tx_queue, - xmit_pkts))); + for (qid = 0; qid < eth_dev->data->nb_tx_queues; qid++) { + eth_stats->q_opackets[j] = 0; + + for_each_hwfn(edev, hw_fn) { + idx = qid * edev->num_hwfns + hw_fn; + + txq = qdev->fp_array[idx].txq; + eth_stats->q_opackets[j] += + *((uint64_t *)(uintptr_t) + (((uint64_t)(uintptr_t)(txq)) + + offsetof(struct qede_tx_queue, + xmit_pkts))); + } + j++; if (j == txq_stat_cntrs) break; @@ -1563,18 +1578,18 @@ static unsigned qede_get_xstats_count(struct qede_dev *qdev) { + struct rte_eth_dev *dev = (struct rte_eth_dev *)qdev->ethdev; + if (ECORE_IS_BB(&qdev->edev)) return RTE_DIM(qede_xstats_strings) + RTE_DIM(qede_bb_xstats_strings) + (RTE_DIM(qede_rxq_xstats_strings) * - RTE_MIN(QEDE_RSS_COUNT(qdev), - RTE_ETHDEV_QUEUE_STAT_CNTRS)); + QEDE_RSS_COUNT(dev) * qdev->edev.num_hwfns); else return RTE_DIM(qede_xstats_strings) + RTE_DIM(qede_ah_xstats_strings) + (RTE_DIM(qede_rxq_xstats_strings) * - RTE_MIN(QEDE_RSS_COUNT(qdev), - RTE_ETHDEV_QUEUE_STAT_CNTRS)); + QEDE_RSS_COUNT(dev)); } static int @@ -1585,45 +1600,43 @@ struct qede_dev *qdev = dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; const unsigned int stat_cnt = qede_get_xstats_count(qdev); - unsigned int i, qid, stat_idx = 0; - unsigned int rxq_stat_cntrs; + unsigned int i, qid, hw_fn, stat_idx = 0; + + if (xstats_names == NULL) + return stat_cnt; + + for (i = 0; i < RTE_DIM(qede_xstats_strings); i++) { + strlcpy(xstats_names[stat_idx].name, + qede_xstats_strings[i].name, + sizeof(xstats_names[stat_idx].name)); + stat_idx++; + } - if (xstats_names != NULL) { - for (i = 0; i < RTE_DIM(qede_xstats_strings); i++) { - snprintf(xstats_names[stat_idx].name, - sizeof(xstats_names[stat_idx].name), - "%s", - qede_xstats_strings[i].name); + if (ECORE_IS_BB(edev)) { + for (i = 0; i < RTE_DIM(qede_bb_xstats_strings); i++) { + strlcpy(xstats_names[stat_idx].name, + qede_bb_xstats_strings[i].name, + sizeof(xstats_names[stat_idx].name)); stat_idx++; } - - if (ECORE_IS_BB(edev)) { - for (i = 0; i < RTE_DIM(qede_bb_xstats_strings); i++) { - snprintf(xstats_names[stat_idx].name, - sizeof(xstats_names[stat_idx].name), - "%s", - qede_bb_xstats_strings[i].name); - stat_idx++; - } - } else { - for (i = 0; i < RTE_DIM(qede_ah_xstats_strings); i++) { - snprintf(xstats_names[stat_idx].name, - sizeof(xstats_names[stat_idx].name), - "%s", - qede_ah_xstats_strings[i].name); - stat_idx++; - } + } else { + for (i = 0; i < RTE_DIM(qede_ah_xstats_strings); i++) { + strlcpy(xstats_names[stat_idx].name, + qede_ah_xstats_strings[i].name, + sizeof(xstats_names[stat_idx].name)); + stat_idx++; } + } - rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(qdev), - RTE_ETHDEV_QUEUE_STAT_CNTRS); - for (qid = 0; qid < rxq_stat_cntrs; qid++) { + for (qid = 0; qid < QEDE_RSS_COUNT(dev); qid++) { + for_each_hwfn(edev, hw_fn) { for (i = 0; i < RTE_DIM(qede_rxq_xstats_strings); i++) { snprintf(xstats_names[stat_idx].name, - sizeof(xstats_names[stat_idx].name), - "%.4s%d%s", - qede_rxq_xstats_strings[i].name, qid, - qede_rxq_xstats_strings[i].name + 4); + RTE_ETH_XSTATS_NAME_SIZE, + "%.4s%d.%d%s", + qede_rxq_xstats_strings[i].name, + hw_fn, qid, + qede_rxq_xstats_strings[i].name + 4); stat_idx++; } } @@ -1640,8 +1653,7 @@ struct ecore_dev *edev = &qdev->edev; struct ecore_eth_stats stats; const unsigned int num = qede_get_xstats_count(qdev); - unsigned int i, qid, stat_idx = 0; - unsigned int rxq_stat_cntrs; + unsigned int i, qid, hw_fn, fpidx, stat_idx = 0; if (n < num) return num; @@ -1673,17 +1685,17 @@ } } - rxq_stat_cntrs = RTE_MIN(QEDE_RSS_COUNT(qdev), - RTE_ETHDEV_QUEUE_STAT_CNTRS); - for (qid = 0; qid < rxq_stat_cntrs; qid++) { - for_each_rss(qid) { + for (qid = 0; qid < dev->data->nb_rx_queues; qid++) { + for_each_hwfn(edev, hw_fn) { for (i = 0; i < RTE_DIM(qede_rxq_xstats_strings); i++) { - xstats[stat_idx].value = *(uint64_t *)( - ((char *)(qdev->fp_array[qid].rxq)) + + fpidx = qid * edev->num_hwfns + hw_fn; + xstats[stat_idx].value = *(uint64_t *) + (((char *)(qdev->fp_array[fpidx].rxq)) + qede_rxq_xstats_strings[i].offset); xstats[stat_idx].id = stat_idx; stat_idx++; } + } } @@ -1937,7 +1949,8 @@ RTE_PTYPE_UNKNOWN }; - if (eth_dev->rx_pkt_burst == qede_recv_pkts) + if (eth_dev->rx_pkt_burst == qede_recv_pkts || + eth_dev->rx_pkt_burst == qede_recv_pkts_cmt) return ptypes; return NULL; @@ -1967,8 +1980,7 @@ uint32_t *key = (uint32_t *)rss_conf->rss_key; uint64_t hf = rss_conf->rss_hf; uint8_t len = rss_conf->rss_key_len; - uint8_t idx; - uint8_t i; + uint8_t idx, i, j, fpidx; int rc; memset(&vport_update_params, 0, sizeof(vport_update_params)); @@ -2002,14 +2014,18 @@ /* tbl_size has to be set with capabilities */ rss_params.rss_table_size_log = 7; vport_update_params.vport_id = 0; - /* pass the L2 handles instead of qids */ - for (i = 0 ; i < ECORE_RSS_IND_TABLE_SIZE ; i++) { - idx = i % QEDE_RSS_COUNT(qdev); - rss_params.rss_ind_table[i] = qdev->fp_array[idx].rxq->handle; - } - vport_update_params.rss_params = &rss_params; for_each_hwfn(edev, i) { + /* pass the L2 handles instead of qids */ + for (j = 0 ; j < ECORE_RSS_IND_TABLE_SIZE ; j++) { + idx = j % QEDE_RSS_COUNT(eth_dev); + fpidx = idx * edev->num_hwfns + i; + rss_params.rss_ind_table[j] = + qdev->fp_array[fpidx].rxq->handle; + } + + vport_update_params.rss_params = &rss_params; + p_hwfn = &edev->hwfns[i]; vport_update_params.opaque_fid = p_hwfn->hw_info.opaque_fid; rc = ecore_sp_vport_update(p_hwfn, &vport_update_params, @@ -2061,61 +2077,6 @@ return 0; } -static bool qede_update_rss_parm_cmt(struct ecore_dev *edev, - struct ecore_rss_params *rss) -{ - int i, fn; - bool rss_mode = 1; /* enable */ - struct ecore_queue_cid *cid; - struct ecore_rss_params *t_rss; - - /* In regular scenario, we'd simply need to take input handlers. - * But in CMT, we'd have to split the handlers according to the - * engine they were configured on. We'd then have to understand - * whether RSS is really required, since 2-queues on CMT doesn't - * require RSS. - */ - - /* CMT should be round-robin */ - for (i = 0; i < ECORE_RSS_IND_TABLE_SIZE; i++) { - cid = rss->rss_ind_table[i]; - - if (cid->p_owner == ECORE_LEADING_HWFN(edev)) - t_rss = &rss[0]; - else - t_rss = &rss[1]; - - t_rss->rss_ind_table[i / edev->num_hwfns] = cid; - } - - t_rss = &rss[1]; - t_rss->update_rss_ind_table = 1; - t_rss->rss_table_size_log = 7; - t_rss->update_rss_config = 1; - - /* Make sure RSS is actually required */ - for_each_hwfn(edev, fn) { - for (i = 1; i < ECORE_RSS_IND_TABLE_SIZE / edev->num_hwfns; - i++) { - if (rss[fn].rss_ind_table[i] != - rss[fn].rss_ind_table[0]) - break; - } - - if (i == ECORE_RSS_IND_TABLE_SIZE / edev->num_hwfns) { - DP_INFO(edev, - "CMT - 1 queue per-hwfn; Disabling RSS\n"); - rss_mode = 0; - goto out; - } - } - -out: - t_rss->rss_enable = rss_mode; - - return rss_mode; -} - int qede_rss_reta_update(struct rte_eth_dev *eth_dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size) @@ -2124,8 +2085,8 @@ struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); struct ecore_sp_vport_update_params vport_update_params; struct ecore_rss_params *params; + uint16_t i, j, idx, fid, shift; struct ecore_hwfn *p_hwfn; - uint16_t i, idx, shift; uint8_t entry; int rc = 0; @@ -2136,40 +2097,36 @@ } memset(&vport_update_params, 0, sizeof(vport_update_params)); - params = rte_zmalloc("qede_rss", sizeof(*params) * edev->num_hwfns, - RTE_CACHE_LINE_SIZE); + params = rte_zmalloc("qede_rss", sizeof(*params), RTE_CACHE_LINE_SIZE); if (params == NULL) { DP_ERR(edev, "failed to allocate memory\n"); return -ENOMEM; } - for (i = 0; i < reta_size; i++) { - idx = i / RTE_RETA_GROUP_SIZE; - shift = i % RTE_RETA_GROUP_SIZE; - if (reta_conf[idx].mask & (1ULL << shift)) { - entry = reta_conf[idx].reta[shift]; - /* Pass rxq handles to ecore */ - params->rss_ind_table[i] = - qdev->fp_array[entry].rxq->handle; - /* Update the local copy for RETA query command */ - qdev->rss_ind_table[i] = entry; - } - } - params->update_rss_ind_table = 1; params->rss_table_size_log = 7; params->update_rss_config = 1; - /* Fix up RETA for CMT mode device */ - if (ECORE_IS_CMT(edev)) - qdev->rss_enable = qede_update_rss_parm_cmt(edev, - params); vport_update_params.vport_id = 0; /* Use the current value of rss_enable */ params->rss_enable = qdev->rss_enable; vport_update_params.rss_params = params; for_each_hwfn(edev, i) { + for (j = 0; j < reta_size; j++) { + idx = j / RTE_RETA_GROUP_SIZE; + shift = j % RTE_RETA_GROUP_SIZE; + if (reta_conf[idx].mask & (1ULL << shift)) { + entry = reta_conf[idx].reta[shift]; + fid = entry * edev->num_hwfns + i; + /* Pass rxq handles to ecore */ + params->rss_ind_table[j] = + qdev->fp_array[fid].rxq->handle; + /* Update the local copy for RETA query cmd */ + qdev->rss_ind_table[j] = entry; + } + } + p_hwfn = &edev->hwfns[i]; vport_update_params.opaque_fid = p_hwfn->hw_info.opaque_fid; rc = ecore_sp_vport_update(p_hwfn, &vport_update_params, @@ -2253,10 +2210,10 @@ restart = true; } rte_delay_ms(1000); - qdev->mtu = mtu; + qdev->new_mtu = mtu; /* Fix up RX buf size for all queues of the port */ - for_each_rss(i) { + for (i = 0; i < qdev->num_rx_queues; i++) { fp = &qdev->fp_array[i]; if (fp->rxq != NULL) { bufsz = (uint16_t)rte_pktmbuf_data_room_size( @@ -2285,9 +2242,13 @@ /* update max frame size */ dev->data->dev_conf.rxmode.max_rx_pkt_len = max_rx_pkt_len; /* Reassign back */ - dev->rx_pkt_burst = qede_recv_pkts; - dev->tx_pkt_burst = qede_xmit_pkts; - + if (ECORE_IS_CMT(edev)) { + dev->rx_pkt_burst = qede_recv_pkts_cmt; + dev->tx_pkt_burst = qede_xmit_pkts_cmt; + } else { + dev->rx_pkt_burst = qede_recv_pkts; + dev->tx_pkt_burst = qede_xmit_pkts; + } return 0; } @@ -2428,10 +2389,6 @@ pci_addr.bus, pci_addr.devid, pci_addr.function, eth_dev->data->port_id); - eth_dev->rx_pkt_burst = qede_recv_pkts; - eth_dev->tx_pkt_burst = qede_xmit_pkts; - eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts; - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { DP_ERR(edev, "Skipping device init from secondary process\n"); return 0; @@ -2489,6 +2446,16 @@ strncpy((char *)params.name, QEDE_PMD_VER_PREFIX, QEDE_PMD_DRV_VER_STR_SIZE); + if (ECORE_IS_CMT(edev)) { + eth_dev->rx_pkt_burst = qede_recv_pkts_cmt; + eth_dev->tx_pkt_burst = qede_xmit_pkts_cmt; + } else { + eth_dev->rx_pkt_burst = qede_recv_pkts; + eth_dev->tx_pkt_burst = qede_xmit_pkts; + } + + eth_dev->tx_pkt_prepare = qede_xmit_prep_pkts; + /* For CMT mode device do periodic polling for slowpath events. * This is required since uio device uses only one MSI-x * interrupt vector but we need one for each engine. diff -Nru dpdk-18.11.5/drivers/net/qede/qede_ethdev.h dpdk-18.11.6/drivers/net/qede/qede_ethdev.h --- dpdk-18.11.5/drivers/net/qede/qede_ethdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/qede_ethdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -66,8 +66,8 @@ (edev)->dev_info.num_tc) #define QEDE_QUEUE_CNT(qdev) ((qdev)->num_queues) -#define QEDE_RSS_COUNT(qdev) ((qdev)->num_rx_queues) -#define QEDE_TSS_COUNT(qdev) ((qdev)->num_tx_queues) +#define QEDE_RSS_COUNT(dev) ((dev)->data->nb_rx_queues) +#define QEDE_TSS_COUNT(dev) ((dev)->data->nb_tx_queues) #define QEDE_DUPLEX_FULL 1 #define QEDE_DUPLEX_HALF 2 @@ -215,7 +215,9 @@ struct qed_dev_eth_info dev_info; struct ecore_sb_info *sb_array; struct qede_fastpath *fp_array; + struct qede_fastpath_cmt *fp_array_cmt; uint16_t mtu; + uint16_t new_mtu; bool enable_tx_switching; bool rss_enable; struct rte_eth_rss_conf rss_conf; diff -Nru dpdk-18.11.5/drivers/net/qede/qede_filter.c dpdk-18.11.6/drivers/net/qede/qede_filter.c --- dpdk-18.11.5/drivers/net/qede/qede_filter.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/qede_filter.c 2020-01-31 09:55:30.000000000 +0000 @@ -431,7 +431,7 @@ return -EINVAL; } - if (fdir->action.rx_queue >= QEDE_RSS_COUNT(qdev)) { + if (fdir->action.rx_queue >= QEDE_RSS_COUNT(eth_dev)) { DP_ERR(edev, "invalid queue number %u\n", fdir->action.rx_queue); return -EINVAL; @@ -1343,7 +1343,6 @@ struct rte_flow_error *error, struct rte_flow *flow) { - struct qede_dev *qdev = QEDE_INIT_QDEV(dev); const struct rte_flow_action_queue *queue; if (actions == NULL) { @@ -1358,7 +1357,7 @@ case RTE_FLOW_ACTION_TYPE_QUEUE: queue = actions->conf; - if (queue->index >= QEDE_RSS_COUNT(qdev)) { + if (queue->index >= QEDE_RSS_COUNT(dev)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, actions, diff -Nru dpdk-18.11.5/drivers/net/qede/qede_rxtx.c dpdk-18.11.6/drivers/net/qede/qede_rxtx.c --- dpdk-18.11.5/drivers/net/qede/qede_rxtx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/qede_rxtx.c 2020-01-31 09:55:30.000000000 +0000 @@ -46,8 +46,6 @@ int i, ret = 0; uint16_t idx; - idx = rxq->sw_rx_prod & NUM_RX_BDS(rxq); - if (count > QEDE_MAX_BULK_ALLOC_COUNT) count = QEDE_MAX_BULK_ALLOC_COUNT; @@ -56,7 +54,9 @@ PMD_RX_LOG(ERR, rxq, "Failed to allocate %d rx buffers " "sw_rx_prod %u sw_rx_cons %u mp entries %u free %u", - count, idx, rxq->sw_rx_cons & NUM_RX_BDS(rxq), + count, + rxq->sw_rx_prod & NUM_RX_BDS(rxq), + rxq->sw_rx_cons & NUM_RX_BDS(rxq), rte_mempool_avail_count(rxq->mb_pool), rte_mempool_in_use_count(rxq->mb_pool)); return -ENOMEM; @@ -124,36 +124,20 @@ return QEDE_FLOOR_TO_CACHE_LINE_SIZE(rx_buf_size); } -int -qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, - uint16_t nb_desc, unsigned int socket_id, - __rte_unused const struct rte_eth_rxconf *rx_conf, - struct rte_mempool *mp) +static struct qede_rx_queue * +qede_alloc_rx_queue_mem(struct rte_eth_dev *dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + struct rte_mempool *mp, + uint16_t bufsz) { struct qede_dev *qdev = QEDE_INIT_QDEV(dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); - struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; struct qede_rx_queue *rxq; - uint16_t max_rx_pkt_len; - uint16_t bufsz; size_t size; int rc; - PMD_INIT_FUNC_TRACE(edev); - - /* Note: Ring size/align is controlled by struct rte_eth_desc_lim */ - if (!rte_is_power_of_2(nb_desc)) { - DP_ERR(edev, "Ring size %u is not power of 2\n", - nb_desc); - return -EINVAL; - } - - /* Free memory prior to re-allocation if needed... */ - if (dev->data->rx_queues[queue_idx] != NULL) { - qede_rx_queue_release(dev->data->rx_queues[queue_idx]); - dev->data->rx_queues[queue_idx] = NULL; - } - /* First allocate the rx queue data structure */ rxq = rte_zmalloc_socket("qede_rx_queue", sizeof(struct qede_rx_queue), RTE_CACHE_LINE_SIZE, socket_id); @@ -161,7 +145,7 @@ if (!rxq) { DP_ERR(edev, "Unable to allocate memory for rxq on socket %u", socket_id); - return -ENOMEM; + return NULL; } rxq->qdev = qdev; @@ -170,27 +154,8 @@ rxq->queue_id = queue_idx; rxq->port_id = dev->data->port_id; - max_rx_pkt_len = (uint16_t)rxmode->max_rx_pkt_len; - - /* Fix up RX buffer size */ - bufsz = (uint16_t)rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; - /* cache align the mbuf size to simplfy rx_buf_size calculation */ - bufsz = QEDE_FLOOR_TO_CACHE_LINE_SIZE(bufsz); - if ((rxmode->offloads & DEV_RX_OFFLOAD_SCATTER) || - (max_rx_pkt_len + QEDE_ETH_OVERHEAD) > bufsz) { - if (!dev->data->scattered_rx) { - DP_INFO(edev, "Forcing scatter-gather mode\n"); - dev->data->scattered_rx = 1; - } - } - rc = qede_calc_rx_buf_size(dev, bufsz, max_rx_pkt_len); - if (rc < 0) { - rte_free(rxq); - return rc; - } - - rxq->rx_buf_size = rc; + rxq->rx_buf_size = bufsz; DP_INFO(edev, "mtu %u mbufsz %u bd_max_bytes %u scatter_mode %d\n", qdev->mtu, bufsz, rxq->rx_buf_size, dev->data->scattered_rx); @@ -203,7 +168,7 @@ DP_ERR(edev, "Memory allocation fails for sw_rx_ring on" " socket %u\n", socket_id); rte_free(rxq); - return -ENOMEM; + return NULL; } /* Allocate FW Rx ring */ @@ -221,7 +186,7 @@ " on socket %u\n", socket_id); rte_free(rxq->sw_rx_ring); rte_free(rxq); - return -ENOMEM; + return NULL; } /* Allocate FW completion ring */ @@ -240,14 +205,88 @@ qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring); rte_free(rxq->sw_rx_ring); rte_free(rxq); - return -ENOMEM; + return NULL; } - dev->data->rx_queues[queue_idx] = rxq; - qdev->fp_array[queue_idx].rxq = rxq; + return rxq; +} + +int +qede_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qid, + uint16_t nb_desc, unsigned int socket_id, + __rte_unused const struct rte_eth_rxconf *rx_conf, + struct rte_mempool *mp) +{ + struct qede_dev *qdev = QEDE_INIT_QDEV(dev); + struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); + struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; + struct qede_rx_queue *rxq; + uint16_t max_rx_pkt_len; + uint16_t bufsz; + int rc; + + PMD_INIT_FUNC_TRACE(edev); + + /* Note: Ring size/align is controlled by struct rte_eth_desc_lim */ + if (!rte_is_power_of_2(nb_desc)) { + DP_ERR(edev, "Ring size %u is not power of 2\n", + nb_desc); + return -EINVAL; + } + + /* Free memory prior to re-allocation if needed... */ + if (dev->data->rx_queues[qid] != NULL) { + qede_rx_queue_release(dev->data->rx_queues[qid]); + dev->data->rx_queues[qid] = NULL; + } + + max_rx_pkt_len = (uint16_t)rxmode->max_rx_pkt_len; + + /* Fix up RX buffer size */ + bufsz = (uint16_t)rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM; + /* cache align the mbuf size to simplfy rx_buf_size calculation */ + bufsz = QEDE_FLOOR_TO_CACHE_LINE_SIZE(bufsz); + if ((rxmode->offloads & DEV_RX_OFFLOAD_SCATTER) || + (max_rx_pkt_len + QEDE_ETH_OVERHEAD) > bufsz) { + if (!dev->data->scattered_rx) { + DP_INFO(edev, "Forcing scatter-gather mode\n"); + dev->data->scattered_rx = 1; + } + } + + rc = qede_calc_rx_buf_size(dev, bufsz, max_rx_pkt_len); + if (rc < 0) + return rc; + + bufsz = rc; + + if (ECORE_IS_CMT(edev)) { + rxq = qede_alloc_rx_queue_mem(dev, qid * 2, nb_desc, + socket_id, mp, bufsz); + if (!rxq) + return -ENOMEM; + + qdev->fp_array[qid * 2].rxq = rxq; + rxq = qede_alloc_rx_queue_mem(dev, qid * 2 + 1, nb_desc, + socket_id, mp, bufsz); + if (!rxq) + return -ENOMEM; + + qdev->fp_array[qid * 2 + 1].rxq = rxq; + /* provide per engine fp struct as rx queue */ + dev->data->rx_queues[qid] = &qdev->fp_array_cmt[qid]; + } else { + rxq = qede_alloc_rx_queue_mem(dev, qid, nb_desc, + socket_id, mp, bufsz); + if (!rxq) + return -ENOMEM; + + dev->data->rx_queues[qid] = rxq; + qdev->fp_array[qid].rxq = rxq; + } DP_INFO(edev, "rxq %d num_desc %u rx_buf_size=%u socket %u\n", - queue_idx, nb_desc, rxq->rx_buf_size, socket_id); + qid, nb_desc, rxq->rx_buf_size, socket_id); return 0; } @@ -278,9 +317,21 @@ } } +static void _qede_rx_queue_release(struct qede_dev *qdev, + struct ecore_dev *edev, + struct qede_rx_queue *rxq) +{ + qede_rx_queue_release_mbufs(rxq); + qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring); + qdev->ops->common->chain_free(edev, &rxq->rx_comp_ring); + rte_free(rxq->sw_rx_ring); + rte_free(rxq); +} + void qede_rx_queue_release(void *rx_queue) { struct qede_rx_queue *rxq = rx_queue; + struct qede_fastpath_cmt *fp_cmt; struct qede_dev *qdev; struct ecore_dev *edev; @@ -288,11 +339,13 @@ qdev = rxq->qdev; edev = QEDE_INIT_EDEV(qdev); PMD_INIT_FUNC_TRACE(edev); - qede_rx_queue_release_mbufs(rxq); - qdev->ops->common->chain_free(edev, &rxq->rx_bd_ring); - qdev->ops->common->chain_free(edev, &rxq->rx_comp_ring); - rte_free(rxq->sw_rx_ring); - rte_free(rxq); + if (ECORE_IS_CMT(edev)) { + fp_cmt = rx_queue; + _qede_rx_queue_release(qdev, edev, fp_cmt->fp0->rxq); + _qede_rx_queue_release(qdev, edev, fp_cmt->fp1->rxq); + } else { + _qede_rx_queue_release(qdev, edev, rxq); + } } } @@ -306,8 +359,8 @@ int hwfn_index; int rc; - if (rx_queue_id < eth_dev->data->nb_rx_queues) { - rxq = eth_dev->data->rx_queues[rx_queue_id]; + if (rx_queue_id < qdev->num_rx_queues) { + rxq = qdev->fp_array[rx_queue_id].rxq; hwfn_index = rx_queue_id % edev->num_hwfns; p_hwfn = &edev->hwfns[hwfn_index]; rc = ecore_eth_rx_queue_stop(p_hwfn, rxq->handle, @@ -329,32 +382,18 @@ return rc; } -int -qede_tx_queue_setup(struct rte_eth_dev *dev, - uint16_t queue_idx, - uint16_t nb_desc, - unsigned int socket_id, - const struct rte_eth_txconf *tx_conf) +static struct qede_tx_queue * +qede_alloc_tx_queue_mem(struct rte_eth_dev *dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) { struct qede_dev *qdev = dev->data->dev_private; struct ecore_dev *edev = &qdev->edev; struct qede_tx_queue *txq; int rc; - PMD_INIT_FUNC_TRACE(edev); - - if (!rte_is_power_of_2(nb_desc)) { - DP_ERR(edev, "Ring size %u is not power of 2\n", - nb_desc); - return -EINVAL; - } - - /* Free memory prior to re-allocation if needed... */ - if (dev->data->tx_queues[queue_idx] != NULL) { - qede_tx_queue_release(dev->data->tx_queues[queue_idx]); - dev->data->tx_queues[queue_idx] = NULL; - } - txq = rte_zmalloc_socket("qede_tx_queue", sizeof(struct qede_tx_queue), RTE_CACHE_LINE_SIZE, socket_id); @@ -362,7 +401,7 @@ DP_ERR(edev, "Unable to allocate memory for txq on socket %u", socket_id); - return -ENOMEM; + return NULL; } txq->nb_tx_desc = nb_desc; @@ -382,7 +421,7 @@ "Unable to allocate memory for txbd ring on socket %u", socket_id); qede_tx_queue_release(txq); - return -ENOMEM; + return NULL; } /* Allocate software ring */ @@ -397,7 +436,7 @@ socket_id); qdev->ops->common->chain_free(edev, &txq->tx_pbl); qede_tx_queue_release(txq); - return -ENOMEM; + return NULL; } txq->queue_id = queue_idx; @@ -408,12 +447,61 @@ tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh : (txq->nb_tx_desc - QEDE_DEFAULT_TX_FREE_THRESH); - dev->data->tx_queues[queue_idx] = txq; - qdev->fp_array[queue_idx].txq = txq; - DP_INFO(edev, "txq %u num_desc %u tx_free_thresh %u socket %u\n", queue_idx, nb_desc, txq->tx_free_thresh, socket_id); + return txq; +} + +int +qede_tx_queue_setup(struct rte_eth_dev *dev, + uint16_t queue_idx, + uint16_t nb_desc, + unsigned int socket_id, + const struct rte_eth_txconf *tx_conf) +{ + struct qede_dev *qdev = dev->data->dev_private; + struct ecore_dev *edev = &qdev->edev; + struct qede_tx_queue *txq; + + PMD_INIT_FUNC_TRACE(edev); + + if (!rte_is_power_of_2(nb_desc)) { + DP_ERR(edev, "Ring size %u is not power of 2\n", + nb_desc); + return -EINVAL; + } + + /* Free memory prior to re-allocation if needed... */ + if (dev->data->tx_queues[queue_idx] != NULL) { + qede_tx_queue_release(dev->data->tx_queues[queue_idx]); + dev->data->tx_queues[queue_idx] = NULL; + } + + if (ECORE_IS_CMT(edev)) { + txq = qede_alloc_tx_queue_mem(dev, queue_idx * 2, nb_desc, + socket_id, tx_conf); + if (!txq) + return -ENOMEM; + + qdev->fp_array[queue_idx * 2].txq = txq; + txq = qede_alloc_tx_queue_mem(dev, (queue_idx * 2) + 1, nb_desc, + socket_id, tx_conf); + if (!txq) + return -ENOMEM; + + qdev->fp_array[(queue_idx * 2) + 1].txq = txq; + dev->data->tx_queues[queue_idx] = + &qdev->fp_array_cmt[queue_idx]; + } else { + txq = qede_alloc_tx_queue_mem(dev, queue_idx, nb_desc, + socket_id, tx_conf); + if (!txq) + return -ENOMEM; + + dev->data->tx_queues[queue_idx] = txq; + qdev->fp_array[queue_idx].txq = txq; + } return 0; } @@ -443,9 +531,20 @@ } } +static void _qede_tx_queue_release(struct qede_dev *qdev, + struct ecore_dev *edev, + struct qede_tx_queue *txq) +{ + qede_tx_queue_release_mbufs(txq); + qdev->ops->common->chain_free(edev, &txq->tx_pbl); + rte_free(txq->sw_tx_ring); + rte_free(txq); +} + void qede_tx_queue_release(void *tx_queue) { struct qede_tx_queue *txq = tx_queue; + struct qede_fastpath_cmt *fp_cmt; struct qede_dev *qdev; struct ecore_dev *edev; @@ -453,10 +552,14 @@ qdev = txq->qdev; edev = QEDE_INIT_EDEV(qdev); PMD_INIT_FUNC_TRACE(edev); - qede_tx_queue_release_mbufs(txq); - qdev->ops->common->chain_free(edev, &txq->tx_pbl); - rte_free(txq->sw_tx_ring); - rte_free(txq); + + if (ECORE_IS_CMT(edev)) { + fp_cmt = tx_queue; + _qede_tx_queue_release(qdev, edev, fp_cmt->fp0->txq); + _qede_tx_queue_release(qdev, edev, fp_cmt->fp1->txq); + } else { + _qede_tx_queue_release(qdev, edev, txq); + } } } @@ -494,6 +597,7 @@ struct qede_fastpath *fp; uint32_t num_sbs; uint16_t sb_idx; + int i; if (IS_VF(edev)) ecore_vf_get_num_sbs(ECORE_LEADING_HWFN(edev), &num_sbs); @@ -517,6 +621,28 @@ memset((void *)qdev->fp_array, 0, QEDE_RXTX_MAX(qdev) * sizeof(*qdev->fp_array)); + if (ECORE_IS_CMT(edev)) { + qdev->fp_array_cmt = rte_calloc("fp_cmt", + QEDE_RXTX_MAX(qdev) / 2, + sizeof(*qdev->fp_array_cmt), + RTE_CACHE_LINE_SIZE); + + if (!qdev->fp_array_cmt) { + DP_ERR(edev, "fp array for CMT allocation failed\n"); + return -ENOMEM; + } + + memset((void *)qdev->fp_array_cmt, 0, + (QEDE_RXTX_MAX(qdev) / 2) * sizeof(*qdev->fp_array_cmt)); + + /* Establish the mapping of fp_array with fp_array_cmt */ + for (i = 0; i < QEDE_RXTX_MAX(qdev) / 2; i++) { + qdev->fp_array_cmt[i].qdev = qdev; + qdev->fp_array_cmt[i].fp0 = &qdev->fp_array[i * 2]; + qdev->fp_array_cmt[i].fp1 = &qdev->fp_array[i * 2 + 1]; + } + } + for (sb_idx = 0; sb_idx < QEDE_RXTX_MAX(qdev); sb_idx++) { fp = &qdev->fp_array[sb_idx]; if (!fp) @@ -581,6 +707,10 @@ if (qdev->fp_array) rte_free(qdev->fp_array); qdev->fp_array = NULL; + + if (qdev->fp_array_cmt) + rte_free(qdev->fp_array_cmt); + qdev->fp_array_cmt = NULL; } static inline void @@ -632,9 +762,9 @@ int hwfn_index; int rc; - if (rx_queue_id < eth_dev->data->nb_rx_queues) { + if (rx_queue_id < qdev->num_rx_queues) { fp = &qdev->fp_array[rx_queue_id]; - rxq = eth_dev->data->rx_queues[rx_queue_id]; + rxq = fp->rxq; /* Allocate buffers for the Rx ring */ for (j = 0; j < rxq->nb_rx_desc; j++) { rc = qede_alloc_rx_buffer(rxq); @@ -703,9 +833,9 @@ int hwfn_index; int rc; - if (tx_queue_id < eth_dev->data->nb_tx_queues) { - txq = eth_dev->data->tx_queues[tx_queue_id]; + if (tx_queue_id < qdev->num_tx_queues) { fp = &qdev->fp_array[tx_queue_id]; + txq = fp->txq; memset(¶ms, 0, sizeof(params)); params.queue_id = tx_queue_id / edev->num_hwfns; params.vport_id = 0; @@ -846,8 +976,8 @@ int hwfn_index; int rc; - if (tx_queue_id < eth_dev->data->nb_tx_queues) { - txq = eth_dev->data->tx_queues[tx_queue_id]; + if (tx_queue_id < qdev->num_tx_queues) { + txq = qdev->fp_array[tx_queue_id].txq; /* Drain txq */ if (qede_drain_txq(qdev, txq, true)) return -1; /* For the lack of retcodes */ @@ -878,13 +1008,13 @@ uint8_t id; int rc = -1; - for_each_rss(id) { + for (id = 0; id < qdev->num_rx_queues; id++) { rc = qede_rx_queue_start(eth_dev, id); if (rc != ECORE_SUCCESS) return -1; } - for_each_tss(id) { + for (id = 0; id < qdev->num_tx_queues; id++) { rc = qede_tx_queue_start(eth_dev, id); if (rc != ECORE_SUCCESS) return -1; @@ -899,13 +1029,11 @@ uint8_t id; /* Stopping RX/TX queues */ - for_each_tss(id) { + for (id = 0; id < qdev->num_tx_queues; id++) qede_tx_queue_stop(eth_dev, id); - } - for_each_rss(id) { + for (id = 0; id < qdev->num_rx_queues; id++) qede_rx_queue_stop(eth_dev, id); - } } static inline bool qede_tunn_exist(uint16_t flag) @@ -1685,6 +1813,23 @@ return rx_pkt; } +uint16_t +qede_recv_pkts_cmt(void *p_fp_cmt, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) +{ + struct qede_fastpath_cmt *fp_cmt = p_fp_cmt; + uint16_t eng0_pkts, eng1_pkts; + + eng0_pkts = nb_pkts / 2; + + eng0_pkts = qede_recv_pkts(fp_cmt->fp0->rxq, rx_pkts, eng0_pkts); + + eng1_pkts = nb_pkts - eng0_pkts; + + eng1_pkts = qede_recv_pkts(fp_cmt->fp1->rxq, rx_pkts + eng0_pkts, + eng1_pkts); + + return eng0_pkts + eng1_pkts; +} /* Populate scatter gather buffer descriptor fields */ static inline uint16_t @@ -2208,6 +2353,24 @@ } uint16_t +qede_xmit_pkts_cmt(void *p_fp_cmt, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) +{ + struct qede_fastpath_cmt *fp_cmt = p_fp_cmt; + uint16_t eng0_pkts, eng1_pkts; + + eng0_pkts = nb_pkts / 2; + + eng0_pkts = qede_xmit_pkts(fp_cmt->fp0->txq, tx_pkts, eng0_pkts); + + eng1_pkts = nb_pkts - eng0_pkts; + + eng1_pkts = qede_xmit_pkts(fp_cmt->fp1->txq, tx_pkts + eng0_pkts, + eng1_pkts); + + return eng0_pkts + eng1_pkts; +} + +uint16_t qede_rxtx_pkts_dummy(__rte_unused void *p_rxq, __rte_unused struct rte_mbuf **pkts, __rte_unused uint16_t nb_pkts) diff -Nru dpdk-18.11.5/drivers/net/qede/qede_rxtx.h dpdk-18.11.6/drivers/net/qede/qede_rxtx.h --- dpdk-18.11.5/drivers/net/qede/qede_rxtx.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/qede/qede_rxtx.h 2020-01-31 09:55:30.000000000 +0000 @@ -81,10 +81,8 @@ ETH_RSS_VXLAN |\ ETH_RSS_GENEVE) -#define for_each_rss(i) for (i = 0; i < qdev->num_rx_queues; i++) -#define for_each_tss(i) for (i = 0; i < qdev->num_tx_queues; i++) #define QEDE_RXTX_MAX(qdev) \ - (RTE_MAX(QEDE_RSS_COUNT(qdev), QEDE_TSS_COUNT(qdev))) + (RTE_MAX(qdev->num_rx_queues, qdev->num_tx_queues)) /* Macros for non-tunnel packet types lkup table */ #define QEDE_PKT_TYPE_UNKNOWN 0x0 @@ -179,6 +177,8 @@ * Structure associated with each RX queue. */ struct qede_rx_queue { + /* Always keep qdev as first member */ + struct qede_dev *qdev; struct rte_mempool *mb_pool; struct ecore_chain rx_bd_ring; struct ecore_chain rx_comp_ring; @@ -199,7 +199,6 @@ uint64_t rx_hw_errors; uint64_t rx_alloc_errors; struct qede_agg_info tpa_info[ETH_TPA_MAX_AGGS_NUM]; - struct qede_dev *qdev; void *handle; }; @@ -217,6 +216,8 @@ }; struct qede_tx_queue { + /* Always keep qdev as first member */ + struct qede_dev *qdev; struct ecore_chain tx_pbl; struct qede_tx_entry *sw_tx_ring; uint16_t nb_tx_desc; @@ -231,7 +232,6 @@ uint16_t port_id; uint64_t xmit_pkts; bool is_legacy; - struct qede_dev *qdev; void *handle; }; @@ -241,6 +241,18 @@ struct qede_tx_queue *txq; }; +/* This structure holds the inforation of fast path queues + * belonging to individual engines in CMT mode. + */ +struct qede_fastpath_cmt { + /* Always keep this a first element */ + struct qede_dev *qdev; + /* fastpath info of engine 0 */ + struct qede_fastpath *fp0; + /* fastpath info of engine 1 */ + struct qede_fastpath *fp1; +}; + /* * RX/TX function prototypes */ @@ -261,12 +273,16 @@ uint16_t qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t qede_xmit_pkts_cmt(void *p_txq, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); uint16_t qede_xmit_prep_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); uint16_t qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); +uint16_t qede_recv_pkts_cmt(void *p_rxq, struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); uint16_t qede_rxtx_pkts_dummy(void *p_rxq, struct rte_mbuf **pkts, diff -Nru dpdk-18.11.5/drivers/net/sfc/sfc_ev.c dpdk-18.11.6/drivers/net/sfc/sfc_ev.c --- dpdk-18.11.5/drivers/net/sfc/sfc_ev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/sfc/sfc_ev.c 2020-01-31 09:55:30.000000000 +0000 @@ -414,7 +414,7 @@ struct rte_eth_link new_link; sfc_port_link_mode_to_info(link_mode, &new_link); - if (rte_eth_linkstatus_set(sa->eth_dev, &new_link)) + if (rte_eth_linkstatus_set(sa->eth_dev, &new_link) == 0) evq->sa->port.lsc_seq++; return B_FALSE; diff -Nru dpdk-18.11.5/drivers/net/sfc/sfc_flow.c dpdk-18.11.6/drivers/net/sfc/sfc_flow.c --- dpdk-18.11.5/drivers/net/sfc/sfc_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/sfc/sfc_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -2314,10 +2314,10 @@ if (rc != 0) goto fail_bad_value; - TAILQ_INSERT_TAIL(&sa->filter.flow_list, flow, entries); - sfc_adapter_lock(sa); + TAILQ_INSERT_TAIL(&sa->filter.flow_list, flow, entries); + if (sa->state == SFC_ADAPTER_STARTED) { rc = sfc_flow_filter_insert(sa, flow); if (rc != 0) { diff -Nru dpdk-18.11.5/drivers/net/szedata2/meson.build dpdk-18.11.6/drivers/net/szedata2/meson.build --- dpdk-18.11.5/drivers/net/szedata2/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/szedata2/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation -dep = cc.find_library('sze2', required: false) +dep = dependency('libsze2', required: false) build = dep.found() ext_deps += dep sources = files('rte_eth_szedata2.c') diff -Nru dpdk-18.11.5/drivers/net/tap/rte_eth_tap.c dpdk-18.11.6/drivers/net/tap/rte_eth_tap.c --- dpdk-18.11.5/drivers/net/tap/rte_eth_tap.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/tap/rte_eth_tap.c 2020-01-31 09:55:30.000000000 +0000 @@ -355,10 +355,8 @@ if (trigger == rxq->trigger_seen) return 0; - if (trigger) - rxq->trigger_seen = trigger; + process_private = rte_eth_devices[rxq->in_port].process_private; - rte_compiler_barrier(); for (num_rx = 0; num_rx < nb_pkts; ) { struct rte_mbuf *mbuf = rxq->pool; struct rte_mbuf *seg = NULL; @@ -435,6 +433,9 @@ rxq->stats.ipackets += num_rx; rxq->stats.ibytes += num_rx_bytes; + if (trigger && num_rx < nb_pkts) + rxq->trigger_seen = trigger; + return num_rx; } diff -Nru dpdk-18.11.5/drivers/net/vhost/rte_eth_vhost.c dpdk-18.11.6/drivers/net/vhost/rte_eth_vhost.c --- dpdk-18.11.5/drivers/net/vhost/rte_eth_vhost.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/vhost/rte_eth_vhost.c 2020-01-31 09:55:30.000000000 +0000 @@ -851,6 +851,10 @@ /* won't be NULL */ state = vring_states[eth_dev->data->port_id]; rte_spinlock_lock(&state->lock); + if (state->cur[vring] == enable) { + rte_spinlock_unlock(&state->lock); + return 0; + } state->cur[vring] = enable; state->max_vring = RTE_MAX(vring, state->max_vring); rte_spinlock_unlock(&state->lock); diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_ethdev.c dpdk-18.11.6/drivers/net/virtio/virtio_ethdev.c --- dpdk-18.11.5/drivers/net/virtio/virtio_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -1866,6 +1866,20 @@ PMD_INIT_LOG(DEBUG, "configure"); req_features = VIRTIO_PMD_DEFAULT_GUEST_FEATURES; + if (rxmode->mq_mode != ETH_MQ_RX_NONE) { + PMD_DRV_LOG(ERR, + "Unsupported Rx multi queue mode %d", + rxmode->mq_mode); + return -EINVAL; + } + + if (txmode->mq_mode != ETH_MQ_TX_NONE) { + PMD_DRV_LOG(ERR, + "Unsupported Tx multi queue mode %d", + txmode->mq_mode); + return -EINVAL; + } + if (dev->data->dev_conf.intr_conf.rxq) { ret = virtio_init_device(dev, hw->req_guest_features); if (ret < 0) diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_ethdev.h dpdk-18.11.6/drivers/net/virtio/virtio_ethdev.h --- dpdk-18.11.5/drivers/net/virtio/virtio_ethdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_ethdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -94,9 +94,6 @@ uint16_t virtio_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts); -uint16_t virtio_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts, - uint16_t nb_pkts); - int eth_virtio_dev_init(struct rte_eth_dev *eth_dev); void virtio_interrupt_handler(void *param); diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_rxtx.c dpdk-18.11.6/drivers/net/virtio/virtio_rxtx.c --- dpdk-18.11.5/drivers/net/virtio/virtio_rxtx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_rxtx.c 2020-01-31 09:55:30.000000000 +0000 @@ -555,7 +555,7 @@ uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id __rte_unused, - const struct rte_eth_rxconf *rx_conf __rte_unused, + const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp) { uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX; @@ -565,6 +565,11 @@ PMD_INIT_FUNC_TRACE(); + if (rx_conf->rx_deferred_start) { + PMD_INIT_LOG(ERR, "Rx deferred start is not supported"); + return -EINVAL; + } + if (nb_desc == 0 || nb_desc > vq->vq_nentries) nb_desc = vq->vq_nentries; vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc); @@ -682,6 +687,11 @@ PMD_INIT_FUNC_TRACE(); + if (tx_conf->tx_deferred_start) { + PMD_INIT_LOG(ERR, "Tx deferred start is not supported"); + return -EINVAL; + } + if (nb_desc == 0 || nb_desc > vq->vq_nentries) nb_desc = vq->vq_nentries; vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc); @@ -755,7 +765,7 @@ } } -static void +void virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) { uint32_t s = mbuf->pkt_len; diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_rxtx.h dpdk-18.11.6/drivers/net/virtio/virtio_rxtx.h --- dpdk-18.11.5/drivers/net/virtio/virtio_rxtx.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_rxtx.h 2020-01-31 09:55:30.000000000 +0000 @@ -59,5 +59,7 @@ }; int virtio_rxq_vec_setup(struct virtnet_rx *rxvq); +void virtio_update_packet_stats(struct virtnet_stats *stats, + struct rte_mbuf *mbuf); #endif /* _VIRTIO_RXTX_H_ */ diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_rxtx_simple_neon.c dpdk-18.11.6/drivers/net/virtio/virtio_rxtx_simple_neon.c --- dpdk-18.11.5/drivers/net/virtio/virtio_rxtx_simple_neon.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_rxtx_simple_neon.c 2020-01-31 09:55:30.000000000 +0000 @@ -42,11 +42,12 @@ struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; - uint16_t nb_used; + uint16_t nb_used, nb_total; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; struct rte_mbuf **sw_ring_end; + struct rte_mbuf **ref_rx_pkts; uint16_t nb_pkts_received = 0; uint8x16_t shuf_msk1 = { @@ -105,8 +106,10 @@ virtqueue_notify(vq); } + nb_total = nb_used; + ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { uint64x2_t desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; uint64x2_t mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; uint64x2_t pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; @@ -204,5 +207,8 @@ vq->vq_used_cons_idx += nb_pkts_received; vq->vq_free_cnt += nb_pkts_received; rxvq->stats.packets += nb_pkts_received; + for (nb_used = 0; nb_used < nb_pkts_received; nb_used++) + virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); + return nb_pkts_received; } diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_rxtx_simple_sse.c dpdk-18.11.6/drivers/net/virtio/virtio_rxtx_simple_sse.c --- dpdk-18.11.5/drivers/net/virtio/virtio_rxtx_simple_sse.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_rxtx_simple_sse.c 2020-01-31 09:55:30.000000000 +0000 @@ -43,11 +43,12 @@ struct virtnet_rx *rxvq = rx_queue; struct virtqueue *vq = rxvq->vq; struct virtio_hw *hw = vq->hw; - uint16_t nb_used; + uint16_t nb_used, nb_total; uint16_t desc_idx; struct vring_used_elem *rused; struct rte_mbuf **sw_ring; struct rte_mbuf **sw_ring_end; + struct rte_mbuf **ref_rx_pkts; uint16_t nb_pkts_received = 0; __m128i shuf_msk1, shuf_msk2, len_adjust; @@ -107,8 +108,10 @@ virtqueue_notify(vq); } + nb_total = nb_used; + ref_rx_pkts = rx_pkts; for (nb_pkts_received = 0; - nb_pkts_received < nb_used;) { + nb_pkts_received < nb_total;) { __m128i desc[RTE_VIRTIO_DESC_PER_LOOP / 2]; __m128i mbp[RTE_VIRTIO_DESC_PER_LOOP / 2]; __m128i pkt_mb[RTE_VIRTIO_DESC_PER_LOOP]; @@ -190,5 +193,8 @@ vq->vq_used_cons_idx += nb_pkts_received; vq->vq_free_cnt += nb_pkts_received; rxvq->stats.packets += nb_pkts_received; + for (nb_used = 0; nb_used < nb_pkts_received; nb_used++) + virtio_update_packet_stats(&rxvq->stats, ref_rx_pkts[nb_used]); + return nb_pkts_received; } diff -Nru dpdk-18.11.5/drivers/net/virtio/virtio_user/virtio_user_dev.c dpdk-18.11.6/drivers/net/virtio/virtio_user/virtio_user_dev.c --- dpdk-18.11.5/drivers/net/virtio/virtio_user/virtio_user_dev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/virtio/virtio_user/virtio_user_dev.c 2020-01-31 09:55:30.000000000 +0000 @@ -306,9 +306,9 @@ static void virtio_user_mem_event_cb(enum rte_mem_event type __rte_unused, - const void *addr __rte_unused, - size_t len __rte_unused, - void *arg) + const void *addr, + size_t len __rte_unused, + void *arg) { struct virtio_user_dev *dev = arg; struct rte_memseg_list *msl; @@ -600,6 +600,10 @@ queues = *(uint16_t *)(uintptr_t)vring->desc[idx_data].addr; status = virtio_user_handle_mq(dev, queues); + } else if (hdr->class == VIRTIO_NET_CTRL_RX || + hdr->class == VIRTIO_NET_CTRL_MAC || + hdr->class == VIRTIO_NET_CTRL_VLAN) { + status = 0; } /* Update status */ diff -Nru dpdk-18.11.5/drivers/net/vmxnet3/vmxnet3_ethdev.c dpdk-18.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.c --- dpdk-18.11.5/drivers/net/vmxnet3/vmxnet3_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/net/vmxnet3/vmxnet3_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -44,7 +44,6 @@ #define VMXNET3_TX_OFFLOAD_CAP \ (DEV_TX_OFFLOAD_VLAN_INSERT | \ - DEV_TX_OFFLOAD_IPV4_CKSUM | \ DEV_TX_OFFLOAD_TCP_CKSUM | \ DEV_TX_OFFLOAD_UDP_CKSUM | \ DEV_TX_OFFLOAD_TCP_TSO | \ @@ -54,7 +53,6 @@ (DEV_RX_OFFLOAD_VLAN_STRIP | \ DEV_RX_OFFLOAD_VLAN_FILTER | \ DEV_RX_OFFLOAD_SCATTER | \ - DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_TCP_CKSUM | \ DEV_RX_OFFLOAD_TCP_LRO | \ diff -Nru dpdk-18.11.5/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c dpdk-18.11.6/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c --- dpdk-18.11.5/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c 2020-01-31 09:55:30.000000000 +0000 @@ -62,6 +62,7 @@ struct qbman_fd fd; struct qbman_eq_desc eqdesc; struct qbman_swp *swp; + uint32_t retry_count = 0; int ret; DPAA2_CMDIF_FUNC_TRACE(); @@ -102,11 +103,15 @@ ret = qbman_swp_enqueue_multiple(swp, &eqdesc, &fd, NULL, 1); if (ret < 0 && ret != -EBUSY) DPAA2_CMDIF_ERR("Transmit failure with err: %d\n", ret); - } while (ret == -EBUSY); + retry_count++; + } while ((ret == -EBUSY) && (retry_count < DPAA2_MAX_TX_RETRY_COUNT)); + + if (ret < 0) + return ret; DPAA2_CMDIF_DP_DEBUG("Successfully transmitted a packet\n"); - return 0; + return 1; } static int diff -Nru dpdk-18.11.5/examples/bbdev_app/Makefile dpdk-18.11.6/examples/bbdev_app/Makefile --- dpdk-18.11.5/examples/bbdev_app/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/bbdev_app/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/bond/Makefile dpdk-18.11.6/examples/bond/Makefile --- dpdk-18.11.5/examples/bond/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/bond/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -19,10 +19,12 @@ LDFLAGS += -lrte_pmd_bond -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/cmdline/Makefile dpdk-18.11.6/examples/cmdline/Makefile --- dpdk-18.11.5/examples/cmdline/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/cmdline/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/distributor/Makefile dpdk-18.11.6/examples/distributor/Makefile --- dpdk-18.11.5/examples/distributor/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/distributor/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/ethtool/lib/rte_ethtool.c dpdk-18.11.6/examples/ethtool/lib/rte_ethtool.c --- dpdk-18.11.5/examples/ethtool/lib/rte_ethtool.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ethtool/lib/rte_ethtool.c 2020-01-31 09:55:30.000000000 +0000 @@ -40,7 +40,6 @@ printf("Insufficient fw version buffer size, " "the minimum size should be %d\n", ret); - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); snprintf(drvinfo->driver, sizeof(drvinfo->driver), "%s", @@ -372,7 +371,6 @@ struct rte_eth_dev_info dev_info; uint16_t vf; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); num_vfs = dev_info.max_vfs; diff -Nru dpdk-18.11.5/examples/eventdev_pipeline/Makefile dpdk-18.11.6/examples/eventdev_pipeline/Makefile --- dpdk-18.11.5/examples/eventdev_pipeline/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/eventdev_pipeline/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -19,10 +19,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/exception_path/Makefile dpdk-18.11.6/examples/exception_path/Makefile --- dpdk-18.11.5/examples/exception_path/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/exception_path/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/fips_validation/Makefile dpdk-18.11.6/examples/fips_validation/Makefile --- dpdk-18.11.5/examples/fips_validation/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/fips_validation/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -24,10 +24,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/fips_validation/fips_validation_tdes.c dpdk-18.11.6/examples/fips_validation/fips_validation_tdes.c --- dpdk-18.11.5/examples/fips_validation/fips_validation_tdes.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/fips_validation/fips_validation_tdes.c 2020-01-31 09:55:30.000000000 +0000 @@ -212,6 +212,8 @@ tmp_val.val = val->val + 8; else if (strstr(key, KEY3_STR)) tmp_val.val = val->val + 16; + else + return -EINVAL; return writeback_hex_str(key, dst, &tmp_val); } diff -Nru dpdk-18.11.5/examples/fips_validation/main.c dpdk-18.11.6/examples/fips_validation/main.c --- dpdk-18.11.5/examples/fips_validation/main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/fips_validation/main.c 2020-01-31 09:55:30.000000000 +0000 @@ -404,6 +404,7 @@ prepare_auth_op(void) { struct rte_crypto_sym_op *sym = env.op->sym; + uint8_t *pt; __rte_crypto_op_reset(env.op, RTE_CRYPTO_OP_TYPE_SYMMETRIC); rte_pktmbuf_reset(env.mbuf); @@ -411,52 +412,25 @@ sym->m_src = env.mbuf; sym->auth.data.offset = 0; - if (info.op == FIPS_TEST_ENC_AUTH_GEN) { - uint8_t *pt; + pt = (uint8_t *)rte_pktmbuf_append(env.mbuf, vec.pt.len + + vec.cipher_auth.digest.len); - if (vec.pt.len > RTE_MBUF_MAX_NB_SEGS) { - RTE_LOG(ERR, USER1, "PT len %u\n", vec.pt.len); - return -EPERM; - } + if (!pt) { + RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", + -ENOMEM); + return -ENOMEM; + } - pt = (uint8_t *)rte_pktmbuf_append(env.mbuf, vec.pt.len + - vec.cipher_auth.digest.len); + sym->auth.data.length = vec.pt.len; + sym->auth.digest.data = pt + vec.pt.len; + sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset( + env.mbuf, vec.pt.len); - if (!pt) { - RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", - -ENOMEM); - return -ENOMEM; - } - - memcpy(pt, vec.pt.val, vec.pt.len); - sym->auth.data.length = vec.pt.len; - sym->auth.digest.data = pt + vec.pt.len; - sym->auth.digest.phys_addr = rte_pktmbuf_mtophys_offset( - env.mbuf, vec.pt.len); - - } else { - uint8_t *ct; - - if (vec.ct.len > RTE_MBUF_MAX_NB_SEGS) { - RTE_LOG(ERR, USER1, "CT len %u\n", vec.ct.len); - return -EPERM; - } - - ct = (uint8_t *)rte_pktmbuf_append(env.mbuf, - vec.ct.len + vec.cipher_auth.digest.len); - - if (!ct) { - RTE_LOG(ERR, USER1, "Error %i: MBUF too small\n", - -ENOMEM); - return -ENOMEM; - } - - memcpy(ct, vec.ct.val, vec.ct.len); - sym->auth.data.length = vec.ct.len; - sym->auth.digest.data = vec.cipher_auth.digest.val; - sym->auth.digest.phys_addr = rte_malloc_virt2iova( - sym->auth.digest.data); - } + memcpy(pt, vec.pt.val, vec.pt.len); + + if (info.op == FIPS_TEST_DEC_AUTH_VERIF) + memcpy(pt + vec.pt.len, vec.cipher_auth.digest.val, + vec.cipher_auth.digest.len); rte_crypto_op_attach_sym_session(env.op, env.sess); diff -Nru dpdk-18.11.5/examples/flow_classify/Makefile dpdk-18.11.6/examples/flow_classify/Makefile --- dpdk-18.11.5/examples/flow_classify/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/flow_classify/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/flow_filtering/Makefile dpdk-18.11.6/examples/flow_filtering/Makefile --- dpdk-18.11.5/examples/flow_filtering/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/flow_filtering/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -15,10 +15,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/helloworld/Makefile dpdk-18.11.6/examples/helloworld/Makefile --- dpdk-18.11.5/examples/helloworld/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/helloworld/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/ip_fragmentation/Makefile dpdk-18.11.6/examples/ip_fragmentation/Makefile --- dpdk-18.11.5/examples/ip_fragmentation/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ip_fragmentation/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -18,10 +18,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/ip_pipeline/Makefile dpdk-18.11.6/examples/ip_pipeline/Makefile --- dpdk-18.11.5/examples/ip_pipeline/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ip_pipeline/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -30,10 +30,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -I. diff -Nru dpdk-18.11.5/examples/ip_reassembly/Makefile dpdk-18.11.6/examples/ip_reassembly/Makefile --- dpdk-18.11.5/examples/ip_reassembly/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ip_reassembly/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -18,10 +18,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/ipsec-secgw/Makefile dpdk-18.11.6/examples/ipsec-secgw/Makefile --- dpdk-18.11.5/examples/ipsec-secgw/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -27,10 +27,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/ipsec-secgw/ep0.cfg dpdk-18.11.6/examples/ipsec-secgw/ep0.cfg --- dpdk-18.11.5/examples/ipsec-secgw/ep0.cfg 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/ep0.cfg 2020-01-31 09:55:30.000000000 +0000 @@ -49,14 +49,14 @@ sp ipv6 out esp protect 26 pri 1 dst 0000:0000:0000:0000:bbbb:bbbb:0000:0000/96 \ sport 0:65535 dport 0:65535 -sp ipv6 in esp protect 15 pri 1 dst ffff:0000:0000:0000:5555:5555:0000:0000/96 \ -sport 0:65535 dport 0:65535 -sp ipv6 in esp protect 16 pri 1 dst ffff:0000:0000:0000:6666:6666:0000:0000/96 \ -sport 0:65535 dport 0:65535 sp ipv6 in esp protect 110 pri 1 dst ffff:0000:1111:1111:0000:0000:0000:0000/96 \ sport 0:65535 dport 0:65535 sp ipv6 in esp protect 111 pri 1 dst ffff:0000:1111:1111:1111:1111:0000:0000/96 \ sport 0:65535 dport 0:65535 +sp ipv6 in esp protect 115 pri 1 dst ffff:0000:0000:0000:5555:5555:0000:0000/96 \ +sport 0:65535 dport 0:65535 +sp ipv6 in esp protect 116 pri 1 dst ffff:0000:0000:0000:6666:6666:0000:0000/96 \ +sport 0:65535 dport 0:65535 sp ipv6 in esp protect 125 pri 1 dst ffff:0000:0000:0000:aaaa:aaaa:0000:0000/96 \ sport 0:65535 dport 0:65535 sp ipv6 in esp protect 126 pri 1 dst ffff:0000:0000:0000:bbbb:bbbb:0000:0000/96 \ diff -Nru dpdk-18.11.5/examples/ipsec-secgw/ep1.cfg dpdk-18.11.6/examples/ipsec-secgw/ep1.cfg --- dpdk-18.11.5/examples/ipsec-secgw/ep1.cfg 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/ep1.cfg 2020-01-31 09:55:30.000000000 +0000 @@ -19,8 +19,8 @@ sp ipv4 in esp protect 16 pri 1 dst 192.168.201.0/24 sport 0:65535 dport 0:65535 sp ipv4 in esp protect 25 pri 1 dst 192.168.55.0/24 sport 0:65535 dport 0:65535 sp ipv4 in esp protect 26 pri 1 dst 192.168.56.0/24 sport 0:65535 dport 0:65535 -sp ipv4 in esp bypass dst 192.168.240.0/24 sport 0:65535 dport 0:65535 -sp ipv4 in esp bypass dst 192.168.241.0/24 sport 0:65535 dport 0:65535 +sp ipv4 in esp bypass pri 1 dst 192.168.240.0/24 sport 0:65535 dport 0:65535 +sp ipv4 in esp bypass pri 1 dst 192.168.241.0/24 sport 0:65535 dport 0:65535 sp ipv4 out esp protect 105 pri 1 dst 192.168.115.0/24 sport 0:65535 dport 0:65535 sp ipv4 out esp protect 106 pri 1 dst 192.168.116.0/24 sport 0:65535 dport 0:65535 @@ -49,14 +49,14 @@ sp ipv6 in esp protect 26 pri 1 dst 0000:0000:0000:0000:bbbb:bbbb:0000:0000/96 \ sport 0:65535 dport 0:65535 -sp ipv6 out esp protect 15 pri 1 dst ffff:0000:0000:0000:5555:5555:0000:0000/96 \ -sport 0:65535 dport 0:65535 -sp ipv6 out esp protect 16 pri 1 dst ffff:0000:0000:0000:6666:6666:0000:0000/96 \ -sport 0:65535 dport 0:65535 sp ipv6 out esp protect 110 pri 1 dst ffff:0000:1111:1111:0000:0000:0000:0000/96 \ sport 0:65535 dport 0:65535 sp ipv6 out esp protect 111 pri 1 dst ffff:0000:1111:1111:1111:1111:0000:0000/96 \ sport 0:65535 dport 0:65535 +sp ipv6 out esp protect 115 pri 1 dst ffff:0000:0000:0000:5555:5555:0000:0000/96 \ +sport 0:65535 dport 0:65535 +sp ipv6 out esp protect 116 pri 1 dst ffff:0000:0000:0000:6666:6666:0000:0000/96 \ +sport 0:65535 dport 0:65535 sp ipv6 out esp protect 125 pri 1 dst ffff:0000:0000:0000:aaaa:aaaa:0000:0000/96 \ sport 0:65535 dport 0:65535 sp ipv6 out esp protect 126 pri 1 dst ffff:0000:0000:0000:bbbb:bbbb:0000:0000/96 \ diff -Nru dpdk-18.11.5/examples/ipsec-secgw/ipsec-secgw.c dpdk-18.11.6/examples/ipsec-secgw/ipsec-secgw.c --- dpdk-18.11.5/examples/ipsec-secgw/ipsec-secgw.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/ipsec-secgw.c 2020-01-31 09:55:30.000000000 +0000 @@ -258,6 +258,7 @@ RTE_LOG(ERR, IPSEC, "Unsupported packet type 0x%x\n", rte_be_to_cpu_16(eth->ether_type)); rte_pktmbuf_free(pkt); + return; } /* Check if the packet has been processed inline. For inline protocol diff -Nru dpdk-18.11.5/examples/ipsec-secgw/ipsec.c dpdk-18.11.6/examples/ipsec-secgw/ipsec.c --- dpdk-18.11.5/examples/ipsec-secgw/ipsec.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/ipsec.c 2020-01-31 09:55:30.000000000 +0000 @@ -200,8 +200,14 @@ /* Try RSS. */ sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS; sa->action[1].conf = &action_rss; - rte_eth_dev_rss_hash_conf_get(sa->portid, + ret = rte_eth_dev_rss_hash_conf_get(sa->portid, &rss_conf); + if (ret != 0) { + RTE_LOG(ERR, IPSEC, + "rte_eth_dev_rss_hash_conf_get:ret=%d\n", + ret); + return -1; + } for (i = 0, j = 0; i < dev_info.nb_rx_queues; ++i) queue[j++] = i; diff -Nru dpdk-18.11.5/examples/ipsec-secgw/sa.c dpdk-18.11.6/examples/ipsec-secgw/sa.c --- dpdk-18.11.5/examples/ipsec-secgw/sa.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipsec-secgw/sa.c 2020-01-31 09:55:30.000000000 +0000 @@ -112,7 +112,7 @@ { .keyword = "sha256-hmac", .algo = RTE_CRYPTO_AUTH_SHA256_HMAC, - .digest_len = 12, + .digest_len = 16, .key_len = 32 } }; @@ -911,7 +911,7 @@ } if (sa->aead_algo == RTE_CRYPTO_AEAD_AES_GCM) { - iv_length = 16; + iv_length = 12; sa_ctx->xf[idx].a.type = RTE_CRYPTO_SYM_XFORM_AEAD; sa_ctx->xf[idx].a.aead.algo = sa->aead_algo; diff -Nru dpdk-18.11.5/examples/ipv4_multicast/Makefile dpdk-18.11.6/examples/ipv4_multicast/Makefile --- dpdk-18.11.5/examples/ipv4_multicast/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ipv4_multicast/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -18,10 +18,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/kni/Makefile dpdk-18.11.6/examples/kni/Makefile --- dpdk-18.11.5/examples/kni/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/kni/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,11 +17,13 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/kni/main.c dpdk-18.11.6/examples/kni/main.c --- dpdk-18.11.5/examples/kni/main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/kni/main.c 2020-01-31 09:55:30.000000000 +0000 @@ -900,7 +900,6 @@ const struct rte_pci_device *pci_dev; const struct rte_bus *bus = NULL; - memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.device) diff -Nru dpdk-18.11.5/examples/l2fwd/Makefile dpdk-18.11.6/examples/l2fwd/Makefile --- dpdk-18.11.5/examples/l2fwd/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l2fwd/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l2fwd-cat/Makefile dpdk-18.11.6/examples/l2fwd-cat/Makefile --- dpdk-18.11.5/examples/l2fwd-cat/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l2fwd-cat/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) LDFLAGS += -lpqos diff -Nru dpdk-18.11.5/examples/l2fwd-crypto/Makefile dpdk-18.11.6/examples/l2fwd-crypto/Makefile --- dpdk-18.11.5/examples/l2fwd-crypto/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l2fwd-crypto/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l2fwd-jobstats/Makefile dpdk-18.11.6/examples/l2fwd-jobstats/Makefile --- dpdk-18.11.5/examples/l2fwd-jobstats/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l2fwd-jobstats/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l2fwd-keepalive/Makefile dpdk-18.11.6/examples/l2fwd-keepalive/Makefile --- dpdk-18.11.5/examples/l2fwd-keepalive/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l2fwd-keepalive/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -19,10 +19,12 @@ LDFLAGS += -pthread -lrt -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l3fwd/Makefile dpdk-18.11.6/examples/l3fwd/Makefile --- dpdk-18.11.5/examples/l3fwd/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l3fwd/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l3fwd-acl/Makefile dpdk-18.11.6/examples/l3fwd-acl/Makefile --- dpdk-18.11.5/examples/l3fwd-acl/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l3fwd-acl/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/l3fwd-power/Makefile dpdk-18.11.6/examples/l3fwd-power/Makefile --- dpdk-18.11.5/examples/l3fwd-power/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l3fwd-power/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/l3fwd-power/main.c dpdk-18.11.6/examples/l3fwd-power/main.c --- dpdk-18.11.5/examples/l3fwd-power/main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l3fwd-power/main.c 2020-01-31 09:55:30.000000000 +0000 @@ -814,7 +814,9 @@ port_id = ((uintptr_t)data) >> CHAR_BIT; queue_id = ((uintptr_t)data) & RTE_LEN2MASK(CHAR_BIT, uint8_t); + rte_spinlock_lock(&(locks[port_id])); rte_eth_dev_rx_intr_disable(port_id, queue_id); + rte_spinlock_unlock(&(locks[port_id])); RTE_LOG(INFO, L3FWD_POWER, "lcore %u is waked up from rx interrupt on" " port %d queue %d\n", diff -Nru dpdk-18.11.5/examples/l3fwd-vf/Makefile dpdk-18.11.6/examples/l3fwd-vf/Makefile --- dpdk-18.11.5/examples/l3fwd-vf/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/l3fwd-vf/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/link_status_interrupt/Makefile dpdk-18.11.6/examples/link_status_interrupt/Makefile --- dpdk-18.11.5/examples/link_status_interrupt/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/link_status_interrupt/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/load_balancer/Makefile dpdk-18.11.6/examples/load_balancer/Makefile --- dpdk-18.11.5/examples/load_balancer/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/load_balancer/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/multi_process/client_server_mp/mp_client/client.c dpdk-18.11.6/examples/multi_process/client_server_mp/mp_client/client.c --- dpdk-18.11.5/examples/multi_process/client_server_mp/mp_client/client.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/multi_process/client_server_mp/mp_client/client.c 2020-01-31 09:55:30.000000000 +0000 @@ -246,19 +246,19 @@ for (;;) { uint16_t i, rx_pkts; - uint16_t port; rx_pkts = rte_ring_dequeue_burst(rx_ring, pkts, PKT_READ_SIZE, NULL); - if (unlikely(rx_pkts == 0)){ - if (need_flush) - for (port = 0; port < ports->num_ports; port++) { - sent = rte_eth_tx_buffer_flush(ports->id[port], client_id, - tx_buffer[port]); - if (unlikely(sent)) - tx_stats->tx[port] += sent; - } + if (rx_pkts == 0 && need_flush) { + for (i = 0; i < ports->num_ports; i++) { + uint16_t port = ports->id[i]; + + sent = rte_eth_tx_buffer_flush(port, + client_id, + tx_buffer[port]); + tx_stats->tx[port] += sent; + } need_flush = 0; continue; } diff -Nru dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/args.c dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/args.c --- dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/args.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/args.c 2020-01-31 09:55:30.000000000 +0000 @@ -10,6 +10,7 @@ #include #include +#include #include #include "common.h" @@ -41,31 +42,34 @@ * array variable */ static int -parse_portmask(uint8_t max_ports, const char *portmask) +parse_portmask(const char *portmask) { char *end = NULL; - unsigned long pm; - uint16_t count = 0; + unsigned long long pm; + uint16_t id; if (portmask == NULL || *portmask == '\0') return -1; /* convert parameter to a number and verify */ - pm = strtoul(portmask, &end, 16); - if (end == NULL || *end != '\0' || pm == 0) + errno = 0; + pm = strtoull(portmask, &end, 16); + if (errno != 0 || end == NULL || *end != '\0') return -1; - /* loop through bits of the mask and mark ports */ - while (pm != 0){ - if (pm & 0x01){ /* bit is set in mask, use port */ - if (count >= max_ports) - printf("WARNING: requested port %u not present" - " - ignoring\n", (unsigned)count); - else - ports->id[ports->num_ports++] = count; - } - pm = (pm >> 1); - count++; + RTE_ETH_FOREACH_DEV(id) { + unsigned long msk = 1u << id; + + if ((pm & msk) == 0) + continue; + + pm &= ~msk; + ports->id[ports->num_ports++] = id; + } + + if (pm != 0) { + printf("WARNING: leftover ports in mask %#llx - ignoring\n", + pm); } return 0; @@ -99,7 +103,7 @@ * on error. */ int -parse_app_args(uint16_t max_ports, int argc, char *argv[]) +parse_app_args(int argc, char *argv[]) { int option_index, opt; char **argvopt = argv; @@ -112,7 +116,7 @@ &option_index)) != EOF){ switch (opt){ case 'p': - if (parse_portmask(max_ports, optarg) != 0){ + if (parse_portmask(optarg) != 0) { usage(); return -1; } diff -Nru dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/args.h dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/args.h --- dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/args.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/args.h 2020-01-31 09:55:30.000000000 +0000 @@ -5,6 +5,6 @@ #ifndef _ARGS_H_ #define _ARGS_H_ -int parse_app_args(uint16_t max_ports, int argc, char *argv[]); +int parse_app_args(int argc, char *argv[]); #endif /* ifndef _ARGS_H_ */ diff -Nru dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/init.c dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/init.c --- dpdk-18.11.5/examples/multi_process/client_server_mp/mp_server/init.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/multi_process/client_server_mp/mp_server/init.c 2020-01-31 09:55:30.000000000 +0000 @@ -238,7 +238,7 @@ { int retval; const struct rte_memzone *mz; - uint16_t i, total_ports; + uint16_t i; /* init EAL, parsing EAL args */ retval = rte_eal_init(argc, argv); @@ -247,9 +247,6 @@ argc -= retval; argv += retval; - /* get total number of ports */ - total_ports = rte_eth_dev_count_total(); - /* set up array for port data */ mz = rte_memzone_reserve(MZ_PORT_INFO, sizeof(*ports), rte_socket_id(), NO_FLAGS); @@ -259,7 +256,7 @@ ports = mz->addr; /* parse additional, application arguments */ - retval = parse_app_args(total_ports, argc, argv); + retval = parse_app_args(argc, argv); if (retval != 0) return -1; diff -Nru dpdk-18.11.5/examples/packet_ordering/Makefile dpdk-18.11.6/examples/packet_ordering/Makefile --- dpdk-18.11.5/examples/packet_ordering/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/packet_ordering/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/ptpclient/Makefile dpdk-18.11.6/examples/ptpclient/Makefile --- dpdk-18.11.5/examples/ptpclient/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/ptpclient/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/qos_meter/Makefile dpdk-18.11.6/examples/qos_meter/Makefile --- dpdk-18.11.5/examples/qos_meter/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/qos_meter/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/qos_sched/Makefile dpdk-18.11.6/examples/qos_sched/Makefile --- dpdk-18.11.5/examples/qos_sched/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/qos_sched/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/rxtx_callbacks/Makefile dpdk-18.11.6/examples/rxtx_callbacks/Makefile --- dpdk-18.11.5/examples/rxtx_callbacks/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/rxtx_callbacks/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/service_cores/Makefile dpdk-18.11.6/examples/service_cores/Makefile --- dpdk-18.11.5/examples/service_cores/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/service_cores/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/skeleton/Makefile dpdk-18.11.6/examples/skeleton/Makefile --- dpdk-18.11.5/examples/skeleton/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/skeleton/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/tep_termination/Makefile dpdk-18.11.6/examples/tep_termination/Makefile --- dpdk-18.11.5/examples/tep_termination/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/tep_termination/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -19,10 +19,12 @@ LDFLAGS += -pthread -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/timer/Makefile dpdk-18.11.6/examples/timer/Makefile --- dpdk-18.11.5/examples/timer/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/timer/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/vhost/Makefile dpdk-18.11.6/examples/vhost/Makefile --- dpdk-18.11.5/examples/vhost/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vhost/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -19,10 +19,12 @@ LDFLAGS += -pthread -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) CFLAGS += -DALLOW_EXPERIMENTAL_API diff -Nru dpdk-18.11.5/examples/vhost_scsi/Makefile dpdk-18.11.6/examples/vhost_scsi/Makefile --- dpdk-18.11.5/examples/vhost_scsi/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vhost_scsi/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -20,10 +20,10 @@ CFLAGS += -D_FILE_OFFSET_BITS=64 LDFLAGS += -pthread -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/vm_power_manager/channel_monitor.c dpdk-18.11.6/examples/vm_power_manager/channel_monitor.c --- dpdk-18.11.5/examples/vm_power_manager/channel_monitor.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vm_power_manager/channel_monitor.c 2020-01-31 09:55:30.000000000 +0000 @@ -27,7 +27,9 @@ #include #include #include +#ifdef RTE_LIBRTE_I40E_PMD #include +#endif #include #include "channel_monitor.h" @@ -407,8 +409,12 @@ for (i = 0; i < pol->pkt.nb_mac_to_monitor; i++) { RTE_ETH_FOREACH_DEV(x) { +#ifdef RTE_LIBRTE_I40E_PMD ret = rte_pmd_i40e_query_vfid_by_mac(x, (struct ether_addr *)&(pol->pkt.vfid[i])); +#else + ret = -ENOTSUP; +#endif if (ret != -EINVAL) { pol->port[i] = x; break; @@ -494,15 +500,21 @@ vsi_pkt_count_prev_total = 0; double rdtsc_curr, rdtsc_diff, diff; int x; +#ifdef RTE_LIBRTE_I40E_PMD struct rte_eth_stats vf_stats; +#endif for (x = 0; x < pol->pkt.nb_mac_to_monitor; x++) { +#ifdef RTE_LIBRTE_I40E_PMD /*Read vsi stats*/ if (rte_pmd_i40e_get_vf_stats(x, pol->pfid[x], &vf_stats) == 0) vsi_pkt_count = vf_stats.ipackets; else vsi_pkt_count = -1; +#else + vsi_pkt_count = -1; +#endif vsi_pkt_total += vsi_pkt_count; diff -Nru dpdk-18.11.5/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c dpdk-18.11.6/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c --- dpdk-18.11.5/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c 2020-01-31 09:55:30.000000000 +0000 @@ -158,7 +158,7 @@ cmdline_parse_token_string_t cmd_set_cpu_freq = TOKEN_STRING_INITIALIZER(struct cmd_set_cpu_freq_result, set_cpu_freq, "set_cpu_freq"); -cmdline_parse_token_string_t cmd_set_cpu_freq_core_num = +cmdline_parse_token_num_t cmd_set_cpu_freq_core_num = TOKEN_NUM_INITIALIZER(struct cmd_set_cpu_freq_result, lcore_id, UINT8); cmdline_parse_token_string_t cmd_set_cpu_freq_cmd_cmd = diff -Nru dpdk-18.11.5/examples/vm_power_manager/oob_monitor_x86.c dpdk-18.11.6/examples/vm_power_manager/oob_monitor_x86.c --- dpdk-18.11.5/examples/vm_power_manager/oob_monitor_x86.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vm_power_manager/oob_monitor_x86.c 2020-01-31 09:55:30.000000000 +0000 @@ -39,6 +39,7 @@ int64_t hits_diff, miss_diff; float ratio; int ret; + int freq_window_idx, up_count = 0, i; g_active = 0; ci = get_core_info(); @@ -101,10 +102,37 @@ ratio = (float)miss_diff * (float)100 / (float)hits_diff; - if (ratio < ci->branch_ratio_threshold) - power_manager_scale_core_min(core); + /* + * Store the last few directions that the ratio indicates + * we should take. If there's on 'up', then we scale up + * quickly. If all indicate 'down', only then do we scale + * down. Each core_details struct has it's own array. + */ + freq_window_idx = ci->cd[core].freq_window_idx; + if (ratio > ci->branch_ratio_threshold) + ci->cd[core].freq_directions[freq_window_idx] = 1; else - power_manager_scale_core_max(core); + ci->cd[core].freq_directions[freq_window_idx] = 0; + + freq_window_idx++; + freq_window_idx = freq_window_idx & (FREQ_WINDOW_SIZE-1); + ci->cd[core].freq_window_idx = freq_window_idx; + + up_count = 0; + for (i = 0; i < FREQ_WINDOW_SIZE; i++) + up_count += ci->cd[core].freq_directions[i]; + + if (up_count == 0) { + if (ci->cd[core].freq_state != FREQ_MIN) { + power_manager_scale_core_min(core); + ci->cd[core].freq_state = FREQ_MIN; + } + } else { + if (ci->cd[core].freq_state != FREQ_MAX) { + power_manager_scale_core_max(core); + ci->cd[core].freq_state = FREQ_MAX; + } + } g_active = 1; return ratio; diff -Nru dpdk-18.11.5/examples/vm_power_manager/power_manager.c dpdk-18.11.6/examples/vm_power_manager/power_manager.c --- dpdk-18.11.5/examples/vm_power_manager/power_manager.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vm_power_manager/power_manager.c 2020-01-31 09:55:30.000000000 +0000 @@ -76,14 +76,13 @@ ci->core_count = get_nprocs_conf(); ci->branch_ratio_threshold = BRANCH_RATIO_THRESHOLD; ci->cd = malloc(ci->core_count * sizeof(struct core_details)); + memset(ci->cd, 0, ci->core_count * sizeof(struct core_details)); if (!ci->cd) { RTE_LOG(ERR, POWER_MANAGER, "Failed to allocate memory for core info."); return -1; } for (i = 0; i < ci->core_count; i++) { ci->cd[i].global_enabled_cpus = 1; - ci->cd[i].oob_enabled = 0; - ci->cd[i].msr_fd = 0; } printf("%d cores in system\n", ci->core_count); return 0; diff -Nru dpdk-18.11.5/examples/vm_power_manager/power_manager.h dpdk-18.11.6/examples/vm_power_manager/power_manager.h --- dpdk-18.11.5/examples/vm_power_manager/power_manager.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vm_power_manager/power_manager.h 2020-01-31 09:55:30.000000000 +0000 @@ -8,12 +8,24 @@ #ifdef __cplusplus extern "C" { #endif + +#define FREQ_WINDOW_SIZE 32 + +enum { + FREQ_UNKNOWN, + FREQ_MIN, + FREQ_MAX +}; + struct core_details { uint64_t last_branches; uint64_t last_branch_misses; uint16_t global_enabled_cpus; uint16_t oob_enabled; int msr_fd; + uint16_t freq_directions[FREQ_WINDOW_SIZE]; + uint16_t freq_window_idx; + uint16_t freq_state; }; struct core_info { diff -Nru dpdk-18.11.5/examples/vmdq/Makefile dpdk-18.11.6/examples/vmdq/Makefile --- dpdk-18.11.5/examples/vmdq/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vmdq/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/examples/vmdq_dcb/Makefile dpdk-18.11.6/examples/vmdq_dcb/Makefile --- dpdk-18.11.5/examples/vmdq_dcb/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/examples/vmdq_dcb/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -17,10 +17,12 @@ static: build/$(APP)-static ln -sf $(APP)-static build/$(APP) -PC_FILE := $(shell pkg-config --path libdpdk) -CFLAGS += -O3 $(shell pkg-config --cflags libdpdk) -LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk) -LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk) +PKGCONF ?= pkg-config + +PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null) +CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk) +LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk) +LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk) build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_82575.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_82575.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_82575.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_82575.c 2020-01-31 09:55:30.000000000 +0000 @@ -1633,7 +1633,7 @@ case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ pcs_autoneg = false; - /* fall through to default case */ + /* fallthrough */ default: if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { @@ -1760,6 +1760,7 @@ break; } /* fall through for I2C based SGMII */ + /* fallthrough */ case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: /* read media type from SFP EEPROM */ ret_val = e1000_set_sfp_media_type_82575(hw); diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_mbx.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_mbx.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_mbx.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_mbx.c 2020-01-31 09:55:30.000000000 +0000 @@ -504,6 +504,7 @@ mbx->stats.reqs = 0; mbx->stats.acks = 0; mbx->stats.rsts = 0; + /* fallthrough */ default: return E1000_SUCCESS; } diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_phy.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_phy.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/e1000_phy.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/e1000_phy.c 2020-01-31 09:55:30.000000000 +0000 @@ -1205,6 +1205,7 @@ phy_data |= M88E1000_PSCR_AUTO_X_1000T; break; } + /* fallthrough */ case 0: default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_ethtool.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_ethtool.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_ethtool.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_ethtool.c 2020-01-31 09:55:30.000000000 +0000 @@ -2564,9 +2564,11 @@ switch (cmd->flow_type) { case TCP_V4_FLOW: cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ case UDP_V4_FLOW: if (adapter->flags & IGB_FLAG_RSS_FIELD_IPV4_UDP) cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ case SCTP_V4_FLOW: case AH_ESP_V4_FLOW: case AH_V4_FLOW: @@ -2576,9 +2578,11 @@ break; case TCP_V6_FLOW: cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ case UDP_V6_FLOW: if (adapter->flags & IGB_FLAG_RSS_FIELD_IPV6_UDP) cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ case SCTP_V6_FLOW: case AH_ESP_V6_FLOW: case AH_V6_FLOW: diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_main.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_main.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_main.c 2020-01-31 09:55:30.000000000 +0000 @@ -1041,6 +1041,7 @@ dev_warn(pci_dev_to_dev(pdev), "Failed to initialize MSI-X interrupts. " "Falling back to MSI interrupts.\n"); igb_reset_interrupt_capability(adapter); + /* fallthrough */ case IGB_INT_MODE_MSI: if (!pci_enable_msi(pdev)) adapter->flags |= IGB_FLAG_HAS_MSI; @@ -4585,6 +4586,7 @@ case e1000_media_type_copper: if (!hw->mac.get_link_status) return true; + /* fallthrough */ case e1000_media_type_internal_serdes: e1000_check_for_link(hw); link_active = !hw->mac.get_link_status; @@ -9561,11 +9563,13 @@ reg |= (E1000_DTXCTL_VLAN_ADDED | E1000_DTXCTL_SPOOF_INT); E1000_WRITE_REG(hw, E1000_DTXCTL, reg); + /* fallthrough */ case e1000_82580: /* enable replication vlan tag stripping */ reg = E1000_READ_REG(hw, E1000_RPLOLR); reg |= E1000_RPLOLR_STRVLAN; E1000_WRITE_REG(hw, E1000_RPLOLR, reg); + /* fallthrough */ case e1000_i350: case e1000_i354: /* none of the above registers are supported by i350 */ diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_param.c dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_param.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/igb/igb_param.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/igb/igb_param.c 2020-01-31 09:55:30.000000000 +0000 @@ -609,6 +609,7 @@ igb_validate_option(&adapter->rss_queues, &opt, adapter); if (adapter->rss_queues) break; + /* fallthrough */ case 0: adapter->rss_queues = min_t(u32, opt.arg.r.max, num_online_cpus()); break; diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_82599.c dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_82599.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_82599.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_82599.c 2020-01-31 09:55:30.000000000 +0000 @@ -1581,6 +1581,7 @@ case 0x0000: /* mask VLAN ID, fall through to mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANID; + /* fallthrough */ case 0x0FFF: /* mask VLAN priority */ fdirm |= IXGBE_FDIRM_VLANP; @@ -1761,6 +1762,7 @@ hw_dbg(hw, " Error on src/dst port\n"); return IXGBE_ERR_CONFIG; } + /* fallthrough */ case IXGBE_ATR_FLOW_TYPE_TCPV4: case IXGBE_ATR_FLOW_TYPE_UDPV4: input_mask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK | diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_common.c dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_common.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_common.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_common.c 2020-01-31 09:55:30.000000000 +0000 @@ -3851,6 +3851,7 @@ for (; i < (num_pb / 2); i++) IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); /* Fall through to configure remaining packet buffers */ + /* fallthrough */ case PBA_STRATEGY_EQUAL: rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; for (; i < num_pb; i++) diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_ethtool.c 2020-01-31 09:55:30.000000000 +0000 @@ -1780,6 +1780,7 @@ wol->supported = 0; break; } + /* fallthrough */ case IXGBE_SUBDEV_ID_82599_SFP: retval = 0; break; diff -Nru dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_main.c dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_main.c --- dpdk-18.11.5/kernel/linux/kni/ethtool/ixgbe/ixgbe_main.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/kernel/linux/kni/ethtool/ixgbe/ixgbe_main.c 2020-01-31 09:55:30.000000000 +0000 @@ -840,6 +840,7 @@ case ixgbe_phy_nl: if (hw->mac.type == ixgbe_mac_82598EB) return true; + /* fallthrough */ default: return false; } @@ -1418,6 +1419,7 @@ break; case ixgbe_mac_X540: adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE; + /* fallthrough */ case ixgbe_mac_82599EB: adapter->flags |= IXGBE_FLAG_MSI_CAPABLE | IXGBE_FLAG_MSIX_CAPABLE | @@ -2033,6 +2035,7 @@ hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC); hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC); hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC); + /* fallthrough */ case ixgbe_mac_82599EB: for (i = 0; i < 16; i++) adapter->hw_rx_no_dma_resources += @@ -2681,6 +2684,7 @@ /* only support first port */ if (hw->bus.func != 0) break; + /* fallthrough */ case IXGBE_SUBDEV_ID_82599_SFP: adapter->wol = IXGBE_WUFC_MAG; break; diff -Nru dpdk-18.11.5/lib/Makefile dpdk-18.11.6/lib/Makefile --- dpdk-18.11.5/lib/Makefile 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/Makefile 2020-01-31 09:55:30.000000000 +0000 @@ -45,7 +45,7 @@ DEPDIRS-librte_rawdev := librte_eal librte_ethdev DIRS-$(CONFIG_RTE_LIBRTE_VHOST) += librte_vhost DEPDIRS-librte_vhost := librte_eal librte_mempool librte_mbuf librte_ethdev \ - librte_net + librte_net librte_hash librte_cryptodev DIRS-$(CONFIG_RTE_LIBRTE_HASH) += librte_hash DEPDIRS-librte_hash := librte_eal librte_ring DIRS-$(CONFIG_RTE_LIBRTE_EFD) += librte_efd diff -Nru dpdk-18.11.5/lib/librte_compat/rte_compat.h dpdk-18.11.6/lib/librte_compat/rte_compat.h --- dpdk-18.11.5/lib/librte_compat/rte_compat.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_compat/rte_compat.h 2020-01-31 09:55:30.000000000 +0000 @@ -38,14 +38,14 @@ /* * VERSION_SYMBOL * Creates a symbol version table entry binding symbol @DPDK_ to the internal - * function name _ + * function name */ #define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", " RTE_STR(b) "@DPDK_" RTE_STR(n)) /* * BIND_DEFAULT_SYMBOL * Creates a symbol version entry instructing the linker to bind references to - * symbol to the internal symbol _ + * symbol to the internal symbol */ #define BIND_DEFAULT_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", " RTE_STR(b) "@@DPDK_" RTE_STR(n)) #define __vsym __attribute__((used)) diff -Nru dpdk-18.11.5/lib/librte_cryptodev/rte_cryptodev.c dpdk-18.11.6/lib/librte_cryptodev/rte_cryptodev.c --- dpdk-18.11.5/lib/librte_cryptodev/rte_cryptodev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_cryptodev/rte_cryptodev.c 2020-01-31 09:55:30.000000000 +0000 @@ -50,8 +50,7 @@ static struct rte_cryptodev_global cryptodev_globals = { .devs = rte_crypto_devices, .data = { NULL }, - .nb_devs = 0, - .max_devs = RTE_CRYPTO_MAX_DEVS + .nb_devs = 0 }; /* spinlock for crypto device callbacks */ @@ -496,7 +495,7 @@ if (name == NULL) return NULL; - for (i = 0; i < cryptodev_globals.max_devs; i++) { + for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) { dev = &cryptodev_globals.devs[i]; if ((dev->attached == RTE_CRYPTODEV_ATTACHED) && @@ -507,12 +506,21 @@ return NULL; } +static inline uint8_t +rte_cryptodev_is_valid_device_data(uint8_t dev_id) +{ + if (rte_crypto_devices[dev_id].data == NULL) + return 0; + + return 1; +} + unsigned int rte_cryptodev_pmd_is_valid_dev(uint8_t dev_id) { struct rte_cryptodev *dev = NULL; - if (dev_id >= cryptodev_globals.nb_devs) + if (!rte_cryptodev_is_valid_device_data(dev_id)) return 0; dev = rte_cryptodev_pmd_get_dev(dev_id); @@ -531,12 +539,15 @@ if (name == NULL) return -1; - for (i = 0; i < cryptodev_globals.nb_devs; i++) + for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) { + if (!rte_cryptodev_is_valid_device_data(i)) + continue; if ((strcmp(cryptodev_globals.devs[i].data->name, name) == 0) && (cryptodev_globals.devs[i].attached == RTE_CRYPTODEV_ATTACHED)) return i; + } return -1; } @@ -552,7 +563,7 @@ { uint8_t i, dev_count = 0; - for (i = 0; i < cryptodev_globals.max_devs; i++) + for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) if (cryptodev_globals.devs[i].driver_id == driver_id && cryptodev_globals.devs[i].attached == RTE_CRYPTODEV_ATTACHED) @@ -567,9 +578,10 @@ { uint8_t i, count = 0; struct rte_cryptodev *devs = cryptodev_globals.devs; - uint8_t max_devs = cryptodev_globals.max_devs; - for (i = 0; i < max_devs && count < nb_devices; i++) { + for (i = 0; i < RTE_CRYPTO_MAX_DEVS && count < nb_devices; i++) { + if (!rte_cryptodev_is_valid_device_data(i)) + continue; if (devs[i].attached == RTE_CRYPTODEV_ATTACHED) { int cmp; @@ -684,12 +696,14 @@ cryptodev->data = cryptodev_data; - snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN, - "%s", name); - - cryptodev->data->dev_id = dev_id; - cryptodev->data->socket_id = socket_id; - cryptodev->data->dev_started = 0; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN, + "%s", name); + + cryptodev->data->dev_id = dev_id; + cryptodev->data->socket_id = socket_id; + cryptodev->data->dev_started = 0; + } /* init user callbacks */ TAILQ_INIT(&(cryptodev->link_intr_cbs)); @@ -1016,7 +1030,7 @@ { struct rte_cryptodev *dev; - if (dev_id >= cryptodev_globals.nb_devs) { + if (!rte_cryptodev_pmd_is_valid_dev(dev_id)) { CDEV_LOG_ERR("Invalid dev_id=%d", dev_id); return; } diff -Nru dpdk-18.11.5/lib/librte_cryptodev/rte_cryptodev_pmd.h dpdk-18.11.6/lib/librte_cryptodev/rte_cryptodev_pmd.h --- dpdk-18.11.5/lib/librte_cryptodev/rte_cryptodev_pmd.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_cryptodev/rte_cryptodev_pmd.h 2020-01-31 09:55:30.000000000 +0000 @@ -61,7 +61,6 @@ struct rte_cryptodev_data *data[RTE_CRYPTO_MAX_DEVS]; /**< Device private data */ uint8_t nb_devs; /**< Number of devices found */ - uint8_t max_devs; /**< Max number of devices */ }; /* Cryptodev driver, containing the driver ID */ diff -Nru dpdk-18.11.5/lib/librte_distributor/meson.build dpdk-18.11.6/lib/librte_distributor/meson.build --- dpdk-18.11.5/lib/librte_distributor/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_distributor/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -9,3 +9,8 @@ endif headers = files('rte_distributor.h') deps += ['mbuf'] + +# for clang 32-bit compiles we need libatomic for 64-bit atomic ops +if cc.get_id() == 'clang' and dpdk_conf.get('RTE_ARCH_64') == false + ext_deps += cc.find_library('atomic') +endif diff -Nru dpdk-18.11.5/lib/librte_distributor/rte_distributor.c dpdk-18.11.6/lib/librte_distributor/rte_distributor.c --- dpdk-18.11.5/lib/librte_distributor/rte_distributor.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_distributor/rte_distributor.c 2020-01-31 09:55:30.000000000 +0000 @@ -48,8 +48,11 @@ } retptr64 = &(buf->retptr64[0]); - /* Spin while handshake bits are set (scheduler clears it) */ - while (unlikely(*retptr64 & RTE_DISTRIB_GET_BUF)) { + /* Spin while handshake bits are set (scheduler clears it). + * Sync with worker on GET_BUF flag. + */ + while (unlikely(__atomic_load_n(retptr64, __ATOMIC_ACQUIRE) + & RTE_DISTRIB_GET_BUF)) { rte_pause(); uint64_t t = rte_rdtsc()+100; @@ -74,8 +77,10 @@ /* * Finally, set the GET_BUF to signal to distributor that cache * line is ready for processing + * Sync with distributor to release retptrs */ - *retptr64 |= RTE_DISTRIB_GET_BUF; + __atomic_store_n(retptr64, *retptr64 | RTE_DISTRIB_GET_BUF, + __ATOMIC_RELEASE); } BIND_DEFAULT_SYMBOL(rte_distributor_request_pkt, _v1705, 17.05); MAP_STATIC_SYMBOL(void rte_distributor_request_pkt(struct rte_distributor *d, @@ -97,8 +102,11 @@ return (pkts[0]) ? 1 : 0; } - /* If bit is set, return */ - if (buf->bufptr64[0] & RTE_DISTRIB_GET_BUF) + /* If bit is set, return + * Sync with distributor to acquire bufptrs + */ + if (__atomic_load_n(&(buf->bufptr64[0]), __ATOMIC_ACQUIRE) + & RTE_DISTRIB_GET_BUF) return -1; /* since bufptr64 is signed, this should be an arithmetic shift */ @@ -113,8 +121,10 @@ * so now we've got the contents of the cacheline into an array of * mbuf pointers, so toggle the bit so scheduler can start working * on the next cacheline while we're working. + * Sync with distributor on GET_BUF flag. Release bufptrs. */ - buf->bufptr64[0] |= RTE_DISTRIB_GET_BUF; + __atomic_store_n(&(buf->bufptr64[0]), + buf->bufptr64[0] | RTE_DISTRIB_GET_BUF, __ATOMIC_RELEASE); return count; } @@ -173,6 +183,8 @@ return -EINVAL; } + /* Sync with distributor to acquire retptrs */ + __atomic_thread_fence(__ATOMIC_ACQUIRE); for (i = 0; i < RTE_DIST_BURST_SIZE; i++) /* Switch off the return bit first */ buf->retptr64[i] &= ~RTE_DISTRIB_RETURN_BUF; @@ -181,8 +193,11 @@ buf->retptr64[i] = (((int64_t)(uintptr_t)oldpkt[i]) << RTE_DISTRIB_FLAG_BITS) | RTE_DISTRIB_RETURN_BUF; - /* set the GET_BUF but even if we got no returns */ - buf->retptr64[0] |= RTE_DISTRIB_GET_BUF; + /* set the GET_BUF but even if we got no returns. + * Sync with distributor on GET_BUF flag. Release retptrs. + */ + __atomic_store_n(&(buf->retptr64[0]), + buf->retptr64[0] | RTE_DISTRIB_GET_BUF, __ATOMIC_RELEASE); return 0; } @@ -272,7 +287,9 @@ unsigned int count = 0; unsigned int i; - if (buf->retptr64[0] & RTE_DISTRIB_GET_BUF) { + /* Sync on GET_BUF flag. Acquire retptrs. */ + if (__atomic_load_n(&(buf->retptr64[0]), __ATOMIC_ACQUIRE) + & RTE_DISTRIB_GET_BUF) { for (i = 0; i < RTE_DIST_BURST_SIZE; i++) { if (buf->retptr64[i] & RTE_DISTRIB_RETURN_BUF) { oldbuf = ((uintptr_t)(buf->retptr64[i] >> @@ -285,8 +302,10 @@ } d->returns.start = ret_start; d->returns.count = ret_count; - /* Clear for the worker to populate with more returns */ - buf->retptr64[0] = 0; + /* Clear for the worker to populate with more returns. + * Sync with distributor on GET_BUF flag. Release retptrs. + */ + __atomic_store_n(&(buf->retptr64[0]), 0, __ATOMIC_RELEASE); } return count; } @@ -306,7 +325,9 @@ struct rte_distributor_buffer *buf = &(d->bufs[wkr]); unsigned int i; - while (!(d->bufs[wkr].bufptr64[0] & RTE_DISTRIB_GET_BUF)) + /* Sync with worker on GET_BUF flag */ + while (!(__atomic_load_n(&(d->bufs[wkr].bufptr64[0]), __ATOMIC_ACQUIRE) + & RTE_DISTRIB_GET_BUF)) rte_pause(); handle_returns(d, wkr); @@ -326,8 +347,11 @@ d->backlog[wkr].count = 0; - /* Clear the GET bit */ - buf->bufptr64[0] &= ~RTE_DISTRIB_GET_BUF; + /* Clear the GET bit. + * Sync with worker on GET_BUF flag. Release bufptrs. + */ + __atomic_store_n(&(buf->bufptr64[0]), + buf->bufptr64[0] & ~RTE_DISTRIB_GET_BUF, __ATOMIC_RELEASE); return buf->count; } @@ -354,7 +378,9 @@ if (unlikely(num_mbufs == 0)) { /* Flush out all non-full cache-lines to workers. */ for (wid = 0 ; wid < d->num_workers; wid++) { - if (d->bufs[wid].bufptr64[0] & RTE_DISTRIB_GET_BUF) { + /* Sync with worker on GET_BUF flag. */ + if (__atomic_load_n(&(d->bufs[wid].bufptr64[0]), + __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF) { release(d, wid); handle_returns(d, wid); } @@ -366,7 +392,9 @@ uint16_t matches[RTE_DIST_BURST_SIZE]; unsigned int pkts; - if (d->bufs[wkr].bufptr64[0] & RTE_DISTRIB_GET_BUF) + /* Sync with worker on GET_BUF flag. */ + if (__atomic_load_n(&(d->bufs[wkr].bufptr64[0]), + __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF) d->bufs[wkr].count = 0; if ((num_mbufs - next_idx) < RTE_DIST_BURST_SIZE) @@ -464,7 +492,9 @@ /* Flush out all non-full cache-lines to workers. */ for (wid = 0 ; wid < d->num_workers; wid++) - if ((d->bufs[wid].bufptr64[0] & RTE_DISTRIB_GET_BUF)) + /* Sync with worker on GET_BUF flag. */ + if ((__atomic_load_n(&(d->bufs[wid].bufptr64[0]), + __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF)) release(d, wid); return num_mbufs; @@ -573,7 +603,9 @@ /* throw away returns, so workers can exit */ for (wkr = 0; wkr < d->num_workers; wkr++) - d->bufs[wkr].retptr64[0] = 0; + /* Sync with worker. Release retptrs. */ + __atomic_store_n(&(d->bufs[wkr].retptr64[0]), 0, + __ATOMIC_RELEASE); } BIND_DEFAULT_SYMBOL(rte_distributor_clear_returns, _v1705, 17.05); MAP_STATIC_SYMBOL(void rte_distributor_clear_returns(struct rte_distributor *d), diff -Nru dpdk-18.11.5/lib/librte_distributor/rte_distributor_v20.c dpdk-18.11.6/lib/librte_distributor/rte_distributor_v20.c --- dpdk-18.11.5/lib/librte_distributor/rte_distributor_v20.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_distributor/rte_distributor_v20.c 2020-01-31 09:55:30.000000000 +0000 @@ -33,9 +33,12 @@ union rte_distributor_buffer_v20 *buf = &d->bufs[worker_id]; int64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS) | RTE_DISTRIB_GET_BUF; - while (unlikely(buf->bufptr64 & RTE_DISTRIB_FLAGS_MASK)) + while (unlikely(__atomic_load_n(&buf->bufptr64, __ATOMIC_RELAXED) + & RTE_DISTRIB_FLAGS_MASK)) rte_pause(); - buf->bufptr64 = req; + + /* Sync with distributor on GET_BUF flag. */ + __atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE); } VERSION_SYMBOL(rte_distributor_request_pkt, _v20, 2.0); @@ -44,7 +47,9 @@ unsigned worker_id) { union rte_distributor_buffer_v20 *buf = &d->bufs[worker_id]; - if (buf->bufptr64 & RTE_DISTRIB_GET_BUF) + /* Sync with distributor. Acquire bufptr64. */ + if (__atomic_load_n(&buf->bufptr64, __ATOMIC_ACQUIRE) + & RTE_DISTRIB_GET_BUF) return NULL; /* since bufptr64 is signed, this should be an arithmetic shift */ @@ -72,7 +77,8 @@ union rte_distributor_buffer_v20 *buf = &d->bufs[worker_id]; uint64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS) | RTE_DISTRIB_RETURN_BUF; - buf->bufptr64 = req; + /* Sync with distributor on RETURN_BUF flag. */ + __atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE); return 0; } VERSION_SYMBOL(rte_distributor_return_pkt, _v20, 2.0); @@ -116,7 +122,8 @@ { d->in_flight_tags[wkr] = 0; d->in_flight_bitmask &= ~(1UL << wkr); - d->bufs[wkr].bufptr64 = 0; + /* Sync with worker. Release bufptr64. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), 0, __ATOMIC_RELEASE); if (unlikely(d->backlog[wkr].count != 0)) { /* On return of a packet, we need to move the * queued packets for this core elsewhere. @@ -160,17 +167,23 @@ ret_count = d->returns.count; for (wkr = 0; wkr < d->num_workers; wkr++) { - - const int64_t data = d->bufs[wkr].bufptr64; uintptr_t oldbuf = 0; + /* Sync with worker. Acquire bufptr64. */ + const int64_t data = __atomic_load_n(&(d->bufs[wkr].bufptr64), + __ATOMIC_ACQUIRE); if (data & RTE_DISTRIB_GET_BUF) { flushed++; if (d->backlog[wkr].count) - d->bufs[wkr].bufptr64 = - backlog_pop(&d->backlog[wkr]); + /* Sync with worker. Release bufptr64. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), + backlog_pop(&d->backlog[wkr]), + __ATOMIC_RELEASE); else { - d->bufs[wkr].bufptr64 = RTE_DISTRIB_GET_BUF; + /* Sync with worker on GET_BUF flag. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), + RTE_DISTRIB_GET_BUF, + __ATOMIC_RELEASE); d->in_flight_tags[wkr] = 0; d->in_flight_bitmask &= ~(1UL << wkr); } @@ -206,9 +219,10 @@ return process_returns(d); while (next_idx < num_mbufs || next_mb != NULL) { - - int64_t data = d->bufs[wkr].bufptr64; uintptr_t oldbuf = 0; + /* Sync with worker. Acquire bufptr64. */ + int64_t data = __atomic_load_n(&(d->bufs[wkr].bufptr64), + __ATOMIC_ACQUIRE); if (!next_mb) { next_mb = mbufs[next_idx++]; @@ -254,11 +268,16 @@ (d->backlog[wkr].count || next_mb)) { if (d->backlog[wkr].count) - d->bufs[wkr].bufptr64 = - backlog_pop(&d->backlog[wkr]); + /* Sync with worker. Release bufptr64. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), + backlog_pop(&d->backlog[wkr]), + __ATOMIC_RELEASE); else { - d->bufs[wkr].bufptr64 = next_value; + /* Sync with worker. Release bufptr64. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), + next_value, + __ATOMIC_RELEASE); d->in_flight_tags[wkr] = new_tag; d->in_flight_bitmask |= (1UL << wkr); next_mb = NULL; @@ -279,13 +298,19 @@ * if they are ready */ for (wkr = 0; wkr < d->num_workers; wkr++) if (d->backlog[wkr].count && - (d->bufs[wkr].bufptr64 & RTE_DISTRIB_GET_BUF)) { + /* Sync with worker. Acquire bufptr64. */ + (__atomic_load_n(&(d->bufs[wkr].bufptr64), + __ATOMIC_ACQUIRE) & RTE_DISTRIB_GET_BUF)) { int64_t oldbuf = d->bufs[wkr].bufptr64 >> RTE_DISTRIB_FLAG_BITS; + store_return(oldbuf, d, &ret_start, &ret_count); - d->bufs[wkr].bufptr64 = backlog_pop(&d->backlog[wkr]); + /* Sync with worker. Release bufptr64. */ + __atomic_store_n(&(d->bufs[wkr].bufptr64), + backlog_pop(&d->backlog[wkr]), + __ATOMIC_RELEASE); } d->returns.start = ret_start; diff -Nru dpdk-18.11.5/lib/librte_eal/bsdapp/eal/eal.c dpdk-18.11.6/lib/librte_eal/bsdapp/eal/eal.c --- dpdk-18.11.5/lib/librte_eal/bsdapp/eal/eal.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/bsdapp/eal/eal.c 2020-01-31 09:55:30.000000000 +0000 @@ -253,11 +253,6 @@ } memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config)); rte_config.mem_config = rte_mem_cfg_addr; - - /* store address of the config in the config itself so that secondary - * processes could later map the config into this exact location - */ - rte_config.mem_config->mem_cfg_addr = (uintptr_t) rte_mem_cfg_addr; } /* attach to an existing shared memory config */ diff -Nru dpdk-18.11.5/lib/librte_eal/bsdapp/eal/eal_interrupts.c dpdk-18.11.6/lib/librte_eal/bsdapp/eal/eal_interrupts.c --- dpdk-18.11.5/lib/librte_eal/bsdapp/eal/eal_interrupts.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/bsdapp/eal/eal_interrupts.c 2020-01-31 09:55:30.000000000 +0000 @@ -327,6 +327,15 @@ return 0; } +int +rte_intr_ack(const struct rte_intr_handle *intr_handle) +{ + if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) + return 0; + + return -1; +} + static void eal_intr_process_interrupts(struct kevent *events, int nfds) { diff -Nru dpdk-18.11.5/lib/librte_eal/common/eal_common_lcore.c dpdk-18.11.6/lib/librte_eal/common/eal_common_lcore.c --- dpdk-18.11.5/lib/librte_eal/common/eal_common_lcore.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/eal_common_lcore.c 2020-01-31 09:55:30.000000000 +0000 @@ -57,15 +57,6 @@ /* find socket first */ socket_id = eal_cpu_socket_id(lcore_id); - if (socket_id >= RTE_MAX_NUMA_NODES) { -#ifdef RTE_EAL_ALLOW_INV_SOCKET_ID - socket_id = 0; -#else - RTE_LOG(ERR, EAL, "Socket ID (%u) is greater than RTE_MAX_NUMA_NODES (%d)\n", - socket_id, RTE_MAX_NUMA_NODES); - return -1; -#endif - } lcore_to_socket_id[lcore_id] = socket_id; /* in 1:1 mapping, record related cpu detected state */ diff -Nru dpdk-18.11.5/lib/librte_eal/common/eal_common_log.c dpdk-18.11.6/lib/librte_eal/common/eal_common_log.c --- dpdk-18.11.5/lib/librte_eal/common/eal_common_log.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/eal_common_log.c 2020-01-31 09:55:30.000000000 +0000 @@ -45,7 +45,7 @@ static FILE *default_log_stream; /** - * This global structure stores some informations about the message + * This global structure stores some information about the message * that is currently being processed by one lcore */ struct log_cur_msg { diff -Nru dpdk-18.11.5/lib/librte_eal/common/eal_common_proc.c dpdk-18.11.6/lib/librte_eal/common/eal_common_proc.c --- dpdk-18.11.5/lib/librte_eal/common/eal_common_proc.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/eal_common_proc.c 2020-01-31 09:55:30.000000000 +0000 @@ -272,7 +272,7 @@ } if (msglen != buflen || (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC))) { - RTE_LOG(ERR, EAL, "truncted msg\n"); + RTE_LOG(ERR, EAL, "truncated msg\n"); return -1; } @@ -1051,7 +1051,7 @@ } if (gettimeofday(&now, NULL) < 0) { - RTE_LOG(ERR, EAL, "Faile to get current time\n"); + RTE_LOG(ERR, EAL, "Failed to get current time\n"); rte_errno = errno; return -1; } diff -Nru dpdk-18.11.5/lib/librte_eal/common/eal_hugepages.h dpdk-18.11.6/lib/librte_eal/common/eal_hugepages.h --- dpdk-18.11.5/lib/librte_eal/common/eal_hugepages.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/eal_hugepages.h 2020-01-31 09:55:30.000000000 +0000 @@ -12,7 +12,7 @@ #define MAX_HUGEPAGE_PATH PATH_MAX /** - * Structure used to store informations about hugepages that we mapped + * Structure used to store information about hugepages that we mapped * through the files in hugetlbfs. */ struct hugepage_file { diff -Nru dpdk-18.11.5/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h dpdk-18.11.6/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h --- dpdk-18.11.5/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/include/arch/ppc_64/rte_atomic.h 2020-01-31 09:55:30.000000000 +0000 @@ -450,7 +450,7 @@ static inline uint64_t rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val) { - return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST); + return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST); } #endif diff -Nru dpdk-18.11.5/lib/librte_eal/common/include/arch/x86/rte_memcpy.h dpdk-18.11.6/lib/librte_eal/common/include/arch/x86/rte_memcpy.h --- dpdk-18.11.5/lib/librte_eal/common/include/arch/x86/rte_memcpy.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/include/arch/x86/rte_memcpy.h 2020-01-31 09:55:30.000000000 +0000 @@ -115,7 +115,7 @@ * Copy 128-byte blocks from one location to another, * locations should not overlap. */ -static inline void +static __rte_always_inline void rte_mov128blocks(uint8_t *dst, const uint8_t *src, size_t n) { __m512i zmm0, zmm1; @@ -163,7 +163,7 @@ } } -static inline void * +static __rte_always_inline void * rte_memcpy_generic(void *dst, const void *src, size_t n) { uintptr_t dstu = (uintptr_t)dst; @@ -330,7 +330,7 @@ * Copy 128 bytes from one location to another, * locations should not overlap. */ -static inline void +static __rte_always_inline void rte_mov128(uint8_t *dst, const uint8_t *src) { rte_mov32((uint8_t *)dst + 0 * 32, (const uint8_t *)src + 0 * 32); @@ -343,7 +343,7 @@ * Copy 128-byte blocks from one location to another, * locations should not overlap. */ -static inline void +static __rte_always_inline void rte_mov128blocks(uint8_t *dst, const uint8_t *src, size_t n) { __m256i ymm0, ymm1, ymm2, ymm3; @@ -363,7 +363,7 @@ } } -static inline void * +static __rte_always_inline void * rte_memcpy_generic(void *dst, const void *src, size_t n) { uintptr_t dstu = (uintptr_t)dst; @@ -523,7 +523,7 @@ * Copy 128 bytes from one location to another, * locations should not overlap. */ -static inline void +static __rte_always_inline void rte_mov128(uint8_t *dst, const uint8_t *src) { rte_mov16((uint8_t *)dst + 0 * 16, (const uint8_t *)src + 0 * 16); @@ -655,7 +655,7 @@ } \ }) -static inline void * +static __rte_always_inline void * rte_memcpy_generic(void *dst, const void *src, size_t n) { __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8; @@ -800,7 +800,7 @@ #endif /* RTE_MACHINE_CPUFLAG */ -static inline void * +static __rte_always_inline void * rte_memcpy_aligned(void *dst, const void *src, size_t n) { void *ret = dst; @@ -860,7 +860,7 @@ return ret; } -static inline void * +static __rte_always_inline void * rte_memcpy(void *dst, const void *src, size_t n) { if (!(((uintptr_t)dst | (uintptr_t)src) & ALIGNMENT_MASK)) diff -Nru dpdk-18.11.5/lib/librte_eal/common/include/rte_dev.h dpdk-18.11.6/lib/librte_eal/common/include/rte_dev.h --- dpdk-18.11.5/lib/librte_eal/common/include/rte_dev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/include/rte_dev.h 2020-01-31 09:55:30.000000000 +0000 @@ -43,67 +43,15 @@ enum rte_dev_event_type event, void *cb_arg); -__attribute__((format(printf, 2, 0))) -static inline void -rte_pmd_debug_trace(const char *func_name, const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - - { - char buffer[vsnprintf(NULL, 0, fmt, ap) + 1]; - - va_end(ap); - - va_start(ap, fmt); - vsnprintf(buffer, sizeof(buffer), fmt, ap); - va_end(ap); - - rte_log(RTE_LOG_ERR, RTE_LOGTYPE_PMD, "%s: %s", - func_name, buffer); - } -} - -/* - * Enable RTE_PMD_DEBUG_TRACE() when at least one component relying on the - * RTE_*_RET() macros defined below is compiled in debug mode. - */ -#if defined(RTE_LIBRTE_EVENTDEV_DEBUG) -#define RTE_PMD_DEBUG_TRACE(...) \ - rte_pmd_debug_trace(__func__, __VA_ARGS__) -#else -#define RTE_PMD_DEBUG_TRACE(...) (void)0 -#endif - -/* Macros for checking for restricting functions to primary instance only */ -#define RTE_PROC_PRIMARY_OR_ERR_RET(retval) do { \ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \ - RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \ - return retval; \ - } \ -} while (0) - -#define RTE_PROC_PRIMARY_OR_RET() do { \ - if (rte_eal_process_type() != RTE_PROC_PRIMARY) { \ - RTE_PMD_DEBUG_TRACE("Cannot run in secondary processes\n"); \ - return; \ - } \ -} while (0) - /* Macros to check for invalid function pointers */ #define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \ - if ((func) == NULL) { \ - RTE_PMD_DEBUG_TRACE("Function not supported\n"); \ + if ((func) == NULL) \ return retval; \ - } \ } while (0) #define RTE_FUNC_PTR_OR_RET(func) do { \ - if ((func) == NULL) { \ - RTE_PMD_DEBUG_TRACE("Function not supported\n"); \ + if ((func) == NULL) \ return; \ - } \ } while (0) /** @@ -286,7 +234,7 @@ * "pci:v8086:d*:sv*:sd*" all PCI devices supported by this driver * whose vendor id is 0x8086. * - * The format of the kernel modules list is a parenthesed expression + * The format of the kernel modules list is a parenthesized expression * containing logical-and (&) and logical-or (|). * * The device pattern and the kmod expression are separated by a space. diff -Nru dpdk-18.11.5/lib/librte_eal/common/include/rte_interrupts.h dpdk-18.11.6/lib/librte_eal/common/include/rte_interrupts.h --- dpdk-18.11.5/lib/librte_eal/common/include/rte_interrupts.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/include/rte_interrupts.h 2020-01-31 09:55:30.000000000 +0000 @@ -6,6 +6,7 @@ #define _RTE_INTERRUPTS_H_ #include +#include /** * @file @@ -85,6 +86,26 @@ */ int rte_intr_disable(const struct rte_intr_handle *intr_handle); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * It acknowledges an interrupt raised for the specified handle. + * + * This function should be called at the end of each interrupt handler either + * from application or driver, so that currently raised interrupt is acked and + * further new interrupts are raised. + * + * @param intr_handle + * pointer to the interrupt handle. + * + * @return + * - On success, zero. + * - On failure, a negative value. + */ +__rte_experimental +int rte_intr_ack(const struct rte_intr_handle *intr_handle); + #ifdef __cplusplus } #endif diff -Nru dpdk-18.11.5/lib/librte_eal/common/include/rte_version.h dpdk-18.11.6/lib/librte_eal/common/include/rte_version.h --- dpdk-18.11.5/lib/librte_eal/common/include/rte_version.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/include/rte_version.h 2020-01-31 09:55:30.000000000 +0000 @@ -37,7 +37,7 @@ /** * Patch level number i.e. the z in yy.mm.z */ -#define RTE_VER_MINOR 5 +#define RTE_VER_MINOR 6 /** * Extra string to be appended to version number diff -Nru dpdk-18.11.5/lib/librte_eal/common/malloc_elem.c dpdk-18.11.6/lib/librte_eal/common/malloc_elem.c --- dpdk-18.11.5/lib/librte_eal/common/malloc_elem.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/malloc_elem.c 2020-01-31 09:55:30.000000000 +0000 @@ -292,6 +292,11 @@ elem->next = split_pt; elem->size = old_elem_size; set_trailer(elem); + if (elem->pad) { + /* Update inner padding inner element size. */ + elem = RTE_PTR_ADD(elem, elem->pad); + elem->size = old_elem_size - elem->pad; + } } /* @@ -463,6 +468,10 @@ else elem1->heap->last = elem1; elem1->next = next; + if (elem1->pad) { + struct malloc_elem *inner = RTE_PTR_ADD(elem1, elem1->pad); + inner->size = elem1->size - elem1->pad; + } } struct malloc_elem * diff -Nru dpdk-18.11.5/lib/librte_eal/common/meson.build dpdk-18.11.6/lib/librte_eal/common/meson.build --- dpdk-18.11.5/lib/librte_eal/common/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -84,7 +84,8 @@ 'include/rte_tailq.h', 'include/rte_time.h', 'include/rte_uuid.h', - 'include/rte_version.h') + 'include/rte_version.h', + 'include/rte_vfio.h') # special case install the generic headers, since they go in a subdir generic_headers = files( diff -Nru dpdk-18.11.5/lib/librte_eal/common/rte_malloc.c dpdk-18.11.6/lib/librte_eal/common/rte_malloc.c --- dpdk-18.11.5/lib/librte_eal/common/rte_malloc.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/rte_malloc.c 2020-01-31 09:55:30.000000000 +0000 @@ -130,7 +130,8 @@ void *new_ptr = rte_malloc(NULL, size, align); if (new_ptr == NULL) return NULL; - const unsigned old_size = elem->size - MALLOC_ELEM_OVERHEAD; + /* elem: |pad|data_elem|data|trailer| */ + const size_t old_size = elem->size - elem->pad - MALLOC_ELEM_OVERHEAD; rte_memcpy(new_ptr, ptr, old_size < size ? old_size : size); rte_free(ptr); diff -Nru dpdk-18.11.5/lib/librte_eal/common/rte_reciprocal.c dpdk-18.11.6/lib/librte_eal/common/rte_reciprocal.c --- dpdk-18.11.5/lib/librte_eal/common/rte_reciprocal.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/rte_reciprocal.c 2020-01-31 09:55:30.000000000 +0000 @@ -133,12 +133,15 @@ { struct rte_reciprocal_u64 R; uint64_t m; + uint64_t r; int l; l = 63 - __builtin_clzll(d); - m = divide_128_div_64_to_64((1ULL << l), 0, d, NULL) << 1; - m = (1ULL << l) - d ? m + 2 : 1; + m = divide_128_div_64_to_64((1ULL << l), 0, d, &r) << 1; + if (r << 1 < r || r << 1 >= d) + m++; + m = (1ULL << l) - d ? m + 1 : 1; R.m = m; R.sh1 = l > 1 ? 1 : l; diff -Nru dpdk-18.11.5/lib/librte_eal/common/rte_service.c dpdk-18.11.6/lib/librte_eal/common/rte_service.c --- dpdk-18.11.5/lib/librte_eal/common/rte_service.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/common/rte_service.c 2020-01-31 09:55:30.000000000 +0000 @@ -71,10 +71,12 @@ static struct core_state *lcore_states; static uint32_t rte_service_library_initialized; -int32_t rte_service_init(void) +int32_t +rte_service_init(void) { if (rte_service_library_initialized) { - printf("service library init() called, init flag %d\n", + RTE_LOG(NOTICE, EAL, + "service library init() called, init flag %d\n", rte_service_library_initialized); return -EALREADY; } @@ -83,14 +85,14 @@ sizeof(struct rte_service_spec_impl), RTE_CACHE_LINE_SIZE); if (!rte_services) { - printf("error allocating rte services array\n"); + RTE_LOG(ERR, EAL, "error allocating rte services array\n"); goto fail_mem; } lcore_states = rte_calloc("rte_service_core_states", RTE_MAX_LCORE, sizeof(struct core_state), RTE_CACHE_LINE_SIZE); if (!lcore_states) { - printf("error allocating core states array\n"); + RTE_LOG(ERR, EAL, "error allocating core states array\n"); goto fail_mem; } @@ -109,10 +111,8 @@ rte_service_library_initialized = 1; return 0; fail_mem: - if (rte_services) - rte_free(rte_services); - if (lcore_states) - rte_free(lcore_states); + rte_free(rte_services); + rte_free(lcore_states); return -ENOMEM; } @@ -122,11 +122,8 @@ if (!rte_service_library_initialized) return; - if (rte_services) - rte_free(rte_services); - - if (lcore_states) - rte_free(lcore_states); + rte_free(rte_services); + rte_free(lcore_states); rte_service_library_initialized = 0; } @@ -398,8 +395,8 @@ return 0; } -int32_t rte_service_run_iter_on_app_lcore(uint32_t id, - uint32_t serialize_mt_unsafe) +int32_t +rte_service_run_iter_on_app_lcore(uint32_t id, uint32_t serialize_mt_unsafe) { /* run service on calling core, using all-ones as the service mask */ if (!service_valid(id)) diff -Nru dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_interrupts.c dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_interrupts.c --- dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_interrupts.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_interrupts.c 2020-01-31 09:55:30.000000000 +0000 @@ -195,6 +195,28 @@ return 0; } +/* unmask/ack legacy (INTx) interrupts */ +static int +vfio_ack_intx(const struct rte_intr_handle *intr_handle) +{ + struct vfio_irq_set irq_set; + + /* unmask INTx */ + memset(&irq_set, 0, sizeof(irq_set)); + irq_set.argsz = sizeof(irq_set); + irq_set.count = 1; + irq_set.flags = VFIO_IRQ_SET_DATA_NONE | VFIO_IRQ_SET_ACTION_UNMASK; + irq_set.index = VFIO_PCI_INTX_IRQ_INDEX; + irq_set.start = 0; + + if (ioctl(intr_handle->vfio_dev_fd, VFIO_DEVICE_SET_IRQS, &irq_set)) { + RTE_LOG(ERR, EAL, "Error unmasking INTx interrupts for fd %d\n", + intr_handle->fd); + return -1; + } + return 0; +} + /* enable MSI interrupts */ static int vfio_enable_msi(const struct rte_intr_handle *intr_handle) { @@ -635,6 +657,66 @@ return -1; } + return 0; +} + +/** + * PMD generally calls this function at the end of its IRQ callback. + * Internally, it unmasks the interrupt if possible. + * + * For INTx, unmasking is required as the interrupt is auto-masked prior to + * invoking callback. + * + * For MSI/MSI-X, unmasking is typically not needed as the interrupt is not + * auto-masked. In fact, for interrupt handle types VFIO_MSIX and VFIO_MSI, + * this function is no-op. + */ +int +rte_intr_ack(const struct rte_intr_handle *intr_handle) +{ + if (intr_handle && intr_handle->type == RTE_INTR_HANDLE_VDEV) + return 0; + + if (!intr_handle || intr_handle->fd < 0 || intr_handle->uio_cfg_fd < 0) + return -1; + + switch (intr_handle->type) { + /* Both acking and enabling are same for UIO */ + case RTE_INTR_HANDLE_UIO: + if (uio_intr_enable(intr_handle)) + return -1; + break; + case RTE_INTR_HANDLE_UIO_INTX: + if (uio_intx_intr_enable(intr_handle)) + return -1; + break; + /* not used at this moment */ + case RTE_INTR_HANDLE_ALARM: + return -1; +#ifdef VFIO_PRESENT + /* VFIO MSI* is implicitly acked unlike INTx, nothing to do */ + case RTE_INTR_HANDLE_VFIO_MSIX: + case RTE_INTR_HANDLE_VFIO_MSI: + return 0; + case RTE_INTR_HANDLE_VFIO_LEGACY: + if (vfio_ack_intx(intr_handle)) + return -1; + break; +#ifdef HAVE_VFIO_DEV_REQ_INTERFACE + case RTE_INTR_HANDLE_VFIO_REQ: + return -1; +#endif +#endif + /* not used at this moment */ + case RTE_INTR_HANDLE_DEV_EVENT: + return -1; + /* unknown handle type */ + default: + RTE_LOG(ERR, EAL, "Unknown handle type of fd %d\n", + intr_handle->fd); + return -1; + } + return 0; } diff -Nru dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_memory.c dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_memory.c --- dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_memory.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_memory.c 2020-01-31 09:55:30.000000000 +0000 @@ -708,7 +708,7 @@ return -1; } -#ifdef RTE_ARCH_PPC64 +#ifdef RTE_ARCH_PPC_64 /* for PPC64 we go through the list backwards */ for (cur_page = seg_end - 1; cur_page >= seg_start; cur_page--, ms_idx++) { diff -Nru dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_vfio.c dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_vfio.c --- dpdk-18.11.5/lib/librte_eal/linuxapp/eal/eal_vfio.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/linuxapp/eal/eal_vfio.c 2020-01-31 09:55:30.000000000 +0000 @@ -263,7 +263,7 @@ int vfio_group_fd; char filename[PATH_MAX]; struct rte_mp_msg mp_req, *mp_rep; - struct rte_mp_reply mp_reply; + struct rte_mp_reply mp_reply = {0}; struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; @@ -319,9 +319,9 @@ RTE_LOG(ERR, EAL, " bad VFIO group fd\n"); vfio_group_fd = 0; } - free(mp_reply.msgs); } + free(mp_reply.msgs); if (vfio_group_fd < 0) RTE_LOG(ERR, EAL, " cannot request group fd\n"); return vfio_group_fd; @@ -553,7 +553,7 @@ vfio_sync_default_container(void) { struct rte_mp_msg mp_req, *mp_rep; - struct rte_mp_reply mp_reply; + struct rte_mp_reply mp_reply = {0}; struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; int iommu_type_id; @@ -583,8 +583,8 @@ p = (struct vfio_mp_param *)mp_rep->param; if (p->result == SOCKET_OK) iommu_type_id = p->iommu_type_id; - free(mp_reply.msgs); } + free(mp_reply.msgs); if (iommu_type_id < 0) { RTE_LOG(ERR, EAL, "Could not get IOMMU type for default container\n"); return -1; @@ -1022,7 +1022,7 @@ vfio_get_default_container_fd(void) { struct rte_mp_msg mp_req, *mp_rep; - struct rte_mp_reply mp_reply; + struct rte_mp_reply mp_reply = {0}; struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; @@ -1050,9 +1050,9 @@ free(mp_reply.msgs); return mp_rep->fds[0]; } - free(mp_reply.msgs); } + free(mp_reply.msgs); RTE_LOG(ERR, EAL, " cannot request default container fd\n"); return -1; } @@ -1128,7 +1128,7 @@ { int ret, vfio_container_fd; struct rte_mp_msg mp_req, *mp_rep; - struct rte_mp_reply mp_reply; + struct rte_mp_reply mp_reply = {0}; struct timespec ts = {.tv_sec = 5, .tv_nsec = 0}; struct vfio_mp_param *p = (struct vfio_mp_param *)mp_req.param; @@ -1182,9 +1182,9 @@ free(mp_reply.msgs); return vfio_container_fd; } - free(mp_reply.msgs); } + free(mp_reply.msgs); RTE_LOG(ERR, EAL, " cannot request container fd\n"); return -1; } diff -Nru dpdk-18.11.5/lib/librte_eal/rte_eal_version.map dpdk-18.11.6/lib/librte_eal/rte_eal_version.map --- dpdk-18.11.5/lib/librte_eal/rte_eal_version.map 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eal/rte_eal_version.map 2020-01-31 09:55:30.000000000 +0000 @@ -318,6 +318,7 @@ rte_fbarray_is_used; rte_fbarray_set_free; rte_fbarray_set_used; + rte_intr_ack; rte_log_register_type_and_pick_level; rte_malloc_dump_heaps; rte_malloc_heap_create; diff -Nru dpdk-18.11.5/lib/librte_efd/rte_efd.c dpdk-18.11.6/lib/librte_efd/rte_efd.c --- dpdk-18.11.5/lib/librte_efd/rte_efd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_efd/rte_efd.c 2020-01-31 09:55:30.000000000 +0000 @@ -179,7 +179,7 @@ /**< Array with all values of the keys of the group. */ uint8_t bin_id[EFD_MAX_GROUP_NUM_RULES]; - /**< Stores the bin for each correspending key to + /**< Stores the bin for each corresponding key to * avoid having to recompute it */ }; diff -Nru dpdk-18.11.5/lib/librte_ethdev/rte_eth_ctrl.h dpdk-18.11.6/lib/librte_ethdev/rte_eth_ctrl.h --- dpdk-18.11.5/lib/librte_ethdev/rte_eth_ctrl.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_ethdev/rte_eth_ctrl.h 2020-01-31 09:55:30.000000000 +0000 @@ -7,7 +7,7 @@ #include #include -#include "rte_ether.h" +#include /** * @file diff -Nru dpdk-18.11.5/lib/librte_ethdev/rte_ethdev.c dpdk-18.11.6/lib/librte_ethdev/rte_ethdev.c --- dpdk-18.11.5/lib/librte_ethdev/rte_ethdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_ethdev/rte_ethdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -37,8 +37,8 @@ #include #include #include +#include -#include "rte_ether.h" #include "rte_ethdev.h" #include "rte_ethdev_driver.h" #include "ethdev_profile.h" @@ -1114,7 +1114,9 @@ * Copy the dev_conf parameter into the dev structure. * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get */ - memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)); + if (dev_conf != &dev->data->dev_conf) + memcpy(&dev->data->dev_conf, dev_conf, + sizeof(dev->data->dev_conf)); rte_eth_dev_info_get(port_id, &dev_info); @@ -2532,6 +2534,13 @@ RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); (*dev->dev_ops->dev_infos_get)(dev, dev_info); + + /* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */ + dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues, + RTE_MAX_QUEUES_PER_PORT); + dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues, + RTE_MAX_QUEUES_PER_PORT); + dev_info->driver_name = dev->device->driver->name; dev_info->nb_rx_queues = dev->data->nb_rx_queues; dev_info->nb_tx_queues = dev->data->nb_tx_queues; diff -Nru dpdk-18.11.5/lib/librte_ethdev/rte_ethdev.h dpdk-18.11.6/lib/librte_ethdev/rte_ethdev.h --- dpdk-18.11.5/lib/librte_ethdev/rte_ethdev.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_ethdev/rte_ethdev.h 2020-01-31 09:55:30.000000000 +0000 @@ -154,8 +154,8 @@ #include #include #include +#include -#include "rte_ether.h" #include "rte_eth_ctrl.h" #include "rte_dev_info.h" @@ -855,7 +855,7 @@ * A structure used to configure the Flow Director (FDIR) feature * of an Ethernet port. * - * If mode is RTE_FDIR_DISABLE, the pballoc value is ignored. + * If mode is RTE_FDIR_MODE_NONE, the pballoc value is ignored. */ struct rte_fdir_conf { enum rte_fdir_mode mode; /**< Flow Director mode. */ @@ -2316,7 +2316,7 @@ * Otherwise, disable VLAN filtering of VLAN packets tagged with *vlan_id*. * @return * - (0) if successful. - * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. + * - (-ENOTSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. * - (-ENOSYS) if VLAN filtering on *port_id* disabled. @@ -2339,7 +2339,7 @@ * If 0, Disable VLAN Stripping of the receive queue of the Ethernet port. * @return * - (0) if successful. - * - (-ENOSUP) if hardware-assisted VLAN stripping not configured. + * - (-ENOTSUP) if hardware-assisted VLAN stripping not configured. * - (-ENODEV) if *port_id* invalid. * - (-EINVAL) if *rx_queue_id* invalid. */ @@ -2359,7 +2359,7 @@ * The Tag Protocol ID * @return * - (0) if successful. - * - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported. + * - (-ENOTSUP) if hardware-assisted VLAN TPID setup is not supported. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. */ @@ -2384,7 +2384,7 @@ * ETH_VLAN_EXTEND_OFFLOAD * @return * - (0) if successful. - * - (-ENOSUP) if hardware-assisted VLAN filtering not configured. + * - (-ENOTSUP) if hardware-assisted VLAN filtering not configured. * - (-ENODEV) if *port_id* invalid. * - (-EIO) if device is removed. */ diff -Nru dpdk-18.11.5/lib/librte_ethdev/rte_flow.c dpdk-18.11.6/lib/librte_ethdev/rte_flow.c --- dpdk-18.11.5/lib/librte_ethdev/rte_flow.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_ethdev/rte_flow.c 2020-01-31 09:55:30.000000000 +0000 @@ -157,6 +157,99 @@ return ret; } +static enum rte_flow_item_type +rte_flow_expand_rss_item_complete(const struct rte_flow_item *item) +{ + enum rte_flow_item_type ret = RTE_FLOW_ITEM_TYPE_VOID; + uint16_t ether_type = 0; + uint16_t ether_type_m; + uint8_t ip_next_proto = 0; + uint8_t ip_next_proto_m; + + if (item == NULL || item->spec == NULL) + return ret; + switch (item->type) { + case RTE_FLOW_ITEM_TYPE_ETH: + if (item->mask) + ether_type_m = ((const struct rte_flow_item_eth *) + (item->mask))->type; + else + ether_type_m = rte_flow_item_eth_mask.type; + if (ether_type_m != RTE_BE16(0xFFFF)) + break; + ether_type = ((const struct rte_flow_item_eth *) + (item->spec))->type; + if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_IPv4) + ret = RTE_FLOW_ITEM_TYPE_IPV4; + else if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_IPv6) + ret = RTE_FLOW_ITEM_TYPE_IPV6; + else if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_VLAN) + ret = RTE_FLOW_ITEM_TYPE_VLAN; + break; + case RTE_FLOW_ITEM_TYPE_VLAN: + if (item->mask) + ether_type_m = ((const struct rte_flow_item_vlan *) + (item->mask))->inner_type; + else + ether_type_m = rte_flow_item_vlan_mask.inner_type; + if (ether_type_m != RTE_BE16(0xFFFF)) + break; + ether_type = ((const struct rte_flow_item_vlan *) + (item->spec))->inner_type; + if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_IPv4) + ret = RTE_FLOW_ITEM_TYPE_IPV4; + else if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_IPv6) + ret = RTE_FLOW_ITEM_TYPE_IPV6; + else if (rte_be_to_cpu_16(ether_type) == ETHER_TYPE_VLAN) + ret = RTE_FLOW_ITEM_TYPE_VLAN; + break; + case RTE_FLOW_ITEM_TYPE_IPV4: + if (item->mask) + ip_next_proto_m = ((const struct rte_flow_item_ipv4 *) + (item->mask))->hdr.next_proto_id; + else + ip_next_proto_m = + rte_flow_item_ipv4_mask.hdr.next_proto_id; + if (ip_next_proto_m != 0xFF) + break; + ip_next_proto = ((const struct rte_flow_item_ipv4 *) + (item->spec))->hdr.next_proto_id; + if (ip_next_proto == IPPROTO_UDP) + ret = RTE_FLOW_ITEM_TYPE_UDP; + else if (ip_next_proto == IPPROTO_TCP) + ret = RTE_FLOW_ITEM_TYPE_TCP; + else if (ip_next_proto == IPPROTO_IP) + ret = RTE_FLOW_ITEM_TYPE_IPV4; + else if (ip_next_proto == IPPROTO_IPV6) + ret = RTE_FLOW_ITEM_TYPE_IPV6; + break; + case RTE_FLOW_ITEM_TYPE_IPV6: + if (item->mask) + ip_next_proto_m = ((const struct rte_flow_item_ipv6 *) + (item->mask))->hdr.proto; + else + ip_next_proto_m = + rte_flow_item_ipv6_mask.hdr.proto; + if (ip_next_proto_m != 0xFF) + break; + ip_next_proto = ((const struct rte_flow_item_ipv6 *) + (item->spec))->hdr.proto; + if (ip_next_proto == IPPROTO_UDP) + ret = RTE_FLOW_ITEM_TYPE_UDP; + else if (ip_next_proto == IPPROTO_TCP) + ret = RTE_FLOW_ITEM_TYPE_TCP; + else if (ip_next_proto == IPPROTO_IP) + ret = RTE_FLOW_ITEM_TYPE_IPV4; + else if (ip_next_proto == IPPROTO_IPV6) + ret = RTE_FLOW_ITEM_TYPE_IPV6; + break; + default: + ret = RTE_FLOW_ITEM_TYPE_VOID; + break; + } + return ret; +} + /* Get generic flow operations structure from a port. */ const struct rte_flow_ops * rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error) @@ -916,7 +1009,13 @@ size_t lsize; size_t user_pattern_size = 0; void *addr = NULL; + const struct rte_flow_expand_node *next = NULL; + struct rte_flow_item missed_item; + int missed = 0; + int elt = 0; + const struct rte_flow_item *last_item = NULL; + memset(&missed_item, 0, sizeof(missed_item)); lsize = offsetof(struct rte_flow_expand_rss, entry) + elt_n * sizeof(buf->entry[0]); if (lsize <= size) { @@ -926,8 +1025,8 @@ addr = buf->entry[0].pattern; } for (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { - const struct rte_flow_expand_node *next = NULL; - + if (item->type != RTE_FLOW_ITEM_TYPE_VOID) + last_item = item; for (i = 0; node->next && node->next[i]; ++i) { next = &graph[node->next[i]]; if (next->type == item->type) @@ -948,6 +1047,41 @@ /* Start expanding. */ memset(flow_items, 0, sizeof(flow_items)); user_pattern_size -= sizeof(*item); + /* + * Check if the last valid item has spec set + * and need complete pattern. + */ + missed_item.type = rte_flow_expand_rss_item_complete(last_item); + if (missed_item.type != RTE_FLOW_ITEM_TYPE_VOID) { + next = NULL; + missed = 1; + for (i = 0; node->next && node->next[i]; ++i) { + next = &graph[node->next[i]]; + if (next->type == missed_item.type) { + flow_items[0].type = missed_item.type; + flow_items[1].type = RTE_FLOW_ITEM_TYPE_END; + break; + } + next = NULL; + } + } + if (next && missed) { + elt = 2; /* missed item + item end. */ + node = next; + lsize += elt * sizeof(*item) + user_pattern_size; + if ((node->rss_types & types) && lsize <= size) { + buf->entry[buf->entries].priority = 1; + buf->entry[buf->entries].pattern = addr; + buf->entries++; + rte_memcpy(addr, buf->entry[0].pattern, + user_pattern_size); + addr = (void *)(((uintptr_t)addr) + user_pattern_size); + rte_memcpy(addr, flow_items, elt * sizeof(*item)); + addr = (void *)(((uintptr_t)addr) + + elt * sizeof(*item)); + } + } + memset(flow_items, 0, sizeof(flow_items)); next_node = node->next; stack[stack_pos] = next_node; node = next_node ? &graph[*next_node] : NULL; @@ -960,21 +1094,24 @@ * When the stack_pos is 0, there are 1 element in it, * plus the addition END item. */ - int elt = stack_pos + 2; - + elt = stack_pos + 2; flow_items[stack_pos + 1].type = RTE_FLOW_ITEM_TYPE_END; lsize += elt * sizeof(*item) + user_pattern_size; if (lsize <= size) { size_t n = elt * sizeof(*item); buf->entry[buf->entries].priority = - stack_pos + 1; + stack_pos + 1 + missed; buf->entry[buf->entries].pattern = addr; buf->entries++; rte_memcpy(addr, buf->entry[0].pattern, user_pattern_size); addr = (void *)(((uintptr_t)addr) + user_pattern_size); + rte_memcpy(addr, &missed_item, + missed * sizeof(*item)); + addr = (void *)(((uintptr_t)addr) + + missed * sizeof(*item)); rte_memcpy(addr, flow_items, n); addr = (void *)(((uintptr_t)addr) + n); } @@ -999,5 +1136,23 @@ } node = *next_node ? &graph[*next_node] : NULL; }; + /* no expanded flows but we have missed item, create one rule for it */ + if (buf->entries == 1 && missed != 0) { + elt = 2; + lsize += elt * sizeof(*item) + user_pattern_size; + if (lsize <= size) { + buf->entry[buf->entries].priority = 1; + buf->entry[buf->entries].pattern = addr; + buf->entries++; + flow_items[0].type = missed_item.type; + flow_items[1].type = RTE_FLOW_ITEM_TYPE_END; + rte_memcpy(addr, buf->entry[0].pattern, + user_pattern_size); + addr = (void *)(((uintptr_t)addr) + user_pattern_size); + rte_memcpy(addr, flow_items, elt * sizeof(*item)); + addr = (void *)(((uintptr_t)addr) + + elt * sizeof(*item)); + } + } return lsize; } diff -Nru dpdk-18.11.5/lib/librte_eventdev/rte_event_timer_adapter.c dpdk-18.11.6/lib/librte_eventdev/rte_event_timer_adapter.c --- dpdk-18.11.5/lib/librte_eventdev/rte_event_timer_adapter.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eventdev/rte_event_timer_adapter.c 2020-01-31 09:55:30.000000000 +0000 @@ -684,11 +684,11 @@ RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE, &sched_type); - if ((ret < 0 && ret != -EOVERFLOW) || - evtim->ev.sched_type != sched_type) - return -1; + if ((ret == 0 && evtim->ev.sched_type == sched_type) || + ret == -EOVERFLOW) + return 0; - return 0; + return -1; } #define NB_OBJS 32 diff -Nru dpdk-18.11.5/lib/librte_eventdev/rte_eventdev.c dpdk-18.11.6/lib/librte_eventdev/rte_eventdev.c --- dpdk-18.11.5/lib/librte_eventdev/rte_eventdev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_eventdev/rte_eventdev.c 2020-01-31 09:55:30.000000000 +0000 @@ -892,7 +892,7 @@ dev = &rte_eventdevs[dev_id]; if (*dev->dev_ops->port_link == NULL) { - RTE_PMD_DEBUG_TRACE("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported\n"); rte_errno = ENOTSUP; return 0; } @@ -951,7 +951,7 @@ dev = &rte_eventdevs[dev_id]; if (*dev->dev_ops->port_unlink == NULL) { - RTE_PMD_DEBUG_TRACE("Function not supported\n"); + RTE_EDEV_LOG_ERR("Function not supported"); rte_errno = ENOTSUP; return 0; } diff -Nru dpdk-18.11.5/lib/librte_mempool/rte_mempool.c dpdk-18.11.6/lib/librte_mempool/rte_mempool.c --- dpdk-18.11.5/lib/librte_mempool/rte_mempool.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_mempool/rte_mempool.c 2020-01-31 09:55:30.000000000 +0000 @@ -355,6 +355,19 @@ return ret; } +static rte_iova_t +get_iova(void *addr) +{ + struct rte_memseg *ms; + + /* try registered memory first */ + ms = rte_mem_virt2memseg(addr, NULL); + if (ms == NULL || ms->iova == RTE_BAD_IOVA) + /* fall back to actual physical address */ + return rte_mem_virt2iova(addr); + return ms->iova + RTE_PTR_DIFF(addr, ms->addr); +} + /* Populate the mempool with a virtual area. Return the number of * objects added, or a negative value on error. */ @@ -380,7 +393,7 @@ for (off = 0; off + pg_sz <= len && mp->populated_size < mp->size; off += phys_len) { - iova = rte_mem_virt2iova(addr + off); + iova = get_iova(addr + off); if (iova == RTE_BAD_IOVA && rte_eal_has_hugepages()) { ret = -EINVAL; @@ -391,7 +404,7 @@ for (phys_len = pg_sz; off + phys_len < len; phys_len += pg_sz) { rte_iova_t iova_tmp; - iova_tmp = rte_mem_virt2iova(addr + off + phys_len); + iova_tmp = get_iova(addr + off + phys_len); if (iova_tmp != iova + phys_len) break; diff -Nru dpdk-18.11.5/lib/librte_port/meson.build dpdk-18.11.6/lib/librte_port/meson.build --- dpdk-18.11.5/lib/librte_port/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_port/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -23,6 +23,10 @@ 'rte_port_sym_crypto.h') deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev'] +if dpdk_conf.has('RTE_PORT_PCAP') + ext_deps += pcap_dep # dependency provided in config/meson.build +endif + if dpdk_conf.has('RTE_LIBRTE_KNI') sources += files('rte_port_kni.c') headers += files('rte_port_kni.h') diff -Nru dpdk-18.11.5/lib/librte_power/guest_channel.c dpdk-18.11.6/lib/librte_power/guest_channel.c --- dpdk-18.11.5/lib/librte_power/guest_channel.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_power/guest_channel.c 2020-01-31 09:55:30.000000000 +0000 @@ -19,7 +19,7 @@ #define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 -static int global_fds[RTE_MAX_LCORE]; +static int global_fds[RTE_MAX_LCORE] = { [0 ... RTE_MAX_LCORE-1] = -1 }; int guest_channel_host_connect(const char *path, unsigned int lcore_id) @@ -35,7 +35,7 @@ return -1; } /* check if path is already open */ - if (global_fds[lcore_id] != 0) { + if (global_fds[lcore_id] != -1) { RTE_LOG(ERR, GUEST_CHANNEL, "Channel(%u) is already open with fd %d\n", lcore_id, global_fds[lcore_id]); return -1; @@ -84,7 +84,7 @@ return 0; error: close(fd); - global_fds[lcore_id] = 0; + global_fds[lcore_id] = -1; return -1; } @@ -100,7 +100,7 @@ return -1; } - if (global_fds[lcore_id] == 0) { + if (global_fds[lcore_id] < 0) { RTE_LOG(ERR, GUEST_CHANNEL, "Channel is not connected\n"); return -1; } @@ -134,8 +134,8 @@ lcore_id, RTE_MAX_LCORE-1); return; } - if (global_fds[lcore_id] == 0) + if (global_fds[lcore_id] < 0) return; close(global_fds[lcore_id]); - global_fds[lcore_id] = 0; + global_fds[lcore_id] = -1; } diff -Nru dpdk-18.11.5/lib/librte_power/power_acpi_cpufreq.c dpdk-18.11.6/lib/librte_power/power_acpi_cpufreq.c --- dpdk-18.11.5/lib/librte_power/power_acpi_cpufreq.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_power/power_acpi_cpufreq.c 2020-01-31 09:55:30.000000000 +0000 @@ -29,7 +29,7 @@ #define FOPEN_OR_ERR_RET(f, retval) do { \ if ((f) == NULL) { \ - RTE_LOG(ERR, POWER, "File not openned\n"); \ + RTE_LOG(ERR, POWER, "File not opened\n"); \ return retval; \ } \ } while (0) @@ -108,7 +108,7 @@ if (idx == pi->curr_idx) return 0; - POWER_DEBUG_TRACE("Freqency[%u] %u to be set for lcore %u\n", + POWER_DEBUG_TRACE("Frequency[%u] %u to be set for lcore %u\n", idx, pi->freqs[idx], pi->lcore_id); if (fseek(pi->f, 0, SEEK_SET) < 0) { RTE_LOG(ERR, POWER, "Fail to set file position indicator to 0 " @@ -505,7 +505,8 @@ } pi = &lcore_power_info[lcore_id]; - if (pi->curr_idx == 0) + if (pi->curr_idx == 0 || + (pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable)) return 0; /* Frequencies in the array are from high to low. */ diff -Nru dpdk-18.11.5/lib/librte_security/rte_security.h dpdk-18.11.6/lib/librte_security/rte_security.h --- dpdk-18.11.5/lib/librte_security/rte_security.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_security/rte_security.h 2020-01-31 09:55:30.000000000 +0000 @@ -115,14 +115,14 @@ * IPsec Security Association option flags */ struct rte_security_ipsec_sa_options { - /**< Extended Sequence Numbers (ESN) + /** Extended Sequence Numbers (ESN) * * * 1: Use extended (64 bit) sequence numbers * * 0: Use normal sequence numbers */ uint32_t esn : 1; - /**< UDP encapsulation + /** UDP encapsulation * * * 1: Do UDP encapsulation/decapsulation so that IPSEC packets can * traverse through NAT boxes. @@ -130,7 +130,7 @@ */ uint32_t udp_encap : 1; - /**< Copy DSCP bits + /** Copy DSCP bits * * * 1: Copy IPv4 or IPv6 DSCP bits from inner IP header to * the outer IP header in encapsulation, and vice versa in @@ -139,7 +139,7 @@ */ uint32_t copy_dscp : 1; - /**< Copy IPv6 Flow Label + /** Copy IPv6 Flow Label * * * 1: Copy IPv6 flow label from inner IPv6 header to the * outer IPv6 header. @@ -147,7 +147,7 @@ */ uint32_t copy_flabel : 1; - /**< Copy IPv4 Don't Fragment bit + /** Copy IPv4 Don't Fragment bit * * * 1: Copy the DF bit from the inner IPv4 header to the outer * IPv4 header. @@ -155,7 +155,7 @@ */ uint32_t copy_df : 1; - /**< Decrement inner packet Time To Live (TTL) field + /** Decrement inner packet Time To Live (TTL) field * * * 1: In tunnel mode, decrement inner packet IPv4 TTL or * IPv6 Hop Limit after tunnel decapsulation, or before tunnel diff -Nru dpdk-18.11.5/lib/librte_vhost/rte_vhost.h dpdk-18.11.6/lib/librte_vhost/rte_vhost.h --- dpdk-18.11.5/lib/librte_vhost/rte_vhost.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/rte_vhost.h 2020-01-31 09:55:30.000000000 +0000 @@ -225,7 +225,7 @@ * @param vid * vhost device ID * @param addr - * the starting address for write + * the starting address for write (in guest physical address space) * @param len * the length to write */ diff -Nru dpdk-18.11.5/lib/librte_vhost/socket.c dpdk-18.11.6/lib/librte_vhost/socket.c --- dpdk-18.11.5/lib/librte_vhost/socket.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/socket.c 2020-01-31 09:55:30.000000000 +0000 @@ -130,7 +130,7 @@ } if (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) { - RTE_LOG(ERR, VHOST_CONFIG, "truncted msg\n"); + RTE_LOG(ERR, VHOST_CONFIG, "truncated msg\n"); return -1; } @@ -857,6 +857,14 @@ } vsocket->dequeue_zero_copy = flags & RTE_VHOST_USER_DEQUEUE_ZERO_COPY; + if (vsocket->dequeue_zero_copy && + (flags & RTE_VHOST_USER_IOMMU_SUPPORT)) { + RTE_LOG(ERR, VHOST_CONFIG, + "error: enabling dequeue zero copy and IOMMU features " + "simultaneously is not supported\n"); + goto out_mutex; + } + /* * Set the supported features correctly for the builtin vhost-user * net driver. diff -Nru dpdk-18.11.5/lib/librte_vhost/vhost.c dpdk-18.11.6/lib/librte_vhost/vhost.c --- dpdk-18.11.5/lib/librte_vhost/vhost.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/vhost.c 2020-01-31 09:55:30.000000000 +0000 @@ -69,6 +69,210 @@ return 0; } +#define VHOST_LOG_PAGE 4096 + +/* + * Atomically set a bit in memory. + */ +static __rte_always_inline void +vhost_set_bit(unsigned int nr, volatile uint8_t *addr) +{ +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100) + /* + * __sync_ built-ins are deprecated, but __atomic_ ones + * are sub-optimized in older GCC versions. + */ + __sync_fetch_and_or_1(addr, (1U << nr)); +#else + __atomic_fetch_or(addr, (1U << nr), __ATOMIC_RELAXED); +#endif +} + +static __rte_always_inline void +vhost_log_page(uint8_t *log_base, uint64_t page) +{ + vhost_set_bit(page % 8, &log_base[page / 8]); +} + +void +__vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len) +{ + uint64_t page; + + if (unlikely(!dev->log_base || !len)) + return; + + if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8))) + return; + + /* To make sure guest memory updates are committed before logging */ + rte_smp_wmb(); + + page = addr / VHOST_LOG_PAGE; + while (page * VHOST_LOG_PAGE < addr + len) { + vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); + page += 1; + } +} + +void +__vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len) +{ + uint64_t hva, gpa, map_len; + map_len = len; + + hva = __vhost_iova_to_vva(dev, vq, iova, &map_len, VHOST_ACCESS_RW); + if (map_len != len) { + RTE_LOG(ERR, VHOST_CONFIG, + "Failed to write log for IOVA 0x%" PRIx64 ". No IOTLB entry found\n", + iova); + return; + } + + gpa = hva_to_gpa(dev, hva, len); + if (gpa) + __vhost_log_write(dev, gpa, len); +} + +void +__vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq) +{ + unsigned long *log_base; + int i; + + if (unlikely(!dev->log_base)) + return; + + rte_smp_wmb(); + + log_base = (unsigned long *)(uintptr_t)dev->log_base; + + for (i = 0; i < vq->log_cache_nb_elem; i++) { + struct log_cache_entry *elem = vq->log_cache + i; + +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100) + /* + * '__sync' builtins are deprecated, but '__atomic' ones + * are sub-optimized in older GCC versions. + */ + __sync_fetch_and_or(log_base + elem->offset, elem->val); +#else + __atomic_fetch_or(log_base + elem->offset, elem->val, + __ATOMIC_RELAXED); +#endif + } + + rte_smp_wmb(); + + vq->log_cache_nb_elem = 0; +} + +static __rte_always_inline void +vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t page) +{ + uint32_t bit_nr = page % (sizeof(unsigned long) << 3); + uint32_t offset = page / (sizeof(unsigned long) << 3); + int i; + + for (i = 0; i < vq->log_cache_nb_elem; i++) { + struct log_cache_entry *elem = vq->log_cache + i; + + if (elem->offset == offset) { + elem->val |= (1UL << bit_nr); + return; + } + } + + if (unlikely(i >= VHOST_LOG_CACHE_NR)) { + /* + * No more room for a new log cache entry, + * so write the dirty log map directly. + */ + rte_smp_wmb(); + vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); + + return; + } + + vq->log_cache[i].offset = offset; + vq->log_cache[i].val = (1UL << bit_nr); + vq->log_cache_nb_elem++; +} + +void +__vhost_log_cache_write(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t addr, uint64_t len) +{ + uint64_t page; + + if (unlikely(!dev->log_base || !len)) + return; + + if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8))) + return; + + page = addr / VHOST_LOG_PAGE; + while (page * VHOST_LOG_PAGE < addr + len) { + vhost_log_cache_page(dev, vq, page); + page += 1; + } +} + +void +__vhost_log_cache_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len) +{ + uint64_t hva, gpa, map_len; + map_len = len; + + hva = __vhost_iova_to_vva(dev, vq, iova, &map_len, VHOST_ACCESS_RW); + if (map_len != len) { + RTE_LOG(ERR, VHOST_CONFIG, + "Failed to write log for IOVA 0x%" PRIx64 ". No IOTLB entry found\n", + iova); + return; + } + + gpa = hva_to_gpa(dev, hva, len); + if (gpa) + __vhost_log_cache_write(dev, vq, gpa, len); +} + +void * +vhost_alloc_copy_ind_table(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t desc_addr, uint64_t desc_len) +{ + void *idesc; + uint64_t src, dst; + uint64_t len, remain = desc_len; + + idesc = rte_malloc(__func__, desc_len, 0); + if (unlikely(!idesc)) + return NULL; + + dst = (uint64_t)(uintptr_t)idesc; + + while (remain) { + len = remain; + src = vhost_iova_to_vva(dev, vq, desc_addr, &len, + VHOST_ACCESS_RO); + if (unlikely(!src || !len)) { + rte_free(idesc); + return NULL; + } + + rte_memcpy((void *)(uintptr_t)dst, (void *)(uintptr_t)src, len); + + remain -= len; + dst += len; + desc_addr += len; + } + + return idesc; +} + void cleanup_vq(struct vhost_virtqueue *vq, int destroy) { @@ -194,7 +398,7 @@ { if (!(dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM))) - goto out; + return -1; if (vq_is_packed(dev)) { if (vring_translate_packed(dev, vq) < 0) @@ -203,7 +407,6 @@ if (vring_translate_split(dev, vq) < 0) return -1; } -out: vq->access_ok = 1; return 0; @@ -219,6 +422,7 @@ vq->desc = NULL; vq->avail = NULL; vq->used = NULL; + vq->log_guest_addr = 0; if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) vhost_user_iotlb_wr_unlock(vq); @@ -635,22 +839,33 @@ { struct virtio_net *dev; struct vhost_virtqueue *vq; + uint16_t ret = 0; dev = get_device(vid); if (!dev) return 0; vq = dev->virtqueue[queue_id]; - if (!vq->enabled) - return 0; - return *(volatile uint16_t *)&vq->avail->idx - vq->last_used_idx; + rte_spinlock_lock(&vq->access_lock); + + if (unlikely(!vq->enabled || vq->avail == NULL)) + goto out; + + ret = *(volatile uint16_t *)&vq->avail->idx - vq->last_used_idx; + +out: + rte_spinlock_unlock(&vq->access_lock); + return ret; } -static inline void +static inline int vhost_enable_notify_split(struct virtio_net *dev, struct vhost_virtqueue *vq, int enable) { + if (vq->used == NULL) + return -1; + if (!(dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX))) { if (enable) vq->used->flags &= ~VRING_USED_F_NO_NOTIFY; @@ -660,17 +875,21 @@ if (enable) vhost_avail_event(vq) = vq->last_avail_idx; } + return 0; } -static inline void +static inline int vhost_enable_notify_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, int enable) { uint16_t flags; + if (vq->device_event == NULL) + return -1; + if (!enable) { vq->device_event->flags = VRING_EVENT_F_DISABLE; - return; + return 0; } flags = VRING_EVENT_F_ENABLE; @@ -683,6 +902,7 @@ rte_smp_wmb(); vq->device_event->flags = flags; + return 0; } int @@ -690,18 +910,23 @@ { struct virtio_net *dev = get_device(vid); struct vhost_virtqueue *vq; + int ret; if (!dev) return -1; vq = dev->virtqueue[queue_id]; + rte_spinlock_lock(&vq->access_lock); + if (vq_is_packed(dev)) - vhost_enable_notify_packed(dev, vq, enable); + ret = vhost_enable_notify_packed(dev, vq, enable); else - vhost_enable_notify_split(dev, vq, enable); + ret = vhost_enable_notify_split(dev, vq, enable); - return 0; + rte_spinlock_unlock(&vq->access_lock); + + return ret; } void @@ -740,6 +965,7 @@ { struct virtio_net *dev; struct vhost_virtqueue *vq; + uint16_t ret = 0; dev = get_device(vid); if (dev == NULL) @@ -755,10 +981,16 @@ if (vq == NULL) return 0; + rte_spinlock_lock(&vq->access_lock); + if (unlikely(vq->enabled == 0 || vq->avail == NULL)) - return 0; + goto out; + + ret = *((volatile uint16_t *)&vq->avail->idx) - vq->last_avail_idx; - return *((volatile uint16_t *)&vq->avail->idx) - vq->last_avail_idx; +out: + rte_spinlock_unlock(&vq->access_lock); + return ret; } int rte_vhost_get_vdpa_device_id(int vid) diff -Nru dpdk-18.11.5/lib/librte_vhost/vhost.h dpdk-18.11.6/lib/librte_vhost/vhost.h --- dpdk-18.11.5/lib/librte_vhost/vhost.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/vhost.h 2020-01-31 09:55:30.000000000 +0000 @@ -399,155 +399,78 @@ wrap_counter != !!(flags & VRING_DESC_F_USED); } -#define VHOST_LOG_PAGE 4096 +void __vhost_log_cache_write(struct virtio_net *dev, + struct vhost_virtqueue *vq, + uint64_t addr, uint64_t len); +void __vhost_log_cache_write_iova(struct virtio_net *dev, + struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len); +void __vhost_log_cache_sync(struct virtio_net *dev, + struct vhost_virtqueue *vq); +void __vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len); +void __vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len); -/* - * Atomically set a bit in memory. - */ static __rte_always_inline void -vhost_set_bit(unsigned int nr, volatile uint8_t *addr) +vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len) { -#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100) - /* - * __sync_ built-ins are deprecated, but __atomic_ ones - * are sub-optimized in older GCC versions. - */ - __sync_fetch_and_or_1(addr, (1U << nr)); -#else - __atomic_fetch_or(addr, (1U << nr), __ATOMIC_RELAXED); -#endif + if (unlikely(dev->features & (1ULL << VHOST_F_LOG_ALL))) + __vhost_log_write(dev, addr, len); } static __rte_always_inline void -vhost_log_page(uint8_t *log_base, uint64_t page) +vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq) { - vhost_set_bit(page % 8, &log_base[page / 8]); + if (unlikely(dev->features & (1ULL << VHOST_F_LOG_ALL))) + __vhost_log_cache_sync(dev, vq); } static __rte_always_inline void -vhost_log_write(struct virtio_net *dev, uint64_t addr, uint64_t len) +vhost_log_cache_write(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t addr, uint64_t len) { - uint64_t page; - - if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) || - !dev->log_base || !len)) - return; - - if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8))) - return; - - /* To make sure guest memory updates are committed before logging */ - rte_smp_wmb(); - - page = addr / VHOST_LOG_PAGE; - while (page * VHOST_LOG_PAGE < addr + len) { - vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); - page += 1; - } + if (unlikely(dev->features & (1ULL << VHOST_F_LOG_ALL))) + __vhost_log_cache_write(dev, vq, addr, len); } static __rte_always_inline void -vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq) +vhost_log_cache_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t offset, uint64_t len) { - unsigned long *log_base; - int i; - - if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) || - !dev->log_base)) - return; - - log_base = (unsigned long *)(uintptr_t)dev->log_base; - - /* - * It is expected a write memory barrier has been issued - * before this function is called. - */ - - for (i = 0; i < vq->log_cache_nb_elem; i++) { - struct log_cache_entry *elem = vq->log_cache + i; - -#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100) - /* - * '__sync' builtins are deprecated, but '__atomic' ones - * are sub-optimized in older GCC versions. - */ - __sync_fetch_and_or(log_base + elem->offset, elem->val); -#else - __atomic_fetch_or(log_base + elem->offset, elem->val, - __ATOMIC_RELAXED); -#endif - } - - rte_smp_wmb(); - - vq->log_cache_nb_elem = 0; + vhost_log_cache_write(dev, vq, vq->log_guest_addr + offset, len); } static __rte_always_inline void -vhost_log_cache_page(struct virtio_net *dev, struct vhost_virtqueue *vq, - uint64_t page) +vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t offset, uint64_t len) { - uint32_t bit_nr = page % (sizeof(unsigned long) << 3); - uint32_t offset = page / (sizeof(unsigned long) << 3); - int i; - - for (i = 0; i < vq->log_cache_nb_elem; i++) { - struct log_cache_entry *elem = vq->log_cache + i; - - if (elem->offset == offset) { - elem->val |= (1UL << bit_nr); - return; - } - } - - if (unlikely(i >= VHOST_LOG_CACHE_NR)) { - /* - * No more room for a new log cache entry, - * so write the dirty log map directly. - */ - rte_smp_wmb(); - vhost_log_page((uint8_t *)(uintptr_t)dev->log_base, page); - - return; - } - - vq->log_cache[i].offset = offset; - vq->log_cache[i].val = (1UL << bit_nr); - vq->log_cache_nb_elem++; + vhost_log_write(dev, vq->log_guest_addr + offset, len); } static __rte_always_inline void -vhost_log_cache_write(struct virtio_net *dev, struct vhost_virtqueue *vq, - uint64_t addr, uint64_t len) +vhost_log_cache_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len) { - uint64_t page; - - if (likely(((dev->features & (1ULL << VHOST_F_LOG_ALL)) == 0) || - !dev->log_base || !len)) - return; - - if (unlikely(dev->log_size <= ((addr + len - 1) / VHOST_LOG_PAGE / 8))) + if (likely(!(dev->features & (1ULL << VHOST_F_LOG_ALL)))) return; - page = addr / VHOST_LOG_PAGE; - while (page * VHOST_LOG_PAGE < addr + len) { - vhost_log_cache_page(dev, vq, page); - page += 1; - } + if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) + __vhost_log_cache_write_iova(dev, vq, iova, len); + else + __vhost_log_cache_write(dev, vq, iova, len); } static __rte_always_inline void -vhost_log_cache_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, - uint64_t offset, uint64_t len) +vhost_log_write_iova(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t iova, uint64_t len) { - vhost_log_cache_write(dev, vq, vq->log_guest_addr + offset, len); -} + if (likely(!(dev->features & (1ULL << VHOST_F_LOG_ALL)))) + return; -static __rte_always_inline void -vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, - uint64_t offset, uint64_t len) -{ - vhost_log_write(dev, vq->log_guest_addr + offset, len); + if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) + __vhost_log_write_iova(dev, vq, iova, len); + else + __vhost_log_write(dev, iova, len); } /* Macros for printing using RTE_LOG */ @@ -604,6 +527,26 @@ return 0; } +static __rte_always_inline uint64_t +hva_to_gpa(struct virtio_net *dev, uint64_t vva, uint64_t len) +{ + struct rte_vhost_mem_region *r; + uint32_t i; + + if (unlikely(!dev || !dev->mem)) + return 0; + + for (i = 0; i < dev->mem->nregions; i++) { + r = &dev->mem->regions[i]; + + if (vva >= r->host_user_addr && + vva + len < r->host_user_addr + r->size) { + return r->guest_phys_addr + vva - r->host_user_addr; + } + } + return 0; +} + static __rte_always_inline struct virtio_net * get_device(int vid) { @@ -646,6 +589,9 @@ uint64_t __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq, uint64_t iova, uint64_t *len, uint8_t perm); +void *vhost_alloc_copy_ind_table(struct virtio_net *dev, + struct vhost_virtqueue *vq, + uint64_t desc_addr, uint64_t desc_len); int vring_translate(struct virtio_net *dev, struct vhost_virtqueue *vq); void vring_invalidate(struct virtio_net *dev, struct vhost_virtqueue *vq); diff -Nru dpdk-18.11.5/lib/librte_vhost/vhost_user.c dpdk-18.11.6/lib/librte_vhost/vhost_user.c --- dpdk-18.11.5/lib/librte_vhost/vhost_user.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/vhost_user.c 2020-01-31 09:55:30.000000000 +0000 @@ -384,8 +384,20 @@ * * Queue Size value is always a power of 2. The maximum Queue Size * value is 32768. + * + * VIRTIO 1.1 2.7 Virtqueues says: + * + * Packed virtqueues support up to 2^15 entries each. */ - if ((vq->size & (vq->size - 1)) || vq->size > 32768) { + if (!vq_is_packed(dev)) { + if (vq->size & (vq->size - 1)) { + RTE_LOG(ERR, VHOST_CONFIG, + "invalid virtqueue size %u\n", vq->size); + return VH_RESULT_ERR; + } + } + + if (vq->size > 32768) { RTE_LOG(ERR, VHOST_CONFIG, "invalid virtqueue size %u\n", vq->size); return VH_RESULT_ERR; @@ -465,6 +477,9 @@ struct batch_copy_elem *new_batch_copy_elems; int ret; + if (dev->flags & VIRTIO_DEV_RUNNING) + return dev; + old_dev = dev; vq = old_vq = dev->virtqueue[index]; @@ -613,11 +628,13 @@ { if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) { uint64_t vva; + uint64_t req_size = *size; vva = vhost_user_iotlb_cache_find(vq, ra, size, VHOST_ACCESS_RW); - if (!vva) - vhost_user_iotlb_miss(dev, ra, VHOST_ACCESS_RW); + if (req_size != *size) + vhost_user_iotlb_miss(dev, (ra + *size), + VHOST_ACCESS_RW); return vva; } @@ -625,6 +642,39 @@ return qva_to_vva(dev, ra, size); } +/* + * Converts vring log address to GPA + * If IOMMU is enabled, the log address is IOVA + * If IOMMU not enabled, the log address is already GPA + */ +static uint64_t +translate_log_addr(struct virtio_net *dev, struct vhost_virtqueue *vq, + uint64_t log_addr) +{ + if (dev->features & (1ULL << VIRTIO_F_IOMMU_PLATFORM)) { + const uint64_t exp_size = sizeof(struct vring_used) + + sizeof(struct vring_used_elem) * vq->size; + uint64_t hva, gpa; + uint64_t size = exp_size; + + hva = vhost_iova_to_vva(dev, vq, log_addr, + &size, VHOST_ACCESS_RW); + if (size != exp_size) + return 0; + + gpa = hva_to_gpa(dev, hva, exp_size); + if (!gpa) { + RTE_LOG(ERR, VHOST_CONFIG, + "VQ: Failed to find GPA for log_addr: 0x%" PRIx64 " hva: 0x%" PRIx64 "\n", + log_addr, hva); + return 0; + } + return gpa; + + } else + return log_addr; +} + static struct virtio_net * translate_ring_addresses(struct virtio_net *dev, int vq_index) { @@ -632,11 +682,21 @@ struct vhost_vring_addr *addr = &vq->ring_addrs; uint64_t len, expected_len; + if (addr->flags & (1 << VHOST_VRING_F_LOG)) { + vq->log_guest_addr = + translate_log_addr(dev, vq, addr->log_guest_addr); + if (vq->log_guest_addr == 0) { + RTE_LOG(DEBUG, VHOST_CONFIG, + "(%d) failed to map log_guest_addr.\n", + dev->vid); + return dev; + } + } + if (vq_is_packed(dev)) { len = sizeof(struct vring_packed_desc) * vq->size; vq->desc_packed = (struct vring_packed_desc *)(uintptr_t) ring_addr_to_vva(dev, vq, addr->desc_user_addr, &len); - vq->log_guest_addr = 0; if (vq->desc_packed == NULL || len != sizeof(struct vring_packed_desc) * vq->size) { @@ -674,6 +734,7 @@ return dev; } + vq->access_ok = 1; return dev; } @@ -731,7 +792,7 @@ vq->last_avail_idx = vq->used->idx; } - vq->log_guest_addr = addr->log_guest_addr; + vq->access_ok = 1; VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address desc: %p\n", dev->vid, vq->desc); @@ -756,6 +817,7 @@ struct virtio_net *dev = *pdev; struct vhost_virtqueue *vq; struct vhost_vring_addr *addr = &msg->payload.addr; + bool access_ok; if (validate_msg_fds(msg, 0) != 0) return VH_RESULT_ERR; @@ -766,6 +828,8 @@ /* addr->index refers to the queue index. The txq 1, rxq is 0. */ vq = dev->virtqueue[msg->payload.addr.index]; + access_ok = vq->access_ok; + /* * Rings addresses should not be interpreted as long as the ring is not * started and enabled @@ -774,8 +838,9 @@ vring_invalidate(dev, vq); - if (vq->enabled && (dev->features & - (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) { + if ((vq->enabled && (dev->features & + (1ULL << VHOST_USER_F_PROTOCOL_FEATURES))) || + access_ok) { dev = translate_ring_addresses(dev, msg->payload.addr.index); if (!dev) return VH_RESULT_ERR; @@ -1153,10 +1218,11 @@ goto err_mmap; } RTE_LOG(INFO, VHOST_CONFIG, - "\t userfaultfd registered for range : %llx - %llx\n", - reg_struct.range.start, - reg_struct.range.start + - reg_struct.range.len - 1); + "\t userfaultfd registered for range : " + "%" PRIx64 " - %" PRIx64 "\n", + (uint64_t)reg_struct.range.start, + (uint64_t)reg_struct.range.start + + (uint64_t)reg_struct.range.len - 1); #else goto err_mmap; #endif @@ -1408,6 +1474,8 @@ msg->size = sizeof(msg->payload.state); msg->fd_num = 0; + vring_invalidate(dev, vq); + return VH_RESULT_REPLY; } @@ -1672,60 +1740,75 @@ return VH_RESULT_ERR; } + if (dev->slave_req_fd >= 0) + close(dev->slave_req_fd); + dev->slave_req_fd = fd; return VH_RESULT_OK; } static int -is_vring_iotlb_update(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg) +is_vring_iotlb_split(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg) { struct vhost_vring_addr *ra; - uint64_t start, end; + uint64_t start, end, len; start = imsg->iova; end = start + imsg->size; ra = &vq->ring_addrs; - if (ra->desc_user_addr >= start && ra->desc_user_addr < end) + len = sizeof(struct vring_desc) * vq->size; + if (ra->desc_user_addr < end && (ra->desc_user_addr + len) > start) return 1; - if (ra->avail_user_addr >= start && ra->avail_user_addr < end) + + len = sizeof(struct vring_avail) + sizeof(uint16_t) * vq->size; + if (ra->avail_user_addr < end && (ra->avail_user_addr + len) > start) return 1; - if (ra->used_user_addr >= start && ra->used_user_addr < end) + + len = sizeof(struct vring_used) + + sizeof(struct vring_used_elem) * vq->size; + if (ra->used_user_addr < end && (ra->used_user_addr + len) > start) return 1; return 0; } static int -is_vring_iotlb_invalidate(struct vhost_virtqueue *vq, - struct vhost_iotlb_msg *imsg) +is_vring_iotlb_packed(struct vhost_virtqueue *vq, struct vhost_iotlb_msg *imsg) { - uint64_t istart, iend, vstart, vend; + struct vhost_vring_addr *ra; + uint64_t start, end, len; - istart = imsg->iova; - iend = istart + imsg->size - 1; + start = imsg->iova; + end = start + imsg->size; - vstart = (uintptr_t)vq->desc; - vend = vstart + sizeof(struct vring_desc) * vq->size - 1; - if (vstart <= iend && istart <= vend) + ra = &vq->ring_addrs; + len = sizeof(struct vring_packed_desc) * vq->size; + if (ra->desc_user_addr < end && (ra->desc_user_addr + len) > start) return 1; - vstart = (uintptr_t)vq->avail; - vend = vstart + sizeof(struct vring_avail); - vend += sizeof(uint16_t) * vq->size - 1; - if (vstart <= iend && istart <= vend) + len = sizeof(struct vring_packed_desc_event); + if (ra->avail_user_addr < end && (ra->avail_user_addr + len) > start) return 1; - vstart = (uintptr_t)vq->used; - vend = vstart + sizeof(struct vring_used); - vend += sizeof(struct vring_used_elem) * vq->size - 1; - if (vstart <= iend && istart <= vend) + len = sizeof(struct vring_packed_desc_event); + if (ra->used_user_addr < end && (ra->used_user_addr + len) > start) return 1; return 0; } +static int is_vring_iotlb(struct virtio_net *dev, + struct vhost_virtqueue *vq, + struct vhost_iotlb_msg *imsg) +{ + if (vq_is_packed(dev)) + return is_vring_iotlb_packed(vq, imsg); + else + return is_vring_iotlb_split(vq, imsg); +} + static int vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg, int main_fd __rte_unused) @@ -1751,7 +1834,7 @@ vhost_user_iotlb_cache_insert(vq, imsg->iova, vva, len, imsg->perm); - if (is_vring_iotlb_update(vq, imsg)) + if (is_vring_iotlb(dev, vq, imsg)) *pdev = dev = translate_ring_addresses(dev, i); } break; @@ -1762,7 +1845,7 @@ vhost_user_iotlb_cache_remove(vq, imsg->iova, imsg->size); - if (is_vring_iotlb_invalidate(vq, imsg)) + if (is_vring_iotlb(dev, vq, imsg)) vring_invalidate(dev, vq); } break; diff -Nru dpdk-18.11.5/lib/librte_vhost/virtio_net.c dpdk-18.11.6/lib/librte_vhost/virtio_net.c --- dpdk-18.11.5/lib/librte_vhost/virtio_net.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/lib/librte_vhost/virtio_net.c 2020-01-31 09:55:30.000000000 +0000 @@ -37,39 +37,6 @@ return (is_tx ^ (idx & 1)) == 0 && idx < nr_vring; } -static __rte_always_inline void * -alloc_copy_ind_table(struct virtio_net *dev, struct vhost_virtqueue *vq, - uint64_t desc_addr, uint64_t desc_len) -{ - void *idesc; - uint64_t src, dst; - uint64_t len, remain = desc_len; - - idesc = rte_malloc(__func__, desc_len, 0); - if (unlikely(!idesc)) - return 0; - - dst = (uint64_t)(uintptr_t)idesc; - - while (remain) { - len = remain; - src = vhost_iova_to_vva(dev, vq, desc_addr, &len, - VHOST_ACCESS_RO); - if (unlikely(!src || !len)) { - rte_free(idesc); - return 0; - } - - rte_memcpy((void *)(uintptr_t)dst, (void *)(uintptr_t)src, len); - - remain -= len; - dst += len; - desc_addr += len; - } - - return idesc; -} - static __rte_always_inline void free_ind_table(void *idesc) { @@ -136,6 +103,8 @@ { int i; uint16_t used_idx = vq->last_used_idx; + uint16_t head_idx = vq->last_used_idx; + uint16_t head_flags = 0; /* Split loop in two to save memory barriers */ for (i = 0; i < vq->shadow_used_idx; i++) { @@ -165,12 +134,17 @@ flags &= ~VRING_DESC_F_AVAIL; } - vq->desc_packed[vq->last_used_idx].flags = flags; + if (i > 0) { + vq->desc_packed[vq->last_used_idx].flags = flags; - vhost_log_cache_used_vring(dev, vq, + vhost_log_cache_used_vring(dev, vq, vq->last_used_idx * sizeof(struct vring_packed_desc), sizeof(struct vring_packed_desc)); + } else { + head_idx = vq->last_used_idx; + head_flags = flags; + } vq->last_used_idx += vq->shadow_used_packed[i].count; if (vq->last_used_idx >= vq->size) { @@ -179,7 +153,13 @@ } } - rte_smp_wmb(); + vq->desc_packed[head_idx].flags = head_flags; + + vhost_log_cache_used_vring(dev, vq, + head_idx * + sizeof(struct vring_packed_desc), + sizeof(struct vring_packed_desc)); + vq->shadow_used_idx = 0; vhost_log_cache_sync(dev, vq); } @@ -204,7 +184,8 @@ for (i = 0; i < count; i++) { rte_memcpy(elem[i].dst, elem[i].src, elem[i].len); - vhost_log_cache_write(dev, vq, elem[i].log_addr, elem[i].len); + vhost_log_cache_write_iova(dev, vq, elem[i].log_addr, + elem[i].len); PRINT_PACKET(dev, (uintptr_t)elem[i].dst, elem[i].len, 0); } @@ -268,6 +249,7 @@ ipv4_hdr = rte_pktmbuf_mtod_offset(m_buf, struct ipv4_hdr *, m_buf->l2_len); + ipv4_hdr->hdr_checksum = 0; ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); } @@ -312,6 +294,8 @@ if (unlikely(!desc_addr)) return -1; + rte_prefetch0((void *)(uintptr_t)desc_addr); + buf_vec[vec_id].buf_iova = desc_iova; buf_vec[vec_id].buf_addr = desc_addr; buf_vec[vec_id].buf_len = desc_chunck_len; @@ -363,7 +347,7 @@ * The indirect desc table is not contiguous * in process VA space, we have to copy it. */ - idesc = alloc_copy_ind_table(dev, vq, + idesc = vhost_alloc_copy_ind_table(dev, vq, vq->desc[idx].addr, vq->desc[idx].len); if (unlikely(!idesc)) return -1; @@ -480,7 +464,8 @@ * The indirect desc table is not contiguous * in process VA space, we have to copy it. */ - idescs = alloc_copy_ind_table(dev, vq, desc->addr, desc->len); + idescs = vhost_alloc_copy_ind_table(dev, + vq, desc->addr, desc->len); if (unlikely(!idescs)) return -1; @@ -636,6 +621,36 @@ return 0; } +static __rte_noinline void +copy_vnet_hdr_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, + struct buf_vector *buf_vec, + struct virtio_net_hdr_mrg_rxbuf *hdr) +{ + uint64_t len; + uint64_t remain = dev->vhost_hlen; + uint64_t src = (uint64_t)(uintptr_t)hdr, dst; + uint64_t iova = buf_vec->buf_iova; + + while (remain) { + len = RTE_MIN(remain, + buf_vec->buf_len); + dst = buf_vec->buf_addr; + rte_memcpy((void *)(uintptr_t)dst, + (void *)(uintptr_t)src, + len); + + PRINT_PACKET(dev, (uintptr_t)dst, + (uint32_t)len, 0); + vhost_log_cache_write_iova(dev, vq, + iova, len); + + remain -= len; + iova += len; + src += len; + buf_vec++; + } +} + static __rte_always_inline int copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mbuf *m, struct buf_vector *buf_vec, @@ -661,9 +676,6 @@ buf_iova = buf_vec[vec_idx].buf_iova; buf_len = buf_vec[vec_idx].buf_len; - if (nr_vec > 1) - rte_prefetch0((void *)(uintptr_t)buf_vec[1].buf_addr); - if (unlikely(buf_len < dev->vhost_hlen && nr_vec <= 1)) { error = -1; goto out; @@ -706,10 +718,6 @@ buf_iova = buf_vec[vec_idx].buf_iova; buf_len = buf_vec[vec_idx].buf_len; - /* Prefetch next buffer address. */ - if (vec_idx + 1 < nr_vec) - rte_prefetch0((void *)(uintptr_t) - buf_vec[vec_idx + 1].buf_addr); buf_offset = 0; buf_avail = buf_len; } @@ -729,34 +737,11 @@ num_buffers); if (unlikely(hdr == &tmp_hdr)) { - uint64_t len; - uint64_t remain = dev->vhost_hlen; - uint64_t src = (uint64_t)(uintptr_t)hdr, dst; - uint64_t iova = buf_vec[0].buf_iova; - uint16_t hdr_vec_idx = 0; - - while (remain) { - len = RTE_MIN(remain, - buf_vec[hdr_vec_idx].buf_len); - dst = buf_vec[hdr_vec_idx].buf_addr; - rte_memcpy((void *)(uintptr_t)dst, - (void *)(uintptr_t)src, - len); - - PRINT_PACKET(dev, (uintptr_t)dst, - (uint32_t)len, 0); - vhost_log_cache_write(dev, vq, - iova, len); - - remain -= len; - iova += len; - src += len; - hdr_vec_idx++; - } + copy_vnet_hdr_to_desc(dev, vq, buf_vec, hdr); } else { PRINT_PACKET(dev, (uintptr_t)hdr_addr, dev->vhost_hlen, 0); - vhost_log_cache_write(dev, vq, + vhost_log_cache_write_iova(dev, vq, buf_vec[0].buf_iova, dev->vhost_hlen); } @@ -771,8 +756,9 @@ rte_memcpy((void *)((uintptr_t)(buf_addr + buf_offset)), rte_pktmbuf_mtod_offset(m, void *, mbuf_offset), cpy_len); - vhost_log_cache_write(dev, vq, buf_iova + buf_offset, - cpy_len); + vhost_log_cache_write_iova(dev, vq, + buf_iova + buf_offset, + cpy_len); PRINT_PACKET(dev, (uintptr_t)(buf_addr + buf_offset), cpy_len, 0); } else { @@ -797,7 +783,7 @@ return error; } -static __rte_always_inline uint32_t +static __rte_noinline uint32_t virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mbuf **pkts, uint32_t count) { @@ -829,8 +815,6 @@ break; } - rte_prefetch0((void *)(uintptr_t)buf_vec[0].buf_addr); - VHOST_LOG_DEBUG(VHOST_DATA, "(%d) current index %d | end index %d\n", dev->vid, vq->last_avail_idx, vq->last_avail_idx + num_buffers); @@ -855,7 +839,7 @@ return pkt_idx; } -static __rte_always_inline uint32_t +static __rte_noinline uint32_t virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mbuf **pkts, uint32_t count) { @@ -878,8 +862,6 @@ break; } - rte_prefetch0((void *)(uintptr_t)buf_vec[0].buf_addr); - VHOST_LOG_DEBUG(VHOST_DATA, "(%d) current index %d | end index %d\n", dev->vid, vq->last_avail_idx, vq->last_avail_idx + num_buffers); @@ -1088,6 +1070,27 @@ } } +static __rte_noinline void +copy_vnet_hdr_from_desc(struct virtio_net_hdr *hdr, + struct buf_vector *buf_vec) +{ + uint64_t len; + uint64_t remain = sizeof(struct virtio_net_hdr); + uint64_t src; + uint64_t dst = (uint64_t)(uintptr_t)hdr; + + while (remain) { + len = RTE_MIN(remain, buf_vec->buf_len); + src = buf_vec->buf_addr; + rte_memcpy((void *)(uintptr_t)dst, + (void *)(uintptr_t)src, len); + + remain -= len; + dst += len; + buf_vec++; + } +} + static __rte_always_inline int copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, struct buf_vector *buf_vec, uint16_t nr_vec, @@ -1114,37 +1117,16 @@ goto out; } - if (likely(nr_vec > 1)) - rte_prefetch0((void *)(uintptr_t)buf_vec[1].buf_addr); - if (virtio_net_with_host_offload(dev)) { if (unlikely(buf_len < sizeof(struct virtio_net_hdr))) { - uint64_t len; - uint64_t remain = sizeof(struct virtio_net_hdr); - uint64_t src; - uint64_t dst = (uint64_t)(uintptr_t)&tmp_hdr; - uint16_t hdr_vec_idx = 0; - /* * No luck, the virtio-net header doesn't fit * in a contiguous virtual area. */ - while (remain) { - len = RTE_MIN(remain, - buf_vec[hdr_vec_idx].buf_len); - src = buf_vec[hdr_vec_idx].buf_addr; - rte_memcpy((void *)(uintptr_t)dst, - (void *)(uintptr_t)src, len); - - remain -= len; - dst += len; - hdr_vec_idx++; - } - + copy_vnet_hdr_from_desc(&tmp_hdr, buf_vec); hdr = &tmp_hdr; } else { hdr = (struct virtio_net_hdr *)((uintptr_t)buf_addr); - rte_prefetch0(hdr); } } @@ -1174,9 +1156,6 @@ buf_avail = buf_vec[vec_idx].buf_len - dev->vhost_hlen; } - rte_prefetch0((void *)(uintptr_t) - (buf_addr + buf_offset)); - PRINT_PACKET(dev, (uintptr_t)(buf_addr + buf_offset), (uint32_t)buf_avail, 0); @@ -1242,14 +1221,6 @@ buf_iova = buf_vec[vec_idx].buf_iova; buf_len = buf_vec[vec_idx].buf_len; - /* - * Prefecth desc n + 1 buffer while - * desc n buffer is processed. - */ - if (vec_idx + 1 < nr_vec) - rte_prefetch0((void *)(uintptr_t) - buf_vec[vec_idx + 1].buf_addr); - buf_offset = 0; buf_avail = buf_len; @@ -1325,7 +1296,7 @@ return NULL; } -static __rte_always_inline uint16_t +static __rte_noinline uint16_t virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count) { @@ -1393,8 +1364,6 @@ if (likely(dev->dequeue_zero_copy == 0)) update_shadow_used_ring_split(vq, head_idx, 0); - rte_prefetch0((void *)(uintptr_t)buf_vec[0].buf_addr); - pkts[i] = rte_pktmbuf_alloc(mbuf_pool); if (unlikely(pkts[i] == NULL)) { RTE_LOG(ERR, VHOST_DATA, @@ -1447,7 +1416,7 @@ return i; } -static __rte_always_inline uint16_t +static __rte_noinline uint16_t virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq, struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t count) { @@ -1506,8 +1475,6 @@ update_shadow_used_ring_packed(vq, buf_id, 0, desc_count); - rte_prefetch0((void *)(uintptr_t)buf_vec[0].buf_addr); - pkts[i] = rte_pktmbuf_alloc(mbuf_pool); if (unlikely(pkts[i] == NULL)) { RTE_LOG(ERR, VHOST_DATA, diff -Nru dpdk-18.11.5/meson.build dpdk-18.11.6/meson.build --- dpdk-18.11.5/meson.build 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/meson.build 2020-01-31 09:55:30.000000000 +0000 @@ -2,7 +2,7 @@ # Copyright(c) 2017 Intel Corporation project('DPDK', 'C', - version: '18.11.5', + version: '18.11.6', license: 'BSD', default_options: ['buildtype=release', 'default_library=static'], meson_version: '>= 0.41' diff -Nru dpdk-18.11.5/meson_options.txt dpdk-18.11.6/meson_options.txt --- dpdk-18.11.5/meson_options.txt 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/meson_options.txt 2020-01-31 09:55:30.000000000 +0000 @@ -1,5 +1,3 @@ -option('allow_invalid_socket_id', type: 'boolean', value: false, - description: 'allow out-of-range NUMA socket id\'s for platforms that don\'t report the value correctly') option('drivers_install_subdir', type: 'string', value: 'dpdk/pmds-', description: 'Subdirectory of libdir where to install PMDs. Defaults to using a versioned subdirectory.') option('enable_driver_mlx_glue', type: 'boolean', value: false, diff -Nru dpdk-18.11.5/mk/rte.app.mk dpdk-18.11.6/mk/rte.app.mk --- dpdk-18.11.5/mk/rte.app.mk 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/mk/rte.app.mk 2020-01-31 09:55:30.000000000 +0000 @@ -333,10 +333,6 @@ LDLIBS := $(call filter-libs,$(LDLIBS)) -ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) -LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib -endif - MAPFLAGS = -Map=$@.map --cref .PHONY: all diff -Nru dpdk-18.11.5/mk/toolchain/gcc/rte.toolchain-compat.mk dpdk-18.11.6/mk/toolchain/gcc/rte.toolchain-compat.mk --- dpdk-18.11.5/mk/toolchain/gcc/rte.toolchain-compat.mk 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/mk/toolchain/gcc/rte.toolchain-compat.mk 2020-01-31 09:55:30.000000000 +0000 @@ -99,7 +99,7 @@ endif # Disable octeontx event PMD for gcc < 4.8.6 & ARCH=arm64 - ifeq ($(CONFIG_RTE_ARCH), arm64) + ifeq ($(RTE_ARCH), arm64) ifeq ($(shell test $(GCC_VERSION)$(GCC_PATCHLEVEL) -lt 486 && echo 1), 1) CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF=d CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL=d diff -Nru dpdk-18.11.5/pkg/dpdk.spec dpdk-18.11.6/pkg/dpdk.spec --- dpdk-18.11.5/pkg/dpdk.spec 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/pkg/dpdk.spec 2020-01-31 09:55:30.000000000 +0000 @@ -2,7 +2,7 @@ # Copyright 2014 6WIND S.A. Name: dpdk -Version: 18.11.5 +Version: 18.11.6 Release: 1 Packager: packaging@6wind.com URL: http://dpdk.org diff -Nru dpdk-18.11.5/test/test/process.h dpdk-18.11.6/test/test/process.h --- dpdk-18.11.5/test/test/process.h 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/process.h 2020-01-31 09:55:30.000000000 +0000 @@ -9,6 +9,7 @@ #include /* basename et al */ #include /* NULL */ #include /* readlink */ +#include #ifdef RTE_EXEC_ENV_BSDAPP #define self "curproc" @@ -29,8 +30,7 @@ { int num; char *argv_cpy[numargs + 1]; - int i, fd, status; - char path[32]; + int i, status; pid_t pid = fork(); if (pid < 0) @@ -42,13 +42,50 @@ argv_cpy[i] = NULL; num = numargs; - /* close all open file descriptors, check /proc/self/fd to only - * call close on open fds. Exclude fds 0, 1 and 2*/ - for (fd = getdtablesize(); fd > 2; fd-- ) { - snprintf(path, sizeof(path), "/proc/" exe "/fd/%d", fd); - if (access(path, F_OK) == 0) +#ifdef RTE_EXEC_ENV_LINUX + { + const char *procdir = "/proc/" self "/fd/"; + struct dirent *dirent; + char *endptr; + int fd, fdir; + DIR *dir; + + /* close all open file descriptors, check /proc/self/fd + * to only call close on open fds. Exclude fds 0, 1 and + * 2 + */ + dir = opendir(procdir); + if (dir == NULL) { + rte_panic("Error opening %s: %s\n", procdir, + strerror(errno)); + } + + fdir = dirfd(dir); + if (fdir < 0) { + status = errno; + closedir(dir); + rte_panic("Error %d obtaining fd for dir %s: %s\n", + fdir, procdir, + strerror(status)); + } + + while ((dirent = readdir(dir)) != NULL) { + errno = 0; + fd = strtol(dirent->d_name, &endptr, 10); + if (errno != 0 || endptr[0] != '\0') { + printf("Error converting name fd %d %s:\n", + fd, dirent->d_name); + continue; + } + + if (fd == fdir || fd <= 2) + continue; + close(fd); + } + closedir(dir); } +#endif printf("Running binary with argv[]:"); for (i = 0; i < num; i++) printf("'%s' ", argv_cpy[i]); diff -Nru dpdk-18.11.5/test/test/test_cryptodev.c dpdk-18.11.6/test/test/test_cryptodev.c --- dpdk-18.11.5/test/test/test_cryptodev.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_cryptodev.c 2020-01-31 09:55:30.000000000 +0000 @@ -2300,6 +2300,7 @@ enum rte_crypto_auth_algorithm algo) { uint8_t hash_key[key_len]; + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -2322,8 +2323,9 @@ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->auth_xform, ts_params->session_mpool); + TEST_ASSERT_EQUAL(status, 0, "session init failed"); TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2336,7 +2338,7 @@ uint8_t iv_len) { uint8_t cipher_key[key_len]; - + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -2359,8 +2361,9 @@ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->cipher_xform, ts_params->session_mpool); + TEST_ASSERT_EQUAL(status, 0, "session init failed"); TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2438,6 +2441,7 @@ { uint8_t cipher_auth_key[key_len]; + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -2475,9 +2479,10 @@ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->cipher_xform, ts_params->session_mpool); + TEST_ASSERT_EQUAL(status, 0, "session init failed"); TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2492,6 +2497,7 @@ { const uint8_t key_len = tdata->key.len; uint8_t cipher_auth_key[key_len]; + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -2534,9 +2540,10 @@ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->cipher_xform, ts_params->session_mpool); + TEST_ASSERT_EQUAL(status, 0, "session init failed"); TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; } @@ -2562,7 +2569,7 @@ uint8_t cipher_iv_len) { uint8_t auth_cipher_key[key_len]; - + int status; struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; @@ -2596,9 +2603,10 @@ ut_params->sess = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_cryptodev_sym_session_init(dev_id, ut_params->sess, + status = rte_cryptodev_sym_session_init(dev_id, ut_params->sess, &ut_params->auth_xform, ts_params->session_mpool); + TEST_ASSERT_EQUAL(status, 0, "session init failed"); TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed"); return 0; @@ -6970,28 +6978,23 @@ return TEST_SUCCESS; } -uint8_t orig_data[] = {0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab, - 0xab, 0xab, 0xab, 0xab}; + +#define CRYPTO_NULL_DIGEST_LEN 4 + static int test_null_auth_only_operation(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + const char ver_vector[CRYPTO_NULL_DIGEST_LEN] = { 0 }; uint8_t *digest; /* Generate test mbuf data and space for digest */ ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, catch_22_quote, QUOTE_512_BYTES, 0); - - /* create a pointer for digest, but don't expect anything to be written - * here in a NULL auth algo so no mbuf append done. - */ - digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, - QUOTE_512_BYTES); - /* prefill the memory pointed to by digest */ - memcpy(digest, orig_data, sizeof(orig_data)); + digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, CRYPTO_NULL_DIGEST_LEN); + memset(digest, 0, CRYPTO_NULL_DIGEST_LEN); + ut_params->auth_xform.auth.digest_length = CRYPTO_NULL_DIGEST_LEN; /* Setup HMAC Parameters */ ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; @@ -7037,10 +7040,10 @@ "crypto operation processing failed"); /* Make sure memory pointed to by digest hasn't been overwritten */ TEST_ASSERT_BUFFERS_ARE_EQUAL( - orig_data, + ver_vector, digest, - sizeof(orig_data), - "Memory at digest ptr overwritten unexpectedly"); + CRYPTO_NULL_DIGEST_LEN, + "Digest not as expected"); return TEST_SUCCESS; } @@ -7051,19 +7054,16 @@ { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + const char ver_vector[CRYPTO_NULL_DIGEST_LEN] = { 0 }; uint8_t *digest; /* Generate test mbuf data and space for digest */ ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, catch_22_quote, QUOTE_512_BYTES, 0); - /* create a pointer for digest, but don't expect anything to be written - * here in a NULL auth algo so no mbuf append done. - */ - digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, - QUOTE_512_BYTES); - /* prefill the memory pointed to by digest */ - memcpy(digest, orig_data, sizeof(orig_data)); + digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, CRYPTO_NULL_DIGEST_LEN); + memset(digest, 0, CRYPTO_NULL_DIGEST_LEN); + ut_params->auth_xform.auth.digest_length = CRYPTO_NULL_DIGEST_LEN; /* Setup Cipher Parameters */ ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; @@ -7126,10 +7126,10 @@ "Ciphertext data not as expected"); /* Make sure memory pointed to by digest hasn't been overwritten */ TEST_ASSERT_BUFFERS_ARE_EQUAL( - orig_data, + ver_vector, digest, - sizeof(orig_data), - "Memory at digest ptr overwritten unexpectedly"); + CRYPTO_NULL_DIGEST_LEN, + "Digest not as expected"); return TEST_SUCCESS; } @@ -7139,19 +7139,16 @@ { struct crypto_testsuite_params *ts_params = &testsuite_params; struct crypto_unittest_params *ut_params = &unittest_params; + const char ver_vector[CRYPTO_NULL_DIGEST_LEN] = { 0 }; uint8_t *digest; - /* Generate test mbuf data */ + /* Generate test mbuf data and space for digest */ ut_params->ibuf = setup_test_string(ts_params->mbuf_pool, catch_22_quote, QUOTE_512_BYTES, 0); - /* create a pointer for digest, but don't expect anything to be written - * here in a NULL auth algo so no mbuf append done. - */ - digest = rte_pktmbuf_mtod_offset(ut_params->ibuf, uint8_t *, - QUOTE_512_BYTES); - /* prefill the memory pointed to by digest */ - memcpy(digest, orig_data, sizeof(orig_data)); + digest = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, CRYPTO_NULL_DIGEST_LEN); + memset(digest, 0, CRYPTO_NULL_DIGEST_LEN); + ut_params->auth_xform.auth.digest_length = CRYPTO_NULL_DIGEST_LEN; /* Setup Cipher Parameters */ ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; @@ -7214,10 +7211,10 @@ "Ciphertext data not as expected"); /* Make sure memory pointed to by digest hasn't been overwritten */ TEST_ASSERT_BUFFERS_ARE_EQUAL( - orig_data, + ver_vector, digest, - sizeof(orig_data), - "Memory at digest ptr overwritten unexpectedly"); + CRYPTO_NULL_DIGEST_LEN, + "Digest not as expected"); return TEST_SUCCESS; } diff -Nru dpdk-18.11.5/test/test/test_distributor.c dpdk-18.11.6/test/test/test_distributor.c --- dpdk-18.11.5/test/test/test_distributor.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_distributor.c 2020-01-31 09:55:30.000000000 +0000 @@ -70,12 +70,14 @@ buf[i] = NULL; num = rte_distributor_get_pkt(db, id, buf, buf, num); while (!quit) { - worker_stats[id].handled_packets += num; + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); count += num; num = rte_distributor_get_pkt(db, id, buf, buf, num); } - worker_stats[id].handled_packets += num; + __atomic_fetch_add(&worker_stats[id].handled_packets, num, + __ATOMIC_RELAXED); count += num; rte_distributor_return_pkt(db, id, buf, num); return 0; diff -Nru dpdk-18.11.5/test/test/test_distributor_perf.c dpdk-18.11.6/test/test/test_distributor_perf.c --- dpdk-18.11.5/test/test/test_distributor_perf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_distributor_perf.c 2020-01-31 09:55:30.000000000 +0000 @@ -25,7 +25,7 @@ struct worker_stats { volatile unsigned handled_packets; } __rte_cache_aligned; -struct worker_stats worker_stats[RTE_MAX_LCORE]; +static struct worker_stats worker_stats[RTE_MAX_LCORE]; /* * worker thread used for testing the time to do a round-trip of a cache diff -Nru dpdk-18.11.5/test/test/test_efd.c dpdk-18.11.6/test/test/test_efd.c --- dpdk-18.11.5/test/test/test_efd.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_efd.c 2020-01-31 09:55:30.000000000 +0000 @@ -96,7 +96,7 @@ } }; /* Array to store the data */ -efd_value_t data[5]; +static efd_value_t data[5]; static inline uint8_t efd_get_all_sockets_bitmask(void) { diff -Nru dpdk-18.11.5/test/test/test_efd_perf.c dpdk-18.11.6/test/test/test_efd_perf.c --- dpdk-18.11.5/test/test/test_efd_perf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_efd_perf.c 2020-01-31 09:55:30.000000000 +0000 @@ -71,13 +71,13 @@ }; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; +static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS]; /* Array to store the data */ -efd_value_t data[KEYS_TO_ADD]; +static efd_value_t data[KEYS_TO_ADD]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Shuffle the keys that have been added, so lookups will be totally random */ static void diff -Nru dpdk-18.11.5/test/test/test_hash_perf.c dpdk-18.11.6/test/test/test_hash_perf.c --- dpdk-18.11.5/test/test/test_hash_perf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_hash_perf.c 2020-01-31 09:55:30.000000000 +0000 @@ -53,22 +53,22 @@ struct rte_hash *h[NUM_KEYSIZES]; /* Array that stores if a slot is full */ -uint8_t slot_taken[MAX_ENTRIES]; +static uint8_t slot_taken[MAX_ENTRIES]; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2]; +static uint64_t cycles[NUM_KEYSIZES][NUM_OPERATIONS][2][2]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Array to store the precomputed hash for 'keys' */ -hash_sig_t signatures[KEYS_TO_ADD]; +static hash_sig_t signatures[KEYS_TO_ADD]; /* Array to store how many busy entries have each bucket */ -uint8_t buckets[NUM_BUCKETS]; +static uint8_t buckets[NUM_BUCKETS]; /* Array to store the positions where keys are added */ -int32_t positions[KEYS_TO_ADD]; +static int32_t positions[KEYS_TO_ADD]; /* Parameters used for hash table in unit test functions. */ static struct rte_hash_parameters ut_params = { diff -Nru dpdk-18.11.5/test/test/test_hash_readwrite_lf.c dpdk-18.11.6/test/test/test_hash_readwrite_lf.c --- dpdk-18.11.5/test/test/test_hash_readwrite_lf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_hash_readwrite_lf.c 2020-01-31 09:55:30.000000000 +0000 @@ -42,7 +42,7 @@ #define READ_PASS_NON_SHIFT_PATH 8 #define BULK_LOOKUP 16 #define NUM_TEST 3 -unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4}; +static unsigned int rwc_core_cnt[NUM_TEST] = {1, 2, 4}; struct rwc_perf { uint32_t w_no_ks_r_hit[2][NUM_TEST]; @@ -55,7 +55,7 @@ static struct rwc_perf rwc_lf_results, rwc_non_lf_results; -struct { +static struct { uint32_t *keys; uint32_t *keys_no_ks; uint32_t *keys_ks; @@ -76,9 +76,9 @@ static volatile uint8_t writer_done; -uint16_t enabled_core_ids[RTE_MAX_LCORE]; +static uint16_t enabled_core_ids[RTE_MAX_LCORE]; -uint8_t *scanned_bkts; +static uint8_t *scanned_bkts; static inline int get_enabled_cores_list(void) diff -Nru dpdk-18.11.5/test/test/test_interrupts.c dpdk-18.11.6/test/test/test_interrupts.c --- dpdk-18.11.5/test/test/test_interrupts.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_interrupts.c 2020-01-31 09:55:30.000000000 +0000 @@ -370,9 +370,13 @@ rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL); rte_delay_ms(TEST_INTERRUPT_CHECK_INTERVAL); - if (rte_intr_callback_unregister(&test_intr_handle, - test_interrupt_callback, &test_intr_handle) < 0) - return -1; + while ((count = + rte_intr_callback_unregister(&test_intr_handle, + test_interrupt_callback, + &test_intr_handle)) < 0) { + if (count != -EAGAIN) + return -1; + } if (flag == 0) { printf("callback has not been called\n"); diff -Nru dpdk-18.11.5/test/test/test_link_bonding.c dpdk-18.11.6/test/test/test_link_bonding.c --- dpdk-18.11.5/test/test/test_link_bonding.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_link_bonding.c 2020-01-31 09:55:30.000000000 +0000 @@ -1125,7 +1125,7 @@ } #define TEST_STATUS_INTERRUPT_SLAVE_COUNT 4 -#define TEST_LSC_WAIT_TIMEOUT_MS 500 +#define TEST_LSC_WAIT_TIMEOUT_US 500000 int test_lsc_interrupt_count; @@ -1159,6 +1159,11 @@ ts.tv_sec = tp.tv_sec; ts.tv_nsec = tp.tv_usec * 1000; ts.tv_nsec += wait_us * 1000; + /* Normalize tv_nsec to [0,999999999L] */ + while (ts.tv_nsec > 1000000000L) { + ts.tv_nsec -= 1000000000L; + ts.tv_sec += 1; + } pthread_mutex_lock(&mutex); if (test_lsc_interrupt_count < 1) @@ -1213,7 +1218,7 @@ virtual_ethdev_simulate_link_status_interrupt( test_params->slave_port_ids[3], 0); - TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0, + TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0, "timed out waiting for interrupt"); TEST_ASSERT(test_lsc_interrupt_count > 0, @@ -1232,7 +1237,7 @@ virtual_ethdev_simulate_link_status_interrupt( test_params->slave_port_ids[0], 1); - TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) == 0, + TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0, "timed out waiting for interrupt"); /* test that we have received another lsc interrupt */ @@ -1246,7 +1251,7 @@ virtual_ethdev_simulate_link_status_interrupt( test_params->slave_port_ids[0], 1); - TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_MS) != 0, + TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) != 0, "received unexpected interrupt"); TEST_ASSERT_EQUAL(test_lsc_interrupt_count, 0, diff -Nru dpdk-18.11.5/test/test/test_lpm_perf.c dpdk-18.11.6/test/test/test_lpm_perf.c --- dpdk-18.11.5/test/test/test_lpm_perf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_lpm_perf.c 2020-01-31 09:55:30.000000000 +0000 @@ -460,7 +460,7 @@ (double)total_time / ((double)ITERATIONS * BATCH_SIZE), (count * 100.0) / (double)(ITERATIONS * BATCH_SIZE)); - /* Delete */ + /* Measure Delete */ status = 0; begin = rte_rdtsc(); @@ -470,7 +470,7 @@ large_route_table[i].depth); } - total_time += rte_rdtsc() - begin; + total_time = rte_rdtsc() - begin; printf("Average LPM Delete: %g cycles\n", (double)total_time / NUM_ROUTE_ENTRIES); diff -Nru dpdk-18.11.5/test/test/test_mbuf.c dpdk-18.11.6/test/test/test_mbuf.c --- dpdk-18.11.5/test/test/test_mbuf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_mbuf.c 2020-01-31 09:55:30.000000000 +0000 @@ -331,8 +331,11 @@ m->next = rte_pktmbuf_alloc(pktmbuf_pool); if (m->next == NULL) GOTO_FAIL("Next Pkt Null\n"); + m->nb_segs = 2; rte_pktmbuf_append(m->next, sizeof(uint32_t)); + m->pkt_len = 2 * sizeof(uint32_t); + data = rte_pktmbuf_mtod(m->next, unaligned_uint32_t *); *data = MAGIC_DATA; diff -Nru dpdk-18.11.5/test/test/test_member_perf.c dpdk-18.11.6/test/test/test_member_perf.c --- dpdk-18.11.5/test/test/test_member_perf.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_member_perf.c 2020-01-31 09:55:30.000000000 +0000 @@ -65,18 +65,18 @@ }; /* Array to store number of cycles per operation */ -uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS]; -uint64_t false_data[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t cycles[NUM_TYPE][NUM_KEYSIZES][NUM_OPERATIONS]; +static uint64_t false_data[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_bulk[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_multi[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_data_multi_bulk[NUM_TYPE][NUM_KEYSIZES]; -uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; +static uint64_t false_hit[NUM_TYPE][NUM_KEYSIZES]; -member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD]; +static member_set_t data[NUM_TYPE][/* Array to store the data */KEYS_TO_ADD]; /* Array to store all input keys */ -uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; +static uint8_t keys[KEYS_TO_ADD][MAX_KEYSIZE]; /* Shuffle the keys that have been added, so lookups will be totally random */ static void diff -Nru dpdk-18.11.5/test/test/test_service_cores.c dpdk-18.11.6/test/test/test_service_cores.c --- dpdk-18.11.5/test/test/test_service_cores.c 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/test/test/test_service_cores.c 2020-01-31 09:55:30.000000000 +0000 @@ -483,7 +483,7 @@ int ret = rte_eal_remote_launch(service_remote_launch_func, NULL, slcore_id); TEST_ASSERT_EQUAL(0, ret, "Ex-service core remote launch failed."); - rte_eal_mp_wait_lcore(); + rte_eal_wait_lcore(slcore_id); TEST_ASSERT_EQUAL(1, service_remote_launch_flag, "Ex-service core function call had no effect."); diff -Nru dpdk-18.11.5/usertools/dpdk-pmdinfo.py dpdk-18.11.6/usertools/dpdk-pmdinfo.py --- dpdk-18.11.5/usertools/dpdk-pmdinfo.py 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/usertools/dpdk-pmdinfo.py 2020-01-31 09:55:30.000000000 +0000 @@ -8,13 +8,15 @@ # # ------------------------------------------------------------------------- from __future__ import print_function +from __future__ import unicode_literals import json +import io import os import platform import string import sys from elftools.common.exceptions import ELFError -from elftools.common.py3compat import (byte2int, bytes2str, str2bytes) +from elftools.common.py3compat import byte2int from elftools.elf.elffile import ELFFile from optparse import OptionParser @@ -213,7 +215,8 @@ """ Reads the local file """ - self.contents = open(filename).readlines() + with io.open(filename, 'r', encoding='utf-8') as f: + self.contents = f.readlines() self.date = self.findDate(self.contents) def loadLocal(self): @@ -267,7 +270,13 @@ return None except ValueError: # Not a number. Must be a name then - return self.elffile.get_section_by_name(str2bytes(spec)) + section = self.elffile.get_section_by_name(force_unicode(spec)) + if section is None: + # No match with a unicode name. + # Some versions of pyelftools (<= 0.23) store internal strings + # as bytes. Try again with the name encoded as bytes. + section = self.elffile.get_section_by_name(force_bytes(spec)) + return section def pretty_print_pmdinfo(self, pmdinfo): global pcidb @@ -339,7 +348,8 @@ while endptr < len(data) and byte2int(data[endptr]) != 0: endptr += 1 - mystring = bytes2str(data[dataptr:endptr]) + # pyelftools may return byte-strings, force decode them + mystring = force_unicode(data[dataptr:endptr]) rc = mystring.find("PMD_INFO_STRING") if (rc != -1): self.parse_pmd_info_string(mystring) @@ -348,9 +358,10 @@ def find_librte_eal(self, section): for tag in section.iter_tags(): - if tag.entry.d_tag == 'DT_NEEDED': - if "librte_eal" in tag.needed: - return tag.needed + # pyelftools may return byte-strings, force decode them + if force_unicode(tag.entry.d_tag) == 'DT_NEEDED': + if "librte_eal" in force_unicode(tag.needed): + return force_unicode(tag.needed) return None def search_for_autoload_path(self): @@ -373,7 +384,7 @@ return (None, None) if raw_output is False: print("Scanning for autoload path in %s" % library) - scanfile = open(library, 'rb') + scanfile = io.open(library, 'rb') scanelf = ReadElf(scanfile, sys.stdout) except AttributeError: # Not a dynamic binary @@ -403,7 +414,8 @@ while endptr < len(data) and byte2int(data[endptr]) != 0: endptr += 1 - mystring = bytes2str(data[dataptr:endptr]) + # pyelftools may return byte-strings, force decode them + mystring = force_unicode(data[dataptr:endptr]) rc = mystring.find("DPDK_PLUGIN_PATH") if (rc != -1): rc = mystring.find("=") @@ -416,8 +428,9 @@ def get_dt_runpath(self, dynsec): for tag in dynsec.iter_tags(): - if tag.entry.d_tag == 'DT_RUNPATH': - return tag.runpath + # pyelftools may return byte-strings, force decode them + if force_unicode(tag.entry.d_tag) == 'DT_RUNPATH': + return force_unicode(tag.runpath) return "" def process_dt_needed_entries(self): @@ -438,16 +451,16 @@ return for tag in dynsec.iter_tags(): - if tag.entry.d_tag == 'DT_NEEDED': - rc = tag.needed.find(b"librte_pmd") - if (rc != -1): - library = search_file(tag.needed, + # pyelftools may return byte-strings, force decode them + if force_unicode(tag.entry.d_tag) == 'DT_NEEDED': + if 'librte_pmd' in force_unicode(tag.needed): + library = search_file(force_unicode(tag.needed), runpath + ":" + ldlibpath + ":/usr/lib64:/lib64:/usr/lib:/lib") if library is not None: if raw_output is False: print("Scanning %s for pmd information" % library) - with open(library, 'rb') as file: + with io.open(library, 'rb') as file: try: libelf = ReadElf(file, sys.stdout) except ELFError: @@ -458,6 +471,20 @@ file.close() +# compat: remove force_unicode & force_bytes when pyelftools<=0.23 support is +# dropped. +def force_unicode(s): + if hasattr(s, 'decode') and callable(s.decode): + s = s.decode('latin-1') # same encoding used in pyelftools py3compat + return s + + +def force_bytes(s): + if hasattr(s, 'encode') and callable(s.encode): + s = s.encode('latin-1') # same encoding used in pyelftools py3compat + return s + + def scan_autoload_path(autoload_path): global raw_output @@ -476,7 +503,7 @@ scan_autoload_path(dpath) if os.path.isfile(dpath): try: - file = open(dpath, 'rb') + file = io.open(dpath, 'rb') readelf = ReadElf(file, sys.stdout) except ELFError: # this is likely not an elf file, skip it @@ -503,7 +530,7 @@ print("Must specify a file name") return - file = open(dpdk_path, 'rb') + file = io.open(dpdk_path, 'rb') try: readelf = ReadElf(file, sys.stdout) except ElfError: @@ -595,7 +622,7 @@ print("File not found") sys.exit(1) - with open(myelffile, 'rb') as file: + with io.open(myelffile, 'rb') as file: try: readelf = ReadElf(file, sys.stdout) readelf.process_dt_needed_entries() diff -Nru dpdk-18.11.5/usertools/dpdk-telemetry-client.py dpdk-18.11.6/usertools/dpdk-telemetry-client.py --- dpdk-18.11.5/usertools/dpdk-telemetry-client.py 2019-11-15 15:45:43.000000000 +0000 +++ dpdk-18.11.6/usertools/dpdk-telemetry-client.py 2020-01-31 09:55:30.000000000 +0000 @@ -1,6 +1,8 @@ -# SPDK-License-Identifier: BSD-3-Clause +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Intel Corporation +from __future__ import print_function + import socket import os import sys @@ -14,9 +16,9 @@ DEFAULT_FP = "/var/run/dpdk/default_client" try: - raw_input # Python 2 + raw_input # Python 2 except NameError: - raw_input = input # Python 3 + raw_input = input # Python 3 class Socket: @@ -72,7 +74,7 @@ def requestMetrics(self): # Requests metrics for given client self.socket.client_fd.send(METRICS_REQ) data = self.socket.client_fd.recv(BUFFER_SIZE) - print "\nResponse: \n", str(data) + print("\nResponse: \n", str(data)) def repeatedlyRequestMetrics(self, sleep_time): # Recursively requests metrics for given client print("\nPlease enter the number of times you'd like to continuously request Metrics:") @@ -111,10 +113,10 @@ sleep_time = 1 file_path = "" if (len(sys.argv) == 2): - file_path = sys.argv[1] + file_path = sys.argv[1] else: print("Warning - No filepath passed, using default (" + DEFAULT_FP + ").") - file_path = DEFAULT_FP + file_path = DEFAULT_FP client = Client() client.getFilepath(file_path) client.register()