dpdk.git
2 years agodoc: update release note for bnxt PMD
Ajit Khaparde [Fri, 5 Nov 2021 18:46:34 +0000 (11:46 -0700)]
doc: update release note for bnxt PMD

Updated support for RTE_FLOW_ACTION_TYPE_RSS.

Fixes: 239695f754cb ("net/bnxt: enhance RSS action support")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: remove software prefetches from AVX2 Rx
Lance Richardson [Mon, 15 Nov 2021 18:24:10 +0000 (13:24 -0500)]
net/bnxt: remove software prefetches from AVX2 Rx

Testing has shown no performance benefit from software prefetching
of receive completion descriptors in the AVX2 burst receive path,
and slightly better performance without them on some CPU families,
so this patch removes them.

Fixes: c4e4c18963b0 ("net/bnxt: add AVX2 RX/Tx")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: avoid unnecessary work in AVX2 Rx
Lance Richardson [Mon, 15 Nov 2021 18:24:09 +0000 (13:24 -0500)]
net/bnxt: avoid unnecessary work in AVX2 Rx

Each call to the AVX2 vector burst receive function makes at
least one pass through the function's inner loop, loading
256 bytes of completion descriptors and copying 8 rte_mbuf
pointers regardless of whether there are any packets to be
received.

Unidirectional forwarding performance is improved by about
3-4% if we ensure that at least one packet can be received
before entering the inner loop.

Fixes: c4e4c18963b0 ("net/bnxt: add AVX2 RX/Tx")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agoapp/testpmd: fix flow transfer proxy port handling
Ivan Malov [Tue, 16 Nov 2021 15:38:17 +0000 (18:38 +0300)]
app/testpmd: fix flow transfer proxy port handling

The current approach detects the proxy port on each port (re-)plug and
may spam the log with error messages if the PMD does not support flows.
As testpmd is a debug tool, it must not do such implicit port handling.
Instead, the new API should be called only when the user requests that.

Revoke the existing code. Implement an explicit command-line primitive
to let the user find the proxy port themselves. Provide relevant hints.

Fixes: 1179f05cc9a0 ("ethdev: query proxy port to manage transfer flows")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix MPRQ mempool registration
Dmitry Kozlyuk [Tue, 16 Nov 2021 11:55:44 +0000 (13:55 +0200)]
common/mlx5: fix MPRQ mempool registration

Mempool registration code had a wrong assumption that it is always
dealing with packet mempools and always called rte_pktmbuf_priv_flags(),
which returned a random value for different types of mempools.
In particular, it could consider MPRQ mempools as having externally
pinned buffers, which is wrong.
Packet mempools cannot be reliably recognized, but it is sufficient to
check that the mempool is not a packet one, so it cannot have externally
pinned buffers.
Compare mempool private data size to that of packet mempools to check.

Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")
Fixes: fec28ca0e3a9 ("net/mlx5: support mempool registration")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix mutex unlock in Tx packet pacing cleanup
Chengfeng Ye [Tue, 16 Nov 2021 14:49:23 +0000 (06:49 -0800)]
net/mlx5: fix mutex unlock in Tx packet pacing cleanup

The lock sh->txpp.mutex was not correctly released on one path
of cleanup function return, potentially causing the deadlock.

Fixes: d133f4cdb706 ("net/mlx5: create clock queue for packet pacing")
Cc: stable@dpdk.org
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/hns3: optimize Tx performance
Chengwen Feng [Tue, 16 Nov 2021 01:22:12 +0000 (09:22 +0800)]
net/hns3: optimize Tx performance

This patch uses tx_free_thresh to control mbufs free when the common
xmit algorithm is used.

This patch also modifies the implementation of PMD's tx_done_cleanup
because the mbuf free algorithm changed.

In the testpmd single core MAC forwarding scenario, the performance is
improved by 10% at 64B on Kunpeng920 platform.

Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: optimize Tx performance by mbuf fast free
Chengwen Feng [Tue, 16 Nov 2021 01:22:11 +0000 (09:22 +0800)]
net/hns3: optimize Tx performance by mbuf fast free

Currently the vector and simple xmit algorithm don't support multi_segs,
so if Tx offload support MBUF_FAST_FREE, driver could invoke
rte_mempool_put_bulk() to free Tx mbufs in this situation.

In the testpmd single core MAC forwarding scenario, the performance is
improved by 8% at 64B on Kunpeng920 platform.

Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoapp/testpmd: fix GTP PSC extension header length
Raslan Darawsheh [Thu, 4 Nov 2021 09:40:25 +0000 (11:40 +0200)]
app/testpmd: fix GTP PSC extension header length

Current implementation for raw encap sets the length to be in bytes,
but, GTP 'extension' header length is an 8-bit field in 4-octet units.

This fixes the length calculation of the header length.

Fixes: 9213c50e36fa ("app/testpmd: support GTP PSC option in raw sets")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix keeping indirect RSS non-isolated mode
Dmitry Kozlyuk [Tue, 16 Nov 2021 07:38:34 +0000 (09:38 +0200)]
net/mlx5: fix keeping indirect RSS non-isolated mode

When a port starts in non-isolated mode,
an internal indirect RSS is created that includes all configured queues
and a flow rule is created that references this indirect RSS.
If before switching to non-isolated mode an indirect RSS was created
that includes the same set of queues, it would be reused at this point.
However, because the port had been stopped (or not yet started),
the TIR for this indirect RSS had been destroyed (or not yet created).
The flow rule could not be created and the port start failed.

Creation of TIRs is moved before configuring non-isolated mode flows,
but it is not enough because of the following issue.

Commit 0cedf34da78f ("net/mlx5: move Rx queue reference count")
changed mlx5_rxq_get() not to increment RxQ control structure
reference count, mlx5_rxq_ref() was introduced for this purpose.
mlx5_ind_table_obj_attach() was not updated to use the new function,
so when the port was stopped, the control structure reference count
of an RxQ used in RSS reached zero and the structure was destroyed.

Use mlx5_rxq_ref() to keep RxQ control structure
needed for indirect RSS persistence across port restart.

