diff --git a/MAINTAINERS b/MAINTAINERS index 27a4981b10d..d7d8dbdb252 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1907,6 +1907,7 @@ M: Konstantin Ananyev F: lib/bpf/ F: examples/bpf/ F: app/test/test_bpf.c +F: app/test/bpf/ F: app/test-pmd/bpf_cmd.* F: doc/guides/prog_guide/bpf_lib.rst diff --git a/VERSION b/VERSION index 7534e512e6c..89e1751fbf4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -25.11.0-rc3 +25.11.0-rc4 diff --git a/app/proc-info/main.c b/app/proc-info/main.c index b09c03ab35c..5925bbb7658 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -686,7 +686,7 @@ nic_stats_clear(uint16_t port_id) static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len, const char *cnt_name) { - char *type_end = strrchr(cnt_name, '_'); + const char *type_end = strrchr(cnt_name, '_'); if ((type_end != NULL) && (strncmp(cnt_name, "rx_", strlen("rx_")) == 0)) { diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index a6e872e5a43..c841651756d 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -526,11 +526,26 @@ get_tunnel_ol_flags_by_ptype(uint32_t ptype) } static uint8_t -parse_l4_proto(const struct rte_mbuf *m, uint32_t off, uint32_t ptype, bool parse_inner) +parse_l4_proto(const struct rte_mbuf *m, uint32_t off, uint32_t ptype, bool in_tunnel) { + uint32_t align_ptype = ptype; int frag = 0, ret; - if (RTE_ETH_IS_IPV4_HDR(ptype)) { + if (in_tunnel) { + uint32_t mask_ptype = ptype & RTE_PTYPE_INNER_L3_MASK; + if (mask_ptype == RTE_PTYPE_INNER_L3_IPV4) + align_ptype = RTE_PTYPE_L3_IPV4; + else if (mask_ptype == RTE_PTYPE_INNER_L3_IPV4_EXT) + align_ptype = RTE_PTYPE_L3_IPV4_EXT; + else if (mask_ptype == RTE_PTYPE_INNER_L3_IPV6) + align_ptype = RTE_PTYPE_L3_IPV6; + else if (mask_ptype == RTE_PTYPE_INNER_L3_IPV6_EXT) + align_ptype = RTE_PTYPE_L3_IPV6_EXT; + else + align_ptype = 0; + } + + if (RTE_ETH_IS_IPV4_HDR(align_ptype)) { const struct rte_ipv4_hdr *ip4h; struct rte_ipv4_hdr ip4h_copy; ip4h = rte_pktmbuf_read(m, off, sizeof(*ip4h), &ip4h_copy); @@ -538,17 +553,14 @@ parse_l4_proto(const struct rte_mbuf *m, uint32_t off, uint32_t ptype, bool pars return 0; return ip4h->next_proto_id; - } else if (RTE_ETH_IS_IPV6_HDR(ptype)) { + } else if (RTE_ETH_IS_IPV6_HDR(align_ptype)) { const struct rte_ipv6_hdr *ip6h; struct rte_ipv6_hdr ip6h_copy; ip6h = rte_pktmbuf_read(m, off, sizeof(*ip6h), &ip6h_copy); if (unlikely(ip6h == NULL)) return 0; - if (!parse_inner && (ptype & RTE_PTYPE_L3_MASK) != RTE_PTYPE_L3_IPV6_EXT) - return ip6h->proto; - - if (parse_inner && (ptype & RTE_PTYPE_INNER_L3_MASK) != RTE_PTYPE_INNER_L3_IPV6_EXT) + if ((align_ptype & RTE_PTYPE_L3_MASK) != RTE_PTYPE_L3_IPV6_EXT) return ip6h->proto; off += sizeof(struct rte_ipv6_hdr); diff --git a/app/test/test_debug.c b/app/test/test_debug.c index fe5dd5b02d2..5ff9068e2b6 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -46,7 +46,7 @@ test_debug(void) * ========== */ -static const char *test_args[7]; +static const char *test_args[8]; int test_panic(void) @@ -158,10 +158,17 @@ test_debug(void) test_args[4] = ""; test_args[5] = ""; test_args[6] = ""; + test_args[7] = ""; } else { test_args[4] = "--no-huge"; test_args[5] = "-m"; test_args[6] = "2048"; +#ifdef RTE_ARCH_PPC_64 + /* iova=pa is the default, but fails on ppc64 with --no-huge */ + test_args[7] = "--iova-mode=va"; +#else + test_args[7] = ""; +#endif } rte_dump_stack(); diff --git a/doc/api/meson.build b/doc/api/meson.build index e9b7f305247..23ed5bf263d 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -27,6 +27,7 @@ example = custom_target('examples.dox', depfile: 'examples.dox.d', install: get_option('enable_docs'), install_dir: htmldir, + install_tag: 'doc', build_by_default: get_option('enable_docs')) # set up common Doxygen configuration @@ -76,6 +77,7 @@ doxy_html_build = custom_target('doxygen-html', command: [generate_doxygen, '@OUTPUT@', doxygen, '@INPUT@'], install: get_option('enable_docs'), install_dir: htmldir, + install_tag: 'doc', build_by_default: get_option('enable_docs')) doc_targets += doxy_html_build @@ -90,6 +92,7 @@ doxy_man_build = custom_target('doxygen-man', command: [generate_doxygen, '@OUTPUT@', doxygen, '@INPUT@'], install: get_option('enable_docs'), install_dir: get_option('datadir'), + install_tag: 'doc', build_by_default: get_option('enable_docs')) doc_targets += doxy_man_build diff --git a/doc/guides/cryptodevs/ionic.rst b/doc/guides/cryptodevs/ionic.rst index d563602ebe9..7c9d2ebd049 100644 --- a/doc/guides/cryptodevs/ionic.rst +++ b/doc/guides/cryptodevs/ionic.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright 2021-2024 Advanced Micro Devices, Inc. + Copyright 2021-2025 Advanced Micro Devices, Inc. IONIC Crypto Driver =================== @@ -16,6 +16,8 @@ It currently supports the below models: `(pdf) `__ - DSC3-400 dual-port 400G Distributed Services Card `(pdf) `__ +- Pollara 400 single-port 400G AI NIC + `(pdf) `__ Please visit the `AMD Pensando Networking diff --git a/doc/guides/freebsd_gsg/build_dpdk.rst b/doc/guides/freebsd_gsg/build_dpdk.rst index f98292bf417..45bb4fc4780 100644 --- a/doc/guides/freebsd_gsg/build_dpdk.rst +++ b/doc/guides/freebsd_gsg/build_dpdk.rst @@ -16,16 +16,16 @@ The following FreeBSD packages are required to build DPDK: * meson * ninja * pkgconf -* py38-pyelftools +* py311-pyelftools -.. note: +.. note:: - The specific package for pyelftools is dependent on the version of python in use, - Python 3.8 being the version at type of writing, hence the ``py38`` prefix. + The specific package for pyelftools is dependent on the version of python in use, + Python 3.11 being the version at type of writing, hence the ``py311`` prefix. These can be installed using (as root):: - pkg install meson pkgconf py38-pyelftools + pkg install meson pkgconf py311-pyelftools To compile the required kernel modules for memory management and working with physical NIC devices, the kernel sources for FreeBSD also diff --git a/doc/guides/linux_gsg/amd_platform.rst b/doc/guides/linux_gsg/amd_platform.rst index 43d85273e27..40b65d1c9e0 100644 --- a/doc/guides/linux_gsg/amd_platform.rst +++ b/doc/guides/linux_gsg/amd_platform.rst @@ -22,7 +22,9 @@ Tuning Guides for AMD EPYC SoC #. `GENOA `_ -#. `BERGAMO|SIENNA `_ +#. `BERGAMO|SIENA `_ + +#. `TURIN `_ General Requirements @@ -86,10 +88,43 @@ Core ~~~~ AMD EPYC SoC supports CPU power functions via ``rte_power`` API from `23.11 LTS` onwards. -These are tested and validated on MILAN, GENOA, BERGAMO and SIENA -using Linux kernel `6.4` and above with ``amd_pstate`` power driver. +These are tested and validated on MILAN, GENOA, BERGAMO, SIENA and TURIN +using Linux kernel `6.4` and above with ``amd_pstate`` power driver in ``passive`` mode. .. note:: * Power libraries are supported on Linux only. * DPDK uncore support on Linux is work in progress. + +Uncore +~~~~~~ + +AMD EPYC SoC support UNCORE power functions via ``rte_power_uncore`` from `25.03` onwards. +These are tested and validated on GENOA, SIENA and TURIN. +Please refer the tuning guides to enable ``HSMP`` and DPDK power management guide. + + +NIC +--- + +To use Solarflare x4 on AMD EPYC TURIN, please ensure the following + +#. Upgrade Linux or distro version to 6.13 or higher. + +#. Disable PCIe power option via ``vfio-pci.disable_idle_d3=1`` in GRUB. + +#. Enable the hardware with out-of-tree sfc (contact Solarflare) Linux kernel driver first; + then bind with ``vfio-pci`` next. + +#. Please use PMD args ``fw_variant=ultra-low-latency,perf_profile=throughput``. + +To use Solarflare x2 on AMD EPYC TURIN, please ensure the following + +#. Upgrade Linux or distro version to 6.13 or higher. + +#. Disable PCIe power option via ``vfio-pci.disable_idle_d3=1`` in GRUB. + +#. Enable the hardware with ``sfc`` Linux Kernel Driver first; + then bind with ``vfio-pci`` next. + +#. Please use PMD args ``fw_variant=ultra-low-latency,perf_profile=throughput``. diff --git a/doc/guides/meson.build b/doc/guides/meson.build index c6779310132..8c75beb1c19 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -22,6 +22,7 @@ html_guides = custom_target('html_guides', depfile: '.html.d', build_by_default: get_option('enable_docs'), install: get_option('enable_docs'), + install_tag: 'doc', install_dir: htmldir) doc_targets += html_guides diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index 6f9dab73e29..165798fb941 100644 --- a/doc/guides/nics/i40e.rst +++ b/doc/guides/nics/i40e.rst @@ -104,6 +104,8 @@ For X710/XL710/XXV710, +--------------+-----------------------+------------------+ | DPDK version | Kernel driver version | Firmware version | +==============+=======================+==================+ + | 25.11 | 2.28.13 | 9.55 | + +--------------+-----------------------+------------------+ | 25.07 | 2.28.7 | 9.54 | +--------------+-----------------------+------------------+ | 25.03 | 2.27.8 | 9.53 | @@ -128,50 +130,6 @@ For X710/XL710/XXV710, +--------------+-----------------------+------------------+ | 21.11 | 2.17.4 | 8.30 | +--------------+-----------------------+------------------+ - | 21.08 | 2.15.9 | 8.30 | - +--------------+-----------------------+------------------+ - | 21.05 | 2.15.9 | 8.30 | - +--------------+-----------------------+------------------+ - | 21.02 | 2.14.13 | 8.00 | - +--------------+-----------------------+------------------+ - | 20.11 | 2.14.13 | 8.00 | - +--------------+-----------------------+------------------+ - | 20.08 | 2.12.6 | 7.30 | - +--------------+-----------------------+------------------+ - | 20.05 | 2.11.27 | 7.30 | - +--------------+-----------------------+------------------+ - | 20.02 | 2.10.19 | 7.20 | - +--------------+-----------------------+------------------+ - | 19.11 | 2.9.21 | 7.00 | - +--------------+-----------------------+------------------+ - | 19.08 | 2.8.43 | 7.00 | - +--------------+-----------------------+------------------+ - | 19.05 | 2.7.29 | 6.80 | - +--------------+-----------------------+------------------+ - | 19.02 | 2.7.26 | 6.80 | - +--------------+-----------------------+------------------+ - | 18.11 | 2.4.6 | 6.01 | - +--------------+-----------------------+------------------+ - | 18.08 | 2.4.6 | 6.01 | - +--------------+-----------------------+------------------+ - | 18.05 | 2.4.6 | 6.01 | - +--------------+-----------------------+------------------+ - | 18.02 | 2.4.3 | 6.01 | - +--------------+-----------------------+------------------+ - | 17.11 | 2.1.26 | 6.01 | - +--------------+-----------------------+------------------+ - | 17.08 | 2.0.19 | 6.01 | - +--------------+-----------------------+------------------+ - | 17.05 | 1.5.23 | 5.05 | - +--------------+-----------------------+------------------+ - | 17.02 | 1.5.23 | 5.05 | - +--------------+-----------------------+------------------+ - | 16.11 | 1.5.23 | 5.05 | - +--------------+-----------------------+------------------+ - | 16.07 | 1.4.25 | 5.04 | - +--------------+-----------------------+------------------+ - | 16.04 | 1.4.25 | 5.02 | - +--------------+-----------------------+------------------+ For X722, @@ -179,6 +137,8 @@ For X722, +--------------+-----------------------+------------------+ | DPDK version | Kernel driver version | Firmware version | +==============+=======================+==================+ + | 25.11 | 2.28.13 | 6.51 | + +--------------+-----------------------+------------------+ | 25.07 | 2.28.7 | 6.50 | +--------------+-----------------------+------------------+ | 25.03 | 2.27.8 | 6.50 | @@ -203,30 +163,6 @@ For X722, +--------------+-----------------------+------------------+ | 21.11 | 2.17.4 | 5.30 | +--------------+-----------------------+------------------+ - | 21.08 | 2.15.9 | 5.30 | - +--------------+-----------------------+------------------+ - | 21.05 | 2.15.9 | 5.30 | - +--------------+-----------------------+------------------+ - | 21.02 | 2.14.13 | 5.00 | - +--------------+-----------------------+------------------+ - | 20.11 | 2.13.10 | 5.00 | - +--------------+-----------------------+------------------+ - | 20.08 | 2.12.6 | 4.11 | - +--------------+-----------------------+------------------+ - | 20.05 | 2.11.27 | 4.11 | - +--------------+-----------------------+------------------+ - | 20.02 | 2.10.19 | 4.11 | - +--------------+-----------------------+------------------+ - | 19.11 | 2.9.21 | 4.10 | - +--------------+-----------------------+------------------+ - | 19.08 | 2.9.21 | 4.10 | - +--------------+-----------------------+------------------+ - | 19.05 | 2.7.29 | 3.33 | - +--------------+-----------------------+------------------+ - | 19.02 | 2.7.26 | 3.33 | - +--------------+-----------------------+------------------+ - | 18.11 | 2.4.6 | 3.33 | - +--------------+-----------------------+------------------+ Configuration diff --git a/doc/guides/nics/ice.rst b/doc/guides/nics/ice.rst index 2d555d2943f..cde31a5694b 100644 --- a/doc/guides/nics/ice.rst +++ b/doc/guides/nics/ice.rst @@ -63,14 +63,6 @@ For E810, +-----------+---------------+-----------------+-----------+--------------+-----------+ | DPDK | Kernel Driver | OS Default DDP | COMMS DDP | Wireless DDP | Firmware | +===========+===============+=================+===========+==============+===========+ - | 20.11 | 1.3.2 | 1.3.20 | 1.3.24 | N/A | 2.3 | - +-----------+---------------+-----------------+-----------+--------------+-----------+ - | 21.02 | 1.4.11 | 1.3.24 | 1.3.28 | 1.3.4 | 2.4 | - +-----------+---------------+-----------------+-----------+--------------+-----------+ - | 21.05 | 1.6.5 | 1.3.26 | 1.3.30 | 1.3.6 | 3.0 | - +-----------+---------------+-----------------+-----------+--------------+-----------+ - | 21.08 | 1.7.16 | 1.3.27 | 1.3.31 | 1.3.7 | 3.1 | - +-----------+---------------+-----------------+-----------+--------------+-----------+ | 21.11 | 1.7.16 | 1.3.27 | 1.3.31 | 1.3.7 | 3.1 | +-----------+---------------+-----------------+-----------+--------------+-----------+ | 22.03 | 1.8.3 | 1.3.28 | 1.3.35 | 1.3.8 | 3.2 | @@ -95,6 +87,8 @@ For E810, +-----------+---------------+-----------------+-----------+--------------+-----------+ | 25.07 | 2.2.8 | 1.3.43 | 1.3.55 | 1.3.23 | 4.8 | +-----------+---------------+-----------------+-----------+--------------+-----------+ + | 25.11 | 2.3.14 | 1.3.43 | 1.3.55 | 1.3.25 | 4.9 | + +-----------+---------------+-----------------+-----------+--------------+-----------+ For E830, @@ -103,7 +97,8 @@ For E830, +===========+===============+=================+===========+==============+===========+ | 25.07 | 2.2.8 | 1.3.43 | 1.3.55 | 1.3.23 | 1.0 | +-----------+---------------+-----------------+-----------+--------------+-----------+ - + | 25.11 | 2.3.14 | 1.3.43 | 1.3.55 | 1.3.25 | 1.2 | + +-----------+---------------+-----------------+-----------+--------------+-----------+ Dynamic Device Personalization (DDP) package loading ---------------------------------------------------- diff --git a/doc/guides/nics/ionic.rst b/doc/guides/nics/ionic.rst index a991a2cf3f2..2709a888fbe 100644 --- a/doc/guides/nics/ionic.rst +++ b/doc/guides/nics/ionic.rst @@ -1,5 +1,5 @@ .. SPDX-License-Identifier: BSD-3-Clause - Copyright 2018-2022 Advanced Micro Devices, Inc. + Copyright 2018-2025 Advanced Micro Devices, Inc. IONIC Driver ============ @@ -15,6 +15,8 @@ It currently supports the below models: `(pdf) `__ - DSC3-400 dual-port 400G Distributed Services Card `(pdf) `__ +- Pollara 400 single-port 400G AI NIC + `(pdf) `__ Please visit the `AMD Pensando Networking diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 51d7637fba2..8481cc974aa 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -647,6 +647,8 @@ for an additional list of options shared with other mlx5 drivers. - 3, this engages tunnel offload mode. In E-Switch configuration, that mode implicitly activates ``dv_xmeta_en=1``. + Tunnel offload is not supported in synchronous flow API + when using :ref:`HW steering `. - 4, this mode is only supported in :ref:`HW steering `. The Rx/Tx metadata with 32b width copy between FDB and NIC is supported. @@ -694,11 +696,8 @@ for an additional list of options shared with other mlx5 drivers. Value 2 enables the WQE based hardware steering. In this mode, only queue-based flow management is supported. - By default, the PMD will set this value according to capability. - If DV flow steering is supported, it will be set to 1. - If DV flow steering is not supported and HW steering is supported, - then it will be set to 2. - Otherwise, it will be set to 0. + It is configured by default to 1 (DV flow steering) if supported. + Otherwise, the value is 0 which indicates legacy Verbs flow offloading. - ``dv_esw_en`` parameter [int] @@ -834,10 +833,7 @@ for an additional list of options shared with other mlx5 drivers. In this case, all rules are inserted but only the first rule takes effect, the next rule takes effect only if the previous rules are deleted. - This option is not supported in :ref:`HW steering `, - and will be forced to 0 in this mode. - - By default, the PMD will set this value according to capability. + By default, the PMD will set this value to 1. .. _mlx5_net_stats: @@ -1367,6 +1363,13 @@ Reconfiguring HW steering engine is not supported. Any subsequent call to ``rte_flow_configure()`` with different configuration than initially provided will be rejected. +.. note:: + + The application must call ``rte_flow_configure()`` + before creating any flow rules + when using :ref:`asynchronous flow API `. + It is also recommended for synchronous API. + Limitations ^^^^^^^^^^^ @@ -1404,6 +1407,41 @@ Limitations which results in L3 encap. d. Only in transfer (switchdev) mode. +#. When using synchronous flow API, + the following limitations and considerations apply: + + - There are limitations on size of match fields. + Exceeding these limitations will result in an error, + unlike other flow engines (``dv_flow_en`` < 2) + that handle this by creating a tree of rules. + + - When updating a rule by inserting a new one and deleting the old one, + for non-zero group, after adding the new rule, + and before the deletion of the old rule, the new rule will be matched, + contrary to the behavior in other flow engines (``dv_flow_en`` < 2) + in which the old rule will be matched. + + - By default, the port is configured with zeroed ``rte_flow_port_attr``: + there are zero flow queues (one is created by default), + no actions, and no flags set. + The default flow queue size for ``rte_flow_queue_attr`` is 32 + (used for the internal flow queue). + If the application uses any configurable actions + (such as meter, age, conntrack or counter), + the system will allocate the maximum number of available actions per port. + To optimize memory usage, + the application should call ``rte_flow_configure`` + and specify only the required number of actions. + If the application needs to modify flow queue settings, + it should also use ``rte_flow_configure``. + + - When creating a rule with a partial `mask` provided in the flow item, + the `spec` value must be calculated after the "AND" operation with the `mask`. + If more significant bits are present in the `spec` than in the `mask`, + the rule will be created without any error + but the packets will not hit as expected. + Such limitation will be removed in future. + .. _mlx5_bifurcated: @@ -2355,6 +2393,14 @@ Limitations restricts the ``port_id`` configuration to only accept the value ``0xffff``, indicating the E-Switch manager. +#. When using synchronous flow API with :ref:`HW steering `: + + - ``RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR`` is not supported. + ``RTE_FLOW_ITEM_TYPE_TX_QUEUE`` can be used with a rule for each queue. + - Transfer rules are not supported on representor ports. + - Rules created on proxy ports without explicit represented port matching + will match packets from all ports. + Examples ^^^^^^^^ @@ -2544,6 +2590,10 @@ DPDK 19.05 18.11 Limitations ^^^^^^^^^^^ +#. When using synchronous flow API with :ref:`HW steering `, + ``RTE_FLOW_ITEM_TYPE_MARK`` (16-bit match) is unsupported. + ``RTE_FLOW_ITEM_TYPE_META`` (32-bit match) can be used as an alternative. + #. ``RTE_FLOW_ACTION_TYPE_MARK`` can be used in transfer flow rules, since firmware version xx.43.1014, but only on template tables @@ -2718,8 +2768,8 @@ With :ref:`HW steering `: #. Using count action on root tables requires: - - Linux kernel >= 6.4 - - rdma-core >= 60.0 + - Linux kernel >= 6.4 and rdma-core >= 60.0 for upstream drivers/libraries or, + - DOCA >= 3.2.0 for drivers/libraries provided by NVIDIA. .. _mlx5_age: @@ -2759,6 +2809,9 @@ With :ref:`HW steering `, in addition to flow rules using only age (without count action). - ``nb_aging_objects`` is the number of flow rules containing age action. +#. When using synchronous flow API with :ref:`HW steering `, + aged flows are reported only once. + #. With strict queueing enabled (``RTE_FLOW_PORT_FLAG_STRICT_QUEUE`` passed to ``rte_flow_configure()``), indirect age actions can be created only through asynchronous flow API. @@ -2891,10 +2944,12 @@ Limitations it cannot be used by flow matching all ports. #. When using :ref:`HW steering `, - only meter mark action is supported. + only ``RTE_FLOW_ACTION_TYPE_METER_MARK`` is supported, + not ``RTE_FLOW_ACTION_TYPE_METER``. #. The maximal number of HW quota and HW meter objects is ``16e6``. + Examples ^^^^^^^^ @@ -3758,6 +3813,12 @@ Requirements Matching on checksum and sequence needs MLNX_OFED 5.6+. +Limitations +^^^^^^^^^^^ + +#. When using synchronous flow API with :ref:`HW steering `, + matching the field ``c_rsvd0_ver`` is not supported on group 0 (root table). + .. _mlx5_nvgre: diff --git a/doc/guides/prog_guide/img/kni_traffic_flow.png b/doc/guides/prog_guide/img/kni_traffic_flow.png deleted file mode 100644 index a7e749661de..00000000000 Binary files a/doc/guides/prog_guide/img/kni_traffic_flow.png and /dev/null differ diff --git a/doc/guides/prog_guide/img/pkt_flow_kni.png b/doc/guides/prog_guide/img/pkt_flow_kni.png deleted file mode 100644 index ab730bb4c73..00000000000 Binary files a/doc/guides/prog_guide/img/pkt_flow_kni.png and /dev/null differ diff --git a/doc/guides/rel_notes/release_25_11.rst b/doc/guides/rel_notes/release_25_11.rst index 83e86ada64b..f3beb6b3d60 100644 --- a/doc/guides/rel_notes/release_25_11.rst +++ b/doc/guides/rel_notes/release_25_11.rst @@ -6,55 +6,9 @@ DPDK Release 25.11 ================== -.. **Read this first.** - - The text in the sections below explains how to update the release notes. - - Use proper spelling, capitalization and punctuation in all sections. - - Variable and config names should be quoted as fixed width text: - ``LIKE_THIS``. - - Build the docs and view the output file to ensure the changes are correct:: - - ninja -C build doc - xdg-open build/doc/guides/html/rel_notes/release_25_11.html - - New Features ------------ -.. This section should contain new features added in this release. - Sample format: - - * **Add a title in the past tense with a full stop.** - - Add a short 1-2 sentence description in the past tense. - The description should be enough to allow someone scanning - the release notes to understand the new feature. - - If the feature adds a lot of sub-features you can use a bullet list - like this: - - * Added feature foo to do something. - * Enhanced feature bar to do something else. - - Refer to the previous release notes for examples. - - Suggested order in release notes items: - * Core libs (EAL, mempool, ring, mbuf, buses) - * Device abstraction libs and PMDs (ordered alphabetically by vendor name) - - ethdev (lib, PMDs) - - cryptodev (lib, PMDs) - - eventdev (lib, PMDs) - - etc - * Other libs - * Apps, Examples, Tools (if significant) - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= - * **Added automatic lcore-id remapping option.** Added the EAL option ``--remap-lcore-ids`` or ``-R`` @@ -72,17 +26,18 @@ New Features that span across different processes or operating system domains. * Added functions to exchange handlers between DMA devices. -* **Added speed 800G.** +* **Added 800G speed.** Added Ethernet link speed for 800 Gb/s as it is well standardized in IEEE, and some devices already support this speed. * **Added mbuf tracking for debug.** - Added history dynamic field in mbuf (disabled by default) + Added history dynamic field in mbuf to store successive states of the mbuf lifecycle. Some functions were added to dump statistics. A script was added to parse mbuf tracking stored in a file. + This feature is disabled by default. * **Added ethdev API to get link connector.** @@ -104,7 +59,7 @@ New Features * OTHER By default, it reports ``RTE_ETH_LINK_CONNECTOR_NONE`` - unless driver specifies it. + unless the driver specifies it. * **Updated Amazon ENA (Elastic Network Adapter) ethernet driver.** @@ -122,7 +77,7 @@ New Features * **Updated Marvell cnxk ethernet driver.** - Added support to set/get link configuration as mentioned below: + Added support to set/get link configuration as outlined below: * Get speed capability from firmware. * Report link type, mode and status. @@ -211,43 +166,34 @@ New Features The argparse library now supports overriding the automatic help text generation, by allowing the user to provide a custom function to generate the output text. - The built-in help text function is available as a public function which can be reused by custom functions, - if so desired. + The built-in help text function is available as a public function + which can be reused by custom functions, if so desired. Removed Items ------------- -.. This section should contain removed items in this release. Sample format: - - * Add a short 1-2 sentence description of the removed item - in the past tense. - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= - * build: as previously announced in the deprecation notices, the ``enable_kmods`` build option has been removed. - Kernel modules will now automatically be built for OS's where out-of-tree kernel modules + Kernel modules will now be built automatically for OSes where out-of-tree kernel modules are required for DPDK operation. Currently, this means that modules will only be built for FreeBSD. No modules are shipped with DPDK for either Linux or Windows. * ethdev: As previously announced in deprecation notes, queue specific stats fields are now removed from ``struct rte_eth_stats``. - Mentioned fields are: ``q_ipackets``, ``q_opackets``, ``q_ibytes``, ``q_obytes``, ``q_errors``. - Instead queue stats will be received via xstats API. - Also compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` is removed from public headers. + Affected fields are: ``q_ipackets``, ``q_opackets``, ``q_ibytes``, ``q_obytes``, ``q_errors``. + Queue stats will be received via the xstats API instead. + Also, the compile time flag ``RTE_ETHDEV_QUEUE_STAT_CNTRS`` is removed from public headers. * telemetry: As previously announced in the deprecation notices, the functions ``rte_tel_data_add_array_u64`` and ``rte_tel_data_add_dict_u64`` are removed. They are replaced by ``rte_tel_data_add_array_uint`` and ``rte_tel_data_add_dict_uint`` respectively. -* net/mlx5: ``repr_matching_en`` device argument has been removed. +* net/mlx5: The ``repr_matching_en`` device argument has been removed. Applications which disabled this option were able to receive traffic from any physical port/VF/SF on any representor port. - Specifically, in most cases, this was used to process all traffic on representor port + Specifically, in most cases, this was used to process all traffic on a representor port which is a transfer proxy port. Similar behavior in mlx5 PMD can be achieved without this device argument, by using ``RTE_FLOW_ACTION_TYPE_RSS`` in transfer flow rules. @@ -256,20 +202,8 @@ Removed Items API Changes ----------- -.. This section should contain API changes. Sample format: - - * sample: Add a short 1-2 sentence description of the API change - which was announced in the previous releases and made in this release. - Start with a scope label like "ethdev:". - Use fixed width quotes for ``function_names`` or ``struct_names``. - Use the past tense. - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= - * rawdev: Changed the return type of ``rte_rawdev_get_dev_id()`` - for negative error values. + to allow negative error values. * pcapng: Changed the API for adding interfaces to include a link type argument. The link type was previously hardcoded to the Ethernet link type in the API. @@ -282,18 +216,6 @@ API Changes ABI Changes ----------- -.. This section should contain ABI changes. Sample format: - - * sample: Add a short 1-2 sentence description of the ABI change - which was announced in the previous releases and made in this release. - Start with a scope label like "ethdev:". - Use fixed width quotes for ``function_names`` or ``struct_names``. - Use the past tense. - - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= - * eal: The structure ``rte_mp_msg`` alignment has been updated to 8 bytes to limit unaligned accesses in messages payload. @@ -301,10 +223,10 @@ ABI Changes to avoid unaligned accesses. * ethdev: Added ``link_connector`` field to ``rte_eth_link`` structure - to report type of link connector for a port. + to report the type of link connector for a port. * cryptodev: The ``rte_crypto_sm2_op_param`` struct member ``cipher`` to hold ciphertext - is changed to union data type. This change is required to support partial SM2 calculation + is changed to a union data type. This change is required to support partial SM2 calculation which is driven by ``RTE_CRYPTO_SM2_PARTIAL`` capability flag. * cryptodev: The enum ``rte_crypto_asym_xform_type``, struct ``rte_crypto_asym_xform`` @@ -312,36 +234,258 @@ ABI Changes to support ML-KEM and ML-DSA. -Known Issues ------------- +Tested Platforms +---------------- -.. This section should contain new known issues in this release. Sample format: +* Intel\ |reg| platforms with Intel\ |reg| NICs combinations + + * CPU + + * Intel\ |reg| Atom\ |trade| x7835RE + * Intel\ |reg| Xeon\ |reg| 6553P-B CPU @ 2.6GHz + * Intel\ |reg| Xeon\ |reg| 6767P CPU @ 2.4GHz + * Intel\ |reg| Xeon\ |reg| CPU Max 9480 + * Intel\ |reg| Xeon\ |reg| CPU Max 9480 CPU @ 1.9GHz + * Intel\ |reg| Xeon\ |reg| Gold 6330 CPU @ 2.00GHz + * Intel\ |reg| Xeon\ |reg| Gold 6348 CPU @ 2.60GHz + * Intel\ |reg| Xeon\ |reg| Platinum 8280M CPU @ 2.70GHz + * Intel\ |reg| Xeon\ |reg| Platinum 8380 CPU @ 2.30GHz + * Intel\ |reg| Xeon\ |reg| Platinum 8468H CPU @ 2.1GHz + * Intel\ |reg| Xeon\ |reg| Platinum 8490H CPU @ 1.9GHz + + * OS: - * **Add title in present tense with full stop.** + * Fedora 42 + * FreeBSD 14.3 + * Microsoft Azure Linux 3.0 + * OpenAnolis OS 8.10 + * openEuler 24.03 (LTS-SP2) + * Red Hat Enterprise Linux Server release 10 + * Red Hat Enterprise Linux Server release 9.6 + * Ubuntu 24.04 LTS + * Ubuntu 24.04.3 LTS + * Vmware ESXi 8.0.3 - Add a short 1-2 sentence description of the known issue - in the present tense. Add information on any known workarounds. + * NICs: - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + * Intel\ |reg| Ethernet Controller E810-C for SFP (4x25G) + * Firmware version: 4.90 0x80020eeb 1.3863.0 + * Device ID (PF/VF): 8086:1593 / 8086:1889 + * Driver version (out-of-tree): 2.3.14 (ice) + * Driver version (in-tree): 6.8.0-86-generic (Ubuntu24.04 LTS) (ice) + * OS Default DDP: 1.3.43.0 + * COMMS DDP: 1.3.55.0 + * Wireless Edge DDP: 1.3.25.0 -Tested Platforms ----------------- + * Intel\ |reg| Ethernet Controller E810-C for QSFP (2x100G) + + * Firmware version: 4.90 0x80020ef2 1.3863.0 + * Device ID (PF/VF): 8086:1592 / 8086:1889 + * Driver version (out-of-tree): 2.3.14 (ice) + * Driver version (in-tree): 6.6.12.1-1.azl3+ice+ (Microsoft Azure Linux 3.0) / + 6.12.0-55.9.1.el10_0.x86_64+rt (RHEL10) (ice) + * OS Default DDP: 1.3.43.0 + * COMMS DDP: 1.3.55.0 + * Wireless Edge DDP: 1.3.25.0 + + * Intel\ |reg| Ethernet Controller E830-CC for SFP + + * Firmware version: 1.20 0x800179c0 1.3862.0 + * Device ID (PF/VF): 8086:12d3 / 8086:1889 + * Driver version: 2.3.14 (ice) + * OS Default DDP: 1.3.43.0 + * COMMS DDP: 1.3.55.0 + * Wireless Edge DDP: 1.3.25.0 + + * Intel\ |reg| Ethernet Controller E830-CC for QSFP + + * Firmware version: 1.20 0x800179c1 1.3862.0 + * Device ID (PF/VF): 8086:12d2 / 8086:1889 + * Driver version: 2.3.14 (ice) + * OS Default DDP: 1.3.43.0 + * COMMS DDP: 1.3.55.0 + * Wireless Edge DDP: 1.3.25.0 + + * Intel\ |reg| Ethernet Connection E825-C for QSFP + + * Firmware version: 4.04 0x80007e5c 1.3885.0 + * Device ID (PF/VF): 8086:579d / 8086:1889 + * Driver version: 2.3.14 (ice) + * OS Default DDP: 1.3.43.0 + * COMMS DDP: 1.3.55.0 + * Wireless Edge DDP: 1.3.25.0 + + * Intel\ |reg| Ethernet Network Adapter E610-XT2 + + * Firmware version: 1.30 0x8000e8a2 1.3864.0 + * Device ID (PF/VF): 8086:57b0 / 8086:57ad + * Driver version (out-of-tree): 6.2.5 (ixgbe) + + * Intel\ |reg| Ethernet Network Adapter E610-XT4 + + * Firmware version: 1.30 0x8000e8a5 1.3864.0 + * Device ID (PF/VF): 8086:57b0 / 8086:57ad + * Driver version (out-of-tree): 6.2.5 (ixgbe) + + * Intel\ |reg| Ethernet Converged Network Adapter X710-DA4 (4x10G) + + * Firmware version: 9.55 0x8000fdf4 1.3862.0 + * Device ID (PF/VF): 8086:1572 / 8086:154c + * Driver version (in-tree): 6.8.0-88-generic (i40e) + + * Intel\ |reg| Corporation Ethernet Connection X722 for 10GbE SFP+ (2x10G) + + * Firmware version: 6.51 0x80004430 1.3862.0 + * Device ID (PF/VF): 8086:37d0 / 8086:37cd + * Driver version (out-of-tree): 2.28.13 (i40e) + + * Intel\ |reg| Ethernet Converged Network Adapter XXV710-DA2 (2x25G) + + * Firmware version: 9.55 0x8000fe4c 1.3862.0 + * Device ID (PF/VF): 8086:158b / 8086:154c + * Driver version (out-of-tree): 2.28.13 (i40e) + * Driver version (in-tree): 6.8.0-88-generic (Ubuntu24.04.3 LTS) / + 6.12.0-55.9.1.el10_0.x86_64 (RHEL10) (i40e) + + * Intel\ |reg| Ethernet Converged Network Adapter XL710-QDA2 (2X40G) + + * Firmware version(PF): 9.55 0x8000fe31 1.3862.0 + * Device ID (PF/VF): 8086:1583 / 8086:154c + * Driver version (out-of-tree): 2.28.13 (i40e) + + * Intel\ |reg| Ethernet Controller I226-LM + + * Firmware version: 2.14, 0x8000028c + * Device ID (PF): 8086:125b + * Driver version (in-tree): 6.8.0-87-generic (Ubuntu24.04.3 LTS) (igc) + + * Intel\ |reg| Corporation Ethernet Server Adapter I350-T4 + + * Firmware version: 1.63, 0x8000116b + * Device ID (PF/VF): 8086:1521 /8086:1520 + * Driver version: 6.14.0-35-generic (Ubuntu 24.04.3 LTS) (igb) + + * Intel\ |reg| Infrastructure Processing Unit (Intel\ |reg| IPU) E2100 + + * Firmware version: ci-ts.release.2.0.0.11126 + * Device ID (idpf/cpfl): 8086:1452/8086:1453 + * Driver version: 0.0.772 (idpf) + +* Intel\ |reg| platforms with NVIDIA\ |reg| NICs combinations + + * CPU: + + * Intel\ |reg| Xeon\ |reg| Gold 6154 CPU @ 3.00GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2697A v4 @ 2.60GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2697 v3 @ 2.60GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2680 v2 @ 2.80GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2670 0 @ 2.60GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2650 v4 @ 2.20GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2650 v3 @ 2.30GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2640 @ 2.50GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2650 0 @ 2.00GHz + * Intel\ |reg| Xeon\ |reg| CPU E5-2620 v4 @ 2.10GHz + + * OS: + + * Red Hat Enterprise Linux release 9.2 (Plow) + * Red Hat Enterprise Linux release 9.1 (Plow) + * Red Hat Enterprise Linux release 8.6 (Ootpa) + * Ubuntu 24.04 + * Ubuntu 22.04 + * Ubuntu 20.04 + * SUSE Enterprise Linux 15 SP4 + + * DOCA: + + * DOCA 3.2.0-125000 and above. + + * upstream kernel: + + * Linux 6.17.0 and above + + * rdma-core: + + * rdma-core-58.0 and above + + * NICs + + * NVIDIA\ |reg| ConnectX\ |reg|-6 Dx EN 100G MCX623106AN-CDAT (2x100G) + + * Host interface: PCI Express 4.0 x16 + * Device ID: 15b3:101d + * Firmware version: 22.47.1026 and above + + * NVIDIA\ |reg| ConnectX\ |reg|-6 Lx EN 25G MCX631102AN-ADAT (2x25G) + + * Host interface: PCI Express 4.0 x8 + * Device ID: 15b3:101f + * Firmware version: 26.47.1026 and above + + * NVIDIA\ |reg| ConnectX\ |reg|-7 200G CX713106AE-HEA_QP1_Ax (2x200G) + + * Host interface: PCI Express 5.0 x16 + * Device ID: 15b3:1021 + * Firmware version: 28.47.1026 and above + + * NVIDIA\ |reg| ConnectX\ |reg|-8 SuperNIC 400G MT4131 - 900-9X81Q-00CN-STA (2x400G) + + * Host interface: PCI Express 6.0 x16 + * Device ID: 15b3:1023 + * Firmware version: 40.47.1026 and above + + * NVIDIA\ |reg| ConnectX\ |reg|-9 SuperNIC 800G MT4133 - 900-9X91E-00EB-STA_Ax (1x800G) + + * Host interface: PCI Express 6.0 x16 + * Device ID: 15b3:1025 + * Firmware version: 82.47.0366 and above + +* NVIDIA\ |reg| BlueField\ |reg| SmartNIC + + * NVIDIA\ |reg| BlueField\ |reg|-2 SmartNIC MT41686 - MBF2H332A-AEEOT_A1 (2x25G) + + * Host interface: PCI Express 3.0 x16 + * Device ID: 15b3:a2d6 + * Firmware version: 24.47.1026 and above + + * NVIDIA\ |reg| BlueField\ |reg|-3 P-Series DPU MT41692 - 900-9D3B6-00CV-AAB (2x200G) + + * Host interface: PCI Express 5.0 x16 + * Device ID: 15b3:a2dc + * Firmware version: 32.47.1026 and above + + * Embedded software: + + * Ubuntu 24.04 + * MLNX_OFED 25.10-1.2.8.0 + * bf-bundle-3.2.0-113_25.10_ubuntu-24.04 + * DPDK application running on ARM cores + +* IBM Power 9 platforms with NVIDIA\ |reg| NICs combinations + + * CPU: + + * POWER9 2.2 (pvr 004e 1202) + + * OS: + + * Ubuntu 20.04 + + * NICs: + + * NVIDIA\ |reg| ConnectX\ |reg|-6 Dx 100G MCX623106AN-CDAT (2x100G) -.. This section should contain a list of platforms that were tested - with this release. + * Host interface: PCI Express 4.0 x16 + * Device ID: 15b3:101d + * Firmware version: 22.47.1026 and above - The format is: + * NVIDIA\ |reg| ConnectX\ |reg|-7 200G CX713106AE-HEA_QP1_Ax (2x200G) - * platform with combinations + * Host interface: PCI Express 5.0 x16 + * Device ID: 15b3:1021 + * Firmware version: 28.47.1026 and above - * List of CPU - * List of OS - * List of devices - * Other relevant details... + * DOCA: - This section is a comment. Do not overwrite or remove it. - Also, make sure to start the actual text at the margin. - ======================================================= + * DOCA 3.2.0-125000 and above diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst index 9b0d0350aab..c50a421fd03 100644 --- a/doc/guides/sample_app_ug/l3_forward.rst +++ b/doc/guides/sample_app_ug/l3_forward.rst @@ -77,6 +77,8 @@ The application has a number of command line options:: [-P] [--lookup LOOKUP_METHOD] --config(port,queue,lcore)[,(port,queue,lcore)] + [--rx-burst NPKTS] + [--tx-burst NPKTS] [--eth-dest=X,MM:MM:MM:MM:MM:MM] [--max-pkt-len PKTLEN] [--no-numa] @@ -113,6 +115,10 @@ Where, * ``--config (port,queue,lcore)[,(port,queue,lcore)]:`` Determines which queues from which ports are mapped to which cores. +* ``--rx-burst NPKTS:`` Optional, Rx burst size in decimal (default 32). + +* ``--tx-burst NPKTS:`` Optional, Tx burst size in decimal (default 32). + * ``--eth-dest=X,MM:MM:MM:MM:MM:MM:`` Optional, ethernet destination for port X. * ``--max-pkt-len:`` Optional, maximum packet length in decimal (64-9600). diff --git a/doc/guides/windows_gsg/build_dpdk.rst b/doc/guides/windows_gsg/build_dpdk.rst index 48241f7091a..5a0f5d276b6 100644 --- a/doc/guides/windows_gsg/build_dpdk.rst +++ b/doc/guides/windows_gsg/build_dpdk.rst @@ -14,10 +14,6 @@ environments: * The MinGW-w64 10.0 (or later) toolchain (either native or cross). * Microsoft Visual Studio 2022 (any edition). - - note Microsoft Visual Studio 2022 does not currently build enough - of DPDK to produce a working DPDK application - but may be used to validate that changes are portable between toolchains. - The Meson Build system is used to prepare the sources for compilation with the Ninja backend. The installation of these tools is covered in this section. @@ -30,10 +26,10 @@ Install the Compiler ~~~~~~~~~~~~~~~~~~~~ Download and install the clang compiler from -`LLVM website `_. +`LLVM website `_. For example, Clang-LLVM direct download link:: - http://releases.llvm.org/7.0.1/LLVM-7.0.1-win64.exe + https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.0/LLVM-19.1.0-win64.exe Install the Linker @@ -49,7 +45,7 @@ and ensure the Windows SDK is selected. Option 2. MinGW-w64 Toolchain ----------------------------- -On Windows, obtain the latest version installer from +On Windows, obtain the latest installer version from `MinGW-w64 repository `_. Any thread model (POSIX or Win32) can be chosen, DPDK does not rely on it. Install to a folder without spaces in its name, like ``C:\MinGW``. @@ -70,7 +66,7 @@ Download and install the build system from `Meson website `_. A good option to choose is the MSI installer for both meson and ninja together:: - http://mesonbuild.com/Getting-meson.html#installing-meson-and-ninja-with-the-msi-installer%22 + http://mesonbuild.com/Getting-meson.html#installing-meson-and-ninja-with-the-msi-installer The minimal Meson supported version is 1.5.2. @@ -134,14 +130,21 @@ required to build with Visual Studio 2022. Building DPDK applications that run on 32-bit Windows is currently not supported. If your Visual Studio environment defaults to producing 32-bit binaries, you can instruct the toolset to produce 64-bit binaries using "-arch" parameter. -For more details about the Developer Prompt options, look at the -`Visual Studio Developer Command Prompt and Developer PowerShell -`_. + +The command below opens a 'Visual Studio Developer Command Prompt' +when invoked from a Windows Command Prompt. .. code-block:: console "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 +.. note:: + + To open a Developer Prompt from PowerShell, + and for more details about the options available, + look at the `Visual Studio Developer Command Prompt and Developer PowerShell + `_. + Compile the code from the developer prompt. .. code-block:: console diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 4529ec5085e..abdb0ad50d3 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -242,7 +242,7 @@ static int rte_fslmc_parse(const char *name, void *addr) { uint16_t dev_id; - char *t_ptr; + const char *t_ptr; const char *sep; uint8_t sep_exists = 0; int ret = -1; diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index ca9e49f5489..fdce1f6b1fa 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -468,8 +468,8 @@ ifpga_parse(const char *name, void *addr) int *out = addr; struct rte_rawdev *rawdev = NULL; char rawdev_name[RTE_RAWDEV_NAME_MAX_LEN]; - char *c1 = NULL; - char *c2 = NULL; + const char *c1 = NULL; + const char *c2 = NULL; int port = IFPGA_BUS_DEV_PORT_MAX; char str_port[8]; int str_port_len = 0; diff --git a/drivers/bus/uacce/uacce.c b/drivers/bus/uacce/uacce.c index 87e68b3dbf1..79f990c54cc 100644 --- a/drivers/bus/uacce/uacce.c +++ b/drivers/bus/uacce/uacce.c @@ -328,8 +328,8 @@ static bool uacce_match(const struct rte_uacce_driver *dr, const struct rte_uacce_device *dev) { const struct rte_uacce_id *id_table; + const char *map; uint32_t len; - char *map; for (id_table = dr->id_table; id_table->dev_api != NULL; id_table++) { if (strcmp(id_table->dev_api, dev->api) != 0) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index 22f6b29089e..d885a95c04e 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -784,6 +784,8 @@ mlx5_devx_cmd_create_flex_parser(void *ctx, MLX5_GENERAL_OBJ_TYPE_FLEX_PARSE_GRAPH); MLX5_SET(parse_graph_flex, flex, header_length_mode, data->header_length_mode); + MLX5_SET(parse_graph_flex, flex, header_length_field_offset_mode, + data->header_length_field_offset_mode); MLX5_SET64(parse_graph_flex, flex, modify_field_select, data->modify_field_select); MLX5_SET(parse_graph_flex, flex, header_length_base_value, @@ -911,6 +913,8 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap max_next_header_offset); attr->header_length_mask_width = MLX5_GET(parse_graph_node_cap, hcattr, header_length_mask_width); + attr->header_length_field_mode_wa = !MLX5_GET(parse_graph_node_cap, hcattr, + header_length_field_offset_mode); /* Get the max supported samples from HCA CAP 2 */ hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc, MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 | @@ -1300,18 +1304,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, rx_reg |= ((0xff & reg_c_8_15) << 8); attr->set_reg_c &= (rx_reg & tx_reg); - attr->rx_sw_owner_v2 = MLX5_GET(flow_table_nic_cap, hcattr, - flow_table_properties_nic_receive.sw_owner_v2); - if (!attr->rx_sw_owner_v2) - attr->rx_sw_owner = MLX5_GET(flow_table_nic_cap, hcattr, - flow_table_properties_nic_receive.sw_owner); - - attr->tx_sw_owner_v2 = MLX5_GET(flow_table_nic_cap, hcattr, - flow_table_properties_nic_transmit.sw_owner_v2); - if (!attr->tx_sw_owner_v2) - attr->tx_sw_owner = MLX5_GET(flow_table_nic_cap, hcattr, - flow_table_properties_nic_transmit.sw_owner); - #undef GET_RX_REG_X_BITS #undef GET_TX_REG_X_BITS } @@ -1464,12 +1456,6 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, reg_c_8_15 = MLX5_GET(flow_table_esw_cap, hcattr, ft_field_support_2_esw_fdb.metadata_reg_c_8_15); attr->set_reg_c &= ((0xff & reg_c_8_15) << 8) | esw_reg; - - attr->esw_sw_owner_v2 = MLX5_GET(flow_table_esw_cap, hcattr, - flow_table_properties_nic_esw_fdb.sw_owner_v2); - if (!attr->esw_sw_owner_v2) - attr->esw_sw_owner = MLX5_GET(flow_table_esw_cap, hcattr, - flow_table_properties_nic_esw_fdb.sw_owner); } return 0; error: diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index 4c7747cbeca..f6e8afbf395 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -119,6 +119,7 @@ struct mlx5_hca_flex_attr { uint8_t sample_tunnel_inner2:1; uint8_t zero_size_supported:1; uint8_t sample_id_in_out:1; + uint8_t header_length_field_mode_wa:1; uint16_t max_base_header_length; uint8_t max_sample_base_offset; uint16_t max_next_header_offset; @@ -336,12 +337,6 @@ struct mlx5_hca_attr { uint8_t max_header_modify_pattern_length; uint64_t system_image_guid; uint32_t log_max_conn_track_offload:5; - uint8_t rx_sw_owner:1; - uint8_t rx_sw_owner_v2:1; - uint8_t tx_sw_owner:1; - uint8_t tx_sw_owner_v2:1; - uint8_t esw_sw_owner:1; - uint8_t esw_sw_owner_v2:1; }; /* LAG Context. */ @@ -654,6 +649,7 @@ struct mlx5_devx_graph_node_attr { uint32_t header_length_base_value:16; uint32_t header_length_field_shift:4; uint32_t header_length_field_offset:16; + uint32_t header_length_field_offset_mode:1; uint32_t header_length_field_mask; struct mlx5_devx_match_sample_attr sample[MLX5_GRAPH_NODE_SAMPLE_NUM]; uint32_t next_header_field_offset:16; diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 9383e098933..411c35f456e 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1597,13 +1597,9 @@ enum { #define MLX5_HCA_FLEX_GTPU_DW_0_ENABLED (1UL << 18) #define MLX5_HCA_FLEX_GTPU_TEID_ENABLED (1UL << 19) -/* The device steering logic format version. */ -enum { - MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5 = 0, - MLX5_STEERING_LOGIC_FORMAT_CONNECTX_6DX = 1, - MLX5_STEERING_LOGIC_FORMAT_CONNECTX_7 = 2, - MLX5_STEERING_LOGIC_FORMAT_CONNECTX_8 = 3, -}; +/* The device steering logic format. */ +#define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_5 0x0 +#define MLX5_STEERING_LOGIC_FORMAT_CONNECTX_6DX 0x1 struct mlx5_ifc_cmd_hca_cap_bits { u8 access_other_hca_roce[0x1]; @@ -2119,7 +2115,9 @@ struct mlx5_ifc_parse_graph_node_cap_bits { u8 max_num_arc_in[0x08]; u8 max_num_arc_out[0x08]; u8 max_num_sample[0x08]; - u8 reserved_at_78[0x03]; + u8 reserved_at_78[0x01]; + u8 header_length_field_offset_mode[0x1]; + u8 reserved_at_79[0x01]; u8 parse_graph_anchor[0x1]; u8 reserved_at_7c[0x01]; u8 sample_tunnel_inner2[0x1]; @@ -2350,9 +2348,7 @@ struct mlx5_ifc_flow_table_nic_cap_bits { }; struct mlx5_ifc_flow_table_esw_cap_bits { - u8 reserved_at_0[0x200]; - struct mlx5_ifc_flow_table_prop_layout_bits flow_table_properties_nic_esw_fdb; - u8 reserved_at_400[0x400]; + u8 reserved_at_0[0x800]; struct mlx5_ifc_ft_fields_support_bits ft_header_modify_esw_fdb; u8 reserved_at_C00[0x800]; struct mlx5_ifc_ft_fields_support_2_bits @@ -4991,7 +4987,9 @@ struct mlx5_ifc_parse_graph_flex_bits { u8 next_header_field_offset[0x10]; u8 reserved_at_160[0x12]; u8 head_anchor_id[0x6]; - u8 reserved_at_178[0x3]; + u8 reserved_at_178[0x1]; + u8 header_length_field_offset_mode[0x1]; + u8 reserved_at_17a[0x1]; u8 next_header_field_size[0x5]; u8 header_length_field_mask[0x20]; u8 reserved_at_224[0x20]; diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index b582e3bf8b1..07a8b19583a 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -173,7 +173,7 @@ wireless_slice_support(uint16_t pci_dev_id) * other than the equals sign is ignored. It will not work with other conversion * functions like strt*. */ -char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, +const char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, const char *key) { if (qat_dev->command_line == NULL) @@ -185,8 +185,9 @@ char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, static int cmdline_validate(const char *arg) { + const char *eq_sign = strchr(arg, '='); int i, len; - char *eq_sign = strchr(arg, '='); + /* Check for the equal sign */ if (eq_sign == NULL) { QAT_LOG(ERR, "malformed string, no equals sign, %s", arg); @@ -263,7 +264,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) struct rte_mem_resource *mem_resource; const struct rte_memzone *qat_dev_mz; int qat_dev_size, extra_size; - char *cmdline = NULL; + const char *cmdline = NULL; rte_pci_device_name(&pci_dev->addr, name, sizeof(name)); snprintf(name+strlen(name), QAT_DEV_NAME_MAX_LEN-strlen(name), "_qat"); diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h index f5ba1592c3b..34937e963e5 100644 --- a/drivers/common/qat/qat_device.h +++ b/drivers/common/qat/qat_device.h @@ -42,7 +42,7 @@ typedef int (*qat_dev_get_extra_size_t)(void); typedef int (*qat_dev_get_slice_map_t)(uint32_t *map, const struct rte_pci_device *pci_dev); -char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, const char *key); +const char *qat_dev_cmdline_get_val(struct qat_pci_device *qat_dev, const char *key); struct qat_dev_hw_spec_funcs { qat_dev_reset_ring_pairs_t qat_dev_reset_ring_pairs; diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index 55e510c91fc..92dac794234 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -690,7 +690,7 @@ qat_comp_dev_create(struct qat_pci_device *qat_pci_dev) &qat_comp_gen_dev_ops[qat_pci_dev->qat_dev_gen]; uint64_t capa_size; uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id; - char *cmdline = NULL; + const char *cmdline = NULL; snprintf(name, RTE_COMPRESSDEV_NAME_MAX_LEN, "%s_%s", qat_pci_dev->name, "comp"); diff --git a/drivers/crypto/caam_jr/caam_jr_uio.c b/drivers/crypto/caam_jr/caam_jr_uio.c index 8956f7750d7..43357091e1a 100644 --- a/drivers/crypto/caam_jr/caam_jr_uio.c +++ b/drivers/crypto/caam_jr/caam_jr_uio.c @@ -106,19 +106,11 @@ static int g_uio_jr_num; static bool file_name_match_extract(const char filename[], const char match[], int *number) { - char *substr = NULL; - - substr = strstr(filename, match); - if (substr == NULL) - return false; - /* substring was found in * read number following substring in */ - if (sscanf(filename + strlen(match), "%d", number) <= 0) - return false; - - return true; + return strstr(filename, match) != NULL && + sscanf(filename + strlen(match), "%d", number) > 0; } /** @brief Reads first line from a file. diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c index 88083375511..06f037cc143 100644 --- a/drivers/crypto/qat/qat_asym.c +++ b/drivers/crypto/qat/qat_asym.c @@ -1697,7 +1697,7 @@ qat_asym_dev_create(struct qat_pci_device *qat_pci_dev) char name[RTE_CRYPTODEV_NAME_MAX_LEN]; char capa_memz_name[RTE_CRYPTODEV_NAME_MAX_LEN]; uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id; - char *cmdline = NULL; + const char *cmdline = NULL; snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s", qat_pci_dev->name, "asym"); diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c index d979ae6489e..83f10840304 100644 --- a/drivers/crypto/qat/qat_sym.c +++ b/drivers/crypto/qat/qat_sym.c @@ -217,7 +217,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev) const struct qat_crypto_gen_dev_ops *gen_dev_ops = &qat_sym_gen_dev_ops[qat_pci_dev->qat_dev_gen]; uint16_t sub_id = qat_dev_instance->pci_dev->id.subsystem_device_id; - char *cmdline = NULL; + const char *cmdline = NULL; snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN, "%s_%s", qat_pci_dev->name, "sym"); diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c index 3832eb7e000..0c1431b4e70 100644 --- a/drivers/event/cnxk/cn10k_eventdev.c +++ b/drivers/event/cnxk/cn10k_eventdev.c @@ -126,8 +126,7 @@ cn10k_sso_hws_flush_events(void *hws, uint8_t queue_id, uintptr_t base, while (aq_cnt || cq_ds_cnt || ds_cnt) { plt_write64(req, ws->base + SSOW_LF_GWS_OP_GET_WORK0); - cn10k_sso_hws_get_work_empty( - ws, &ev, (NIX_RX_OFFLOAD_MAX - 1) | NIX_RX_REAS_F | NIX_RX_MULTI_SEG_F); + cn10k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (fn != NULL && ev.u64 != 0) fn(arg, ev); if (ev.sched_type != SSO_TT_EMPTY) @@ -473,8 +472,7 @@ cn10k_sso_port_quiesce(struct rte_eventdev *event_dev, void *port, } while (ptag & (BIT_ULL(62) | BIT_ULL(58) | BIT_ULL(56) | BIT_ULL(54))); - cn10k_sso_hws_get_work_empty(ws, &ev, - (NIX_RX_OFFLOAD_MAX - 1) | NIX_RX_REAS_F | NIX_RX_MULTI_SEG_F); + cn10k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (is_pend && ev.u64) if (flush_cb) flush_cb(event_dev->data->dev_id, ev, args); @@ -503,8 +501,7 @@ cn10k_sso_port_quiesce(struct rte_eventdev *event_dev, void *port, SSO_TT_EMPTY) { plt_write64(BIT_ULL(16) | 1, ws->base + SSOW_LF_GWS_OP_GET_WORK0); - cn10k_sso_hws_get_work_empty( - ws, &ev, (NIX_RX_OFFLOAD_MAX - 1) | NIX_RX_REAS_F | NIX_RX_MULTI_SEG_F); + cn10k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (ev.u64) { if (flush_cb) flush_cb(event_dev->data->dev_id, ev, args); diff --git a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h index 954dee5a2a9..9b6abdf18db 100644 --- a/drivers/event/cnxk/cn10k_worker.h +++ b/drivers/event/cnxk/cn10k_worker.h @@ -52,12 +52,12 @@ cn10k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, struc uint64_t mbuf_init = 0x100010000ULL | RTE_PKTMBUF_HEADROOM; struct cnxk_timesync_info *tstamp = ws->tstamp[port_id]; void *lookup_mem = ws->lookup_mem; + uint64_t meta_aura = 0, laddr = 0; + uint16_t lmt_id = 0, d_off = 0; uintptr_t lbase = ws->lmt_base; - uint64_t meta_aura = 0, laddr; + struct rte_mempool *mp = NULL; struct rte_event_vector *vec; uint16_t nb_mbufs, non_vec; - struct rte_mempool *mp; - uint16_t lmt_id, d_off; struct rte_mbuf **wqe; struct rte_mbuf *mbuf; uint64_t sa_base = 0; diff --git a/drivers/event/cnxk/cn20k_eventdev.c b/drivers/event/cnxk/cn20k_eventdev.c index b25e570211f..1c5d9272398 100644 --- a/drivers/event/cnxk/cn20k_eventdev.c +++ b/drivers/event/cnxk/cn20k_eventdev.c @@ -192,7 +192,7 @@ cn20k_sso_hws_flush_events(void *hws, uint8_t queue_id, uintptr_t base, cnxk_han while (aq_cnt || cq_ds_cnt || ds_cnt) { plt_write64(req, ws->base + SSOW_LF_GWS_OP_GET_WORK0); - cn20k_sso_hws_get_work_empty(ws, &ev, 0); + cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (fn != NULL && ev.u64 != 0) fn(arg, ev); if (ev.sched_type != SSO_TT_EMPTY) @@ -521,8 +521,7 @@ cn20k_sso_port_quiesce(struct rte_eventdev *event_dev, void *port, ptag = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE); } while (ptag & (BIT_ULL(62) | BIT_ULL(58) | BIT_ULL(56) | BIT_ULL(54))); - cn20k_sso_hws_get_work_empty(ws, &ev, - (NIX_RX_OFFLOAD_MAX - 1) | NIX_RX_REAS_F | NIX_RX_MULTI_SEG_F); + cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (is_pend && ev.u64) if (flush_cb) flush_cb(event_dev->data->dev_id, ev, args); @@ -548,8 +547,7 @@ cn20k_sso_port_quiesce(struct rte_eventdev *event_dev, void *port, if (CNXK_TT_FROM_TAG(plt_read64(ws->base + SSOW_LF_GWS_PRF_WQE0)) != SSO_TT_EMPTY) { plt_write64(BIT_ULL(16) | 1, ws->base + SSOW_LF_GWS_OP_GET_WORK0); - cn20k_sso_hws_get_work_empty( - ws, &ev, (NIX_RX_OFFLOAD_MAX - 1) | NIX_RX_REAS_F | NIX_RX_MULTI_SEG_F); + cn20k_sso_hws_get_work_empty(ws, &ev, dev->rx_offloads); if (ev.u64) { if (flush_cb) flush_cb(event_dev->data->dev_id, ev, args); diff --git a/drivers/event/cnxk/cn20k_worker.h b/drivers/event/cnxk/cn20k_worker.h index df0abd9202f..608f93dcd46 100644 --- a/drivers/event/cnxk/cn20k_worker.h +++ b/drivers/event/cnxk/cn20k_worker.h @@ -54,12 +54,12 @@ cn20k_process_vwqe(uintptr_t vwqe, uint16_t port_id, const uint32_t flags, struc struct cnxk_timesync_info *tstamp = ws->tstamp[port_id]; uint8_t m_sz = sizeof(struct rte_mbuf); void *lookup_mem = ws->lookup_mem; + uint64_t meta_aura = 0, laddr = 0; uintptr_t lbase = ws->lmt_base; - uint64_t meta_aura = 0, laddr; + uint16_t lmt_id = 0, d_off = 0; struct rte_event_vector *vec; uint16_t nb_mbufs, non_vec; struct rte_mempool *mp; - uint16_t lmt_id, d_off; struct rte_mbuf **wqe; struct rte_mbuf *mbuf; uint64_t sa_base = 0; diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index e79306e6467..e55910b5759 100644 --- a/drivers/net/cnxk/cn10k_rx.h +++ b/drivers/net/cnxk/cn10k_rx.h @@ -572,7 +572,7 @@ nix_sec_meta_to_mbuf(uint64_t cq_w1, uint64_t cq_w5, uintptr_t inb_sa, const struct cpt_cn10k_parse_hdr_s *hdr = (const struct cpt_cn10k_parse_hdr_s *)cpth; uint64_t mbuf_init = vgetq_lane_u64(*rearm, 0); - struct cn10k_inb_priv_data *inb_priv; + struct cn10k_inb_priv_data *inb_priv = NULL; uintptr_t p; /* Clear checksum flags */ @@ -1464,9 +1464,9 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts, struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3; uint8_t loff = 0, lnum = 0, shft = 0; struct rte_mempool *meta_pool = NULL; + uint16_t lmt_id = 0, d_off = 0; + uint64_t lbase = 0, laddr = 0; uint8x16_t f0, f1, f2, f3; - uint16_t lmt_id, d_off; - uint64_t lbase, laddr; uintptr_t sa_base = 0; uint16_t packets = 0; uint16_t pkts_left; diff --git a/drivers/net/cnxk/cn20k_rx.h b/drivers/net/cnxk/cn20k_rx.h index 56826318151..1944e507b0b 100644 --- a/drivers/net/cnxk/cn20k_rx.h +++ b/drivers/net/cnxk/cn20k_rx.h @@ -307,7 +307,7 @@ nix_cqe_xtract_mseg(const union nix_rx_parse_u *rx, struct rte_mbuf *mbuf, uint6 const struct cpt_parse_hdr_s *hdr = (const struct cpt_parse_hdr_s *)cpth; struct cn20k_inb_priv_data *inb_priv = NULL; const struct cpt_frag_info_s *finfo = NULL; - uint64_t fsz_w1 = 0, cq_w1, cq_w5, sg; + uint64_t fsz_w1 = 0, cq_w1, cq_w5 = 0, sg; uint32_t offset = hdr->w2.ptr_offset; uint8_t num_frags = 0, nxt_frag = 0; struct rte_mbuf *head, *last_mbuf; @@ -845,10 +845,10 @@ cn20k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts, c uint64x2_t rearm2 = vdupq_n_u64(mbuf_initializer); uint64x2_t rearm3 = vdupq_n_u64(mbuf_initializer); struct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3; + uint64_t lbase = 0, laddr = 0, buf_sz = 0; uint8_t loff = 0, lnum = 0, shft = 0; - uint64_t lbase, laddr, buf_sz; + uint16_t lmt_id = 0, d_off; uint8x16_t f0, f1, f2, f3; - uint16_t lmt_id, d_off; uintptr_t sa_base = 0; uint16_t packets = 0; uint16_t pkts_left; diff --git a/drivers/net/enetfec/enet_uio.c b/drivers/net/enetfec/enet_uio.c index f32d5e1b1ee..c3917cd9df1 100644 --- a/drivers/net/enetfec/enet_uio.c +++ b/drivers/net/enetfec/enet_uio.c @@ -32,13 +32,7 @@ static int enetfec_count; static bool file_name_match_extract(const char filename[], const char match[]) { - char *substr = NULL; - - substr = strstr(filename, match); - if (substr == NULL) - return false; - - return true; + return strstr(filename, match) != NULL; } /* diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index df703134beb..3a99923220b 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -4561,7 +4561,7 @@ hns3_set_rxtx_function(struct rte_eth_dev *eth_dev) } else { eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy; eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy; - eth_dev->tx_pkt_prepare = NULL; + eth_dev->tx_pkt_prepare = rte_eth_tx_pkt_prepare_dummy; } hns3_trace_rxtx_function(eth_dev); @@ -4917,7 +4917,7 @@ void hns3_stop_tx_datapath(struct rte_eth_dev *dev) { dev->tx_pkt_burst = rte_eth_pkt_burst_dummy; - dev->tx_pkt_prepare = NULL; + dev->tx_pkt_prepare = rte_eth_tx_pkt_prepare_dummy; hns3_eth_dev_fp_ops_config(dev); if (rte_eal_process_type() == RTE_PROC_SECONDARY) diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c index 3ef766de470..15e49fe2481 100644 --- a/drivers/net/intel/iavf/iavf_ethdev.c +++ b/drivers/net/intel/iavf/iavf_ethdev.c @@ -1177,8 +1177,7 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_CRC) dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_KEEP_CRC; - if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP && - vf->ptp_caps & VIRTCHNL_1588_PTP_CAP_RX_TSTAMP) + if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_CAP_PTP) dev_info->rx_offload_capa |= RTE_ETH_RX_OFFLOAD_TIMESTAMP; if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN_V2 && diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index 9de6f97cd9f..8d7060cd7c9 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -1836,7 +1836,8 @@ memif_set_rs(const char *key __rte_unused, const char *value, void *extra_args) static int memif_check_socket_filename(const char *filename) { - char *dir = NULL, *tmp; + char *dir = NULL; + const char *tmp; uint32_t idx; int ret = 0; diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 447fd31fd4f..decf540c519 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1080,9 +1080,15 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev) /* The unit is uint64_t. */ node.header_length_field_shift = 0x3; /* Header length is the 2nd byte. */ - node.header_length_field_offset = 0x8; - if (attr->header_length_mask_width < 8) - node.header_length_field_offset += 8 - attr->header_length_mask_width; + if (attr->header_length_field_mode_wa) { + /* Legacy firmware before ConnectX-8, we should provide offset WA. */ + node.header_length_field_offset = 8; + if (attr->header_length_mask_width < 8) + node.header_length_field_offset += 8 - attr->header_length_mask_width; + } else { + /* The new firmware, we can specify the correct offset directly. */ + node.header_length_field_offset = 12; + } node.header_length_field_mask = 0xF; /* One byte next header protocol. */ node.next_header_field_size = 0x8; @@ -1435,45 +1441,6 @@ mlx5_dev_args_check_handler(const char *key, const char *val, void *opaque) return 0; } -static bool -mlx5_hws_is_supported(struct mlx5_dev_ctx_shared *sh) -{ - return (sh->cdev->config.devx && - sh->cdev->config.hca_attr.wqe_based_flow_table_sup); -} - -static bool -mlx5_sws_is_any_supported(struct mlx5_dev_ctx_shared *sh) -{ - struct mlx5_common_device *cdev = sh->cdev; - struct mlx5_hca_attr *hca_attr = &cdev->config.hca_attr; - - if (hca_attr->rx_sw_owner_v2 || hca_attr->rx_sw_owner) - return true; - - if (hca_attr->tx_sw_owner_v2 || hca_attr->tx_sw_owner) - return true; - - if (hca_attr->eswitch_manager && (hca_attr->esw_sw_owner_v2 || hca_attr->esw_sw_owner)) - return true; - - return false; -} - -static bool -mlx5_kvargs_is_used(struct mlx5_kvargs_ctrl *mkvlist, const char *key) -{ - const struct rte_kvargs_pair *pair; - uint32_t i; - - for (i = 0; i < mkvlist->kvlist->count; ++i) { - pair = &mkvlist->kvlist->pairs[i]; - if (strcmp(pair->key, key) == 0 && mkvlist->is_used[i]) - return true; - } - return false; -} - /** * Parse user device parameters and adjust them according to device * capabilities. @@ -1514,8 +1481,6 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh, int ret = 0; size_t alignment = rte_mem_page_size(); uint32_t max_queue_umem_size = MLX5_WQE_SIZE * mlx5_dev_get_max_wq_size(sh); - bool hws_is_supported = mlx5_hws_is_supported(sh); - bool sws_is_supported = mlx5_sws_is_any_supported(sh); if (alignment == (size_t)-1) { alignment = (1 << MLX5_LOG_PAGE_SIZE); @@ -1526,15 +1491,9 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh, memset(config, 0, sizeof(*config)); config->vf_nl_en = 1; config->dv_esw_en = 1; - if (!sws_is_supported && hws_is_supported) - config->dv_flow_en = 2; - else - config->dv_flow_en = 1; + config->dv_flow_en = 1; config->decap_en = 1; - if (config->dv_flow_en == 2) - config->allow_duplicate_pattern = 0; - else - config->allow_duplicate_pattern = 1; + config->allow_duplicate_pattern = 1; config->fdb_def_rule = 1; config->cnt_svc.cycle_time = MLX5_CNT_SVC_CYCLE_TIME_DEFAULT; config->cnt_svc.service_core = rte_get_main_lcore(); @@ -1554,26 +1513,6 @@ mlx5_shared_dev_ctx_args_config(struct mlx5_dev_ctx_shared *sh, DRV_LOG(WARNING, "DV flow is not supported."); config->dv_flow_en = 0; } - /* Inform user if DV flow is not supported. */ - if (config->dv_flow_en == 1 && !sws_is_supported && hws_is_supported) { - DRV_LOG(WARNING, "DV flow is not supported. Changing to HWS mode."); - config->dv_flow_en = 2; - } - /* Handle allow_duplicate_pattern based on final dv_flow_en mode. - * HWS mode (dv_flow_en=2) doesn't support duplicate patterns. - * Warn only if user explicitly requested an incompatible setting. - */ - bool allow_dup_pattern_set = mkvlist != NULL && - mlx5_kvargs_is_used(mkvlist, MLX5_ALLOW_DUPLICATE_PATTERN); - if (config->dv_flow_en == 2) { - if (config->allow_duplicate_pattern == 1 && allow_dup_pattern_set) - DRV_LOG(WARNING, "Duplicate pattern is not supported with HWS. Disabling it."); - config->allow_duplicate_pattern = 0; - } else if (!allow_dup_pattern_set) { - /* Non-HWS mode: set default to 1 only if not explicitly set by user */ - config->allow_duplicate_pattern = 1; - } - if (config->dv_esw_en && !sh->dev_cap.dv_esw_en) { DRV_LOG(DEBUG, "E-Switch DV flow is not supported."); config->dv_esw_en = 0; diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c index b1174fe0eda..d21e28f7fd7 100644 --- a/drivers/net/mlx5/mlx5_flow_flex.c +++ b/drivers/net/mlx5/mlx5_flow_flex.c @@ -554,7 +554,7 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr, "mask and shift combination not supported (OFFSET)"); msb++; offset += field->field_size - msb; - if (msb < attr->header_length_mask_width) { + if (attr->header_length_field_mode_wa && msb < attr->header_length_mask_width) { if (attr->header_length_mask_width - msb > offset) return rte_flow_error_set (error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, @@ -572,6 +572,7 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr, node->header_length_field_mask = mask; node->header_length_field_shift = shift; node->header_length_field_offset = offset; + node->header_length_field_offset_mode = !attr->header_length_field_mode_wa; break; } case FIELD_MODE_BITMASK: diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.c b/drivers/net/nbl/nbl_dev/nbl_dev.c index 58eb1c6231d..e926c064568 100644 --- a/drivers/net/nbl/nbl_dev/nbl_dev.c +++ b/drivers/net/nbl/nbl_dev/nbl_dev.c @@ -758,6 +758,15 @@ int nbl_promiscuous_disable(struct rte_eth_dev *eth_dev) return 0; } +int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, __rte_unused int mask) +{ + /* + * No hardware or state change needed since + * receive does VLAN in software based on rxmode.offload + */ + return 0; +} + static int nbl_dev_setup_chan_queue(struct nbl_adapter *adapter) { struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter); diff --git a/drivers/net/nbl/nbl_dev/nbl_dev.h b/drivers/net/nbl/nbl_dev/nbl_dev.h index c8a5a4670b6..21d87a372dc 100644 --- a/drivers/net/nbl/nbl_dev/nbl_dev.h +++ b/drivers/net/nbl/nbl_dev/nbl_dev.h @@ -95,5 +95,6 @@ int nbl_xstats_reset(struct rte_eth_dev *eth_dev); int nbl_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu); int nbl_promiscuous_enable(struct rte_eth_dev *eth_dev); int nbl_promiscuous_disable(struct rte_eth_dev *eth_dev); +int nbl_vlan_offload_set(__rte_unused struct rte_eth_dev *dev, __rte_unused int mask); #endif diff --git a/drivers/net/nbl/nbl_ethdev.c b/drivers/net/nbl/nbl_ethdev.c index a3b963e9cc4..d269ea80582 100644 --- a/drivers/net/nbl/nbl_ethdev.c +++ b/drivers/net/nbl/nbl_ethdev.c @@ -45,6 +45,7 @@ const struct eth_dev_ops nbl_eth_dev_ops = { .mtu_set = nbl_mtu_set, .promiscuous_enable = nbl_promiscuous_enable, .promiscuous_disable = nbl_promiscuous_disable, + .vlan_offload_set = nbl_vlan_offload_set, }; static int nbl_eth_dev_init(struct rte_eth_dev *eth_dev) diff --git a/drivers/net/nbl/nbl_hw/nbl_resource.h b/drivers/net/nbl/nbl_hw/nbl_resource.h index aba0f8e0c17..1f6515f64dd 100644 --- a/drivers/net/nbl/nbl_hw/nbl_resource.h +++ b/drivers/net/nbl/nbl_hw/nbl_resource.h @@ -141,6 +141,7 @@ struct nbl_res_tx_ring { const struct rte_eth_dev *eth_dev; struct nbl_common_info *common; struct nbl_txq_stats txq_stats; + struct nbl_txq_stats txq_stats_reset; u64 default_hdr[2]; enum nbl_product_type product; @@ -182,6 +183,7 @@ struct nbl_res_rx_ring { const struct rte_eth_dev *eth_dev; struct nbl_common_info *common; struct nbl_rxq_stats rxq_stats; + struct nbl_rxq_stats rxq_stats_reset; uint64_t mbuf_initializer; /**< value to init mbufs */ struct rte_mbuf fake_mbuf; diff --git a/drivers/net/nbl/nbl_hw/nbl_txrx.c b/drivers/net/nbl/nbl_hw/nbl_txrx.c index d7ce725872c..650790b4fc1 100644 --- a/drivers/net/nbl/nbl_hw/nbl_txrx.c +++ b/drivers/net/nbl/nbl_hw/nbl_txrx.c @@ -727,9 +727,9 @@ static int nbl_res_txrx_get_stats(void *priv, struct rte_eth_stats *rte_stats, struct nbl_resource_mgt *res_mgt = (struct nbl_resource_mgt *)priv; struct rte_eth_dev *eth_dev = res_mgt->eth_dev; struct nbl_res_rx_ring *rxq; - struct nbl_rxq_stats *rxq_stats; + struct nbl_rxq_stats *rxq_stats, *rxq_stats_reset; struct nbl_res_tx_ring *txq; - struct nbl_txq_stats *txq_stats; + struct nbl_txq_stats *txq_stats, *txq_stats_reset; uint32_t i; uint16_t idx; @@ -739,16 +739,18 @@ static int nbl_res_txrx_get_stats(void *priv, struct rte_eth_stats *rte_stats, if (unlikely(rxq == NULL)) return -EINVAL; rxq_stats = &rxq->rxq_stats; + rxq_stats_reset = &rxq->rxq_stats_reset; idx = rxq->queue_id; if (qstats && idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { - qstats->q_ipackets[idx] += rxq_stats->rx_packets; - qstats->q_ibytes[idx] += rxq_stats->rx_bytes; + qstats->q_ipackets[idx] += rxq_stats->rx_packets - + rxq_stats_reset->rx_packets; + qstats->q_ibytes[idx] += rxq_stats->rx_bytes - rxq_stats_reset->rx_bytes; } - rte_stats->ipackets += rxq_stats->rx_packets; - rte_stats->ibytes += rxq_stats->rx_bytes; - rte_stats->rx_nombuf += rxq_stats->rx_nombuf; - rte_stats->ierrors += rxq_stats->rx_ierror; + rte_stats->ipackets += rxq_stats->rx_packets - rxq_stats_reset->rx_packets; + rte_stats->ibytes += rxq_stats->rx_bytes - rxq_stats_reset->rx_bytes; + rte_stats->rx_nombuf += rxq_stats->rx_nombuf - rxq_stats_reset->rx_nombuf; + rte_stats->ierrors += rxq_stats->rx_ierror - rxq_stats_reset->rx_ierror; } for (i = 0; i < eth_dev->data->nb_tx_queues; i++) { @@ -756,15 +758,17 @@ static int nbl_res_txrx_get_stats(void *priv, struct rte_eth_stats *rte_stats, if (unlikely(txq == NULL)) return -EINVAL; txq_stats = &txq->txq_stats; + txq_stats_reset = &txq->txq_stats_reset; idx = txq->queue_id; if (qstats && idx < RTE_ETHDEV_QUEUE_STAT_CNTRS) { - qstats->q_opackets[idx] += txq_stats->tx_packets; - qstats->q_obytes[idx] += txq_stats->tx_bytes; + qstats->q_opackets[idx] += txq_stats->tx_packets - + txq_stats_reset->tx_packets; + qstats->q_obytes[idx] += txq_stats->tx_bytes - txq_stats_reset->tx_bytes; } - rte_stats->opackets += txq_stats->tx_packets; - rte_stats->obytes += txq_stats->tx_bytes; - rte_stats->oerrors += txq_stats->tx_errors; + rte_stats->opackets += txq_stats->tx_packets - txq_stats_reset->tx_packets; + rte_stats->obytes += txq_stats->tx_bytes - txq_stats_reset->tx_bytes; + rte_stats->oerrors += txq_stats->tx_errors - txq_stats_reset->tx_errors; } return 0; @@ -776,9 +780,7 @@ nbl_res_txrx_reset_stats(void *priv) struct nbl_resource_mgt *res_mgt = (struct nbl_resource_mgt *)priv; struct rte_eth_dev *eth_dev = res_mgt->eth_dev; struct nbl_res_rx_ring *rxq; - struct nbl_rxq_stats *rxq_stats; struct nbl_res_tx_ring *txq; - struct nbl_txq_stats *txq_stats; uint32_t i; /* Add software counters. */ @@ -787,8 +789,7 @@ nbl_res_txrx_reset_stats(void *priv) if (unlikely(rxq == NULL)) continue; - rxq_stats = &rxq->rxq_stats; - memset(rxq_stats, 0, sizeof(struct nbl_rxq_stats)); + rxq->rxq_stats_reset = rxq->rxq_stats; } for (i = 0; i < eth_dev->data->nb_tx_queues; i++) { @@ -796,8 +797,7 @@ nbl_res_txrx_reset_stats(void *priv) if (unlikely(txq == NULL)) continue; - txq_stats = &txq->txq_stats; - memset(txq_stats, 0, sizeof(struct nbl_txq_stats)); + txq->txq_stats_reset = txq->txq_stats; } return 0; diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index 66d72c88dfb..91e215694c8 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -1921,7 +1921,7 @@ ngbe_set_tx_function(struct rte_eth_dev *dev, struct ngbe_tx_queue *txq) if (txq->offloads == 0 && txq->tx_free_thresh >= RTE_PMD_NGBE_TX_MAX_BURST) { PMD_INIT_LOG(DEBUG, "Using simple tx code path"); - dev->tx_pkt_prepare = NULL; + dev->tx_pkt_prepare = rte_eth_tx_pkt_prepare_dummy; if (txq->tx_free_thresh <= RTE_NGBE_TX_MAX_FREE_BUF_SZ && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128 && (rte_eal_process_type() != RTE_PROC_PRIMARY || diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 23c3452d2dd..89e751e7e07 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -2561,7 +2561,6 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) NT_LOG_DBGX(DBG, NTNIC, "Setting up RX functions for SCG"); eth_dev->rx_pkt_burst = eth_dev_rx_scg; eth_dev->tx_pkt_burst = eth_dev_tx_scg; - eth_dev->tx_pkt_prepare = NULL; struct rte_eth_link pmd_link; pmd_link.link_speed = RTE_ETH_SPEED_NUM_NONE; diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index 91a1c3a98e8..868e194509f 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -312,7 +312,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev, /* dev */ dev->rx_pkt_burst = pmd_rx_pkt_burst; dev->tx_pkt_burst = pmd_tx_pkt_burst; - dev->tx_pkt_prepare = NULL; dev->dev_ops = &pmd_ops; dev->device = &vdev->device; diff --git a/drivers/net/txgbe/base/txgbe_aml.c b/drivers/net/txgbe/base/txgbe_aml.c index 867cf4c2d35..b376eca5b54 100644 --- a/drivers/net/txgbe/base/txgbe_aml.c +++ b/drivers/net/txgbe/base/txgbe_aml.c @@ -17,6 +17,7 @@ void txgbe_init_ops_aml(struct txgbe_hw *hw) { struct txgbe_mac_info *mac = &hw->mac; struct txgbe_phy_info *phy = &hw->phy; + struct txgbe_mbx_info *mbx = &hw->mbx; txgbe_init_ops_generic(hw); @@ -27,6 +28,9 @@ void txgbe_init_ops_aml(struct txgbe_hw *hw) mac->init_mac_link_ops = txgbe_init_mac_link_ops_aml; mac->get_link_capabilities = txgbe_get_link_capabilities_aml; mac->check_link = txgbe_check_mac_link_aml; + + /* FW interaction */ + mbx->host_interface_command = txgbe_host_interface_command_aml; } s32 txgbe_check_mac_link_aml(struct txgbe_hw *hw, u32 *speed, diff --git a/drivers/net/txgbe/base/txgbe_aml40.c b/drivers/net/txgbe/base/txgbe_aml40.c index c7d64cade65..733bbac13a8 100644 --- a/drivers/net/txgbe/base/txgbe_aml40.c +++ b/drivers/net/txgbe/base/txgbe_aml40.c @@ -18,6 +18,7 @@ void txgbe_init_ops_aml40(struct txgbe_hw *hw) { struct txgbe_mac_info *mac = &hw->mac; struct txgbe_phy_info *phy = &hw->phy; + struct txgbe_mbx_info *mbx = &hw->mbx; txgbe_init_ops_generic(hw); @@ -28,6 +29,9 @@ void txgbe_init_ops_aml40(struct txgbe_hw *hw) mac->init_mac_link_ops = txgbe_init_mac_link_ops_aml40; mac->get_link_capabilities = txgbe_get_link_capabilities_aml40; mac->check_link = txgbe_check_mac_link_aml40; + + /* FW interaction */ + mbx->host_interface_command = txgbe_host_interface_command_aml; } s32 txgbe_check_mac_link_aml40(struct txgbe_hw *hw, u32 *speed, diff --git a/drivers/net/txgbe/base/txgbe_eeprom.c b/drivers/net/txgbe/base/txgbe_eeprom.c index eb53b35a196..b1d90f6f6b4 100644 --- a/drivers/net/txgbe/base/txgbe_eeprom.c +++ b/drivers/net/txgbe/base/txgbe_eeprom.c @@ -137,7 +137,7 @@ void txgbe_release_eeprom_semaphore(struct txgbe_hw *hw) s32 txgbe_ee_read16(struct txgbe_hw *hw, u32 offset, u16 *data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = (offset << 1); int err; @@ -164,7 +164,7 @@ s32 txgbe_ee_read16(struct txgbe_hw *hw, u32 offset, s32 txgbe_ee_readw_buffer(struct txgbe_hw *hw, u32 offset, u32 words, void *data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = (offset << 1); u32 len = (words << 1); u8 *buf = (u8 *)data; @@ -195,7 +195,7 @@ s32 txgbe_ee_readw_buffer(struct txgbe_hw *hw, s32 txgbe_ee_readw_sw(struct txgbe_hw *hw, u32 offset, u16 *data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = hw->rom.sw_addr + (offset << 1); int err; @@ -220,7 +220,7 @@ s32 txgbe_ee_readw_sw(struct txgbe_hw *hw, u32 offset, **/ s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; int err; err = hw->mac.acquire_swfw_sync(hw, mask); @@ -245,7 +245,7 @@ s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data) s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset, u16 data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = (offset << 1); int err; @@ -272,7 +272,7 @@ s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset, s32 txgbe_ee_writew_buffer(struct txgbe_hw *hw, u32 offset, u32 words, void *data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = (offset << 1); u32 len = (words << 1); u8 *buf = (u8 *)data; @@ -301,7 +301,7 @@ s32 txgbe_ee_writew_buffer(struct txgbe_hw *hw, s32 txgbe_ee_writew_sw(struct txgbe_hw *hw, u32 offset, u16 data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; u32 addr = hw->rom.sw_addr + (offset << 1); int err; @@ -326,7 +326,7 @@ s32 txgbe_ee_writew_sw(struct txgbe_hw *hw, u32 offset, **/ s32 txgbe_ee_write32(struct txgbe_hw *hw, u32 addr, u32 data) { - const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH; + const u32 mask = TXGBE_MNGSEM_SWFLASH; int err; err = hw->mac.acquire_swfw_sync(hw, mask); diff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c index 50178868969..0f3db3a1ade 100644 --- a/drivers/net/txgbe/base/txgbe_hw.c +++ b/drivers/net/txgbe/base/txgbe_hw.c @@ -2998,6 +2998,7 @@ void txgbe_init_ops_sp(struct txgbe_hw *hw) { struct txgbe_mac_info *mac = &hw->mac; struct txgbe_phy_info *phy = &hw->phy; + struct txgbe_mbx_info *mbx = &hw->mbx; txgbe_init_ops_generic(hw); @@ -3008,6 +3009,9 @@ void txgbe_init_ops_sp(struct txgbe_hw *hw) mac->init_mac_link_ops = txgbe_init_mac_link_ops_sp; mac->get_link_capabilities = txgbe_get_link_capabilities_sp; mac->check_link = txgbe_check_mac_link_sp; + + /* FW interaction */ + mbx->host_interface_command = txgbe_host_interface_command_sp; } /** diff --git a/drivers/net/txgbe/base/txgbe_mng.c b/drivers/net/txgbe/base/txgbe_mng.c index 05eb07c0e28..a1974820b60 100644 --- a/drivers/net/txgbe/base/txgbe_mng.c +++ b/drivers/net/txgbe/base/txgbe_mng.c @@ -79,7 +79,7 @@ txgbe_hic_unlocked(struct txgbe_hw *hw, u32 *buffer, u32 length, u32 timeout) } /** - * txgbe_host_interface_command - Issue command to manageability block + * txgbe_host_interface_command_sp - Issue command to manageability block * @hw: pointer to the HW structure * @buffer: contains the command to write and where the return status will * be placed @@ -96,9 +96,9 @@ txgbe_hic_unlocked(struct txgbe_hw *hw, u32 *buffer, u32 length, u32 timeout) * else returns semaphore error when encountering an error acquiring * semaphore or TXGBE_ERR_HOST_INTERFACE_COMMAND when command fails. **/ -static s32 -txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer, - u32 length, u32 timeout, bool return_data) +s32 +txgbe_host_interface_command_sp(struct txgbe_hw *hw, u32 *buffer, + u32 length, u32 timeout, bool return_data) { u32 hdr_size = sizeof(struct txgbe_hic_hdr); struct txgbe_hic_hdr *resp = (struct txgbe_hic_hdr *)buffer; @@ -160,7 +160,7 @@ txgbe_host_interface_command(struct txgbe_hw *hw, u32 *buffer, return err; } -static s32 +s32 txgbe_host_interface_command_aml(struct txgbe_hw *hw, u32 *buffer, u32 length, u32 timeout, bool return_data) { @@ -303,12 +303,8 @@ s32 txgbe_hic_sr_read(struct txgbe_hw *hw, u32 addr, u8 *buf, int len) command.address = cpu_to_be32(addr); command.length = cpu_to_be16(len); - if (hw->mac.type == txgbe_mac_aml || hw->mac.type == txgbe_mac_aml40) - err = txgbe_host_interface_command_aml(hw, (u32 *)&command, - sizeof(command), TXGBE_HI_COMMAND_TIMEOUT, false); - else - err = txgbe_hic_unlocked(hw, (u32 *)&command, - sizeof(command), TXGBE_HI_COMMAND_TIMEOUT); + err = hw->mbx.host_interface_command(hw, (u32 *)&command, + sizeof(command), TXGBE_HI_COMMAND_TIMEOUT, false); if (err) return err; @@ -381,7 +377,7 @@ s32 txgbe_close_notify(struct txgbe_hw *hw) buffer.length = 0; buffer.address = 0; - status = txgbe_host_interface_command(hw, (u32 *)&buffer, + status = hw->mbx.host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), TXGBE_HI_COMMAND_TIMEOUT, false); if (status) @@ -411,7 +407,7 @@ s32 txgbe_open_notify(struct txgbe_hw *hw) buffer.length = 0; buffer.address = 0; - status = txgbe_host_interface_command(hw, (u32 *)&buffer, + status = hw->mbx.host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), TXGBE_HI_COMMAND_TIMEOUT, false); if (status) @@ -466,7 +462,7 @@ s32 txgbe_hic_set_drv_ver(struct txgbe_hw *hw, u8 maj, u8 min, (FW_CEM_HDR_LEN + fw_cmd.hdr.buf_len)); for (i = 0; i <= FW_CEM_MAX_RETRIES; i++) { - ret_val = txgbe_host_interface_command(hw, (u32 *)&fw_cmd, + ret_val = hw->mbx.host_interface_command(hw, (u32 *)&fw_cmd, sizeof(fw_cmd), TXGBE_HI_COMMAND_TIMEOUT, true); @@ -511,7 +507,7 @@ txgbe_hic_reset(struct txgbe_hw *hw) (FW_CEM_HDR_LEN + reset_cmd.hdr.buf_len)); for (i = 0; i <= FW_CEM_MAX_RETRIES; i++) { - err = txgbe_host_interface_command(hw, (u32 *)&reset_cmd, + err = hw->mbx.host_interface_command(hw, (u32 *)&reset_cmd, sizeof(reset_cmd), TXGBE_HI_COMMAND_TIMEOUT, true); @@ -568,7 +564,7 @@ s32 txgbe_hic_get_lldp(struct txgbe_hw *hw) buffer.hdr.checksum = FW_DEFAULT_CHECKSUM; buffer.func = hw->bus.lan_id; - err = txgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), + err = hw->mbx.host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), TXGBE_HI_COMMAND_TIMEOUT, true); if (err) return err; @@ -599,7 +595,7 @@ s32 txgbe_hic_set_lldp(struct txgbe_hw *hw, bool on) buffer.hdr.checksum = FW_DEFAULT_CHECKSUM; buffer.func = hw->bus.lan_id; - return txgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), + return hw->mbx.host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), TXGBE_HI_COMMAND_TIMEOUT, false); } @@ -619,7 +615,7 @@ s32 txgbe_hic_ephy_set_link(struct txgbe_hw *hw, u8 speed, u8 autoneg, u8 duplex buffer.duplex = duplex; for (i = 0; i <= FW_CEM_MAX_RETRIES; i++) { - status = txgbe_host_interface_command(hw, (u32 *)&buffer, + status = hw->mbx.host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), TXGBE_HI_COMMAND_TIMEOUT_SHORT, true); if (status != 0) { diff --git a/drivers/net/txgbe/base/txgbe_mng.h b/drivers/net/txgbe/base/txgbe_mng.h index 53c5cd5487c..da5efecefde 100644 --- a/drivers/net/txgbe/base/txgbe_mng.h +++ b/drivers/net/txgbe/base/txgbe_mng.h @@ -208,6 +208,10 @@ struct txgbe_hic_write_lldp { u16 pad3; }; +s32 txgbe_host_interface_command_sp(struct txgbe_hw *hw, u32 *buffer, + u32 length, u32 timeout, bool return_data); +s32 txgbe_host_interface_command_aml(struct txgbe_hw *hw, u32 *buffer, + u32 length, u32 timeout, bool return_data); s32 txgbe_hic_sr_read(struct txgbe_hw *hw, u32 addr, u8 *buf, int len); s32 txgbe_hic_sr_write(struct txgbe_hw *hw, u32 addr, u8 *buf, int len); s32 txgbe_close_notify(struct txgbe_hw *hw); diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h index b5dbc9b755a..ede780321f4 100644 --- a/drivers/net/txgbe/base/txgbe_type.h +++ b/drivers/net/txgbe/base/txgbe_type.h @@ -786,6 +786,8 @@ struct txgbe_mbx_info { s32 (*check_for_msg)(struct txgbe_hw *hw, u16 mbx_id); s32 (*check_for_ack)(struct txgbe_hw *hw, u16 mbx_id); s32 (*check_for_rst)(struct txgbe_hw *hw, u16 mbx_id); + s32 (*host_interface_command)(struct txgbe_hw *hw, u32 *buffer, + u32 length, u32 timeout, bool return_data); struct txgbe_mbx_stats stats; u32 timeout; diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c index 78199ea00b2..e2cd9b8841e 100644 --- a/drivers/net/txgbe/txgbe_rxtx.c +++ b/drivers/net/txgbe/txgbe_rxtx.c @@ -2344,7 +2344,7 @@ txgbe_set_tx_function(struct rte_eth_dev *dev, struct txgbe_tx_queue *txq) #endif txq->tx_free_thresh >= RTE_PMD_TXGBE_TX_MAX_BURST) { PMD_INIT_LOG(DEBUG, "Using simple tx code path"); - dev->tx_pkt_prepare = NULL; + dev->tx_pkt_prepare = rte_eth_tx_pkt_prepare_dummy; if (txq->tx_free_thresh <= RTE_TXGBE_TX_MAX_FREE_BUF_SZ && rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128 && (rte_eal_process_type() != RTE_PROC_PRIMARY || diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 17ae76d4bad..25b904dbd44 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -884,6 +884,13 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue) nb_mbuf = RTE_MAX(nb_mbuf, (uint32_t)NB_MBUF); + /* Should never happen but check so that pool name won't be too long. */ + if (lcore > RTE_MAX_LCORE || queue > RTE_MAX_QUEUES_PER_PORT) { + RTE_LOG(ERR, IP_RSMBL, "invalid lcore %u or queue %u", + lcore, queue); + return -1; + } + snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue); rxq->pool = rte_pktmbuf_pool_create(buf, nb_mbuf, MEMPOOL_CACHE_SIZE, 0, diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f9ce9e66988..ec12d1cc0b7 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -1501,6 +1501,7 @@ print_usage(const char *prgname) " -U: set min/max frequency for uncore to maximum value\n" " -i (frequency index): set min/max frequency for uncore to specified frequency index\n" " --config (port,queue,lcore): rx queues configuration\n" + " --eth-link-speed: force link speed\n" " --cpu-resume-latency LATENCY: set CPU resume latency to control C-state selection," " 0 : just allow to enter C0-state\n" " --high-perf-cores CORELIST: list of high performance cores\n" @@ -1742,12 +1743,14 @@ parse_pmd_mgmt_config(const char *name) #define CMD_LINE_OPT_SCALE_FREQ_MIN "scale-freq-min" #define CMD_LINE_OPT_SCALE_FREQ_MAX "scale-freq-max" #define CMD_LINE_OPT_CPU_RESUME_LATENCY "cpu-resume-latency" +#define CMD_LINK_OPT_ETH_LINK_SPEED "eth-link-speed" /* Parse the argument given in the command line of the application */ static int parse_args(int argc, char **argv) { int opt, ret; + int speed_num; char **argvopt; int option_index; char *prgname = argv[0]; @@ -1767,6 +1770,7 @@ parse_args(int argc, char **argv) {CMD_LINE_OPT_PAUSE_DURATION, 1, 0, 0}, {CMD_LINE_OPT_SCALE_FREQ_MIN, 1, 0, 0}, {CMD_LINE_OPT_SCALE_FREQ_MAX, 1, 0, 0}, + {CMD_LINK_OPT_ETH_LINK_SPEED, 1, 0, 0}, {NULL, 0, 0, 0} }; @@ -1951,6 +1955,20 @@ parse_args(int argc, char **argv) printf("PM QoS configured\n"); } + if (!strncmp(lgopts[option_index].name, + CMD_LINK_OPT_ETH_LINK_SPEED, + sizeof(CMD_LINK_OPT_ETH_LINK_SPEED))) { + speed_num = atoi(optarg); + if ((speed_num == RTE_ETH_SPEED_NUM_10M) || + (speed_num == RTE_ETH_SPEED_NUM_100M)) { + fprintf(stderr, "Unsupported fixed speed\n"); + print_usage(prgname); + return -1; + } + if (speed_num >= 0 && rte_eth_speed_bitflag(speed_num, 0) > 0) + port_conf.link_speeds = rte_eth_speed_bitflag(speed_num, 0); + } + break; default: diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index 0cce3406ee7..471e3b488fe 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -32,10 +32,6 @@ #define VECTOR_SIZE_DEFAULT MAX_PKT_BURST #define VECTOR_TMO_NS_DEFAULT 1E6 /* 1ms */ -/* - * Try to avoid TX buffering if we have at least MAX_TX_BURST packets to send. - */ -#define MAX_TX_BURST (MAX_PKT_BURST / 2) #define NB_SOCKETS 8 @@ -116,7 +112,7 @@ extern struct acl_algorithms acl_alg[]; extern uint32_t max_pkt_len; -extern uint32_t nb_pkt_per_burst; +extern uint32_t rx_burst_size; extern uint32_t mb_mempool_cache_size; /* Send burst of packets on an output interface */ @@ -152,8 +148,8 @@ send_single_packet(struct lcore_conf *qconf, len++; /* enough pkts to be sent */ - if (unlikely(len == MAX_PKT_BURST)) { - send_burst(qconf, MAX_PKT_BURST, port); + if (unlikely(len == rx_burst_size)) { + send_burst(qconf, rx_burst_size, port); len = 0; } diff --git a/examples/l3fwd/l3fwd_acl.c b/examples/l3fwd/l3fwd_acl.c index 4fc4b986cce..a1275e18bce 100644 --- a/examples/l3fwd/l3fwd_acl.c +++ b/examples/l3fwd/l3fwd_acl.c @@ -1136,7 +1136,7 @@ acl_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, - pkts_burst, nb_pkt_per_burst); + pkts_burst, rx_burst_size); if (nb_rx > 0) { nb_drop = acl_process_pkts(pkts_burst, hops, diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index d94e5f13579..ccaf0cd4021 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -25,6 +25,9 @@ */ #define SENDM_PORT_OVERHEAD(x) (x) +extern uint32_t rx_burst_size; +extern uint32_t tx_burst_size; + /* * From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2: * - The IP version number must be 4. @@ -71,7 +74,7 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], * If TX buffer for that queue is empty, and we have enough packets, * then send them straightway. */ - if (num >= MAX_TX_BURST && len == 0) { + if (num >= tx_burst_size && len == 0) { n = rte_eth_tx_burst(port, qconf->tx_queue_id[port], m, num); if (unlikely(n < num)) { do { diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index da9c45e3a48..58c54ed77e0 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -644,7 +644,7 @@ em_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - nb_pkt_per_burst); + rx_burst_size); if (nb_rx == 0) continue; diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index 82f1739df77..4fc6bf90d53 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -239,7 +239,7 @@ fib_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - nb_pkt_per_burst); + rx_burst_size); if (nb_rx == 0) continue; diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index fec0aeb79c6..a71eee69ec3 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -205,7 +205,7 @@ lpm_main_loop(__rte_unused void *dummy) portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, - nb_pkt_per_burst); + rx_burst_size); if (nb_rx == 0) continue; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index ae3b4f6439b..a5626ff02d1 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -57,8 +57,9 @@ static_assert(MEMPOOL_CACHE_SIZE >= MAX_PKT_BURST, "MAX_PKT_BURST should be at most MEMPOOL_CACHE_SIZE"); uint16_t nb_rxd = RX_DESC_DEFAULT; uint16_t nb_txd = TX_DESC_DEFAULT; -uint32_t nb_pkt_per_burst = DEFAULT_PKT_BURST; +uint32_t rx_burst_size = DEFAULT_PKT_BURST; uint32_t mb_mempool_cache_size = MEMPOOL_CACHE_SIZE; +uint32_t tx_burst_size = DEFAULT_PKT_BURST; /**< Ports set in promiscuous mode off by default. */ static int promiscuous_on; @@ -400,7 +401,8 @@ print_usage(const char *prgname) " --config (port,queue,lcore)[,(port,queue,lcore)]" " [--rx-queue-size NPKTS]" " [--tx-queue-size NPKTS]" - " [--burst NPKTS]" + " [--rx-burst NPKTS]" + " [--tx-burst NPKTS]" " [--mbcache CACHESZ]" " [--eth-dest=X,MM:MM:MM:MM:MM:MM]" " [--max-pkt-len PKTLEN]" @@ -423,11 +425,14 @@ print_usage(const char *prgname) " Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base),\n" " acl (Access Control List)\n" " --config (port,queue,lcore): Rx queue configuration\n" + " --eth-link-speed: force link speed\n" " --rx-queue-size NPKTS: Rx queue size in decimal\n" " Default: %d\n" " --tx-queue-size NPKTS: Tx queue size in decimal\n" " Default: %d\n" - " --burst NPKTS: Burst size in decimal\n" + " --rx-burst NPKTS: RX Burst size in decimal\n" + " Default: %d\n" + " --tx-burst NPKTS: TX Burst size in decimal\n" " Default: %d\n" " --mbcache CACHESZ: Mbuf cache size in decimal\n" " Default: %d\n" @@ -460,8 +465,8 @@ print_usage(const char *prgname) " another is route entry at while line leads with character '%c'.\n" " --rule_ipv6=FILE: Specify the ipv6 rules entries file.\n" " --alg: ACL classify method to use, one of: %s.\n\n", - prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT, DEFAULT_PKT_BURST, MEMPOOL_CACHE_SIZE, - ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg); + prgname, RX_DESC_DEFAULT, TX_DESC_DEFAULT, DEFAULT_PKT_BURST, DEFAULT_PKT_BURST, + MEMPOOL_CACHE_SIZE, ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg); } static int @@ -695,7 +700,7 @@ parse_mbcache_size(const char *optarg) } static void -parse_pkt_burst(const char *optarg) +parse_pkt_burst(const char *optarg, bool is_rx_burst, uint32_t *burst_sz) { struct rte_eth_dev_info dev_info; unsigned long pkt_burst; @@ -710,31 +715,38 @@ parse_pkt_burst(const char *optarg) if (pkt_burst > MAX_PKT_BURST) { RTE_LOG(INFO, L3FWD, "User provided burst must be <= %d. Using default value %d\n", - MAX_PKT_BURST, nb_pkt_per_burst); + MAX_PKT_BURST, *burst_sz); return; } else if (pkt_burst > 0) { - nb_pkt_per_burst = (uint32_t)pkt_burst; + *burst_sz = (uint32_t)pkt_burst; return; } - /* If user gives a value of zero, query the PMD for its recommended Rx burst size. */ - ret = rte_eth_dev_info_get(0, &dev_info); - if (ret != 0) - return; - burst_size = dev_info.default_rxportconf.burst_size; - if (burst_size == 0) { - RTE_LOG(INFO, L3FWD, "PMD does not recommend a burst size. Using default value %d. " - "User provided value must be in [1, %d]\n", - nb_pkt_per_burst, MAX_PKT_BURST); - return; - } else if (burst_size > MAX_PKT_BURST) { - RTE_LOG(INFO, L3FWD, "PMD recommended burst size %d exceeds maximum value %d. " - "Using default value %d\n", - burst_size, MAX_PKT_BURST, nb_pkt_per_burst); - return; + if (is_rx_burst) { + /* If user gives a value of zero, query the PMD for its recommended + * Rx burst size. + */ + ret = rte_eth_dev_info_get(0, &dev_info); + if (ret != 0) + return; + burst_size = dev_info.default_rxportconf.burst_size; + if (burst_size == 0) { + RTE_LOG(INFO, L3FWD, "PMD does not recommend a burst size. Using default value %d. " + "User provided value must be in [1, %d]\n", + rx_burst_size, MAX_PKT_BURST); + return; + } else if (burst_size > MAX_PKT_BURST) { + RTE_LOG(INFO, L3FWD, "PMD recommended burst size %d exceeds maximum value %d. " + "Using default value %d\n", + burst_size, MAX_PKT_BURST, rx_burst_size); + return; + } + *burst_sz = burst_size; + RTE_LOG(INFO, L3FWD, "Using PMD-provided RX burst value %d\n", burst_size); + } else { + RTE_LOG(INFO, L3FWD, "User provided TX burst is 0. Using default value %d\n", + *burst_sz); } - nb_pkt_per_burst = burst_size; - RTE_LOG(INFO, L3FWD, "Using PMD-provided burst value %d\n", burst_size); } #define MAX_JUMBO_PKT_LEN 9600 @@ -747,6 +759,7 @@ static const char short_options[] = ; #define CMD_LINE_OPT_CONFIG "config" +#define CMD_LINK_OPT_ETH_LINK_SPEED "eth-link-speed" #define CMD_LINE_OPT_RX_QUEUE_SIZE "rx-queue-size" #define CMD_LINE_OPT_TX_QUEUE_SIZE "tx-queue-size" #define CMD_LINE_OPT_ETH_DEST "eth-dest" @@ -768,7 +781,8 @@ static const char short_options[] = #define CMD_LINE_OPT_RULE_IPV4 "rule_ipv4" #define CMD_LINE_OPT_RULE_IPV6 "rule_ipv6" #define CMD_LINE_OPT_ALG "alg" -#define CMD_LINE_OPT_PKT_BURST "burst" +#define CMD_LINE_OPT_PKT_RX_BURST "rx-burst" +#define CMD_LINE_OPT_PKT_TX_BURST "tx-burst" #define CMD_LINE_OPT_MB_CACHE_SIZE "mbcache" enum { @@ -778,6 +792,7 @@ enum { * conflict with short options */ CMD_LINE_OPT_MIN_NUM = 256, CMD_LINE_OPT_CONFIG_NUM, + CMD_LINK_OPT_ETH_LINK_SPEED_NUM, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM, CMD_LINE_OPT_ETH_DEST_NUM, @@ -799,12 +814,14 @@ enum { CMD_LINE_OPT_ENABLE_VECTOR_NUM, CMD_LINE_OPT_VECTOR_SIZE_NUM, CMD_LINE_OPT_VECTOR_TMO_NS_NUM, - CMD_LINE_OPT_PKT_BURST_NUM, + CMD_LINE_OPT_PKT_RX_BURST_NUM, + CMD_LINE_OPT_PKT_TX_BURST_NUM, CMD_LINE_OPT_MB_CACHE_SIZE_NUM, }; static const struct option lgopts[] = { {CMD_LINE_OPT_CONFIG, 1, 0, CMD_LINE_OPT_CONFIG_NUM}, + {CMD_LINK_OPT_ETH_LINK_SPEED, 1, 0, CMD_LINK_OPT_ETH_LINK_SPEED_NUM}, {CMD_LINE_OPT_RX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM}, {CMD_LINE_OPT_TX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM}, {CMD_LINE_OPT_ETH_DEST, 1, 0, CMD_LINE_OPT_ETH_DEST_NUM}, @@ -827,7 +844,8 @@ static const struct option lgopts[] = { {CMD_LINE_OPT_RULE_IPV4, 1, 0, CMD_LINE_OPT_RULE_IPV4_NUM}, {CMD_LINE_OPT_RULE_IPV6, 1, 0, CMD_LINE_OPT_RULE_IPV6_NUM}, {CMD_LINE_OPT_ALG, 1, 0, CMD_LINE_OPT_ALG_NUM}, - {CMD_LINE_OPT_PKT_BURST, 1, 0, CMD_LINE_OPT_PKT_BURST_NUM}, + {CMD_LINE_OPT_PKT_RX_BURST, 1, 0, CMD_LINE_OPT_PKT_RX_BURST_NUM}, + {CMD_LINE_OPT_PKT_TX_BURST, 1, 0, CMD_LINE_OPT_PKT_TX_BURST_NUM}, {CMD_LINE_OPT_MB_CACHE_SIZE, 1, 0, CMD_LINE_OPT_MB_CACHE_SIZE_NUM}, {NULL, 0, 0, 0} }; @@ -860,6 +878,7 @@ parse_args(int argc, char **argv) uint8_t eth_rx_q = 0; struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc(); #endif + int speed_num; argvopt = argv; @@ -908,7 +927,17 @@ parse_args(int argc, char **argv) } lcore_params = 1; break; - + case CMD_LINK_OPT_ETH_LINK_SPEED_NUM: + speed_num = atoi(optarg); + if ((speed_num == RTE_ETH_SPEED_NUM_10M) || + (speed_num == RTE_ETH_SPEED_NUM_100M)) { + fprintf(stderr, "Unsupported fixed speed\n"); + print_usage(prgname); + return -1; + } + if (speed_num >= 0 && rte_eth_speed_bitflag(speed_num, 0) > 0) + port_conf.link_speeds = rte_eth_speed_bitflag(speed_num, 0); + break; case CMD_LINE_OPT_RX_QUEUE_SIZE_NUM: parse_queue_size(optarg, &nb_rxd, 1); break; @@ -917,8 +946,12 @@ parse_args(int argc, char **argv) parse_queue_size(optarg, &nb_txd, 0); break; - case CMD_LINE_OPT_PKT_BURST_NUM: - parse_pkt_burst(optarg); + case CMD_LINE_OPT_PKT_RX_BURST_NUM: + parse_pkt_burst(optarg, true, &rx_burst_size); + break; + + case CMD_LINE_OPT_PKT_TX_BURST_NUM: + parse_pkt_burst(optarg, false, &tx_burst_size); break; case CMD_LINE_OPT_MB_CACHE_SIZE_NUM: @@ -1654,6 +1687,8 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid L3FWD parameters\n"); + RTE_LOG(INFO, L3FWD, "Using Rx burst %u Tx burst %u\n", rx_burst_size, tx_burst_size); + /* Setup function pointers for lookup method. */ setup_l3fwd_lookup_tables(); diff --git a/examples/meson.build b/examples/meson.build index 8e8968a1fa2..25d9c88457f 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -78,10 +78,9 @@ else examples = get_option('examples').split(',') allow_skips = false # error out if we can't build a requested app endif + default_cflags = machine_args -if cc.has_argument('-Wno-format-truncation') - default_cflags += '-Wno-format-truncation' -endif + default_ldflags = dpdk_extra_ldflags if get_option('default_library') == 'static' and not is_windows default_ldflags += ['-Wl,--export-dynamic'] diff --git a/examples/server_node_efd/efd_server/main.c b/examples/server_node_efd/efd_server/main.c index 75ff0ea5323..62c3f4a16d0 100644 --- a/examples/server_node_efd/efd_server/main.c +++ b/examples/server_node_efd/efd_server/main.c @@ -68,7 +68,7 @@ static const char * get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; - static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; + static char addresses[RTE_MAX_ETHPORTS][RTE_ETHER_ADDR_FMT_SIZE + 1]; struct rte_ether_addr mac; int ret; diff --git a/examples/server_node_efd/shared/common.h b/examples/server_node_efd/shared/common.h index e1ab7e62b71..6726e2031e7 100644 --- a/examples/server_node_efd/shared/common.h +++ b/examples/server_node_efd/shared/common.h @@ -58,8 +58,9 @@ get_rx_queue_name(unsigned int id) /* * Buffer for return value. Size calculated by %u being replaced * by maximum 3 digits (plus an extra byte for safety) + * Used as ring name, so upper limit is ring name size. */ - static char buffer[sizeof(MP_NODE_RXQ_NAME) + 2]; + static char buffer[RTE_RING_NAMESIZE]; snprintf(buffer, sizeof(buffer), MP_NODE_RXQ_NAME, id); return buffer; diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 289db26498b..08aa933272f 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -22,6 +22,7 @@ #define MAX_PATH_LEN 128 #define MAX_VDPA_SAMPLE_PORTS 1024 +#define MAX_VDPA_STR_LEN sizeof(RTE_STR(MAX_VDPA_SAMPLE_PORTS)) #define RTE_LOGTYPE_VDPA RTE_LOGTYPE_USER1 struct vdpa_port { @@ -36,7 +37,7 @@ struct vdpa_port { static struct vdpa_port vports[MAX_VDPA_SAMPLE_PORTS]; -static char iface[MAX_PATH_LEN]; +static char iface[MAX_PATH_LEN - MAX_VDPA_STR_LEN]; static int devcnt; static int interactive; static int client_mode; @@ -74,9 +75,8 @@ parse_args(int argc, char **argv) break; /* long options */ case 0: - if (strncmp(long_option[idx].name, "iface", - MAX_PATH_LEN) == 0) { - rte_strscpy(iface, optarg, MAX_PATH_LEN); + if (!strcmp(long_option[idx].name, "iface")) { + rte_strscpy(iface, optarg, sizeof(iface)); printf("iface %s\n", iface); } if (!strcmp(long_option[idx].name, "interactive")) {