dpdk.git
3 years agodevtools: catch symbol duplicates in version map
David Marchand [Thu, 13 May 2021 08:34:14 +0000 (10:34 +0200)]
devtools: catch symbol duplicates in version map

Add a check on versioned symbol duplicates in map files.

Signed-off-by: David Marchand <david.marchand@redhat.com>
3 years agodevtools: fix orphan symbols check with busybox
David Marchand [Thu, 13 May 2021 08:34:13 +0000 (10:34 +0200)]
devtools: fix orphan symbols check with busybox

Avoid relying on GNU grep --exclude option.

Fixes: f8ad40dc998c ("devtools: check orphan symbols in map files")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
3 years agodevtools: add acronyms in dictionary for commit checks
Ferruh Yigit [Fri, 14 May 2021 09:03:08 +0000 (10:03 +0100)]
devtools: add acronyms in dictionary for commit checks

GCC     -> GNU Compiler Collection
ID      -> Identification/Identity/Identifier
IP      -> Internet Protocol
QinQ    -> IEEE 802.1Q in 802.1Q
SoC     -> System on a Chip
VEB     -> Virtual Ethernet Bridge
Windows ->

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoconfig/arm: add Qualcomm Centriq 2400
Thierry Herbelot [Fri, 7 May 2021 08:48:15 +0000 (10:48 +0200)]
config/arm: add Qualcomm Centriq 2400

From the documentation:
"The SoC configuration is a combination of implementer and CPU part number
 configuration and SoC-specific configuration."

Align Qualcomm SoC configuration with the configuration of other
server SoCs (eMAG, Kunpeng 9x0): add a soc configuration to the existing
implementer configuration, and a cross file.

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agousertools: add Intel DLB device binding
Timothy McDaniel [Mon, 26 Apr 2021 15:34:50 +0000 (10:34 -0500)]
usertools: add Intel DLB device binding

Add DLB to usertools/dpdk-devbind.py so that it shows up
as an eventdev, and is identified as Intel DLB.

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
3 years agotest/timer: remove license boilerplate
Stephen Hemminger [Tue, 16 Mar 2021 21:00:27 +0000 (14:00 -0700)]
test/timer: remove license boilerplate

This file has redundant BSD license text that is already
replaced by the use of SPDX license id.
Having both is unnecessary and potentially confusing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agodoc: add SPDX tag to custom CSS file
Stephen Hemminger [Tue, 16 Mar 2021 21:00:26 +0000 (14:00 -0700)]
doc: add SPDX tag to custom CSS file

Trivial file, but add SPDX license tag per policy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodevtools: ignore JSON files for SPDX check
Stephen Hemminger [Tue, 16 Mar 2021 21:00:25 +0000 (14:00 -0700)]
devtools: ignore JSON files for SPDX check

The JSON file format does not support comments so there is no good
way to add SPDX license identifier.  This solves false positives
that arrive from the use of JSON in crypto dev tests.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agocommon/mlx5: add SPDX tag in Windows headers
Stephen Hemminger [Tue, 16 Mar 2021 21:00:24 +0000 (14:00 -0700)]
common/mlx5: add SPDX tag in Windows headers

These files were added without required SPDX headers.

Fixes: 7525ebd8ebb0 ("common/mlx5: add glue functions on Windows")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
3 years agotest/crypto: fix result when PMD is not loaded
Ciara Power [Tue, 18 May 2021 14:19:55 +0000 (14:19 +0000)]
test/crypto: fix result when PMD is not loaded

The return value for a test when the required PMD is not loaded should
be TEST_SKIPPED, rather than TEST_FAILED.

Fixes: 8bfdd8a7f0f1 ("test/crypto: refactor to use sub test suites")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agotest: fix division by zero
Min Hu (Connor) [Thu, 13 May 2021 01:10:37 +0000 (09:10 +0800)]
test: fix division by zero

Variable i is used as a denominator which may be zero, and
this may result in segmentation fault.

This patch fixed it.

Fixes: 948bc3d6d095 ("test: add reciprocal based division")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoexamples/l3fwd-power: fix empty poll thresholds
Hongbo Zheng [Wed, 21 Apr 2021 03:53:39 +0000 (11:53 +0800)]
examples/l3fwd-power: fix empty poll thresholds

Fix assignment errors of ep_hgh_edpi in function parse_ep_config.

Fixes: a137d012a0dd ("examples/l3fwd-power: support traffic pattern aware control")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Reshma Pattan <reshma.pattan@gmail.com>
Acked-by: David Hunt <david.hunt@intel.com>
3 years agodevtools: check flow API doc tables
Thomas Monjalon [Tue, 6 Apr 2021 22:28:12 +0000 (00:28 +0200)]
devtools: check flow API doc tables

The script check-doc-vs-code.sh may be used to add
some automatic checks of the doc.

If run without any argument, a complete check is done.
The optional argument is a git history reference point
to check faster only what has changed since this commit.

In this commit, the only check is for rte_flow tables,
achieved through the script parse-flow-support.sh.
If run without a .ini reference, it prints rte_flow tables.
Note: detected features are marked with the value Y,
while the real .ini file could have special values like I.
The script allow parsing exceptions (exclude or include),
like for bnxt code which lists unsupported items and actions.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v6 changes:
- fix redundant drivers
- ignore indirect action
- prefix misses with a category (item or action)

3 years agodoc: add flow API features tables
Thomas Monjalon [Wed, 7 Apr 2021 20:56:51 +0000 (22:56 +0200)]
doc: add flow API features tables

The NICs overview table lists all supported features per driver.
There was a single row for "Flow API",
although rte_flow is composed of many items and actions.

The row "Flow API" is replaced with two new tables for items and actions.

Also, since rte_flow is not implemented in all drivers,
it would be ugly to add empty sections in some files.
That's why the error message for missing INI section is removed.

The lists are sorted alphabetically.
The extra files for some VF and vectorized data paths are not filled.

Signed-off-by: Asaf Penso <asafp@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kiran Kumar K <kirankumark@marvell.com>
---
v6 changes:
- rebase/update
- remove deprecated shared action

3 years agodoc: rename sfc features file
Thomas Monjalon [Wed, 7 Apr 2021 21:03:59 +0000 (23:03 +0200)]
doc: rename sfc features file

The driver directory is drivers/net/sfc
but the features file was doc/guides/nics/features/sfc_efx.ini.

sfc_efx.ini is renamed sfc.ini to match the driver directory name.
It will help automatic checks of this file.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agotest/table: fix build with GCC 11
Ferruh Yigit [Mon, 17 May 2021 15:57:39 +0000 (16:57 +0100)]
test/table: fix build with GCC 11