Fixes: ec4e11d41d12 ("net/mlx5: preserve indirect actions on restart")
Fixes: 0cedf34da78f ("net/mlx5: move Rx queue reference count")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix RSS validation with meter policy
Bing Zhao [Mon, 15 Nov 2021 14:51:21 +0000 (16:51 +0200)]
net/mlx5: fix RSS validation with meter policy

The RSS can be one of the fate actions when creating a meter with
policy. In the previous implementation, the RSS validation was missed
when creating a flow rule with such meter due to the fact that a
policy meter was created firstly and then used in the rule. In the
stage of meter creation, no rte_flow_item* information was provided.

A unnecessary RSS expansion might be called since the validation was
missed and would cause an unexpected error of the rule creation. Even
though the rule should be rejected from the very beginning, it would
cause confusion. There might be some other errors when the validation
was missed.

Adding the RSS validation inside the meter action validation will
prevent the code from continuing when there is a conflict between the
items, other actions and the policy meter RSS action.

Fixes: 444320186393 ("net/mlx5: support meter creation with policy")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Reviewed-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix GRE protocol type translation
Gregory Etelson [Sun, 14 Nov 2021 15:36:16 +0000 (17:36 +0200)]
net/mlx5: fix GRE protocol type translation

When application creates several flows to match on GRE tunnel
without explicitly specifying GRE protocol type value in
flow rules, PMD will translate that to zero mask.
RDMA-CORE cannot distinguish between different inner flow types and
produces identical matchers for each zero mask.

The patch extracts inner header type from flow rule and forces it
in GRE protocol type, if application did not specify
any without explicitly specifying GRE protocol type value in
flow rules, protocol type value.

Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix GENEVE protocol type translation
Gregory Etelson [Sun, 14 Nov 2021 15:36:15 +0000 (17:36 +0200)]
net/mlx5: fix GENEVE protocol type translation

When application creates several flows to match on GENEVE tunnel
without explicitly specifying GENEVE protocol type value in
flow rules, PMD will translate that to zero mask.
RDMA-CORE cannot distinguish between different inner flow types and
produces identical matchers for each zero mask.

The patch extracts inner header type from flow rule and forces it
in GENEVE protocol type, if application did not specify
any without explicitly specifying GENEVE protocol type value in
flow rules, protocol type value.

Fixes: e59a5dbcfd07 ("net/mlx5: add flow match on GENEVE item")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix RSS expansion scheme for GRE header
Gregory Etelson [Sun, 14 Nov 2021 15:36:14 +0000 (17:36 +0200)]
net/mlx5: fix RSS expansion scheme for GRE header

RFC-2784 allows any valid Ethernet type in GRE protocol type field.

Add Ethernet to GRE RSS expansion.

Fixes: f4b901a46aec ("net/mlx5: add flow GRE item")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add Ethernet header to GENEVE RSS expansion
Gregory Etelson [Sun, 14 Nov 2021 15:36:13 +0000 (17:36 +0200)]
net/mlx5: add Ethernet header to GENEVE RSS expansion

RFC-8926 allows inner Ethernet header after GENEVE tunnel.

Current GENEVE RSS expansion created IPv4 and IPv6 paths only.

The patch adds Ethernet to RSS expansion scheme.

Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix VXLAN-GPE next protocol translation
Gregory Etelson [Sun, 14 Nov 2021 15:36:12 +0000 (17:36 +0200)]
net/mlx5: fix VXLAN-GPE next protocol translation

VXLAN-GPE extends VXLAN protocol and provides the next protocol
field specifying the first inner header type.

The application can assign some explicit value to
VXLAN-GPE::next_protocol field or set it to the default one. In the
latter case, the rdma-core library cannot recognize the matcher
built by PMD correctly, and it results in hardware configuration
missing inner headers match.

The patch forces VXLAN-GPE::next_protocol assignment if the
application did not explicitly assign it to the non-default value

Fixes: 90456726eb80 ("net/mlx5: fix VXLAN-GPE item translation")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/iavf: fix VLAN insertion
Radu Nicolau [Mon, 15 Nov 2021 11:42:01 +0000 (11:42 +0000)]
net/iavf: fix VLAN insertion

Fix wrong VLAN insertion position as inner.

Fixes: 1e728b01120c ("net/iavf: rework Tx path")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix secondary process Rx offload path
Alvin Zhang [Tue, 16 Nov 2021 02:32:09 +0000 (10:32 +0800)]
net/ice: fix secondary process Rx offload path

Secondary process depends on the vector offload flag to select right
Rx offload path. This patch adds a variable in share memory to store
the vector offload flag that can be directly read by secondary process.

Fixes: 808a17b3c1e6 ("net/ice: add Rx AVX512 offload path")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Qin Sun <qinx.sun@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agodoc: update release notes for DCF reset in ice PMD
Dapeng Yu [Wed, 10 Nov 2021 08:59:25 +0000 (16:59 +0800)]
doc: update release notes for DCF reset in ice PMD

The ice DCF device reset has been supported. Release notes is updated
to synchronize with the feature.

Fixes: 1a86f4dbdf42 ("net/ice: support DCF device reset")

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: fix GTPU UL/DL flag
Junfeng Guo [Fri, 12 Nov 2021 08:50:29 +0000 (16:50 +0800)]
net/ice/base: fix GTPU UL/DL flag

Just fix the wrong defines of GTPU flags between UL and DL. These two
are defined are misplaced to each other.

Fixes: 8ebb93942b2c ("net/ice/base: add function to set HW profile for raw flow")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agovhost: fix packed ring descriptor update in async enqueue
Jiayu Hu [Tue, 16 Nov 2021 15:17:56 +0000 (10:17 -0500)]
vhost: fix packed ring descriptor update in async enqueue

If the packet uses multiple descriptors and its descriptor indices are
wrapped, the first descriptor flag is not updated last, which may cause
virtio read the incomplete packet. For example, given a packet uses 64
descriptors, and virtio ring size is 256, and its descriptor indices are
224~255 and 0~31, current implementation will update 224~255 descriptor
flags earlier than 0~31 descriptor flags.

