dpdk.git
2 years agonet/bnxt: fix Rx burst size constraint
Lance Richardson [Mon, 24 May 2021 18:59:50 +0000 (14:59 -0400)]
net/bnxt: fix Rx burst size constraint

The burst receive function should return all packets currently
present in the receive ring up to the requested burst size,
update vector mode receive functions accordingly.

Fixes: 398358341419 ("net/bnxt: support NEON")
Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
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: refactor HW ptype mapping table
Lance Richardson [Mon, 24 May 2021 18:59:49 +0000 (14:59 -0400)]
net/bnxt: refactor HW ptype mapping table

Make the definition of the table used to map hardware packet type
information to DPDK packet type more generic.

Add macro definitions for constants used in creating table
indices, use these to eliminate raw constants in code.

Add build-time assertions to validate ptype mapping constants.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: check access to possible null pointer
Thierry Herbelot [Mon, 24 May 2021 09:00:38 +0000 (11:00 +0200)]
net/bnxt: check access to possible null pointer

Check that pointers are valid before using them.

Fixes: 7bc8e9a227ccb ("net/bnxt: support async link notification")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agomalloc: fix size annotation for NUMA-aware realloc
David Marchand [Thu, 10 Jun 2021 12:09:22 +0000 (14:09 +0200)]
malloc: fix size annotation for NUMA-aware realloc

__rte_alloc_size is mapped to compiler alloc_size attribute.

Quoting gcc documentation:
"""
alloc_size
    The alloc_size attribute is used to tell the compiler that the
    function return value points to memory, where the size is given by
    one or two of the functions parameters. GCC uses this information
    to improve the correctness of __builtin_object_size.

    The function parameter(s) denoting the allocated size are specified
    by one or two integer arguments supplied to the attribute.
    The allocated size is either the value of the single function
    argument specified or the product of the two function arguments
    specified. Argument numbering starts at one.
"""

In rte_realloc_socket case, only 'size' matters.

Note: this has been spotted by Maxime trying to use rte_realloc_socket
and compiling with gcc 11.

Fixes: 17b347dab769 ("malloc: add alloc_size attribute to functions")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agobitmap: fix buffer overrun in bitmap init
Ivan Ilchenko [Wed, 2 Jun 2021 09:49:22 +0000 (12:49 +0300)]
bitmap: fix buffer overrun in bitmap init

Bitmap initialization function is allowed to memset()
caller-provided buffer with number of bytes exceeded
this buffer size. This happens due to wrong comparison
sign between buffer size and number of bytes required
to initialize bitmap.

Fixes: 602c9ca33a4 ("sched: bitmap is now dynamically allocated")
Cc: stable@dpdk.org
Reported-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agonet/i40e: enable PCI bus master after reset
Haiyue Wang [Mon, 24 May 2021 01:23:45 +0000 (09:23 +0800)]
net/i40e: enable PCI bus master after reset

The VF reset can be triggered by the PF reset event, then the PCI bus
master will be cleared, the VF will be not allowed to issue any Memory
or I/O Requests.

So after the reset event is detected, always enable the PCI bus master.
And if failed, the device or system may be in an invalid state, so keep
the VF reset state to mark it as I/O error.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/iavf: enable PCI bus master after reset
Haiyue Wang [Mon, 24 May 2021 01:23:44 +0000 (09:23 +0800)]
net/iavf: enable PCI bus master after reset

The VF reset can be triggered by the PF reset event, then the PCI bus
master will be cleared, the VF will be not allowed to issue any Memory
or I/O Requests.

So after the reset event is detected, always enable the PCI bus master.
And if failed, the device or system may be in an invalid state, so keep
the VF reset state to mark it as I/O error.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agobus/pci: configure PCI bus master
Haiyue Wang [Mon, 24 May 2021 01:23:43 +0000 (09:23 +0800)]
bus/pci: configure PCI bus master