Build error:
../app/test/test_table_tables.c: In function ‘test_table_stub’:
../app/test/test_table_tables.c:31:9:
warning: ‘memset’ offset [0, 31] is out of the bounds [0, 0]
[-Warray-bounds]
         memset((uint8_t *)mbuf + sizeof(struct rte_mbuf) + 32, 0, 32); \
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../app/test/test_table_tables.c:151:25:
note: in expansion of macro ‘PREPARE_PACKET’
  151 |                         PREPARE_PACKET(mbufs[i], 0xadadadad);
      |                         ^~~~~~~~~~~~~~

'key' points to mbuf header + 32 bytes, and memset clears next 32 bytes
of 'key', so overall there needs to be 64 bytes after mbuf header.
Adding a mbuf size check before memset.

The original code has an assumption that mbuf data buffer follows mbuf
header, this patch accepts same assumption.

Bugzilla ID: 677
Fixes: 5205954791cb ("app/test: packet framework unit tests")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoversion: 21.05-rc3
Thomas Monjalon [Wed, 12 May 2021 20:40:07 +0000 (22:40 +0200)]
version: 21.05-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agotest/power: fix turbo test
David Hunt [Wed, 12 May 2021 16:32:54 +0000 (17:32 +0100)]
test/power: fix turbo test

when turbo is enabled or disabled, the frequency is set to a low non-turbo
frequency, so we need to set to the frequency expected by the test before
checking.

Fixes: aeaeaf5f2d62 ("test/power: add cases for turbo feature")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agotest/power: fix low frequency test when turbo enabled
David Hunt [Wed, 12 May 2021 16:32:53 +0000 (17:32 +0100)]
test/power: fix low frequency test when turbo enabled

With the intel_pstate driver and turbo enabled, indexing is slightly
different to normal, so to get the test to work properly, enable
turbo at the start.

Fixes: ed7c51a6a680 ("app/test: vm power management")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agotest/power: add turbo mode to frequency check
David Hunt [Wed, 12 May 2021 16:32:52 +0000 (17:32 +0100)]
test/power: add turbo mode to frequency check

With the intel_pstate driver and turbo enabled, the top frequency in
the frequency array is the P1+1, i.e. 2300001, whereas the frequency
shown in scaling_cur_freq could be a lot higher.

This patch adds a flag to the check_cur_freq function so that we can
specify if a frequency is greater than expected (turbo mode), in which
case the check should be successful.

Fixes: aeaeaf5f2d62 ("test/power: add cases for turbo feature")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agotest/power: fix CPU frequency check
David Hunt [Wed, 12 May 2021 16:32:51 +0000 (17:32 +0100)]
test/power: fix CPU frequency check

Different drivers present the current cpu core frequency in different
sysfs files. Some present it in cpuinfo_cur_freq, some in scaling_cur_freq,
and some actually present it in both.

This patch attempts to open one, if that fails, tries the other.

Fixes: d550a8cc31f3 ("app/test: enhance power manager unit tests")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agotest: check flow classifier creation
Min Hu (Connor) [Thu, 22 Apr 2021 06:13:54 +0000 (14:13 +0800)]
test: check flow classifier creation

'cls->cls' will be NULL if flow classifier create has failed,
then segmentation fault will occur if the variable is used.

This patch fixed it.

Fixes: 9c9befea4f57 ("test: add flow classify unit tests")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
3 years agoexamples/skeleton: fix NUMA check of port and core
Min Hu (Connor) [Thu, 29 Apr 2021 00:50:48 +0000 (08:50 +0800)]
examples/skeleton: fix NUMA check of port and core

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

This patch fixes the check for a device on the node 0.

Fixes: 7107e471a6c7 ("examples/skeleton: very simple code for packet forwarding")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoexamples/l2fwd-cat: fix NUMA check of port and core
Min Hu (Connor) [Thu, 29 Apr 2021 00:50:47 +0000 (08:50 +0800)]
examples/l2fwd-cat: fix NUMA check of port and core

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

This patch fixes the check for a device on the node 0.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoexamples/flow_classify: fix NUMA check of port and core
Min Hu (Connor) [Thu, 29 Apr 2021 00:50:46 +0000 (08:50 +0800)]
examples/flow_classify: fix NUMA check of port and core

According to the comments and logging, the author just hope user to use
the core and device which are in the same numa node for optimal
performance. If not, A warning gives out.

For example in flow_classify:
./build/flow_classify -a 0000:7d:00.1  -l 93
Here:
0000:7d:00.1 is on numa node 0.
core 93  is on numa node 3.

The two are not in same numa node, but no warning gives out in old codes
when device is on node 0.
This patch includes the node 0 in the check.