This patch fixes this issue by updating descriptor flags in one loop,
so that the first descriptor flag is always updated last.

Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: fix mkey creation check
Bing Zhao [Fri, 12 Nov 2021 14:42:45 +0000 (16:42 +0200)]
vdpa/mlx5: fix mkey creation check

The return value of "mlx5_os_wrapped_mkey_create" is checked in the
caller. A zero means success without any error.

The typo in the if-condition should be fixed in case there is a
misjudgment.

Fixes: 398ea8450c53 ("vdpa/mlx5: workaround dirty bitmap MR creation")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agoexamples/vhost: fix port init in mergeable mode
Chenbo Xia [Thu, 4 Nov 2021 05:11:02 +0000 (13:11 +0800)]
examples/vhost: fix port init in mergeable mode

When the example starts in mergeable mode with an i40e port,
it fails to launch because the examples use default mtu MAX_MTU
to configure ethdev. The root cause is some devices have Ethernet
frame overhead and then MAX_MTU will be larger than device's max
mtu, so the ethdev configure will fail.

This patch checks the device's max MTU before setting the ethdev
configuration. If the device has a max MTU, use that value to
configure.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")

Reported-by: Xingguang He <xingguang.he@intel.com>
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agobuild: make pdump optional
David Marchand [Wed, 17 Nov 2021 11:28:46 +0000 (12:28 +0100)]
build: make pdump optional

This library can be made optional.
dumpcap and pdump applications depend on this library, check for
dependencies like what we have for examples.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agobuild: make metrics libraries optional
David Marchand [Wed, 17 Nov 2021 11:28:45 +0000 (12:28 +0100)]
build: make metrics libraries optional

metrics, bitratestats, jobstats and latencystats libraries can be made
optional as they provide standalone features.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agobuild: make GRO/GSO libraries optional
David Marchand [Wed, 17 Nov 2021 11:28:44 +0000 (12:28 +0100)]
build: make GRO/GSO libraries optional

GRO and GSO integration in testpmd is relatively self contained and easy
to extract.
Those libraries can be made optional as they provide standalone
features.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agoci: test minimum configuration
David Marchand [Wed, 17 Nov 2021 11:28:43 +0000 (12:28 +0100)]
ci: test minimum configuration

Disabling drivers and optional libraries was not tested.
Add a new target in test-meson-builds.sh and GHA with just the minimum
to run test-null.sh and any other optional component disabled.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agodoc: fix Doxygen examples build on FreeBSD
Bruce Richardson [Wed, 15 Sep 2021 17:36:33 +0000 (18:36 +0100)]
doc: fix Doxygen examples build on FreeBSD

On FreeBSD, "find" does not support the "printf" flag, so we need to
use "gfind" from the "findutils" package.

Fixes: 8260f4f98cfe ("mk: use script to generate examples.dox")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoapp: remove unneeded atomic header include
Joyce Kong [Wed, 17 Nov 2021 08:22:00 +0000 (08:22 +0000)]
app: remove unneeded atomic header include

Remove the unnecessary rte_atomic.h included in app modules.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoapp/testpmd: remove atomic operations for port status
Joyce Kong [Wed, 17 Nov 2021 08:21:58 +0000 (08:21 +0000)]
app/testpmd: remove atomic operations for port status

The port_status changes do not need to be handled
atomically, as they are modified during initialization
or through the testpmd prompt instead of multiple
threads.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agoapp/eventdev: use compiler atomics for shared data sync
Joyce Kong [Wed, 17 Nov 2021 08:21:55 +0000 (08:21 +0000)]
app/eventdev: use compiler atomics for shared data sync

Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in eventdev cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoapp/crypto: use compiler atomic builtins for display sync
Joyce Kong [Wed, 17 Nov 2021 08:21:56 +0000 (08:21 +0000)]
app/crypto: use compiler atomic builtins for display sync

Convert rte_atomic_test_and_set usage to compiler atomic
CAS operation for display sync in crypto cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agoapp/compress: use compiler atomic builtins for display sync
Joyce Kong [Wed, 17 Nov 2021 08:21:57 +0000 (08:21 +0000)]
app/compress: use compiler atomic builtins for display sync

Convert rte_atomic_test_and_set usage to compiler atomic
CAS operation for display sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agoapp/bbdev: use compiler atomics for shared data sync
Joyce Kong [Wed, 17 Nov 2021 08:21:59 +0000 (08:21 +0000)]
app/bbdev: use compiler atomics for shared data sync

Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in bbdev cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agotest/timer: use compiler atomic builtins for sync
Joyce Kong [Wed, 17 Nov 2021 08:21:51 +0000 (08:21 +0000)]
test/timer: use compiler atomic builtins for sync

Convert rte_atomic usages to compiler atomic
built-ins for lcore_state and collisions sync.

Also, move 'main_init_workers' outside of
'timer_stress2_main_loop' to guarantee lcore_state
initialized correctly before the threads launched.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agotest/stack_perf: use compiler atomics for lcore sync
Joyce Kong [Wed, 17 Nov 2021 08:21:52 +0000 (08:21 +0000)]
test/stack_perf: use compiler atomics for lcore sync

Convert rte_atomic usages to compiler atomic built-ins
for lcore sync in stack_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agotest/ring_perf: use compiler atomic builtins for lcores sync
Joyce Kong [Wed, 17 Nov 2021 08:21:50 +0000 (08:21 +0000)]
test/ring_perf: use compiler atomic builtins for lcores sync

Convert rte_atomic usages to compiler atomic built-ins
for lcores sync in ring_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agotest/pmd_perf: use compiler atomic builtins for polling sync
Joyce Kong [Wed, 17 Nov 2021 08:21:49 +0000 (08:21 +0000)]
test/pmd_perf: use compiler atomic builtins for polling sync