Add the API to set 'Bus Master Enable' bit to be enabled or disabled in
the PCI command register.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agotelemetry: remove static limit on callbacks count
David Marchand [Thu, 6 May 2021 08:27:54 +0000 (10:27 +0200)]
telemetry: remove static limit on callbacks count

This code is not performance sensitive and can be switched to dynamic
allocations.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2 years agograph: fix null dereference in stats
Hongbo Zheng [Thu, 6 May 2021 07:16:27 +0000 (15:16 +0800)]
graph: fix null dereference in stats

In function 'stats_mem_init', pointer 'stats' should
be confirmed not null before memset it.

Fixes: af1ae8b6a32c ("graph: implement stats")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agograph: fix memory leak in stats
Hongbo Zheng [Thu, 6 May 2021 07:16:26 +0000 (15:16 +0800)]
graph: fix memory leak in stats

Fix function 'stats_mem_populate' return without
free dynamic memory referenced by 'stats'.

Fixes: af1ae8b6a32c ("graph: implement stats")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agotest: remove strict timing requirements some tests
Aaron Conole [Thu, 3 Jun 2021 15:22:34 +0000 (11:22 -0400)]
test: remove strict timing requirements some tests

The tests 'alarm_autotest' and 'cycles_autotest' rely on the underlying
system having very accurate and precise timing.  On systems where the
timing isn't as rigid, or the load is particularly high, these tests are
unreliable since the wake latency from the scheduler can be high enough
to miss the timing window.

Remove the timing related tests from the test suites.  These tests now
ensure the add/remove callback infrastructure unit tests, but drop the
waits and reliance on system timing and load.

This avoids FAIL on various testing infrastructures.

Signed-off-by: Aaron Conole <aconole@redhat.com>
3 years agoversion: 21.08-rc0
David Marchand [Fri, 21 May 2021 16:45:21 +0000 (18:45 +0200)]
version: 21.08-rc0

Start a new release cycle with empty release notes.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoversion: 21.05.0
Thomas Monjalon [Fri, 21 May 2021 15:53:33 +0000 (17:53 +0200)]
version: 21.05.0

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: update release notes for 21.05
John McNamara [Thu, 20 May 2021 23:24:09 +0000 (23:24 +0000)]
doc: update release notes for 21.05

Fix grammar, spelling and formatting of DPDK 21.05 release notes.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
3 years agodoc: update backport guidelines
Kevin Traynor [Fri, 19 Feb 2021 11:17:11 +0000 (11:17 +0000)]
doc: update backport guidelines

Updating the docs to elaborate on the stable release
characteristics and better document the current practice
about new features in stable releases.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
3 years agodoc: improve lstopo tip
Thomas Monjalon [Mon, 8 Mar 2021 22:25:52 +0000 (23:25 +0100)]
doc: improve lstopo tip

The tool lstopo from hwloc package can provide a graphical
or textual view.
In its textual form, the option --merge gives a shorter summary
which fits well with the DPDK need.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: explain steps for improved code spell checking
Thomas Monjalon [Wed, 3 Feb 2021 10:30:57 +0000 (11:30 +0100)]
doc: explain steps for improved code spell checking

The script build-dict.sh was added in DPDK 20.08.
It generates a better dictionary for spell checking
done via checkpatch.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agodevtools: check %l format specifier
Ferruh Yigit [Wed, 19 May 2021 19:24:49 +0000 (21:24 +0200)]
devtools: check %l format specifier

%lx or %llx tend to be wrong for 32-bit platform
if used for fixed size variable like uint64_t.
A checkpatch warning will avoid this common mistake.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoevent/dlb2: select scalar dequeue by default
Timothy McDaniel [Fri, 21 May 2021 09:11:37 +0000 (11:11 +0200)]
event/dlb2: select scalar dequeue by default

Optimized dequeue using x86 vector instructions was added
in 21.05, but due to limited testing the default has been
changed back to the scalar mode implementation. The vector mode
implementation can be enabled via the devargs option
"vector_opts_enabled=<y/Y>".