Fixes: bab16ddaf2c1 ("examples/flow_classify: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Tested-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoexamples/rxtx_callbacks: fix port ID format specifier
Dmitry Kozlyuk [Wed, 5 May 2021 21:54:35 +0000 (00:54 +0300)]
examples/rxtx_callbacks: fix port ID format specifier

This fixes -Wformat warning with clang 10.0.0 on Windows.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agoraw/ioat: remove special case for no status reporting
Bruce Richardson [Wed, 12 May 2021 14:50:00 +0000 (14:50 +0000)]
raw/ioat: remove special case for no status reporting

The special fast-path for returning completed descriptors without
reporting status or user-handles returns the number of completed ring
slots used, rather than the number of actual user-submitted jobs. This
means that the counts returned are too high, as the batch descriptor
slots would be included in the total. Therefore remove this special
case, and use the normal status-processing path so that the returned
count is correct in all cases.

Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")

Reported-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agoraw/ioat: fix ring space checks
Bruce Richardson [Wed, 12 May 2021 14:49:59 +0000 (14:49 +0000)]
raw/ioat: fix ring space checks

When enqueuing a descriptor, when checking that there is at least one
slot free for the current descriptor and a later batch descriptor, we
need to test for both two free and one free, in case the last write
was a batch descriptor which is allowed to use the "spare" slot.

Similarly, when computing the free space in the ring to return to the
user, we need to take account of the same condition, so that we do not
return a "-1" ring space value, by blindly subtracting "2".

Fixes: 245efe544d8e ("raw/ioat: report status of completed jobs")

Reported-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
3 years agoapp/crypto-perf: check memory allocation
Min Hu (Connor) [Thu, 6 May 2021 06:13:59 +0000 (14:13 +0800)]
app/crypto-perf: check memory allocation

Return value of a function 'rte_zmalloc' is dereferenced without
checking, and it may call segmentation fault.

This patch fixed it.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agocrypto/qat: fix null authentication request
Adam Dybkowski [Mon, 10 May 2021 10:20:11 +0000 (11:20 +0100)]
crypto/qat: fix null authentication request

This patch fixes the NULL auth generation case where the request
shouldn't contain the authentication result address. Allows to run
ipsec_autotest with a QAT device.

Fixes: 65beb9abca6d ("crypto/qat: fix null auth when using VFIO")
Cc: stable@dpdk.org
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agotest/crypto: build block-cipher suite dynamically
Ciara Power [Wed, 12 May 2021 11:36:55 +0000 (11:36 +0000)]
test/crypto: build block-cipher suite dynamically

In the existing implementation, the blockcipher test cases are being run
and reported as one test case per type, even though multiple test cases
are hidden in each. For example, "test_AES_chain_all" runs 46 test cases.
Each blockcipher type should have a testsuite instead.

The blockcipher testsuite is dynamically built, depending on the
blockcipher type chosen. The testcase struct is modified to allow
running a testcase with data, which is used for data required when
running each blockcipher testcase.

The blockcipher testsuites are added dynamically to parent testsuites
as sub-testsuites where needed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest/crypto: fix return value of a skipped test
Ciara Power [Wed, 12 May 2021 11:36:54 +0000 (11:36 +0000)]
test/crypto: fix return value of a skipped test

The blockcipher testcase return value TEST_SUCCESS was incorrect for
one conditional check, it should have been TEST_SKIPPED similar to the
other condition checks in this function when the testcase is skipped.

Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest/crypto: move test suite parameters to header file
Ciara Power [Wed, 12 May 2021 11:36:53 +0000 (11:36 +0000)]
test/crypto: move test suite parameters to header file

The testsuite params struct and ut functions are now in the cryptodev
test header file. This will allow them be used outside of the
cryptodev_test.c file. They will be used in a subsequent patch by the
blockcipher test.

As a result of this change, slight renaming changes were necessary
for ipsec and asym tests, to avoid a clash in names.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest/crypto: replace unsupported with skipped
Ciara Power [Wed, 12 May 2021 11:36:52 +0000 (11:36 +0000)]
test/crypto: replace unsupported with skipped

Testcases were previously using -ENOTSUP and TEST_SKIPPED return
statuses interchangeably. Both resulted in the testcase not being run.

These return statuses are now standardised to TEST_SKIPPED.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest/crypto: refactor to use sub test suites
Ciara Power [Wed, 12 May 2021 11:36:51 +0000 (11:36 +0000)]
test/crypto: refactor to use sub test suites

The existing implementation runs a giant cryptodev testsuite for most
autotests, which in turns runs one setup function regardless of device.

This is now broken down into multiple testsuites,
that are used as sub-testsuites. Each autotest runs a general crypto
parent test suite, to which the sub-testsuites are added.

For example, the AESNI_MB test runs "Cryptodev Unit Test Suite",
which has a setup function only to configure testsuite params.
Creation of vdevs in the setup function is no longer supported,
it is expected the user does this when running the app.
This autotest previously just ran the cryptodev_testsuite,
but now has the smaller sub-testsuites added to the parent suite instead.
The same test cases are being run as before.

The scheduler autotest creates its own parent testsuite with nested
sub-testsuites, rather than using the cryptodev testsuite mentioned above.
This is due to it being more complex in execution,
by requiring setting different modes before running tests.
The scheduler autotest no longer requires the extra test cases to
attach/set mode/detach when running the blockcipher test cases for
each mode. The attach/set mode/detach functionality is now tested in a
sub-testsuite. When running the sub-testsuites for each mode,
the attach/set mode/detach happens in the setup and teardown functions
for that sub-testsuite.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest: introduce parent test suite format
Ciara Power [Wed, 12 May 2021 11:36:50 +0000 (11:36 +0000)]
test: introduce parent test suite format

The current structure for unit testing only allows for running a
test suite with nested test cases. This means all test cases for an
autotest must be in one suite, which is not ideal.
For example, in some cases we may want to run multiple lists of test
cases that each require different setup, so should be in separate suites.

The unit test suite struct is modified to hold a pointer to a list of
sub-testsuite pointers, along with the list of testcases as before.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agotest: refactor unit test suite runner
Ciara Power [Wed, 12 May 2021 11:36:49 +0000 (11:36 +0000)]
test: refactor unit test suite runner

Some small changes were made to the unit test suite runner for
readability and to enable reuse of some of the function in a later patch.

On test suite setup skip/fail, the loop to count testcases as
skipped/failed has been moved to another function.
This will allow for recursion in a later patch when nested sub-testsuites
are used.

The unit test suite runner accessed the list of testcases in the suite
structure every time the testcase was used. This is now replaced by a
testcase variable which improves readability.

A macro has been introduced for readability, instead of using open
coded loops.

Rather than keep local variable status counts for testcases,
these are added to the test suite structure.

The summary output now prints the suite name, this will be useful later
when multiple nested sub-testsuites are being run.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agonet/mlx5: fix metering with flow ID 0
Shun Hao [Wed, 12 May 2021 10:20:59 +0000 (13:20 +0300)]
net/mlx5: fix metering with flow ID 0

When getting meter flow_id bits, there's an issue that not handling
correctly if flow_id is 0.

This fix this issue that when flow_id is 0, treat it as 1 bit.

Fixes: 83306d6c465a ("net/mlx5: fix meter statistics")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix default context in flow age action
Jiawei Wang [Wed, 12 May 2021 12:09:51 +0000 (15:09 +0300)]
net/mlx5: fix default context in flow age action

One of the user parameters for the flow AGE action is the
action context. This context should be provided back to the
user when the action is aged-out.
While this context is NULL, a default value should be provided
by the PMD: the rte_flow pointer in case of rte_flow_create API
and the action pointer in case of the rte_flow_action_handle API.

The default for rte_flow_action_handle was set correctly,
while in case of rte_flow_create it wrongly remained NULL.

This patch set the default value for rte_flow_create case to be
the rte_flow pointer.

Fixes: f9bc5274a6f9 ("net/mlx5: allow age modes combination")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix age action in transfer root group
Jiawei Wang [Wed, 12 May 2021 12:09:50 +0000 (15:09 +0300)]
net/mlx5: fix age action in transfer root group

Current the ASO age action was supported in the non-root table,
and the counter based age action was be used in the root table.

The FDB table skips group 0 on MLX5 PMD by adding implicit rule
that jump to non-root table, but PMD code use the original group
value for checking.

This patch adds the transfer checking for ASO age action.

Fixes: f9bc5274a6f9 ("net/mlx5: allow age modes combination")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix RSS flow item expansion for NVGRE
Jiawei Wang [Wed, 12 May 2021 10:24:08 +0000 (13:24 +0300)]
net/mlx5: fix RSS flow item expansion for NVGRE

Currently RSS expansion only supports GRE and GRE KEY.
This patch adds RSS expansion for NVGRE item so PMD can expand flow item
correctly.

Fixes: ea81c1b816f7 ("net/mlx5: fix NVGRE matching")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix mirroring with metering action
Jiawei Wang [Wed, 12 May 2021 06:53:24 +0000 (09:53 +0300)]
net/mlx5: fix mirroring with metering action

While there's mirror action prior to the meter action in the E-Switch
flow, means that the packets should be duplicated into port firstly,
and then do meter and send to the original destination.
MLX5 PMD will split the above E-Switch flow into two sub flows,
similar as mirror with modify action before.

Fixes: 07627fbf1506 ("net/mlx5: support E-Switch mirroring with modify action")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix LAG representor probing on PF1 PCI
Xueming Li [Mon, 10 May 2021 13:13:42 +0000 (16:13 +0300)]
net/mlx5: fix LAG representor probing on PF1 PCI

In case of bonding, orchestrator wants to use same devargs for LAG and
non-LAG scenario to probe representor on PF1 using PF1 PCI address
like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for
representors on PF1.

Note: detaching PF0 device can't remove representors on PF1. It's
recommended to use primary(PF0) PCI address to probe representors on
both PFs.

Fixes: f926cce3fa94 ("net/mlx5: refactor bonding representor probing")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix secondary process initialization ordering
Chengwen Feng [Mon, 10 May 2021 12:06:03 +0000 (20:06 +0800)]
net/mlx5: fix secondary process initialization ordering

The memory barrier is used to ensure that the response is returned
only after the Tx/Rx function is set, it should place after the Rx/Tx
function is set.

Fixes: 2aac5b5d119f ("net/mlx5: sync stop/start with secondary process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx4: fix secondary process initialization ordering
Chengwen Feng [Mon, 10 May 2021 12:06:02 +0000 (20:06 +0800)]
net/mlx4: fix secondary process initialization ordering

The memory barrier is used to ensure that the response is returned
only after the Tx/Rx function is set, it should place after the Rx/Tx
function is set.

Fixes: 0203d33a1059 ("net/mlx4: support secondary process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/tap: fix build with GCC 11
Ferruh Yigit [Tue, 11 May 2021 13:14:35 +0000 (14:14 +0100)]
net/tap: fix build with GCC 11

Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

There are multiple build errors, like:
In file included from ../drivers/net/tap/tap_flow.c:13:
In function ‘rte_jhash_2hashes’,
    inlined from ‘rte_jhash’ at ../lib/hash/rte_jhash.h:284:2,
    inlined from ‘tap_flow_set_handle’ at
../drivers/net/tap/tap_flow.c:1306:12,
    inlined from ‘rss_enable’ at ../drivers/net/tap/tap_flow.c:1909:3,
    inlined from ‘priv_flow_process’ at
../drivers/net/tap/tap_flow.c:1228:11:
../lib/hash/rte_jhash.h:238:9:
warning: ‘flow’ may be used uninitialized [-Wmaybe-uninitialized]
  238 |         __rte_jhash_2hashes(key, length, pc, pb, 1);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/tap/tap_flow.c: In function ‘priv_flow_process’:
../lib/hash/rte_jhash.h:81:1: note: by argument 1 of type ‘const void *’
to ‘__rte_jhash_2hashes.constprop’ declared here
 81 | __rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc,
    | ^~~~~~~~~~~~~~~~~~~
../drivers/net/tap/tap_flow.c:1028:1: note: ‘flow’ declared here
 1028 | priv_flow_process(struct pmd_internals *pmd,
      | ^~~~~~~~~~~~~~~~~

Fix strict aliasing rule by using union.

Bugzilla ID: 690
Fixes: de96fe68ae95 ("net/tap: add basic flow API patterns and actions")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
3 years agonet/ice/base: fix build with GCC 11
Ferruh Yigit [Tue, 11 May 2021 13:14:34 +0000 (14:14 +0100)]
net/ice/base: fix build with GCC 11

Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

There are multiple build errors, like:
../drivers/net/ice/base/ice_switch.c: In function ‘ice_add_marker_act’:
../drivers/net/ice/base/ice_switch.c:3727:15:
warning: array subscript ‘struct ice_aqc_sw_rules_elem[0]’
is partly outside array bounds of ‘unsigned char[52]’
[-Warray-bounds]
 3727 |         lg_act->type = CPU_TO_LE16(ICE_AQC_SW_RULES_T_LG_ACT);
      |               ^~
In file included from ../drivers/net/ice/base/ice_type.h:52,
                 from ../drivers/net/ice/base/ice_common.h:8,
                 from ../drivers/net/ice/base/ice_switch.h:8,
                 from ../drivers/net/ice/base/ice_switch.c:5:
../drivers/net/ice/base/ice_osdep.h:209:29:
note: referencing an object of size 52 allocated by ‘rte_zmalloc’
  209 | #define ice_malloc(h, s)    rte_zmalloc(NULL, s, 0)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ice/base/ice_switch.c:3720:50:
note: in expansion of macro ‘ice_malloc’
  lg_act = (struct ice_aqc_sw_rules_elem *)ice_malloc(hw, rules_size);

These errors are mainly because allocated memory is cast to
"struct ice_aqc_sw_rules_elem *" but allocated size is less than the size
of "struct ice_aqc_sw_rules_elem".

"struct ice_aqc_sw_rules_elem" has multiple other structs has unions,
based on which one is used allocated memory being less than the size of
"struct ice_aqc_sw_rules_elem" is logically correct but compiler is
complaining about it.

Since the allocation is done explicitly and both producer and consumer
are internal, safe to ignore the warnings. Also to prevent any side
affect disabling the compiler warning for now, until proper fix done.

Reducing the warning disable to gcc >= 11 version.

Bugzilla ID: 678
Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Fixes: 02acdce2f553 ("net/ice/base: add MAC filter with marker and counter")
Fixes: f89aa3affa9e ("net/ice/base: support removing advanced rule")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/bnx2x: fix build with GCC 11
Ferruh Yigit [Tue, 11 May 2021 13:14:33 +0000 (14:14 +0100)]
net/bnx2x: fix build with GCC 11

Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

Build error:
In file included from ../drivers/net/bnx2x/bnx2x.c:16:
../drivers/net/bnx2x/bnx2x.c: In function ‘bnx2x_hc_ack_sb’:
../drivers/net/bnx2x/bnx2x.h:1528:35:
         warning: ‘igu_ack’ is used uninitialized [-Wuninitialized]
 #define REG_WR32(sc, offset, val) bnx2x_reg_write32(sc, (offset), val)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/bnx2x/bnx2x.h:1531:33:
note: in expansion of macro ‘REG_WR32’
 1531 | #define REG_WR(sc, offset, val) REG_WR32(sc, offset, val)
      |                                 ^~~~~~~~
../drivers/net/bnx2x/bnx2x.h:1916:9: note: in expansion of macro ‘REG_WR’
 1916 |         REG_WR(sc, hc_addr, *val);
      |         ^~~~~~
../drivers/net/bnx2x/bnx2x.h:1905:33: note: ‘igu_ack’ declared here
 1905 |         struct igu_ack_register igu_ack;
      |                                 ^~~~~~~

REG_WR32 requires 'uint32_t', use union instead of cast to 'uint32_t'.

Bugzilla ID: 692
Fixes: 38dff79ba736 ("net/bnx2x: update HSI")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
3 years agonet/bnx2x: fix build with GCC 11
Ferruh Yigit [Tue, 11 May 2021 13:14:32 +0000 (14:14 +0100)]
net/bnx2x: fix build with GCC 11

Reproduced with '--buildtype=debugoptimized' config,
compiler version: gcc (GCC) 12.0.0 20210509 (experimental)

Build error:
In file included from ../drivers/net/bnx2x/bnx2x_rxtx.c:8:
../drivers/net/bnx2x/bnx2x_rxtx.c: In function ‘bnx2x_upd_rx_prod_fast’:
../drivers/net/bnx2x/bnx2x.h:1528:35:
    warning: ‘rx_prods’ is used uninitialized [-Wuninitialized]
 #define REG_WR32(sc, offset, val) bnx2x_reg_write32(sc, (offset), val)
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/bnx2x/bnx2x.h:1531:33:
note: in expansion of macro ‘REG_WR32’
 1531 | #define REG_WR(sc, offset, val) REG_WR32(sc, offset, val)
      |                                 ^~~~~~~~
../drivers/net/bnx2x/bnx2x_rxtx.c:331:9:
note: in expansion of macro ‘REG_WR’
  331 |         REG_WR(sc, fp->ustorm_rx_prods_offset, val[0]);
      |         ^~~~~~
../drivers/net/bnx2x/bnx2x_rxtx.c:324:40: note: ‘rx_prods’ declared here
  324 |         struct ustorm_eth_rx_producers rx_prods = { 0 };
      |                                        ^~~~~~~~

REG_WR32 requires 'uint32_t', use union instead of cast to 'uint32_t'.

Bugzilla ID: 692
Fixes: 38dff79ba736 ("net/bnx2x: update HSI")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
3 years agonet/igc: fix speed configuration
Alvin Zhang [Wed, 12 May 2021 08:28:26 +0000 (16:28 +0800)]
net/igc: fix speed configuration

Fixed speed mode is not supported currently, this patch
removes configurations for this mode and adds fault handling
for ETH_LINK_SPEED_FIXED.

Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
3 years agonet/i40e: fix VF RSS configuration
Alvin Zhang [Wed, 12 May 2021 09:23:11 +0000 (17:23 +0800)]
net/i40e: fix VF RSS configuration

The kernel driver supports VF RSS configuration message
"VIRTCHNL_OP_GET_RSS_HENA_CAPS and VIRTCHNL_OP_SET_RSS_HENA",
this patch adds PMD support for these messages.

Fixes: b81295c474b0 ("net/i40e: add user callback for VF to PF message")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/ice: fix VSI array out of bounds access
Jie Wang [Wed, 12 May 2021 03:14:07 +0000 (03:14 +0000)]
net/ice: fix VSI array out of bounds access

In the loop, when the index of array "vsi->rss_key" is equal
to "vsi->rss_key_size", the array will be accessed out of bounds.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix Tx context descriptor
Beilei Xing [Wed, 12 May 2021 08:10:14 +0000 (16:10 +0800)]
net/iavf: fix Tx context descriptor

The QW0 of Tx context descriptor should be reset to 0, otherwise the
previous hardware writeback value may pollute the next context descriptor
write.

Fixes: a2b29a7733ef ("net/avf: enable basic Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix offload flag checking in simple Tx
Alvin Zhang [Tue, 11 May 2021 08:45:31 +0000 (16:45 +0800)]
net/i40e: fix offload flag checking in simple Tx

Tx offload flags 'PKT_TX_IPV6, PKT_TX_IPV4, PKT_TX_OUTER_IPV6,
PKT_TX_OUTER_IPV4' are supported in simple datapath.

This patch removes these offload flags from packet checking in simple
Tx datapath and defines 2 macro I40E_TX_OFFLOAD_SIMPLE_SUP_MASK
and I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.

Fixes: 146ffa81d05e ("net/i40e: add Tx preparation for simple Tx datapath")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/ena: disable ops not supported by secondary process
Stanislaw Kardach [Wed, 12 May 2021 10:13:46 +0000 (12:13 +0200)]
net/ena: disable ops not supported by secondary process

For dev_ops not supported by the secondary process, either return -EPERM
or return without doing anything. In both cases log a warning.

It's still application's responsibility to avoid calls like that and
those changes are for debugging/informational purposes.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena: make ethdev references multi-process safe
Stanislaw Kardach [Wed, 12 May 2021 10:13:45 +0000 (12:13 +0200)]
net/ena: make ethdev references multi-process safe

rte_pci_device and rte_eth_dev are process-local structures. Therefore
ena_adapter::pdev and ena_adapter::rte_dev cannot be used universally.

Both ena_timer_wd_callback and ena_interrupt_handler_rte needs access to
the rte_eth_dev, but as they are being setup and executed in the primary
process, it is safe to pass there the same pointer, which is used for
the device configuration.

In all other cases, except the eth_ena_dev_init(), the rte_eth_dev_data
is used instead.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena: indicate Rx RSS hash presence
Michal Krawczyk [Wed, 12 May 2021 10:13:44 +0000 (12:13 +0200)]
net/ena: indicate Rx RSS hash presence

To make it possible to the app to determine if the hash was calculated
for the packet or not, the PKT_RX_RSS_HASH should be set in the mbuf's
ol_flags.

As the PMD wasn't setting that, the application couldn't check if there
is a hash in a proper way.

The hash is valid only if it's UDP or TCP and the IP packet wasn't
fragmented.

Fixes: e5df9f33db00 ("net/ena: fix passing RSS hash to mbuf")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
3 years agoapp/testpmd: support action meter color
Haifei Luo [Wed, 12 May 2021 10:49:33 +0000 (13:49 +0300)]
app/testpmd: support action meter color

Currently action RTE_FLOW_ACTION_TYPE_METER_COLOR is defined.
Add the CLI for this action:  color type (types)
There are three types: green, yellow and red.

Example for the new policy meter CLIs:
   add port meter policy 0 1 g_actions color type green / end y_actions
     color type yellow / end r_actions color type red / end

In the above command, the action type is
RTE_FLOW_ACTION_TYPE_METER_COLOR, the meter policy action list:
green -> green, yellow -> yellow, red -> red.

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agovhost: fix sign extension in async packed ring
Cheng Jiang [Wed, 12 May 2021 02:30:56 +0000 (02:30 +0000)]
vhost: fix sign extension in async packed ring

Change the variable type in store_dma_desc_info_packed() to fix
suspicious implicit sign extension.

Coverity issue: 370608, 370610, 370612
Fixes: 873e8dad6f49 ("vhost: support packed ring in async datapath")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
3 years agovhost: fix sign extension in async split ring
Cheng Jiang [Wed, 12 May 2021 02:30:41 +0000 (02:30 +0000)]
vhost: fix sign extension in async split ring

Change the variable type in store_dma_desc_info_split() to fix
suspicious implicit sign extension.

Coverity issue: 370604, 370607, 370609
Fixes: 3d6cb86b0de5 ("vhost: refactor async split ring functions")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
3 years agonet/ark: fix control thread argument
Ed Czeck [Tue, 11 May 2021 20:58:54 +0000 (16:58 -0400)]
net/ark: fix control thread argument

Thread argument changed to wrong value during thread name addition,
fixing that bug.

Fixes: fdefe038eb9b ("net/ark: set generator delay thread name")

Signed-off-by: Ed Czeck <ed.czeck@atomicrules.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/mlx5: fix tunnel offload private items location
Gregory Etelson [Thu, 6 May 2021 09:57:51 +0000 (12:57 +0300)]
net/mlx5: fix tunnel offload private items location

Tunnel offload API requires application to query PMD for specific flow
items and actions. Application uses these PMD specific elements to
build flow rules according to the tunnel offload model.
The model does not restrict private elements location in a flow rule,
but the current MLX5 PMD implementation expects that tunnel offload
rule will begin with PMD specific elements.
The patch removes that placement limitation.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/enic: enable GENEVE offload via VNIC configuration
John Daley [Tue, 11 May 2021 19:25:26 +0000 (12:25 -0700)]
net/enic: enable GENEVE offload via VNIC configuration

The admin-configured vNIC settings (i.e. via CIMC or UCSM) now include
Geneve offload. Use that setting to decide whether to enable or
disable Geneve offload and remove the devarg 'geneve-opt'.

Also, the firmware now allows the driver to change the Geneve port
number. So extend udp_tunnel_port_{add,del} to accept Geneve port, in
addition to VXLAN.

Fixes: 93fb21fdbe23 ("net/enic: enable overlay offload for VXLAN and GENEVE")
Cc: stable@dpdk.org
Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
3 years agonet/ice: fix leak on thread termination
David Marchand [Tue, 11 May 2021 11:33:58 +0000 (13:33 +0200)]
net/ice: fix leak on thread termination

A terminated pthread should be joined or detached so that its associated
resources are released.

The "ice-reset-<vf_id>" threads are used to service some reset task in
the background, but they are never joined by the thread that created
them.
The easiest solution is to detach new threads.

The Windows EAL did not provide a pthread_detach wrapper but there is no
resource to release for Windows threads, so add an empty wrapper.

Fixes: 3b3757bda3c3 ("net/ice: get VF hardware index in DCF")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet/ark: fix leak on thread termination
David Marchand [Tue, 11 May 2021 11:33:57 +0000 (13:33 +0200)]
net/ark: fix leak on thread termination

A terminated pthread should be joined or detached so that its associated
resources are released.

The "ark-delay-pg" thread is just used to delay some task but it is never
joined by the thread that created it.
The easiest solution is to detach the new thread.

Fixes: 727b3fe292bc ("net/ark: integrate PMD")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ed Czeck <ed.czeck@atomicrules.com>
3 years agoapp/testpmd: fix tunnel offload flows cleanup
Gregory Etelson [Tue, 11 May 2021 08:03:31 +0000 (11:03 +0300)]
app/testpmd: fix tunnel offload flows cleanup

Tunnel offload model requires application to obtain PMD related flow
items or actions to construct a flow rule. These elements acquire
internal PMD flow resources that must be explicitly released.

The patch destroys tunnel offload PMD resources after flow creation
failure.

Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/hns3: fail setting FEC if one bit mode is not supported
Chengwen Feng [Mon, 10 May 2021 13:38:13 +0000 (21:38 +0800)]
net/hns3: fail setting FEC if one bit mode is not supported

If the FEC mode was not supported, it should return error code.

This patch also adds a space when log error info.

Fixes: 9bf2ea8dbc65 ("net/hns3: support FEC")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix ordering in secondary process initialization
Chengwen Feng [Mon, 10 May 2021 13:38:12 +0000 (21:38 +0800)]
net/hns3: fix ordering in secondary process initialization

The memory barrier is used to ensure that the response is returned
only after the Tx/Rx function is set, it should place after the Rx/Tx
function is set.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix secondary process request start/stop Rx/Tx
Chengwen Feng [Mon, 10 May 2021 13:38:11 +0000 (21:38 +0800)]
net/hns3: fix secondary process request start/stop Rx/Tx

This secondary process should not send request to start/stop Rx/Tx,
this patch fixes it.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix mailbox message ID in log
Chengwen Feng [Mon, 10 May 2021 13:38:10 +0000 (21:38 +0800)]
net/hns3: fix mailbox message ID in log

The mailbox message id is uint8_t, but the unsupported mailbox message
id was logged by uint16.

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix TM QCN error event report by MSI-X
Chengwen Feng [Sat, 8 May 2021 07:40:57 +0000 (15:40 +0800)]
net/hns3: fix TM QCN error event report by MSI-X

The TM QCN error event should report by RAS other than MSIX.

Also this patch adds fifo int enable configuration before the TM QCN
error event is enabled.

Fixes: f53a793bb7c2 ("net/hns3: add more hardware error types")
Fixes: 3903c05382c5 ("net/hns3: remove read when enabling TM QCN error event")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/txgbe: fix QinQ strip
Jiawen Wu [Sat, 8 May 2021 06:35:26 +0000 (14:35 +0800)]
net/txgbe: fix QinQ strip

Support to enable and disable QINQ hardware strip, when configure VLAN
offload with QINQ strip mask. If there are packets have QINQ tag to RSS,
users should enable QINQ strip before configuring the RSS.

Fixes: 220b0e49bc47 ("net/txgbe: support VLAN")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
3 years agonet/hns3: fix querying flow director counter for out param
Chengwen Feng [Fri, 7 May 2021 09:08:18 +0000 (17:08 +0800)]
net/hns3: fix querying flow director counter for out param

The hardware doesn't support counting the number of bytes that through
the fdir rule. Therefore, the corresponding out parameters (e.g.
bytes_set/bytes) is set to zero.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix VF alive notification after config restore
Hongbo Zheng [Fri, 7 May 2021 09:08:17 +0000 (17:08 +0800)]
net/hns3: fix VF alive notification after config restore

Currently in the VF reset scenario, the VF performs the set
alive operation before restoring the configuration completed,
which may cause the hardware to work in an abnormal state.

This patch fix this problem by set VF alive after restoring
the configuration is completed.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: clear hash map on flow director clear
Chengwen Feng [Fri, 7 May 2021 09:08:16 +0000 (17:08 +0800)]
net/hns3: clear hash map on flow director clear

The fdir hash map hold the pointers of fdir rule elements, it needs to
be set to NULL when clear all fdir rules.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix log on flow director clear
Chengwen Feng [Fri, 7 May 2021 09:08:15 +0000 (17:08 +0800)]
net/hns3: fix log on flow director clear

If clear FDIR rules fail, the error code was logged, but the error code
was useless because it was the sum of all fail code.

This patch fixes it by log the success cnt and fail cnt.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Fixes: 8eed8acc812e ("net/hns3: add error code to some logs")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: return error on PCI config write failure
Chengwen Feng [Fri, 7 May 2021 09:08:14 +0000 (17:08 +0800)]
net/hns3: return error on PCI config write failure

This patch returns error code when calling rte_pci_write_config() API.

Fixes: 6dd32ded17d8 ("net/hns3: check PCI config space write")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agodoc: add more description in hns3 guide
Min Hu (Connor) [Thu, 6 May 2021 13:30:12 +0000 (21:30 +0800)]
doc: add more description in hns3 guide

This patch adds more description for hns3 PMD document, that is:
'Sample Application Notes', 'Statistics','Performance tuning'.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/af_xdp: fix build with Linux < 5.4
Ciara Loftus [Mon, 10 May 2021 08:47:54 +0000 (09:47 +0100)]
net/af_xdp: fix build with Linux < 5.4

Prior to this change, two implementations of rx_syscall_handler
existed although only one was needed (for the zero copy path which
is only available from kernel 5.4 and onwards). Remove the second
definition from compat.h and move the first definition back to where
it is called in the Rx function. Doing this removes a build warning
on kernels before 5.4 which complained about the second function
being defined but not used.

Fixes: 2aa51cdd559e ("net/af_xdp: fix trigger for syscall on Tx")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
3 years agonet/nfp: fix reporting of RSS capabilities
Heinrich Kuhn [Mon, 10 May 2021 16:45:50 +0000 (18:45 +0200)]
net/nfp: fix reporting of RSS capabilities

Before this change the dev_infos callback always reported RSS
capabilities regardless of whether the capability is supported by the
device or not. First check the capabilities field in the BAR of the
device and advertise RSS functionality accordingly.

Fixes: 8b945a7f7dcb ("drivers/net: update Rx RSS hash offload capabilities")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
3 years agonet/ena: update version to v2.3.0
Michal Krawczyk [Tue, 11 May 2021 06:45:54 +0000 (08:45 +0200)]
net/ena: update version to v2.3.0

This version update contains:
  * memcpy mapping to the dpdk-optimized version.
  * ena_com (HAL) update to the latest version (from 18.09.2020).
  * Bug fixes for the large LLQ headers and devargs parsing.
  * Bug fix for the default ring size.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
3 years agonet/ena: report default ring size
Stanislaw Kardach [Tue, 11 May 2021 06:45:53 +0000 (08:45 +0200)]
net/ena: report default ring size

Remove invalid ring size alignment logic and add default Rx and Tx port
ring sizes to the device info spec.

The logic in lines 1297 and 1371 is invalid. The
RTE_ETH_DEV_FALLBACK_RX_RINGSIZE (and the TX counterpart) is a value
that rte_eth_rx_queue_setup() will set if
dev_info.default_rxportconf.ring_size is 0 and user provided 0 in
nb_rx_desc argument. However the current code treats it as a hint for
the PMD to change the ring size to internal defaults.

Additionally since the ENA_DEFAULT_RING_SIZE is defined, report it in
the device capabilities so that both rte_ethdev code and the user can
utilize it for device configuration.

Fixes: ea93d37eb49d ("net/ena: add HW queues depth setup")
Cc: stable@dpdk.org
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena: handle spurious wakeups in wait event
Stanislaw Kardach [Tue, 11 May 2021 06:45:50 +0000 (08:45 +0200)]
net/ena: handle spurious wakeups in wait event

pthread_cond_timedwait() may spuriously wakeup according to POSIX.
Therefore it is required to check whether predicate is actually true
before finishing the waiting loop.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena: remove endian swap functions
Stanislaw Kardach [Tue, 11 May 2021 06:45:49 +0000 (08:45 +0200)]
net/ena: remove endian swap functions

swap*_*_le() functions are not used anywhere and besides there are rte
alternatives already present.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena: fix crash with unsupported device argument
Michal Krawczyk [Tue, 11 May 2021 06:45:47 +0000 (08:45 +0200)]
net/ena: fix crash with unsupported device argument

As the documentation of rte_kvargs_parse() states, the valid_keys
argument must be NULL terminated. Lack of this feature may cause
segmentation fault if the passed devarg will be different then the
supported value.

Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/ena: fix parsing of large LLQ header device argument
Igor Chauskin [Tue, 11 May 2021 06:45:46 +0000 (08:45 +0200)]
net/ena: fix parsing of large LLQ header device argument

The code incorrectly checked the return value of comparison when parsing
the argument key name. The return value of strcmp should be compared
to 0 to identify a match.

Fixes: 8a7a73f26cc9 ("net/ena: support large LLQ headers")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
3 years agonet/ena/base: adjust to latest ena-com
Amit Bernstein [Tue, 11 May 2021 06:45:45 +0000 (08:45 +0200)]
net/ena/base: adjust to latest ena-com

1. As memzone uses unique names, changed alloc coherent macro to use
   64 bit size atomic variable to increase the memzone name space
2. "handle" param name change to be consistent with other macros
3. Variable definition displacement
4. Backslash alignment to column 80

Signed-off-by: Amit Bernstein <amitbern@amazon.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
3 years agonet/ena/base: prefetch cache with intention to write
Michal Krawczyk [Tue, 11 May 2021 06:45:44 +0000 (08:45 +0200)]
net/ena/base: prefetch cache with intention to write

As in the v20.11 rte_prefetch0_write API was added, it should be used
in the platform file for the definition of the macro prefetchw, instead
of using simply prefetch0.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
3 years agonet/ena/base: remove mutable RSS from host info
Michal Krawczyk [Tue, 11 May 2021 06:45:43 +0000 (08:45 +0200)]
net/ena/base: remove mutable RSS from host info

This feature wasn't used by any of the drivers. Because of that, it was
removed.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Shay Agroskin <shayagr@amazon.com>
3 years agonet/ena/base: remove indirection table from features context
Michal Krawczyk [Tue, 11 May 2021 06:45:42 +0000 (08:45 +0200)]
net/ena/base: remove indirection table from features context

The RSS indirection table shouldn't be included as a part of the
device features context.

If the driver has to acquire it, it can be done using the separate API
whenever the RSS configuration is needed.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
3 years agonet/ena/base: destroy multiple wait events
Michal Krawczyk [Tue, 11 May 2021 06:45:41 +0000 (08:45 +0200)]
net/ena/base: destroy multiple wait events

Although the ENA DPDK PMD doesn't have to perform any actions for
destroying the wait event, some other platforms have to.

The macro "ENA_WAIT_EVENT_DESTROY" was renamed to
"ENA_WAIT_EVENTS_DESTROY" and also whole implementation responsible for
that was moved to a separate function for better readability.

Fixes: 3adcba9a8987 ("net/ena: update HAL to the newer version")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
3 years agonet/ena/base: fix type conversions by explicit casting
Michal Krawczyk [Tue, 11 May 2021 06:45:40 +0000 (08:45 +0200)]
net/ena/base: fix type conversions by explicit casting

To silence error messages from the static code analysis, make the type
conversions explicit where they're intended.

Also fix the type for the DMA width value.

Fixes: 99ecfbf845b3 ("ena: import communication layer")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
3 years agonet/ena/base: improve style and comments
Michal Krawczyk [Tue, 11 May 2021 06:45:39 +0000 (08:45 +0200)]
net/ena/base: improve style and comments

List of changes:
  * Comment style was adjusted for the functions
  * The keys_num at "struct ena_admin_feature_rss_flow_hash_control" was
    renamed to the key_parts to better describe it's meaning
  * The RSS indirection table was called "REDIRECTION" -> changed to
    INDIRECTION
  * Change AENQ field "syndrom" -> "syndrome"
  * Calculate number of the RSS key parts or whole key by using the
    common way: sizeof of the first element of the RSS key
  * Add description of the "enum ena_admin_aq_feature_id"
  * Rename "map_rx_buf_bidirectional" field as "rx_buf_mirroring"
  * Other minor style fixes (remove extra spaces, add missing line break,
    improve indentation)
  * Remove unused macros ENA_ADMIN_EXTRA_PROPERTIES_*
  * Restructure the "if {} else if {} else" conditional statement for
    setting up the meta descriptor

Fixes: 99ecfbf845b3 ("ena: import communication layer")
Fixes: b68309be44c0 ("net/ena/base: update communication layer for the ENAv2")
Fixes: b2b02edeb0d6 ("net/ena/base: upgrade HAL for new HW features")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
3 years agonet/ena/base: add device argument to logging macros
Michal Krawczyk [Tue, 11 May 2021 06:45:38 +0000 (08:45 +0200)]
net/ena/base: add device argument to logging macros

Some platforms may make use of the device argument to make the logs more
verbose and specific for the appropriate device.

As it's not used by the ENA DPDK PMD for the logging, the type is just
defined, but never used.

It may be reconsidered to change this in the future by adding port ID
to the message logs, but as for now the logging behavior won't change.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
3 years agonet/ena/base: unify parameter names for functions
Michal Krawczyk [Tue, 11 May 2021 06:45:37 +0000 (08:45 +0200)]
net/ena/base: unify parameter names for functions

Instead of using 'queue' for struct ena_com_admin_queue and 'dev' for
struct ena_com_dev variables, use more descriptive 'admin_queue' and
'ena_dev'.

This also unifies the names of variables of the type struct ena_com_dev
in the driver.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
3 years agonet/ena: switch memcpy to optimized version
Igor Chauskin [Tue, 11 May 2021 06:45:36 +0000 (08:45 +0200)]
net/ena: switch memcpy to optimized version

memcpy is now mapped to rte_memcpy macro on x86 architectures.

Fixes: 9ba7981ec992 ("ena: add communication layer for DPDK")
Cc: stable@dpdk.org
Signed-off-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Artur Rojek <ar@semihalf.com>
3 years agonet/mlx5/linux: fix firmware version
Kamil Vojanec [Fri, 5 Feb 2021 09:00:45 +0000 (10:00 +0100)]
net/mlx5/linux: fix firmware version

This patch fixes a bug where firmware version was not
copied from ibv_device_attr structure into mlx5_dev_attr
structure, resulting in inability to read firmware
version.

Fixes: e85f623e13ea ("net/mlx5: remove attributes dependency on Verbs")
Cc: stable@dpdk.org
Signed-off-by: Kamil Vojanec <xvojan00@stud.fit.vutbr.cz>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5/linux: fix missed Rx packet stats
Viacheslav Ovsiienko [Wed, 28 Apr 2021 09:31:45 +0000 (12:31 +0300)]
net/mlx5/linux: fix missed Rx packet stats

There was a typo - the device context was wrongly provided
instead of counter's one for the DevX query operation.

Fixes: e6988afdc75a ("net/mlx5: fix imissed statistics")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix Tx queue doorbell record field offset
Viacheslav Ovsiienko [Wed, 28 Apr 2021 09:18:19 +0000 (12:18 +0300)]
net/mlx5: fix Tx queue doorbell record field offset

If the Send Queue (backing one for PMD Tx queue) the was
created with DevX API the doorbell record offset for the
producer index field was incorrect. If hardware missed the
doorbell register write event the wrong content of doorbell
record might cause queue malfunction. For the Send Queues
created with Verbs API the doorbell record offset was
configured correctly.

Fixes: 86d259cec852 ("net/mlx5: separate Tx queue object creations")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix RSS flow item expansion for GRE key
Jiawei Wang [Fri, 7 May 2021 09:42:12 +0000 (12:42 +0300)]
net/mlx5: fix RSS flow item expansion for GRE key

The support of RSS expansion for the flows with IPv6 GRE item was added
to mlx5 PMD. And the GRE KEY item support in expansion was missed
and the flows with GRE and GRE KEY items were expanded in the wrong
way causing the flow creation failure.

This patch adds the RSS expansion support for GRE KEY and mlx5 PMD
performs RSS expansion correctly.

Fixes: 048f0d45e342 ("net/mlx5: support RSS expansion for IPv6 GRE")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>