Convert rte_atomic usages to compiler atomic built-ins
for polling sync in pmd_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agotest/func_reentrancy: use compiler atomics for data sync
Joyce Kong [Wed, 17 Nov 2021 08:21:54 +0000 (08:21 +0000)]
test/func_reentrancy: use compiler atomics for data sync

Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in func_reentrancy test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agotest/bpf: use compiler atomics for calculation
Joyce Kong [Wed, 17 Nov 2021 08:21:53 +0000 (08:21 +0000)]
test/bpf: use compiler atomics for calculation

Convert rte_atomic usages to compiler atomic built-ins
for calculation in bpf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/l3fwd-power: add wakeup log
Miao Li [Wed, 17 Nov 2021 10:35:31 +0000 (10:35 +0000)]
examples/l3fwd-power: add wakeup log

This patch adds a log in main telemetry loop to show the thread has
woken up and begun to send and receive packets.

Signed-off-by: Miao Li <miao.li@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2 years agoapp/flow-perf: fix parsing of invalid option
Raslan Darawsheh [Tue, 16 Nov 2021 14:12:26 +0000 (16:12 +0200)]
app/flow-perf: fix parsing of invalid option

Currently, if an invalid parameter is passed to the application
it will cause a crash due to missing default in options.

For example:
        ./dpdk-test-flow-perf -a 01:00.0 -- --invalid

This adds missing default for options, and prints the
invalid option.

Fixes: 3344cf2e3001 ("app/flow-perf: add flow performance skeleton")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agocommon/mlx5: fix redundant field in MR control structure
Michael Baum [Tue, 16 Nov 2021 14:36:35 +0000 (16:36 +0200)]
common/mlx5: fix redundant field in MR control structure

Inside the MR control structure there is a pointer to the common device.
This pointer enables access to the global cache as well as hardware
objects that may be required in case a new MR needs to be created.

The purpose of adding this pointer into the MR control structure was to
avoid its transfer as a parameter to all the functions of searching MR
in the caches.
However, adding it to this structure increased the Rx and Tx data-path
structures, all the fields that followed it were slightly moved away
which caused to a reduction in performance.

This patch removes the pointer from the structure. It can be accessed
through the "dev_gen_ptr" existing field using the "container_of"
operator.

Fixes: 334ed198ab4d ("common/mlx5: remove redundant parameter in MR search")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoip_frag: add namespace
Konstantin Ananyev [Tue, 9 Nov 2021 12:32:04 +0000 (12:32 +0000)]
ip_frag: add namespace

Update public macros to have RTE_IP_FRAG_ prefix.
Update DPDK components to use new names.
Keep obsolete macro for compatibility reasons.
Renamed experimental function ``rte_frag_table_del_expired_entries``to
``rte_ip_frag_table_del_expired_entries`` to comply with other public
API naming convention.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2 years agohash: fix Toeplitz hash implementation
Vladimir Medvedkin [Tue, 16 Nov 2021 14:33:29 +0000 (14:33 +0000)]
hash: fix Toeplitz hash implementation

This patch fixes various issues:
- replace _mm512_set_epi8 with _mm512_set_epi32 due to the lack
  of support by some compilers (at least, gcc 8),
- check if AVX512F is supported along with GFNI, this is done if the code
  is built on a platform that supports GFNI, but does not support AVX512,
- fix compilation problems on 32bit arch due to lack of support for
  _mm_extract_epi64() by implementing XOR folding with
  _mm_extract_epi32() on 32-bit arch,

Fixes: 4fd8c4cb0de1 ("hash: add new Toeplitz hash implementation")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2 years agoexamples/ntb: fix build dependency
David Marchand [Tue, 16 Nov 2021 20:51:35 +0000 (21:51 +0100)]
examples/ntb: fix build dependency