Fixes: 000a7b8e7582 ("event/dlb2: optimize dequeue operation")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
3 years agoevent/dlb2: fix extraction of HW scheduling type
Timothy McDaniel [Fri, 21 May 2021 09:11:36 +0000 (11:11 +0200)]
event/dlb2: fix extraction of HW scheduling type

The HW scheduling type was not being extracted properly
in the vector optimized dequeue path. It was also not
being recorded in the xstats.

Fixes: 000a7b8e7582 ("event/dlb2: optimize dequeue operation")

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
3 years agodoc: fix runtime options in DLB2 guide
Timothy McDaniel [Fri, 21 May 2021 09:11:35 +0000 (11:11 +0200)]
doc: fix runtime options in DLB2 guide

Convert to PCI "--allow" devarg format.
The documentation was previously using the "--vdev" form, which cannot
be used with the DLB2 PF PMD.

Fixes: f3cad285bb88 ("event/dlb2: add infos get and configure")
Fixes: f7cc194b0f7e ("event/dlb2: add enqueue and its burst variants")
Fixes: a2e4f1f5e79f ("event/dlb2: add dequeue and its burst variants")
Fixes: 95aa7101cd3c ("doc: add some features to DLB2 guide")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
3 years agoevent/dlb2: remove references to deferred scheduling
Timothy McDaniel [Fri, 21 May 2021 09:11:34 +0000 (11:11 +0200)]
event/dlb2: remove references to deferred scheduling

Deferred scheduling is a DLB v1.0 feature, and is not valid for
DLB v2.0 or v2.5.

Fixes: bc62748bd7d4 ("event/dlb2: add private data structures and constants")
Fixes: a2e4f1f5e79f ("event/dlb2: add dequeue and its burst variants")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
3 years agodevtools: warn about old release notes updates
David Marchand [Thu, 20 May 2021 10:39:38 +0000 (12:39 +0200)]
devtools: warn about old release notes updates

Touching release notes should only be for the current version.

Signed-off-by: David Marchand <david.marchand@redhat.com>
3 years agodoc: support IPsec Multi-buffer lib v1.0
Pablo de Lara [Wed, 5 May 2021 15:58:42 +0000 (15:58 +0000)]
doc: support IPsec Multi-buffer lib v1.0

Updated AESNI MB and AESNI GCM, KASUMI, ZUC and SNOW3G PMD documentation
guides with information about the latest Intel IPSec Multi-buffer
library supported.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
3 years agodoc: add GCC 11 and clang 12 support to release notes
Kevin Traynor [Thu, 20 May 2021 11:18:21 +0000 (12:18 +0100)]
doc: add GCC 11 and clang 12 support to release notes

Note added support for GCC 11 and clang 12 in the
DPDK 21.05 release notes.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
3 years agotest: fix build with GCC 11
Kevin Traynor [Thu, 20 May 2021 11:06:12 +0000 (12:06 +0100)]
test: fix build with GCC 11

GCC 11 complains that 'a' is uninitialized.

../dpdk/app/test/test_prefetch.c: In function 'test_prefetch':
../dpdk/app/test/test_prefetch.c:25:9:
error: 'a' may be used uninitialized [-Werror=maybe-uninitialized]
   25 |         rte_prefetch0(&a);
      |         ^~~~~~~~~~~~~~~~~

Fix by initializing 'a'.

Bugzilla ID: 714
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agodoc: clarify PMD order in release notes
Ferruh Yigit [Wed, 12 May 2021 16:04:43 +0000 (17:04 +0100)]
doc: clarify PMD order in release notes

PMD updates are expected in alphabetical order based on their vendor
name. Clarify this expectation in the section comment.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoversion: 21.05-rc4
Thomas Monjalon [Wed, 19 May 2021 21:38:41 +0000 (23:38 +0200)]
version: 21.05-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: show how to include code in guides
Conor Walsh [Thu, 6 May 2021 16:40:59 +0000 (16:40 +0000)]
doc: show how to include code in guides

Currently the documentation describes how to add code snippets to the
docs using code blocks. This can be problematic as the code snippets
in the docs may fall out of sync with the actual code it is referencing
within DPDK. This patch adds instructions to the contribution guide
about how to include code in the docs using literalinclude which will
dynamically get the code from source when the docs are generated. This
will help to ensure that the code within the docs is up to date and not
out of sync with the actual code.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoethdev: fix comments of packet integrity flow item
Thomas Monjalon [Wed, 19 May 2021 17:33:16 +0000 (19:33 +0200)]
ethdev: fix comments of packet integrity flow item

The Doxygen comments are placed before the related lines,
but the markers were /**< instead of /**

The struct rte_flow_item_integrity did not appear in Doxygen output
because there was no general comment for the struct.

Fixes: b10a421a1f3b ("ethdev: add packet integrity check flow rules")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/memif: fix Tx bps statistics for zero-copy
Tianyu Li [Mon, 12 Apr 2021 08:22:31 +0000 (16:22 +0800)]
net/memif: fix Tx bps statistics for zero-copy

Fix the missing Tx-bps counter for memif zero-copy mode
Before
  Rx-pps:      6891450          Rx-bps:   3528438928
  Tx-pps:      6891482          Tx-bps:            0
After
  Throughput (since last show)
  Rx-pps:     11157056          Rx-bps:   5712413016
  Tx-pps:     11157056          Tx-bps:   5712413016

Fixes: 43b815d88188 ("net/memif: support zero-copy slave")
Cc: stable@dpdk.org
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
3 years agocommon/sfc_efx/base: add missing MCDI response length checks
Andy Moreton [Tue, 18 May 2021 15:10:12 +0000 (18:10 +0300)]
common/sfc_efx/base: add missing MCDI response length checks

Fixes: 6f619653b9b1 ("net/sfc/base: import MCDI implementation")
Fixes: e7cd430c864f ("net/sfc/base: import SFN7xxx family support")
Fixes: 94190e3543bf ("net/sfc/base: import SFN8xxx family support")
Fixes: 34285fd0891d ("common/sfc_efx/base: add match spec validate API")
Fixes: e61baa82e64b ("common/sfc_efx/base: add MAE action set provisioning APIs")
Fixes: b4fac34715f2 ("common/sfc_efx/base: add MAE action rule provisioning APIs")
Fixes: ed15d7f8e064 ("common/sfc_efx/base: validate and compare outer match specs")
Fixes: 7a673e1a4a05 ("common/sfc_efx/base: support outer rule provisioning")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agocommon/sfc_efx/base: limit reported MCDI response length
Andy Moreton [Tue, 18 May 2021 15:10:11 +0000 (18:10 +0300)]
common/sfc_efx/base: limit reported MCDI response length

MCDI helper routines in libefx include length checks for response
messages, to ensure that short replies and optional fields are
handled correctly.

If the MCDI response message from the firmware is larger than the
caller's buffer then the response length reported to the caller
should be limited to the buffer size. Otherwise length checks in
the caller may allow reading past the end of the buffer.

Fixes: 6f619653b9b1 ("net/sfc/base: import MCDI implementation")
Cc: stable@dpdk.org
Signed-off-by: Andy Moreton <amoreton@xilinx.com>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agonet/mlx5: fix meta field size for flow modify
Alexander Kozyrev [Thu, 13 May 2021 19:54:58 +0000 (22:54 +0300)]
net/mlx5: fix meta field size for flow modify

The modify_field flow API assumes that the META item is 32 bits wide.
But the C register that is used for META item can be 16 or 32 bits
wide depending on kernel and firmware configurations.
Take this into consideration and use the appropriate META width.

Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix loopback for Direct Verbs queue
Bing Zhao [Mon, 17 May 2021 15:18:41 +0000 (18:18 +0300)]
net/mlx5: fix loopback for Direct Verbs queue

In the past, all the queues and other hardware objects were created
through Verbs interface. Currently, most of the objects creation are
migrated to Devx interface by default, including queues. Only when
the DV is disabled by device arg or eswitch is enabled, all or some
of the objects are created through Verbs interface.

When using Devx interface to create queues, the kernel driver
behavior is different from the case using Verbs. The Tx loopback
cannot work properly even if the Tx and Rx queues are configured
with loopback attribute. To fix the support self loopback for Tx, a
Verbs dummy queue pair needs to be created to trigger the kernel to
enable the global loopback capability.

This is only required when TIR is created for Rx and loopback is
needed. Only CQ and QP are needed for this case, no WQ(RQ) needs to
be created.

Bugzilla ID: 645
Fixes: 6deb19e1b2d2 ("net/mlx5: separate Rx queue object creations")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/hns3: fix link speed when VF device is down
Huisong Li [Sat, 15 May 2021 00:52:38 +0000 (08:52 +0800)]
net/hns3: fix link speed when VF device is down

When the port is link down state, it is meaningless to display the
port link speed. It should be an undefined state.

Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix DCB reconfiguration
Huisong Li [Sat, 15 May 2021 00:52:37 +0000 (08:52 +0800)]
net/hns3: fix DCB reconfiguration

Whether the enable bit of the pfc ("pfc_en") is changed or not is one of
the conditions for reconfiguring the DCB. Currently, pfc_en is not
rolled back when DCB configuration fails. This patch fixes it.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix DCB configuration
Huisong Li [Sat, 15 May 2021 00:52:36 +0000 (08:52 +0800)]
net/hns3: fix DCB configuration

Currently, the DCB configuration takes effect in the dev_start stage, and
the mapping between TCs and queues are also updated in this stage.
However, the DCB configuration is delivered in the dev_configure stage.

If the configuration fails, it should be intercepted in this stage. If
the configuration succeeds, the user should be able to obtain the
corresponding updated information, such as the mapping between TCs and
queues. So this patch moves DCB configuration to dev_configure.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: remove meaningless packet buffer rollback
Huisong Li [Sat, 15 May 2021 00:52:35 +0000 (08:52 +0800)]
net/hns3: remove meaningless packet buffer rollback

Packet buffer allocation and hardware pause configuration fail normally
when a reset occurs. If the execution fails, rollback of the packet
buffer still fails. So this rollback is meaningless.

Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix requested FC mode rollback
Huisong Li [Sat, 15 May 2021 00:52:34 +0000 (08:52 +0800)]
net/hns3: fix requested FC mode rollback

Currently, the "requested_fc_mode" lacks rollback when enabling link
FC or PFC fails.
For example, this may result an incorrect FC mode after a reset.

Fixes: d4fdb71a0e7b ("net/hns3: fix flow control mode")
Fixes: 62e3ccc2b94c ("net/hns3: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix Rx/Tx queue numbers check
Huisong Li [Sat, 15 May 2021 00:52:33 +0000 (08:52 +0800)]
net/hns3: fix Rx/Tx queue numbers check

The Rx/Tx queue numbers should be greater than TC number, this patch adds
this check for PF before updating the mapping between TC and queue.

Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes: 76d794566d43 ("net/hns3: maximize queue number")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agovdpa/mlx5: fix device unplug
Matan Azrad [Thu, 13 May 2021 18:40:20 +0000 (21:40 +0300)]
vdpa/mlx5: fix device unplug

The vDPA PCI device unplug process should release all the private
device resources and also to unregister the device.

The device unregistration was missed what remained the device data
invalid in the rte_vhost library.

Unregister the device in unplug process via the remove operation.

Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")
Cc: stable@dpdk.org
Reported-by: Eli Britstein <elibr@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>
Tested-by: Eli Britstein <elibr@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/vhost: restore pseudo TSO support
David Marchand [Tue, 18 May 2021 07:07:27 +0000 (09:07 +0200)]
net/vhost: restore pseudo TSO support

The net/vhost PMD does not comply with the ethdev offload API as it does
not report Rx/Tx offload capabilities wrt TSO and checksum offloading.
On the other hand, the net/vhost PMD lets guest negotiates TSO and
checksum offloading.

Changing the behavior for Rx/Tx offload flags handling won't
improve/fix this situation and will break applications that might have
been relying on implicit support of TSO in this driver.

Revert this behavior change until we have a complete fix.

Fixes: ca7036b4af3a ("vhost: fix offload flags in Rx path")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: restore IOTLB mempool allocation
David Marchand [Mon, 17 May 2021 08:59:51 +0000 (10:59 +0200)]
vhost: restore IOTLB mempool allocation

IOTLB messages will be sent when some queues are not enabled. If we
initialize IOTLB in vhost_user_set_vring_num, it could happen that IOTLB
update comes when IOTLB pool of disabled queues are not initialized.

Fixes: 968bbc7e2e50 ("vhost: avoid IOTLB mempool allocation while IOMMU disabled")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: fix stored last used index
Balazs Nemeth [Fri, 14 May 2021 16:02:07 +0000 (18:02 +0200)]
vhost: fix stored last used index

The optimization introduced by
commit d18db8049c7c ("vhost: read last used index once")
didn't account for the fact that vhost_flush_enqueue_shadow_packed
increments the last_used_idx.
For this reason, store last_used_idx after the potential call to
vhost_flush_enqueue_shadow_packed.

Bugzilla ID: 699
Fixes: d18db8049c7c ("vhost: read last used index once")

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Wei Ling <weix.ling@intel.com>
3 years agonet/mlx5: fix metering cleanup on stop
Li Zhang [Thu, 13 May 2021 08:35:44 +0000 (11:35 +0300)]
net/mlx5: fix metering cleanup on stop

A meter may handle Rx queue reference in his sub-policies.
In stop operation, all the Rx queues are released.

Wrongly, the meter reference was not released before
destroying the Rx queues what cause an error in stop.

Release the Rx queues meter references in stop operation.

Fixes: fc6ce56bba05 ("net/mlx5: prepare sub-policy for flow with meter")

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix counter offset detection
Suanming Mou [Thu, 13 May 2021 08:05:15 +0000 (11:05 +0300)]
net/mlx5: fix counter offset detection

Currently, the counter offset support is discovered by creating the
rule with invalid offset counter and drop action in root table. If
the rule creation fails with EINVAL errno, that mean counter offset
is not supported in root table.

However, drop action may not be supported in some rdma-core version
in root table. In this case, the discover code will not work properly.

This commits changes flow attribute to egress. That removes all the
extra fate actions in the flow to avoid any unsupported fate actions
make the discover code fail time to time.

Fixes: 994829e695c0 ("net/mlx5: remove single counter container")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix leak when configured repeatedly
Yunjian Wang [Thu, 13 May 2021 03:39:54 +0000 (11:39 +0800)]
net/mlx5: fix leak when configured repeatedly

Currently, configuring a mlx device, it will allocate its
own process private in mlx5_proc_priv_init() and only frees
it when closing the device. This will lead to a memory leak,
when a device is configured repeatedly.

For example:
for(...)
do
    rte_eth_dev_configure
    rte_eth_rx_queue_setup
    rte_eth_tx_queue_setup
    rte_eth_dev_start
    rte_eth_dev_stop
done

Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx4: fix leak when configured repeatedly
Yunjian Wang [Thu, 13 May 2021 03:38:56 +0000 (11:38 +0800)]
net/mlx4: fix leak when configured repeatedly

Currently, configuring a mlx device, it will allocate its
own process private in mlx5_proc_priv_init() and only frees
it when closing the device. This will lead to a memory leak,
when a device is configured repeatedly.

For example:
for(...)
do
    rte_eth_dev_configure
    rte_eth_rx_queue_setup
    rte_eth_tx_queue_setup
    rte_eth_dev_start
    rte_eth_dev_stop
done

Fixes: 97d37d2c1f6b ("net/mlx4: remove device register remap")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/nfp: fix internal port addressing
Heinrich Kuhn [Fri, 14 May 2021 09:19:34 +0000 (11:19 +0200)]
net/nfp: fix internal port addressing

Depending on the breakout mode of the physical ports the internal NFP
port number might differ from the actual physical port number. Prior to
this patch the physical port number was used when making configuration
changes to the physical ports (enable, admin up etc). After this change
the internal port number is now correctly used for configuration
changes.

Fixes: 5e15e799d697 ("net/nfp: create separate entity for PF device")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
3 years agodoc: fix release notes for QAT compression PMD
Adam Dybkowski [Thu, 13 May 2021 12:05:42 +0000 (13:05 +0100)]
doc: fix release notes for QAT compression PMD

This patch extends the DPDK 21.05 release notes with the QAT GEN3
compression update.

Fixes: da573c0e4205 ("compress/qat: enable compression on GEN3")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agocrypto/zuc: fix build with GCC 11
Kevin Traynor [Fri, 14 May 2021 15:08:34 +0000 (16:08 +0100)]
crypto/zuc: fix build with GCC 11

GCC 11 complains that some arrays may be uninitialized in
process_zuc_hash_op(). This is because their initialization
depends on num_ops being > 0.

This function is only called with num_ops > 0 because of
checks in process_zuc_hash_op().

To remove the warning initialize the arrays.

Fixes: 0b133c36ad7d ("crypto/zuc: support IPsec Multi-buffer lib v0.54")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
3 years agotest/crypto: fix build with GCC 11
Kevin Traynor [Wed, 5 May 2021 08:53:14 +0000 (09:53 +0100)]
test/crypto: fix build with GCC 11

Fix the allocation for sessions, to prevent an array-bounds
warning with GCC 11. Set the not created session to NULL.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
3 years agodoc: remove obsolete future considerations in flow guide
Thomas Monjalon [Mon, 29 Mar 2021 16:52:14 +0000 (18:52 +0200)]
doc: remove obsolete future considerations in flow guide

After 4 years, rte_flow has evolved enough to not require
special notes about what could be added in future.
Part of the removed plans were obsolete anyway.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@nvidia.com>
3 years agodoc: update minimum supported Linux kernel
Stephen Hemminger [Mon, 19 Apr 2021 22:06:17 +0000 (15:06 -0700)]
doc: update minimum supported Linux kernel

The DPDK project is only committed to supporting upstream kernel
versions that are still in support. The 3.16 kernel has reached
End Of Life (in June 2020). The next LTS kernel is 4.4 and is
supported until February 2020.

This does not change the existing policy that distribution kernels
that are older are still supported.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: fix description of some mlx5 features
Asaf Penso [Sun, 16 May 2021 10:56:20 +0000 (10:56 +0000)]
doc: fix description of some mlx5 features

The support of the new RTE_FLOW_ITEM_TYPE_INTEGRITY
was added in the release notes 21.02 by mistake.

The support of the Sub-Function representors was missing
in the release notes and the mlx5 guide.

Fixes: 79f8952783d0 ("net/mlx5: support integrity flow item")
Fixes: cb95feefdd03 ("net/mlx5: support sub-function representor")

Signed-off-by: Asaf Penso <asafp@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: add tested Intel platforms with Intel NICs
Yan Xia [Wed, 19 May 2021 08:55:18 +0000 (16:55 +0800)]
doc: add tested Intel platforms with Intel NICs

Add tested Intel platforms with Intel NICs to v21.05 release note.

Signed-off-by: Yan Xia <yanx.xia@intel.com>
3 years agodoc: add tested platforms with Mellanox NICs
Raslan Darawsheh [Mon, 17 May 2021 12:39:37 +0000 (15:39 +0300)]
doc: add tested platforms with Mellanox NICs

Add tested platforms with Mellanox NICs to the 21.05 release notes.

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
3 years agobuild: check symbol maps in developer mode
David Marchand [Thu, 13 May 2021 08:34:15 +0000 (10:34 +0200)]
build: check symbol maps in developer mode

Hook check-symbol-maps.sh in the symbol check when in developer mode to
help developers catch issues before submitting their changes.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ray Kinsella <mdr@ashroe.eu>
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>