Caught while building with -Ddisable_drivers=*/*.
This example requires raw/ntb specific API.
Fix dependency to avoid a compilation error:

FAILED: examples/c590b3c@@dpdk-ntb@exe/ntb_ntb_fwd.c.o
ccache gcc -Iexamples/c590b3c@@dpdk-ntb@exe -Iexamples -I../examples
  -Iexamples/ntb -I../examples/ntb -I. -I../ -Iconfig -I../config
  -Ilib/eal/include -I../lib/eal/include -Ilib/eal/linux/include
  -I../lib/eal/linux/include -Ilib/eal/x86/include
  -I../lib/eal/x86/include -Ilib/eal/common -I../lib/eal/common
  -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs
  -Ilib/telemetry/../metrics -I../lib/telemetry/../metrics
  -Ilib/telemetry -I../lib/telemetry -Ilib/mempool -I../lib/mempool
  -Ilib/ring -I../lib/ring -Ilib/net -I../lib/net -Ilib/mbuf
  -I../lib/mbuf -Ilib/ethdev -I../lib/ethdev -Ilib/meter
  -I../lib/meter -Ilib/cmdline -I../lib/cmdline -Ilib/rawdev
  -I../lib/rawdev -fdiagnostics-color=always -pipe -Wall
  -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wextra
  -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral
  -Wformat-security -Wmissing-declarations -Wmissing-prototypes
  -Wnested-externs -Wold-style-definition -Wpointer-arith
  -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings
  -Wno-missing-field-initializers -D_GNU_SOURCE -march=corei7
  -Wno-format-truncation -D_FILE_OFFSET_BITS=64
  -DALLOW_EXPERIMENTAL_API  -MD
  -MQ 'examples/c590b3c@@dpdk-ntb@exe/ntb_ntb_fwd.c.o'
  -MF 'examples/c590b3c@@dpdk-ntb@exe/ntb_ntb_fwd.c.o.d'
  -o 'examples/c590b3c@@dpdk-ntb@exe/ntb_ntb_fwd.c.o'
  -c ../examples/ntb/ntb_fwd.c
../examples/ntb/ntb_fwd.c:21:10: fatal error: rte_pmd_ntb.h:
  No such file or directory
 #include <rte_pmd_ntb.h>
          ^~~~~~~~~~~~~~~
compilation terminated.

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
2 years agodoc: discourage using Meson 0.58 on Windows
Dmitry Kozlyuk [Fri, 12 Nov 2021 22:17:08 +0000 (01:17 +0300)]
doc: discourage using Meson 0.58 on Windows

Meson 0.58 and above cannot build DPDK on Windows with clang.
Recommend the latest known working version
and warn about the issue and the affected versions.

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2 years agoconfig/x86: fix MinGW cross build with Meson 0.49
Dmitry Kozlyuk [Fri, 12 Nov 2021 21:48:26 +0000 (00:48 +0300)]
config/x86: fix MinGW cross build with Meson 0.49

Cross build with MinGW was broken for the baseline meson 0.49.2.
Cause: in c_args = '-mno-avx512f' from config/x86/cross-mingw,
each character was treated as a separate compiler option:

    meson.build:4:0: ERROR:  Compiler x86_64-w64-mingw32-gcc can not compile programs.

With c_args = ['-mno-avx512f'] configuration passed, but build failed,
because Meson placed -mno-avx512f after -mavx512f in CFLAGS:

    In file included from /usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/include/immintrin.h:55,
                     from /usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/include/x86intrin.h:32,
                     from ../dpdk/lib/net/net_crc_avx512.c:13:
    /usr/lib/gcc/x86_64-w64-mingw32/9.3-win32/include/avx512fintrin.h:1650:1:
            error: inlining failed in call to always_inline _mm512_ternarylogic_epi64:
            target specific option mismatch
     1650 | _mm512_ternarylogic_epi64 (__m512i __A, __m512i __B, __m512i __C,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~
    ../dpdk/lib/net/net_crc_avx512.c:59:9: note: called from here
       59 |  return _mm512_ternarylogic_epi64(tmp0, tmp1, data_block, 0x96);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Additionally, -m[no-]avx512f flag is expected to be in machine_args
by all the checks in meson.build files.

Commit 419c6e9af69e ("net/i40e: fix build for Windows MinGW")
fixed the errors cause by MinGW using AVX512F on Windows.
The binutils AVX512F bug check is now portable,
so enable it for Windows to switch AVX512 support on and off
without any special logic for MinGW.

Fixes: 549bfc83168f ("config: disable AVX512 with MinGW")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agobuildtools: make AVX512 check portable
Dmitry Kozlyuk [Fri, 12 Nov 2021 21:48:25 +0000 (00:48 +0300)]
buildtools: make AVX512 check portable

buildtools/binutils-avx512-check.sh was Unix-only
and could not be used in cross builds:
1) written in shell;
2) used the assembler binary that may be missing,
   e.g. when building on Windows with LLVM;
3) located the assembler as ${AS:-as} and referenced objdump,
   but those binaries may be overridden via --cross-file.

Rewrite the script in Python.
Use the C compiler for the check.
Locate objdump and the C compiler using Meson.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoconfig/x86: skip GNU binutils bug check for LLVM
Dmitry Kozlyuk [Fri, 12 Nov 2021 21:48:24 +0000 (00:48 +0300)]
config/x86: skip GNU binutils bug check for LLVM

AVX512 was disabled when GNU binutils were missing or had a known bug,
even if LLVM binutils were used for the build,
because binutils-avx512-check.sh was invoked regardless and failed.
In particular, this was the case for FreeBSD with clang (default).
Run the check only when GNU binutils are used.

Fixes: 68b1f1cda5b4 ("build: check AVX512 rather than binutils version")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoapp/gpudev: improve output
Elena Agostini [Mon, 15 Nov 2021 23:03:28 +0000 (23:03 +0000)]
app/gpudev: improve output

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agofix spelling in comments and doxygen
Stephen Hemminger [Fri, 12 Nov 2021 00:02:09 +0000 (16:02 -0800)]
fix spelling in comments and doxygen

Fix spelling errors in comments including doxygen found using codespell.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agogpu/cuda: introduce CUDA driver
Elena Agostini [Tue, 16 Nov 2021 22:50:18 +0000 (22:50 +0000)]
gpu/cuda: introduce CUDA driver

This is the CUDA implementation of the gpudev library.
Functionalities implemented through CUDA Driver API are:
- Device probe and remove
- Manage device memory allocations
- Register/unregister external CPU memory in the device memory area

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agotest: move RED to extra tests list
David Marchand [Wed, 27 Oct 2021 14:04:58 +0000 (16:04 +0200)]
test: move RED to extra tests list

This test gives random failures, move it to extra until we have a fix.
See: https://bugs.dpdk.org/show_bug.cgi?id=826

Signed-off-by: David Marchand <david.marchand@redhat.com>
2 years agotest: create a list of extra tests
David Marchand [Wed, 27 Oct 2021 14:04:57 +0000 (16:04 +0200)]
test: create a list of extra tests

We removed some tests from the "CI" (fast-tests) list because they
were not reliable enough or did not make sense as non regression tests.
Since we still build those tests code, leave an option for users to call
them.
This list can also serve as a point where to document why test X is not
suitable for the "CI" list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
2 years agotest: remove unnecessary test commands
David Marchand [Wed, 27 Oct 2021 14:04:10 +0000 (16:04 +0200)]
test: remove unnecessary test commands

EAL and rwlock tests have been split into smaller unit tests now listed
in meson.
Nothing is referencing eal_flags_autotest and rwlock_autotest anymore,
since we dropped the python wrapper.

Fixes: 8c745bb62340 ("test: remove autotest python wrapper")

Signed-off-by: David Marchand <david.marchand@redhat.com>
2 years agoexamples/flow_filtering: enhance code snippet readability
Joyce Kong [Fri, 12 Nov 2021 06:37:03 +0000 (00:37 -0600)]
examples/flow_filtering: enhance code snippet readability

The 'IPv4' in the comment is to mark the code snippet, while it made
some confusion. Then removing 'IPv4' description will be clearer.

Fixes: 9a212dc06c7a ("doc: use code snippets in sample app guides")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agoexamples/multi_process: fix Rx packets distribution
Gregory Etelson [Wed, 10 Nov 2021 16:57:59 +0000 (18:57 +0200)]
examples/multi_process: fix Rx packets distribution

MP servers distributes Rx packets between clients according to
round-robin scheme.

Current implementation always started packets distribution from
the first client. That procedure resulted in uniform distribution
in cases when Rx packets number was around clients number
multiplication. However, if RX burst repeatedly returned single
packet, round-robin scheme would not work because all packets
were assigned to the first client only.

The patch does not restart packets distribution from
the first client.
Packets distribution always continues to the next client.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agoexamples/l3fwd-power: fix early shutdown
Harneet Singh [Fri, 29 Oct 2021 14:05:56 +0000 (14:05 +0000)]
examples/l3fwd-power: fix early shutdown

Currently, EAL init cannot be interrupted with SIGINT because the
signal handler is already overridden by the time EAL init happens.

Fix it by moving signal handler installation to after EAL
initialization, to allow SIGNIT to interrupt EAL initialization.

Fixes: d7937e2e3d12 ("power: initial import")
Fixes: 613ce6691c0d ("examples/l3fwd-power: implement proper shutdown")
Cc: stable@dpdk.org
Signed-off-by: Harneet Singh <harneet.singh@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agotest/bpf: do not require DNS lookup
Stephen Hemminger [Mon, 15 Nov 2021 23:29:56 +0000 (15:29 -0800)]
test/bpf: do not require DNS lookup

These tests were using strings with hostname (dpdk.org) and this makes
test code do a DNS lookup. In container environment used for OpenSuse
build, DNS is unavailable. Replace dpdk.org with an IPv4 address
reserved for documentation (RFC5737) and use IPv6 in one example
(RFC3849). Actual addresses don't matter for this test which is
validating that code generated in classic BPF can be successfully
converted to eBPF.

Fixes: 2eccf6afbea9 ("bpf: add function to convert classic BPF to DPDK BPF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
2 years agocommon/qat: fix queue pair config overrun
Arek Kusztal [Fri, 12 Nov 2021 12:01:56 +0000 (12:01 +0000)]
common/qat: fix queue pair config overrun

This commit fixes overrun of ring configuration
due to insufficient check.

Fixes: 4badfb0205f7 ("common/qat: fix queue pairs number")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2 years agotest/crypto: fix output buffer length
Gagandeep Singh [Fri, 12 Nov 2021 07:53:48 +0000 (13:23 +0530)]
test/crypto: fix output buffer length

Input buffer length is getting appended with
padding length when the test case is encrypted
digest, but output buffer length is appended
with padding length for all the cases.

This patch fixes the output buffer length
by appending the padding length only when the
test case is of encrypted digest type.

Fixes: 6356c28642a6 ("test/crypto: add cases for block cipher encrypted digest")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: support BlueField 2 and ConnectX-6 Dx devices
Raja Zidane [Thu, 11 Nov 2021 13:51:33 +0000 (13:51 +0000)]
crypto/mlx5: support BlueField 2 and ConnectX-6 Dx devices

Starting from FW version xx.32.0108. version, the BlueField 2 and
ConnectX-6 Dx adapters support crypto operations.

Add them to the supported PCI devices list.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
2 years agotest/crypto: remove unnecessary stats retrieval
Ciara Power [Thu, 11 Nov 2021 10:56:19 +0000 (10:56 +0000)]
test/crypto: remove unnecessary stats retrieval

The device stats are retrieved in the testcase teardown function,
but are not being used afterwards. Remove this unnecessary call.
The stats retrieval for the device is being tested already by a
dedicated stats testcase.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocommon/cpt: fix KASUMI input length
Anoob Joseph [Thu, 11 Nov 2021 11:48:42 +0000 (17:18 +0530)]
common/cpt: fix KASUMI input length

Fix kasumi input len calculation to consider encr_offset.

Fixes: da39e3eccd3d ("common/cpt: support KASUMI")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: fix KASUMI input length
Anoob Joseph [Thu, 11 Nov 2021 11:44:29 +0000 (17:14 +0530)]
crypto/cnxk: fix KASUMI input length

Fix kasumi input len calculation to consider encr_offset.

Fixes: 546dff20a034 ("crypto/cnxk: add KASUMI decryption")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/crypto: fix missing return checks
Anoob Joseph [Mon, 8 Nov 2021 15:13:46 +0000 (20:43 +0530)]
test/crypto: fix missing return checks

The API could return errors. Add error checking for the same.

Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: fix telemetry memory leaks
Radu Nicolau [Tue, 9 Nov 2021 09:51:40 +0000 (09:51 +0000)]
examples/ipsec-secgw: fix telemetry memory leaks

Free telemetry structures when memory allocation
or input parameter errors occur.

Fixes: 3e7b7dd88021 ("examples/ipsec-secgw: support telemetry")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: fix data lengths
Kai Ji [Tue, 9 Nov 2021 10:42:31 +0000 (10:42 +0000)]
test/crypto: fix data lengths

This patch fixes incorrect data lengths computation in cryptodev
unit test. Previously some data lengths were incorrectly set, which
was insensitive for crypto op unit tets but is critical for raw data
path API unit tests. The patch addressed the issue by setting the
correct data lengths for some tests.

Fixes: 681f540da52b ("cryptodev: do not use AAD in wireless algorithms")
Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")
Fixes: b1c1df46878d ("test/crypto: add ZUC test cases for auth-cipher")
Cc: stable@dpdk.org
Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/crypto: skip plain text compare for null cipher
Anoob Joseph [Wed, 10 Nov 2021 13:04:08 +0000 (18:34 +0530)]
test/crypto: skip plain text compare for null cipher

NULL cipher is used for validating auth only cases. With NULL cipher,
validating plain text should not be done as the PMD is only expected
to update auth data.

Fixes: e847fc512817 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2 years agoevent/dlb2: fix delayed pop test in selftest
Rashmi Shetty [Mon, 15 Nov 2021 16:34:44 +0000 (10:34 -0600)]
event/dlb2: fix delayed pop test in selftest

Number of events scheduled and available for dequeue
after token pop was set to dequeue_depth-1 instead of
dequeue_depth in test_delayed_pop. The expectation is
that all dequeue_depth number of events can be dequeued
once the last event is released.

Fixes: 07d55c418d47 ("event/dlb2: add delayed token pop logic")
Cc: stable@dpdk.org
Signed-off-by: Rashmi Shetty <rashmi.shetty@intel.com>
Reviewed-by: Mike Ximing Chen <mike.ximing.chen@intel.com>
2 years agoeventdev: negate maintenance capability flag
Mattias Rönnblom [Wed, 10 Nov 2021 11:32:10 +0000 (12:32 +0100)]
eventdev: negate maintenance capability flag

Replace RTE_EVENT_DEV_CAP_REQUIRES_MAINT, which signaled the need
for the application to call rte_event_maintain(), with
RTE_EVENT_DEV_CAP_MAINTENANCE_FREE, which does the opposite (i.e.,
signifies that the event device does not require maintenance).

This approach is more in line with how other eventdev hardware and/or
software limitations are handled in the Eventdev API.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoeventdev/eth_rx: fix stalls on event device backpressure
Mattias Rönnblom [Wed, 10 Nov 2021 11:14:00 +0000 (12:14 +0100)]
eventdev/eth_rx: fix stalls on event device backpressure

In the Eventdev Ethernet RX Adapter, correctly handle the case where
the circular enqueue buffer head and last index point to the same
element.

This bug may be triggered in case there is backpressure from the event
device to the RX adapter.

Fixes: 8113fd15e229 ("eventdev/eth_rx: make enqueue buffer circular")

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2 years agoeventdev/eth_tx: fix queue delete logic
Naga Harish K S V [Tue, 9 Nov 2021 07:33:33 +0000 (01:33 -0600)]
eventdev/eth_tx: fix queue delete logic

This patch fixes heap-use-after-free reported by ASan.

The application can use the queue_id as `-1` to delete all
the queues of the eth_device that are added to tx_adapter
instance.
In above case, the queue_del API is trying to use number of
queues from adapter level instead of eth_device queues.
When there are queues added from multiple eth devices,
it will result in heap-use-after-free as reported by ASAN.

This patch fixes the queue_del API to use correct number of
queues.

Bugzilla ID: 869
Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2 years agoexamples/performance-thread: remove unused hits count
Conor Walsh [Mon, 15 Nov 2021 17:58:55 +0000 (17:58 +0000)]
examples/performance-thread: remove unused hits count

Reported by clang 13.
This patch removes the hits variable from the cpu_load_collector function
within the performance thread example app as it is an unused but set
variable.

Bugzilla ID: 881
Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agotest/distributor: remove unused counter
Conor Walsh [Mon, 15 Nov 2021 17:58:50 +0000 (17:58 +0000)]
test/distributor: remove unused counter

Reported by clang 13.
This patch fixes unused but set variables in the distributor test perf.

Bugzilla ID: 881
Fixes: c0de0eb82e40 ("distributor: switch over to new API")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/vmxnet3: fix build with clang 13
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/vmxnet3: fix build with clang 13

The completed variable is used for debug logs even though clang 13
reports it as unused.

Bugzilla ID: 881
Fixes: c3ecdbb376da ("vmxnet3: support TSO")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/txgbe: fix build with clang 13
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/txgbe: fix build with clang 13

eicr serves as a placeholder for some read-on-clear nic register.
clang 13 reports it as unused.

Bugzilla ID: 881
Fixes: b7311360fb67 ("net/txgbe: support VF interrupt")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/qede/base: remove unused message size
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/qede/base: remove unused message size

Reported by clang 13.

Bugzilla ID: 881
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/nfp: remove unused message length
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/nfp: remove unused message length

Reported by clang 13.

Bugzilla ID: 881
Fixes: 29a62d1476b6 ("net/nfp: add CPP bridge as service")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/liquidio: remove unused counter
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/liquidio: remove unused counter

Reported by clang 13.

Bugzilla ID: 881
Fixes: 5ee7640f95a0 ("net/liquidio: add API to flush IQ")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/bnxt: remove some unused variables
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/bnxt: remove some unused variables

Reported by clang 13.

Bugzilla ID: 881
Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
Fixes: 88badb3aef94 ("net/bnxt: add helper functions for blob/regfile ops")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agoevent/sw: remove unused inflight events count
Conor Walsh [Mon, 15 Nov 2021 17:58:53 +0000 (17:58 +0000)]
event/sw: remove unused inflight events count

Reported by clang 13.
This patch removes the inflights variable from the sw_dump function
within the software section of the event driver as it is an unused but
set variable.

Bugzilla ID: 881
Fixes: c66baa68e453 ("event/sw: add dump function for easier debugging")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agobus/fslmc: remove unused device count
Conor Walsh [Mon, 15 Nov 2021 17:58:51 +0000 (17:58 +0000)]
bus/fslmc: remove unused device count

Reported by clang 13.
This patch removes the device_count variable from the rte_fslmc_scan
function within the fslmc bus driver as it is an unused but set variable.

Bugzilla ID: 881
Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Cc: stable@dpdk.org
Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agotest/thash: fix build with clang 13
Conor Walsh [Mon, 15 Nov 2021 17:58:50 +0000 (17:58 +0000)]
test/thash: fix build with clang 13

run_rss_calc() is used to compare the number of cycles spent computing a
hash value for different implementations.
clang 13 reports the hash variable as being unused, but run_rss_calc()
needs this variable as a placeholder for computing the hash value.

Bugzilla ID: 881
Fixes: 239fffe0402e ("test/thash: add performance tests for Toeplitz hash")

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/octeontx: remove unused packet length
Conor Walsh [Mon, 15 Nov 2021 17:58:50 +0000 (17:58 +0000)]
net/octeontx: remove unused packet length

Reported by clang 13.

Bugzilla ID: 881
Fixes: 9eb5cb3b11cc ("net/octeontx: fix access to indirect buffers")

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/hinic/base: remove some unused variables
Conor Walsh [Mon, 15 Nov 2021 17:58:54 +0000 (17:58 +0000)]
net/hinic/base: remove some unused variables

Reported by clang 13.

Bugzilla ID: 881
Fixes: a4957d87e05a ("net/hinic/base: add mgmt module")

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agocommon/qat: remove unused time counter
Conor Walsh [Mon, 15 Nov 2021 17:58:52 +0000 (17:58 +0000)]
common/qat: remove unused time counter

Reported by clang 13.
This patch removes the us variable from the qat_pf2vf_exch_msg function
within the PF to VF section of the QAT driver as it is an unused but set
variable.

Bugzilla ID: 881
Fixes: b17d16fb47b4 ("common/qat: add PF to VF communication")

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agodoc: fix indentation in flow-perf guide
Rongwei Liu [Thu, 11 Nov 2021 14:23:40 +0000 (16:23 +0200)]
doc: fix indentation in flow-perf guide

The --meter section used wrong indentation previously.

Fixes: 6a2cf58a045f ("app/flow-perf: support meter action")
Cc: stable@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agoapp/flow-perf: add packet metering mode
Rongwei Liu [Thu, 11 Nov 2021 14:23:39 +0000 (16:23 +0200)]
app/flow-perf: add packet metering mode

The flow perf application uses the srtcm_rfc2697 as meter profile
while doing the meter testing.

This patch adds new configuration parameter '--packet-mode' to
generate the meter flows with packet cir instead of byte cir.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agoapp/flow-perf: support dynamic values for meter profile
Rongwei Liu [Thu, 11 Nov 2021 14:23:38 +0000 (16:23 +0200)]
app/flow-perf: support dynamic values for meter profile

Change meter-cir option to meter-profile to cover user input for CIR,
CBS & EBS values.

The usage is as below:
--meter-profile=N1,N2,N3 default value is 1250000 156250 0.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agoapp/flow-perf: support meter policy API
Rongwei Liu [Thu, 11 Nov 2021 14:23:37 +0000 (16:23 +0200)]
app/flow-perf: support meter policy API

Add option "policy-mtr" to indicate if meter creation will include policy
or not. Meter creation will keep unchanged without it.

With "policy-mtr", the policy is introduced. API create_meter_policy
is to create a policy. API create_meter_rule will use it to create
a meter. The value of it is used to specify meter policy actions.

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agoapp/flow-perf: move flow options as global
Rongwei Liu [Thu, 11 Nov 2021 14:23:36 +0000 (16:23 +0200)]
app/flow-perf: move flow options as global

With flow_options defined as global struct, it's possible
to use sub-functions to handle run-time options.

It's helpful to avoid too many tabs warnings.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2 years agoeal/ppc: support ASan
David Christensen [Mon, 15 Nov 2021 21:38:47 +0000 (13:38 -0800)]
eal/ppc: support ASan

Add support for Address Sanitizer (ASan) for PPC/POWER architecture.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agotest/red: fix typo in test description
David Marchand [Fri, 12 Nov 2021 13:56:45 +0000 (14:56 +0100)]
test/red: fix typo in test description

This is probably due a s/red/rte_red/ a long time ago.

Fixes: de3cfa2c9823 ("sched: initial import")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@yahoo.com>
2 years agoexamples/l3fwd: use reserved addresses for EM mode
Pavan Nikhilesh [Fri, 5 Nov 2021 08:38:51 +0000 (14:08 +0530)]
examples/l3fwd: use reserved addresses for EM mode

The l3fwd example should use the reserved IPv4/v6 reserved address
ranges defined in RFC5735, RFC5180 and RFC863 discard protocol for
the port number in the exact match mode of L3 forwarding.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agoexamples/l3fwd: print device name when adding routes
Pavan Nikhilesh [Fri, 5 Nov 2021 08:38:50 +0000 (14:08 +0530)]
examples/l3fwd: print device name when adding routes

Since the number of Ethernet ports have gone up, print the device name
(which for PCI devices is the BDF triplet), along with the routes.
This is also helpful for cases where allow listing order is not honored.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agoexamples/l3fwd: increase number of routes
Pavan Nikhilesh [Fri, 5 Nov 2021 08:38:49 +0000 (14:08 +0530)]
examples/l3fwd: increase number of routes

Increase the number of routes from 8 to 16 that are statically added for
lpm and em mode as most of the SoCs support more than 8 interfaces.
The number of routes added is equal to the number of ethernet devices
ports enabled through port mask.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/af_xdp: workaround custom program loading
Ciara Loftus [Fri, 12 Nov 2021 10:30:02 +0000 (10:30 +0000)]
net/af_xdp: workaround custom program loading

Since v0.4.0, if the underlying kernel supports it, libbpf uses 'bpf
link' to manage the programs on the interfaces of the XDP sockets (xsks).
This is not compatible with the PMD's custom XDP program loading feature
which uses the netlink-based method for loading custom programs.

The conflict arises when libbpf searches for a custom program on the
interface using bpf link, but doesn't find one because the netlink
method was used. libbpf then proceeds to try to load the default program
on the interface, but fails due to the presence of the custom program.

To work around this, the PMD now uses the
XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD flag which prevents libbpf from
attempting to search for or load a program. One repercussion is that
DPDK must now insert the xsk into the xsks_map as this was previously
handled by libbpf during the routines for program loading/probing.

Ideally, the PMD would use bpf link to load the custom program, however
at present there is no convenient and reliable way of detecting whether
the underlying kernel supports bpf link. Perhaps this may become
available in a future libbpf release, at which point we can switch the
PMD over to the new bpf link based method.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
2 years agonet/af_xdp: revert use BPF link for XDP programs
Ciara Loftus [Fri, 12 Nov 2021 10:30:01 +0000 (10:30 +0000)]
net/af_xdp: revert use BPF link for XDP programs

The commit ae70cc6e893b ("net/af_xdp: use BPF link for XDP programs")
caused compilation errors on kernels older than v5.8 due to absence of
the bpf_link_info struct and some definitions in the linux/bpf.h header.
Since relying on the reported kernel version is not a robust solution
and also since there doesn't appear to be a suitable definition in the
bpf header that the preprocessor could rely on to determine support for
bpf link, we will take a different approach to solving the issue that
the original patch attempted to solve. The next commit will address
this.

Fixes: ae70cc6e893b ("net/af_xdp: use BPF link for XDP programs")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>