dpdk.git
3 years agoapp/testpmd: count outer IP checksum errors
Lance Richardson [Fri, 29 Jan 2021 22:35:54 +0000 (17:35 -0500)]
app/testpmd: count outer IP checksum errors

Count and display outer IP checksum errors in the checksum
forwarder.

Example forwarder stats output:
  RX-packets: 158            RX-dropped: 0             RX-total: 158
  Bad-ipcsum: 48             Bad-l4csum: 48            Bad-outer-l4csum: 6
  Bad-outer-ipcsum: 40
  TX-packets: 0              TX-dropped: 0             TX-total: 0

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/iavf: fix VLAN tag extraction handling
Haiyue Wang [Tue, 23 Feb 2021 03:10:58 +0000 (11:10 +0800)]
net/iavf: fix VLAN tag extraction handling

The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows
the PF to set the location of the RX VLAN tag for stripping offloads.

So the VF needs to extract the VLAN tag according to the location flags.

Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Wei Xie <weix.xie@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/mlx5: fix metadata item validation for ingress flows
Viacheslav Ovsiienko [Wed, 10 Feb 2021 09:30:51 +0000 (11:30 +0200)]
net/mlx5: fix metadata item validation for ingress flows

In legacy metadata mode the metadata register B is engaged to
handle the metadata item. In the ingress domain the hardware
supports the register setting only, the match on register B
is not supported.

Due to this limitation only the SET_META action can be supported
for the ingress flows, the META item should be rejected on
flow validation.

Fixes: 5f3541724e08 ("net/mlx5: fix flow META item validation")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: fix DevX read output buffer size
Dekel Peled [Thu, 18 Feb 2021 16:18:05 +0000 (18:18 +0200)]
common/mlx5: fix DevX read output buffer size

Previous patch included a glue function call, with wrong size
calculation for an output buffer.
This patch fixes the issue, using the correct size calculation.

Fixes: bb7ef9a96281 ("common/mlx5: add register access DevX routine")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix TCP flag field modification
Alexander Kozyrev [Fri, 5 Feb 2021 03:03:04 +0000 (03:03 +0000)]
net/mlx5: fix TCP flag field modification

Wrong modification field ID is used for TCP flags: the inner
TCP flag field is changing instead of the outermost one.
Use the proper field ID to match the expectations.

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 external buffer pool registration for Rx queue
Viacheslav Ovsiienko [Fri, 12 Feb 2021 11:06:30 +0000 (13:06 +0200)]
net/mlx5: fix external buffer pool registration for Rx queue

On Rx queue creation the mlx5 PMD registers the data buffers of the
specified pools for DMA operations. It scans the mem_list of the pools
and creates the MRs (DMA related NIC objects) for the chunks found.
If the pool is created with rte_pktmbuf_pool_create_extbuf() and
refers to the external attached buffers (whose are in the area of
application responsibility and it should explicitly register the
data buffer memory for DMA with rte_dev_dma_map() call) the chunks
contain the mbuf structures only, w/o any built-in data buffers.
Hence, DMA with mlx5 NIC never happens to this area and there is
no need to create MRs for these ones.

The extra not needed MRs were created for the pools with external
buffers causing MR cache load and performance was slightly affected.
The patch checks the mbuf pool type and skips MR creation for the
pools with external buffers.

Fixes: bdb8e5b1ea7b ("net/mlx5: allow allocated mbuf with external buffer")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agoapp/testpmd: remove unused struct member
Kathleen Capella [Tue, 9 Feb 2021 15:40:26 +0000 (15:40 +0000)]
app/testpmd: remove unused struct member

The tx_queue member of the fwd_lcore struct is unused as it is already
part of the fwd_stream structure. Deleting helps improve code readability.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agonet/pcap: support imissed stats
Ido Goshen [Thu, 4 Feb 2021 10:33:57 +0000 (12:33 +0200)]
net/pcap: support imissed stats

Get value from pcap_stats.ps_drop (see man pcap_stats)
the value is adjusted in this cases:
 - port stop - pcap is closed and will lose count
 - stats reset - pcap doesn't provide reset api
 - rollover - pcap counter size is u_32 only

Signed-off-by: Ido Goshen <ido@cgstowernetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodrivers/net: redefine array size macros
Andrew Boyer [Fri, 29 Jan 2021 22:44:32 +0000 (14:44 -0800)]
drivers/net: redefine array size macros

Replace copies of size(arr)/size(arr[0]) with RTE_DIM().
Eventually all of these macro definitions should be removed.

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/vmxnet3: support device reset
Dheemanth Mallikarjun [Mon, 4 Jan 2021 19:43:08 +0000 (11:43 -0800)]
net/vmxnet3: support device reset

The vmxnet3 driver didn't have the dev_reset function
pointer set. Hence, provided the necessary function
pointer so that DPDK developers can use the rte_eth_dev_reset
API to reset the vmxnet3 device data.

Signed-off-by: Dheemanth Mallikarjun <dheemanthm@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
3 years agonet/failsafe: report minimum and maximum MTU
Andrew Rybchenko [Tue, 22 Dec 2020 08:51:49 +0000 (11:51 +0300)]
net/failsafe: report minimum and maximum MTU

Take minimum and maximum MTU values for subdevices and
report maximum of minimums and minimum of maximums.

Fixes: ad97ceece12c ("ethdev: add min/max MTU to device info")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Gaetan Rivet <grive@u256.net>
3 years agonet/failsafe: fix RSS hash offload reporting
Andrew Rybchenko [Tue, 22 Dec 2020 08:00:04 +0000 (11:00 +0300)]
net/failsafe: fix RSS hash offload reporting

If sub-devices support RSS hash offload, the offload should be
reported by the failsafe device since handling is transparent
from failsafe point of view.

Fixes: 5d308972954c ("ethdev: add mbuf RSS update as an offload")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Gaetan Rivet <grive@u256.net>
3 years agoapp/testpmd: display Rx queue used descriptor count
Lance Richardson [Fri, 12 Feb 2021 21:24:52 +0000 (16:24 -0500)]
app/testpmd: display Rx queue used descriptor count

Add support for displaying the count of used (filled by hardware
but not yet processed by the driver) descriptors on a receive
queue in order to allow the rte_eth_dev rx_queue_count() API to
be exercised and tested.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agofbarray: fix log message on truncation error
Anatoly Burakov [Fri, 19 Feb 2021 17:54:45 +0000 (17:54 +0000)]
fbarray: fix log message on truncation error

When file truncation fails, the log message attempts to print a path of
file we failed to truncate, but this path was never set to anything and,
what's worse, was uninitialized. Fix it by passing path from the caller.

Coverity issue: 366122
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")
Cc: stable@dpdk.org
Reported-by: Andrew Boyer <aboyer@pensando.io>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoeal/ppc: provide arch-specific TSC frequency
David Christensen [Wed, 3 Feb 2021 21:54:13 +0000 (13:54 -0800)]
eal/ppc: provide arch-specific TSC frequency

Return a PPC specific value for get_tsc_freq_arch() rather than
depending on the EAL framework to estimate the frequency.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agomem: detach memsegs on cleanup
Anatoly Burakov [Mon, 14 Sep 2020 13:04:05 +0000 (14:04 +0100)]
mem: detach memsegs on cleanup

Currently, we don't detach the shared memory on EAL cleanup, which
leaves the page table descriptors still holding on to the file
descriptors as well as memory space occupied by them. Fix it by adding
another detach stage that closes the internal memory allocator resource
references, detaches shared fbarrays and unmaps the shared mem config.

Bugzilla ID: 380
Bugzilla ID: 381

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agoci: catch coredumps
David Marchand [Mon, 25 Jan 2021 15:05:39 +0000 (16:05 +0100)]
ci: catch coredumps

Parts of the unit tests code rely on forked/secondary processes
(expectedly) failing.
A crash in those situations could be missed so add a check on coredumps
presence after unit tests have run.
When unit tests fail, it can also help checking for coredumps as it
could give more insights on what happened.

In some situations (like explicit call to rte_panic), coredump generation
must be disabled to avoid false positives.

Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Aaron Conole <aconole@redhat.com>
3 years agovfio: fix API description
Yunjian Wang [Sat, 6 Jun 2020 09:17:20 +0000 (17:17 +0800)]
vfio: fix API description

Fix few comments and add detailed comments for return value.

Fixes: 279b581c897d ("vfio: expose functions")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: remove duplicated symbols from map file
Ferruh Yigit [Thu, 25 Feb 2021 10:54:49 +0000 (10:54 +0000)]
power: remove duplicated symbols from map file

This is causing build error, like:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/482121104

Also '@internal' marker removed from doxygen comment, since public API
should not be internal.
Experimental tag removed from 'rte_power_guest_channel_send_msg()'

Fixes: 4d3892dcd77b ("power: make channel message functions public")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoci: update arm64 Travis jobs to Graviton2
Juraj Linkeš [Tue, 23 Feb 2021 08:28:24 +0000 (09:28 +0100)]
ci: update arm64 Travis jobs to Graviton2

Use only the newer Graviton2 environment in Travis CI instead of using
the older platform, which has intermittent issues:
1. collect2: fatal error: ld terminated with signal 9 [Killed]
2. ticketlock_autotest sometimes times out

These failures hint at resource availability issues in container
environments. The Graviton2 environment is using VMs and these failures
are not observed in it.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
3 years agotest/mem: fix page size for external memory
Nithin Dabilpuram [Fri, 15 Jan 2021 07:32:43 +0000 (13:02 +0530)]
test/mem: fix page size for external memory

Currently external memory test uses 4K page size.
VFIO DMA mapping works only with system page granularity.

Earlier it was working because all the contiguous mappings
were coalesced and mapped in one-go which ended up becoming
a lot bigger page. Now that VFIO DMA mappings both in IOVA as VA
and IOVA as PA mode, are being done at memseg list granularity,
we need to use system page size.

Fixes: b270daa43b3d ("test: support external memory")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agovfio: fix DMA mapping granularity for IOVA as VA
Nithin Dabilpuram [Fri, 15 Jan 2021 07:32:42 +0000 (13:02 +0530)]
vfio: fix DMA mapping granularity for IOVA as VA

Partial unmapping is not supported for VFIO IOMMU type1
by kernel. Though kernel gives return as zero, the unmapped size
returned will not be same as expected. So check for
returned unmap size and return error.

For IOVA as PA, DMA mapping is already at memseg size
granularity. Do the same even for IOVA as VA mode as
DMA map/unmap triggered by heap allocations,
maintain granularity of memseg page size so that heap
expansion and contraction does not have this issue.

For user requested DMA map/unmap disallow partial unmapping
for VFIO type1.

Fixes: 73a639085938 ("vfio: allow to map other memory regions")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agovfio: do not merge contiguous areas
Nithin Dabilpuram [Fri, 15 Jan 2021 07:32:41 +0000 (13:02 +0530)]
vfio: do not merge contiguous areas

In order to save DMA entries limited by kernel both for external
memory and hugepage memory, an attempt was made to map physically
contiguous memory in one go. This cannot be done as VFIO IOMMU type1
does not support partially unmapping a previously mapped memory
region while Heap can request for multi page mapping and
partial unmapping.
Hence for going back to old method of mapping/unmapping at
memseg granularity, this commit reverts
commit d1c7c0cdf7ba ("vfio: map contiguous areas in one go")

Also add documentation on what module parameter needs to be used
to increase the per-container dma map limit for VFIO.

Fixes: d1c7c0cdf7ba ("vfio: map contiguous areas in one go")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agomaintainers: update for crypto
Akhil Goyal [Tue, 23 Feb 2021 08:42:49 +0000 (14:12 +0530)]
maintainers: update for crypto

Recently joined Marvell, hence change in
email id for crypto sub tree, security API
and ipsec-secgw application maintainers list.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
3 years agomaintainers: update for NXP pfe and dpaax_sec
Hemant Agrawal [Thu, 18 Feb 2021 13:16:31 +0000 (18:46 +0530)]
maintainers: update for NXP pfe and dpaax_sec

remove Akhil
add Gagan

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agoversion: 21.05-rc0
Thomas Monjalon [Mon, 15 Feb 2021 09:12:57 +0000 (10:12 +0100)]
version: 21.05-rc0

Start a new release cycle with empty release notes.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
3 years agoversion: 21.02.0
Thomas Monjalon [Sun, 14 Feb 2021 09:58:34 +0000 (10:58 +0100)]
version: 21.02.0

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: update release notes for 21.02
John McNamara [Thu, 11 Feb 2021 12:04:21 +0000 (12:04 +0000)]
doc: update release notes for 21.02

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

Signed-off-by: John McNamara <john.mcnamara@intel.com>
3 years agodoc: add pmdinfogen rewrite to release notes
Dmitry Kozlyuk [Fri, 12 Feb 2021 10:40:53 +0000 (11:40 +0100)]
doc: add pmdinfogen rewrite to release notes

The build tool pmdinfogen was rewritten in DPDK 21.02,
adding Windows support.
There is a new build-time dependency: pyelftools.

Fixes: f0f93a7adfee ("buildtools: use Python pmdinfogen")
Fixes: 6b19edcb663c ("build: enable pmdinfogen for Windows")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agodoc: update pyelftools install method
Kevin Traynor [Fri, 12 Feb 2021 14:46:28 +0000 (14:46 +0000)]
doc: update pyelftools install method

python-pyelftools is not packaged for RHEL/CentOS with
the exception of RHEL7 EPEL.

Add command to install it with pip.

Fixes: f0f93a7adfee ("buildtools: use Python pmdinfogen")

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoversion: 21.02-rc4
Thomas Monjalon [Thu, 11 Feb 2021 22:54:28 +0000 (23:54 +0100)]
version: 21.02-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: replace hugepages commands with dedicated tool
Thomas Monjalon [Thu, 11 Feb 2021 18:16:59 +0000 (19:16 +0100)]
doc: replace hugepages commands with dedicated tool

The tool dpdk-hugepages.py, added in DPDK 20.11,
is referenced in the guides instead of more complicate commands.

The original Linux commands are kept in linux_gsg/sys_reqs.rst
and nics/build_and_test.rst.

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agousertools: fix binding built-in kernel driver
Yongxin Liu [Mon, 23 Nov 2020 03:05:33 +0000 (11:05 +0800)]
usertools: fix binding built-in kernel driver

A driver can be loaded as a dynamic module or a built-in module.
In commit 681a67288655 ("usertools: check if module is loaded
before binding"), the script only checks modules in /sys/module/.

However, for built-in kernel driver, it only shows up in /sys/module/,
if it has a version or at least one parameter. So add check for
modules in /lib/modules/$(uname -r)/modules.builtin.

Fixes: 681a67288655 ("usertools: check if module is loaded before binding")
Cc: stable@dpdk.org
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agousertools: show valid hugepage sizes if wrong request
Sarosh Arif [Thu, 11 Feb 2021 08:20:04 +0000 (13:20 +0500)]
usertools: show valid hugepage sizes if wrong request

If user requests a hugepage size which is not supported by the system,
currently user gets an error message saying that the requested size
is not a valid system huge page size. In addition to this if we display
the valid hugepage sizes it will be convenient for the user to request
the right size next time.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
3 years agodoc: replace testpmd with dpdk-testpmd in commands
Sarosh Arif [Thu, 11 Feb 2021 07:19:37 +0000 (12:19 +0500)]
doc: replace testpmd with dpdk-testpmd in commands

replace testpmd with dpdk-testpmd in all commands
because on compilation through meson, dpdk-testpmd is the default
application name.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agodoc: add tested platforms with NXP SoCs
Hemant Agrawal [Thu, 11 Feb 2021 13:25:34 +0000 (18:55 +0530)]
doc: add tested platforms with NXP SoCs

Add tested platforms with NXP SoCs to the 21.02 release notes.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agodoc: add tested platforms for Broadcom NICs
Ajit Khaparde [Thu, 11 Feb 2021 06:22:36 +0000 (22:22 -0800)]
doc: add tested platforms for Broadcom NICs

Add tested platforms for Broadcom NICs.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agodoc: add tested platforms with Mellanox NICs
Raslan Darawsheh [Wed, 10 Feb 2021 12:30:18 +0000 (14:30 +0200)]
doc: add tested platforms with Mellanox NICs

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

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
3 years agodoc: add tested Intel platforms with Intel NICs
Bo Chen [Tue, 9 Feb 2021 11:17:25 +0000 (06:17 -0500)]
doc: add tested Intel platforms with Intel NICs

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

Signed-off-by: Bo Chen <box.c.chen@intel.com>
3 years agoapp/testpmd: fix help of metering commands
Ferruh Yigit [Tue, 9 Feb 2021 14:15:06 +0000 (14:15 +0000)]
app/testpmd: fix help of metering commands

Helps strings syntax is "command : description", the 'command' part was
missing, updated command help strings.

Fixes: 281eeb8afc55 ("app/testpmd: add commands for metering and policing")
Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agodoc: fix mark action zero value in mlx5 guide
Viacheslav Ovsiienko [Fri, 5 Feb 2021 12:15:04 +0000 (14:15 +0200)]
doc: fix mark action zero value in mlx5 guide

The zero value in flow MARK action is reported in Rx datapath
as tagged with zero FDIR ID. Once packet is marked in flow engine
it will be always reported as tagged. For metadata only the zero
value means there is "no metadata" in the packet and the metadata
flag is not set for the case.

Fixes: 3ceeed9f7855 ("doc: update flow mark action in mlx5 guide")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agovdpa/mlx5: fix polling threads scheduling
Matan Azrad [Mon, 8 Feb 2021 09:28:01 +0000 (09:28 +0000)]
vdpa/mlx5: fix polling threads scheduling

When the event mode is with 0 fixed delay, the polling-thread will never
give-up CPU.

So, when multi-polling-threads are active, the context-switch between
them will be managed by the system which may affect latency according to
the time-out decided by the system.

In order to fix multi-devices polling thread scheduling, this patch
forces rescheduling for each CQ poll iteration.

Move the polling thread to SCHED_RR mode with maximum priority to
complete the fairness.

Fixes: 6956a48cabbb ("vdpa/mlx5: set polling mode default delay to zero")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
3 years agovhost: fix packed ring dequeue offloading
Marvin Liu [Fri, 5 Feb 2021 07:47:58 +0000 (15:47 +0800)]
vhost: fix packed ring dequeue offloading

When vhost is doing dequeue offloading, it parses ethernet and L3/L4
headers of the packet. Then vhost will set corresponding value in mbuf
attributes. It means offloading action should be after packet data copy.

Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agonet/ixgbe: fix UDP zero checksum on Arm
Feifei Wang [Mon, 8 Feb 2021 09:07:04 +0000 (17:07 +0800)]
net/ixgbe: fix UDP zero checksum on Arm

There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading PKT_RX_L4_CKSUM_BAD flag.

To fix it for the NEON path in Arm platform, change the bad UDP checksum to
unknown, and then let software application to recompute the checksum.

NICs: 82599(igb)
Driver: ixgbe(vector)
Architecture: arm64
$:./app/dpdk-testpmd -c 0x3 -w 0002:f9:00.0 -- -i
--port-topology=chained --enable-rx-cksum
test-pmd> set fwd rxonly
test-pmd> set verbose 1
test-pmd> start

1. UDP Test:
Package: (Ether()/IP()/UDP(checksum=0)
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_GOOD

2. TCP Test:
Package: (Ether()/IP()/TCP(checksum=0)
ol_flags: PKT_RX_L4_CKSUM_BAD PKT_RX_IP_CKSUM_GOOD

Bugzilla ID: 629
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agonet/ixgbe: fix UDP zero checksum on x86
Haiyue Wang [Thu, 4 Feb 2021 14:39:48 +0000 (22:39 +0800)]
net/ixgbe: fix UDP zero checksum on x86

There is an 82599 errata that UDP frames with a zero checksum are
incorrectly marked as checksum invalid by the hardware.  This was
leading to misleading PKT_RX_L4_CKSUM_BAD flag.

This patch changes the bad UDP checksum to PKT_RX_L4_CKSUM_UNKNOWN,
so the software application will then have to recompute the checksum
itself if needed.

Bugzilla ID: 629
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Reported-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Paolo Valerio <pvalerio@redhat.com>
3 years agoethdev: refine doxygen comment of UDP tunnel API
Qi Zhang [Wed, 3 Feb 2021 20:02:20 +0000 (21:02 +0100)]
ethdev: refine doxygen comment of UDP tunnel API

Clarify what is the scope and impact of the UDP port tunnel API.

There are still missing infos to be improved in future:
- no capability flag
- dependency between ports of the same device
- required privilege

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoconfig/arm: fix part number for clang Ubuntu 18.04
Juraj Linkeš [Mon, 8 Feb 2021 14:44:01 +0000 (15:44 +0100)]
config/arm: fix part number for clang Ubuntu 18.04

Rename the 'default' part number in clang cross-file to fix the
following issue:
config/arm/meson.build:238:2: ERROR:  Problem encountered: Unsupported
part number default of implementer generic. Please add support for it or
use the generic (-Dmachine=generic) build.

Fixes: 3d01d65ba0d3 ("config: add aarch64 clang for Ubuntu 18.04")

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
3 years agoconfig/arm: add Qualcomm
Honnappa Nagarahalli [Fri, 5 Feb 2021 22:33:10 +0000 (16:33 -0600)]
config/arm: add Qualcomm

Add Qualcomm config back which was deleted.

Fixes: 91c730fd4e09 ("config/arm: remove unused or superfluous variables")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agoeal: fix automatic loading of drivers as shared libs
Bruce Richardson [Mon, 8 Feb 2021 16:33:19 +0000 (16:33 +0000)]
eal: fix automatic loading of drivers as shared libs

When checking the loading of EAL shared lib to see if we have a shared
DPDK build, we only want to include part of the ABI version in the check
rather than the whole thing. For example, with ABI version 21.1 for DPDK
release 21.02, the linker links the binary against librte_eal.so.21,
without the ".1".

To avoid any further brittleness in this area, we can check for multiple
versions when doing the check, since just about any version of EAL implies
a shared build. Therefore we check for presence of librte_eal.so with full
ABI_VERSION extension, and then repeatedly remove the end part of the
filename after the last dot, checking each time. For example (debug log
output for static build):

  EAL: Checking presence of .so 'librte_eal.so.21.1'
  EAL: Checking presence of .so 'librte_eal.so.21'
  EAL: Checking presence of .so 'librte_eal.so'
  EAL: Detected static linkage of DPDK

Fixes: 7781950f4d38 ("eal: fix shared lib mode detection")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
3 years agotelemetry: mark init function as internal-only
Bruce Richardson [Fri, 5 Feb 2021 21:23:57 +0000 (21:23 +0000)]
telemetry: mark init function as internal-only

The "rte_telemetry_init()" function is for use by "rte_eal_init()" and
should not be part of the public API. Mark it as internal only.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoversion: 21.02-rc3
Thomas Monjalon [Fri, 5 Feb 2021 20:11:44 +0000 (21:11 +0100)]
version: 21.02-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agousertools: show error if unable to reserve hugepages
Sarosh Arif [Fri, 8 Jan 2021 09:06:27 +0000 (14:06 +0500)]
usertools: show error if unable to reserve hugepages

Sometimes the system is unable to reserve the requested hugepages because
enough space is not available in the RAM. In that case, currently the
script displays no error message hence the user can be under the delusion
that the hugepages requested are all successfully reserved. This patch
displays an error message if the pages reserved are different from the
requested pages.

Signed-off-by: Sarosh Arif <sarosh.arif@emumba.com>
3 years agousertools: show hugepages on POWER systems
David Christensen [Wed, 2 Dec 2020 20:57:56 +0000 (12:57 -0800)]
usertools: show hugepages on POWER systems

The IBM PowerNV systems include NUMA nodes that don't have associated
CPUs or hugepage memory.  Here is an example on an IBM AC922 system:

$ lscpu
...
NUMA node0 CPU(s):   0-63
NUMA node8 CPU(s):   64-127
NUMA node252 CPU(s):
...

$ numastat -m
...
                          Node 0          Node 8        Node 252
                 --------------- --------------- ---------------
MemTotal               126763.19       130785.06            0.00
MemFree                119513.38       125294.44            0.00
MemUsed                  7249.81         5490.62            0.00
...
HugePages_Total             4.00         1734.00            0.00
HugePages_Free              0.00            4.00            0.00
HugePages_Surp              4.00         1730.00            0.00
...

Modify dpdk-hugepages.py to test for the ../hugepages directory before
attempting to parse the hugepage entries.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
3 years agombuf: remove unneeded atomic generic header include
David Marchand [Thu, 4 Feb 2021 10:05:19 +0000 (11:05 +0100)]
mbuf: remove unneeded atomic generic header include

There is no need for the direct inclusion of the generic/ header [1]
now that we don't use the rte_atomic API anymore.

It was the last case of direct inclusion of the generic/ headers,
so the flag -Wno-unused-function can be dropped.

1: https://git.dpdk.org/dpdk/commit/?id=3eb860b08eb7

Fixes: e41d27a68df6 ("mbuf: remove atomic reference counters")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agomaintainers: update for testpmd
Bernard Iremonger [Thu, 4 Feb 2021 10:04:39 +0000 (10:04 +0000)]
maintainers: update for testpmd

remove Bernard Iremonger
remove Wenzhuo Lu

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agolicense: remove pmdinfogen from exceptions
John McNamara [Thu, 4 Feb 2021 10:28:35 +0000 (10:28 +0000)]
license: remove pmdinfogen from exceptions

The C based pmdinfogen tool has been replaced by a Python
based tool with a BSD license. As such, we no longer need
to call out a licence exception for pmdinfogen.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodevtools: remove ethdev ABI exception
David Marchand [Mon, 1 Feb 2021 18:08:52 +0000 (19:08 +0100)]
devtools: remove ethdev ABI exception

Now that the ethernet driver dev_ops structure definition is not
exported anymore, there is no need for an exception.
abidiff will only consider structures defined in the installed headers
(passed with --headers-dirX options).

Fixes: df96fd0d7395 ("ethdev: make driver-only headers private")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agomempool: fix panic on dump or audit
Olivier Matz [Wed, 3 Feb 2021 09:01:01 +0000 (10:01 +0100)]
mempool: fix panic on dump or audit

When doing a mempool dump or an audit, the application can panic because
the length of the cache is greater than the flush threshold, which is
seen as a fatal error. But this can temporarily happen when the mempool
is in use.

Fix the panic condition to abort only when the cache length is greater
than the array.

Fixes: ea5dd2744b90 ("mempool: cache optimisations")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agoconfig: increase default maximum number of NUMA nodes
Thomas Monjalon [Wed, 3 Feb 2021 21:08:50 +0000 (22:08 +0100)]
config: increase default maximum number of NUMA nodes

AMD CPU can present a high number of NUMA nodes.
On a dual-socket with 16 CCXs per CPU,
the option "CCX (or LLC) as NUMA domain" will expose 32 NUMA nodes.

The DPDK default should be 32 for better compatibility.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agoeventdev: fix a return value comment
Harry van Haaren [Mon, 1 Feb 2021 13:19:46 +0000 (13:19 +0000)]
eventdev: fix a return value comment

The PMD info get API has a void return type. Remove the
@return 0 Success doxygen comment as it doesn't make sense here.

Fixes: 5223a1f3b8de ("eventdev: define southbound driver interface")
Cc: stable@dpdk.org
Reported-by: Fredrik A Lindgren <fredrik.a.lindgren@tietoevry.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
3 years agoevent/dlb: fix accessing uninitialized variables
Timothy McDaniel [Wed, 3 Feb 2021 18:12:21 +0000 (12:12 -0600)]
event/dlb: fix accessing uninitialized variables

This patch updates the PMD to initialize response fields
prior to calling into the PF layer.

Coverity issue: 366200, 366202, 366205
Fixes: eb14a3421afd ("event/dlb: add eventdev start")
Fixes: f0073621940c ("event/dlb: add eventdev stop and close")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
3 years agoapp/crypto-perf: fix handling of config parameters
Ciara Power [Tue, 2 Feb 2021 16:58:16 +0000 (16:58 +0000)]
app/crypto-perf: fix handling of config parameters

The crypto perf graphing script did not handle parsing parameters
from the JSON config files correctly.
A common parsing function is used for both EAL and app parameters,
to ensure they are handled the same way and to reduce code duplication.
Short parameters are now passed with the value being a second argument,
rather than as one argument with dividing space.
Long parameters with no expected value are supported for EAL now also.
e.g. "--no-huge" can be added to config as "no-huge": true

Fixes: f400e0b82bf1 ("app/crypto-perf: add script to graph perf results")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
3 years agodoc: fix crypto perf script guide
Ciara Power [Tue, 2 Feb 2021 16:58:15 +0000 (16:58 +0000)]
doc: fix crypto perf script guide

The guide for using the crypto perf graphing script had some incorrect
indentation, unnecessary blank lines, and a missing argument in one of
the usage examples. These are corrected in this patch.

Fixes: f400e0b82bf1 ("app/crypto-perf: add script to graph perf results")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
3 years agodoc: add crypto perf script in release notes
Ciara Power [Tue, 2 Feb 2021 16:58:14 +0000 (16:58 +0000)]
doc: add crypto perf script in release notes

Add release note for the new crypto perf graphing script.

Fixes: f400e0b82bf1 ("app/crypto-perf: add script to graph perf results")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
3 years agotest/crypto: add check in decryption with digest case
Gagandeep Singh [Thu, 4 Feb 2021 04:52:10 +0000 (12:52 +0800)]
test/crypto: add check in decryption with digest case

Some platforms may not support operations on encrypted digest,
So in this patch adding a check for such test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
3 years agocompress/mlx5: fix asserts
Matan Azrad [Thu, 4 Feb 2021 09:06:01 +0000 (09:06 +0000)]
compress/mlx5: fix asserts

When ASSERT is enabled for compilation, the 2 usages of assert mechanism
in the driver are failed due to typos.

Fix the typos.

Fixes: f8c97babc9f4 ("compress/mlx5: add data-path functions")
Fixes: 37862dafcbed ("compress/mlx5: support 32-bit systems")

Reported-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocrypto/octeontx2: fix null pointer dereferences
Ankur Dwivedi [Thu, 28 Jan 2021 05:16:53 +0000 (10:46 +0530)]
crypto/octeontx2: fix null pointer dereferences

Coverity reports that pointers ip and ip6 may be dereferenced
with null value. This patch fixes this.

Coverity issue: 365549, 365551
Fixes: 8f685ec2d545 ("crypto/octeontx2: support AES-CBC SHA1-HMAC")

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
3 years agonet/ionic: fix Tx fragment limits
Andrew Boyer [Thu, 4 Feb 2021 20:37:10 +0000 (12:37 -0800)]
net/ionic: fix Tx fragment limits

The reported nb_seg_max should include the main fragment in the
descriptor and the fragments in the accompanying SGL.

Update the Tx prep check as well.

These were missed when updating to the v1 Tx queue structures.

Fixes: 561176361047 ("net/ionic: clean up Tx queue version support")

Signed-off-by: Andrew Boyer <aboyer@pensando.io>
3 years agonet/enic: fix filter log message
Hyong Youb Kim [Fri, 5 Feb 2021 01:35:03 +0000 (17:35 -0800)]
net/enic: fix filter log message

A debug message for filter API is using a wrong flag. Use the correct
one.

Fixes: 936a9b9975e7 ("net/enic: flow API debug")
Cc: stable@dpdk.org
Reported-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
3 years agonet/mlx5: fix Tx queue size created with DevX
Viacheslav Ovsiienko [Thu, 4 Feb 2021 12:04:09 +0000 (14:04 +0200)]
net/mlx5: fix Tx queue size created with DevX

The number of descriptors specified for queue creation
implies the queue should be able to contain the specified
amount of packets being sent. Typically one packet takes
one queue descriptor (WQE) to be handled. If there is inline
data option enabled one packet might require more WQEs to
embrace the inline data and the overall queue size (the
number of queue descriptors) should be adjusted accordingly.

In mlx5 PMD the queues can be created either via Verbs, using
the rdma-core library or via DevX as direct kernel/firmware call.
The rdma-core does queue size adjustment internally, depending on
TSO and inline setting. The DevX approach missed this point.
This caused the queue size discrepancy and performance variations.

The patch adjusts the Tx queue size for the DevX approach
in the same as it is done in rdma-core implementation.

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: validate hash Rx queue pointer
Dekel Peled [Wed, 3 Feb 2021 10:09:09 +0000 (12:09 +0200)]
net/mlx5: validate hash Rx queue pointer

Implementation of mlx5_hrxq_get() tries to get pointer to a hrxq
object, by reusing an existing hrxq, or creating a new one.
There is no check of the obtained pointer, so using it might result
in error.

This patch adds check of the pointer before using it, and return 0
if the pointer is NULL to indicate error.

Fixes: e1592b6c4dea ("net/mlx5: make Rx queue thread safe")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix shared RSS capability check
Dekel Peled [Wed, 3 Feb 2021 10:08:42 +0000 (12:08 +0200)]
net/mlx5: fix shared RSS capability check

Existing code to create shared RSS action doesn't fully check
driver capabilities.
Using older driver, if DevX capabilities are insufficient,
the IBV operations are used.
In this case the ind_table_modify operation is not supported, and
shared RSS action can't be modified after creation.

This patch adds check of driver capability, and fails the validation
for shared RSS action in case it is insufficient.

Fixes: d2046c09aa64 ("net/mlx5: support shared action for RSS")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/pcap: fix infinite Rx with large files
Ferruh Yigit [Thu, 4 Feb 2021 16:51:03 +0000 (16:51 +0000)]
net/pcap: fix infinite Rx with large files

Packet forwarding is not working when infinite Rx feature is used with
large .pcap files that has high number of packets.

The problem is number of allocated mbufs are less than the infinite Rx
ring size, and all mbufs consumed to fill the ring, so there is no mbuf
left for forwarding.

Current logic can not detect that infinite Rx ring is not filled
completely and no more mbufs left, and setup continues which leads
silent fail on packet forwarding.

There isn't much can be done when there is not enough mbuf for the given
.pcap file, so additional checks added to detect the case and fail
explicitly with an error log.

Bugzilla ID: 595
Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
3 years agonet/pcap: fix byte stats for drop Tx
Ferruh Yigit [Wed, 3 Feb 2021 17:30:25 +0000 (17:30 +0000)]
net/pcap: fix byte stats for drop Tx

Drop Tx path in pcap is Tx that just drops the packets, which is used
for the case only Rx from a pcap file is requested/matters.

The byte stats was calculated using first mbuf segment, which gives
wrong values for multi segmented mbufs, updated to use packet length
instead.

Bugzilla ID: 597
Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file")
Cc: stable@dpdk.org
Reported-by: Cian Ferriter <cian.ferriter@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cian Ferriter <cian.ferriter@intel.com>
3 years agonet/ice: fix VLAN 0 adding based on VLAN mode
Haiyue Wang [Thu, 4 Feb 2021 12:50:29 +0000 (20:50 +0800)]
net/ice: fix VLAN 0 adding based on VLAN mode

In Single VLAN Mode, single VLAN filters via ICE_SW_LKUP_VLAN are based
on the inner VLAN ID, so the VLAN TPID (i.e. 0x8100 or 0x888a8) doesn't
matter.

In Double VLAN Mode, outer/single VLAN filters via ICE_SW_LKUP_VLAN are
based on the outer/single VLAN ID + VLAN TPID.

For both modes, adding a VLAN 0 + no VLAN TPID filter to handle untagged
traffic when VLAN pruning is enabled. Also, this handles VLAN 0 priority
tagged traffic in Single VLAN Mode, since the VLAN TPID is not part of
filtering.

If Double VLAN Mode is enabled then an explicit VLAN 0 + VLAN TPID filter
needs to be added to allow VLAN 0 priority tagged traffic in DVM, since
the VLAN TPID is part of filtering.

Fixes: 14e7a4b37b4f ("net/ice/base: support configuring device in double VLAN mode")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/testpmd: support shared age action query
Dekel Peled [Thu, 4 Feb 2021 10:04:15 +0000 (12:04 +0200)]
app/testpmd: support shared age action query

Shared age action query was implemented as part of flow query,
but was not implemented as part of shared action query.

This patch adds the required implementation.

Fixes: 2f622174bf86 ("app/testpmd: support query of age action")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/hns3: validate requested maximum Rx frame length
Huisong Li [Wed, 3 Feb 2021 12:23:57 +0000 (20:23 +0800)]
net/hns3: validate requested maximum Rx frame length

When jumbo frame is enabled, the MTU size needs to be modified
based on 'max_rx_pkt_len'. Driver needs to check the validity
of 'max_rx_pkt_len'. And it should be in the range of
HNS3_DEFAULT_FRAME_LEN and HNS3_MAX_FRAME_LEN. Otherwise, it may
cause that the MTU size is inconsistent with jumbo frame offload.

Fixes: 19a3ca4c99cf ("net/hns3: add start/stop and configure operations")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix VF reset on mailbox failure
Chengchang Tang [Wed, 3 Feb 2021 12:23:56 +0000 (20:23 +0800)]
net/hns3: fix VF reset on mailbox failure

Currently, during the VF reset, the VF will send a MBX to inform
PF to reset it and the disable command bit will be set whether
the MBX is successful. Generally, multiple reset attempts are made
after a failure. However, because the command is disabled, all
subsequent reset will all fail.

This patch disable the command only after the MBX message is
successfully.

Fixes: 2790c6464725 ("net/hns3: support device reset")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix firmware exceptions by concurrent commands
Chengchang Tang [Wed, 3 Feb 2021 12:23:55 +0000 (20:23 +0800)]
net/hns3: fix firmware exceptions by concurrent commands

There are two scenarios that command queue uninit performed
concurrently with the firmware command: asynchronous command
and timeout command.

For asynchronous command, if a large number of functions send
commands, these commands may need to be queued to wait for
firmware processing. If a function is uninited suddenly, CMDQ
clearing and firmware processing may be performed concurrently.

For timeout command, if the command failed due to busy scheduling
of firmware, this command will be processed in the next scheduling.
And this may lead to concurrency.

The preceding concurrency may lead to a firmware exceptions.

This patch add a waiting time to ensure the firmware complete the
processing of left over command when PMD uninit.

Fixes: 737f30e1c3ab ("net/hns3: support command interface with firmware")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix flow director rule residue on malloc failure
Chengwen Feng [Wed, 3 Feb 2021 12:23:54 +0000 (20:23 +0800)]
net/hns3: fix flow director rule residue on malloc failure

After FD rule config success, driver will malloc fdir_rule to hold the
rule info, if malloc fail the FD rule in hardware was not cleanup.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: use C11 atomics
Chengchang Tang [Wed, 3 Feb 2021 12:23:53 +0000 (20:23 +0800)]
net/hns3: use C11 atomics

Replace all the atomic type with C11 atomic builtins in hns3
PMD.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix stats flip overflow
Chengchang Tang [Wed, 3 Feb 2021 12:23:52 +0000 (20:23 +0800)]
net/hns3: fix stats flip overflow

Currently, statistics may overflow in some scenarios.

For example, if HW statistics are reset by stats reset operation,
but there are still a lot of residual packets exist in the HW
queues and these packets are error packets, flip may occurred
because the ipacket is obtained by subtracting the number of
software error packets from the number of HW received packets.

This patch verifies the calculation and returns 0 when overflow
may occur.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: remove MPLS from supported flow items
Chengwen Feng [Wed, 3 Feb 2021 12:23:51 +0000 (20:23 +0800)]
net/hns3: remove MPLS from supported flow items

The Kunpeng920 and Kunpeng930 don't support parse MPLS packet, so
remove the type from supported flow items.

Fixes: fcba820d9b9e ("net/hns3: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: constrain TM peak rate
Chengwen Feng [Wed, 3 Feb 2021 12:23:50 +0000 (20:23 +0800)]
net/hns3: constrain TM peak rate

User could config Port or TC's peak rate by TM ops, but hardware does
not support peak rate which lower than 1Mbps. So we constraint TM
peak rate must be at least 1Mbps.

Fixes: c09c7847d892 ("net/hns3: support traffic management")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix RSS indirection table size
Lijun Ou [Wed, 3 Feb 2021 12:23:49 +0000 (20:23 +0800)]
net/hns3: fix RSS indirection table size

The driver should not use the fixed value as the validity check of
RSS indirection table size with HW supported. As a result, it will
cause misjudgment when the RSS RETA size with HW supported have
changed.

Fixes: c37ca66f2b27 ("net/hns3: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix link status change from firmware
Huisong Li [Wed, 3 Feb 2021 12:23:48 +0000 (20:23 +0800)]
net/hns3: fix link status change from firmware

When the hardware link status changes, the firmware proactively
reports the link status change message, and then driver update
link status. This feature is lack of a switch to control in PF
driver. Otherwise, this feature does not take effect when the
kernel PF driver that supports the feature is not loaded.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix query order of link status and link info
Huisong Li [Wed, 3 Feb 2021 12:23:47 +0000 (20:23 +0800)]
net/hns3: fix query order of link status and link info

When link information is updated in the firmware, the link information
is updated first and then the link status is updated. In a 1s periodic
task, PF driver queries the link information and then obtains link
status.
It may lead to a 1s time difference for obtaining valid link information
when the port is up. Therefore, the query order of driver should be
reversed to the order of firmware.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Fixes: 59fad0f32135 ("net/hns3: support link update operation")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/mlx5: fix E-Switch egress mirror flow validation
Jiawei Wang [Wed, 3 Feb 2021 08:29:17 +0000 (10:29 +0200)]
net/mlx5: fix E-Switch egress mirror flow validation

The stored metadata in all registers C were lost in E-Switch egress
mirroring flows due to HW limitation. The register C0 keeps the
source vport index that also was used as one of the flow matcher.

While sample action and jump action (jump to table X) was in the
E-Switch egress flow, the flow in the next table X wasn't hit since
source vport value lost.

The modify actions after sample action should be applied to the packet
on normal path, not to the sampled packet. In order to support this
mlx5 PMD splits the flow into sub flows and jump action is engaged
implicitly, causing malfunction due to registers corruption.

This patch adds the validation the for E-Switch mirroring jump egress
flow, and checks for this hidden jump as well and reject the flows with
modify actions after sampling.

Fixes: 6a951567c159 ("net/mlx5: support E-Switch mirroring and jump in one flow")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: fix storing synced MAC to internal table
Souvik Dey [Tue, 2 Feb 2021 17:48:40 +0000 (12:48 -0500)]
common/mlx5: fix storing synced MAC to internal table

As the internal MAC table is divided into Unicast and Multicast address
sections, we should check the type of synced MAC address before storing
it to the internal table. Currently the check is not done, and the
synced MAC of 33:33:00:00:00:01 gets stored in the unicast section
(mostly index 1) causing all subsequent mlx5_set_mc_addr_list()
to fail with error -EADDRINUSE, as the mac_list contains the MAC
33:33:00:00:00:01. This denies adding of any new multicast address to
the internal list and also fails to add the MAC address to the device
in case of SR-IOV VF.

Fixes: f22442cb5d42 ("net/mlx5: reduce Netlink commands dependencies")
Fixes: ccdcba53a3f4 ("net/mlx5: use Netlink to add/remove MAC addresses")
Cc: stable@dpdk.org
Signed-off-by: Souvik Dey <sodey@rbbn.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix counter and age flow action validation
Jiawei Wang [Tue, 2 Feb 2021 16:42:49 +0000 (18:42 +0200)]
net/mlx5: fix counter and age flow action validation

Currently old age action was implemented by flow counter and only one
counter index was maintained in each flow. While there was old age
action and share count action in one flow, and the same share count
action in the another flow, the counter was updated if second flow
was hit, so it may cause the first flow didn't aged out since the
counter was updated by second flow.

This patch updates the validation function for count and old age action:
  - Old age and shared count action combination is not supported.
  - Old age and count(not shared) action could work in the same sub
    flow.

Fixes: e7138997e07d ("net/mlx5: make shared counters thread safe")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agodoc: fix supported feature table in mlx5 guide
Viacheslav Ovsiienko [Tue, 2 Feb 2021 14:27:32 +0000 (16:27 +0200)]
doc: fix supported feature table in mlx5 guide

This sets the correct minimal requirements for these features:

- Buffer Split offload is supported/verified on ConnectX-5
- Tx scheduling requires ConnectX-6DX and depends on firmware version

Fixes: cb7b0c24c835 ("doc: update hardware offloads support in mlx5 guide")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agonet/octeontx: fix max Rx packet length
Sunil Kumar Kori [Tue, 26 Jan 2021 08:52:43 +0000 (14:22 +0530)]
net/octeontx: fix max Rx packet length

Maximum Rx packet length is getting updated twice which
corrupts actual value.

Fixes: 3151e6a687a3 ("net/octeontx: support MTU")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
3 years agonet/i40e: fix build for Windows MinGW
Leyi Rong [Tue, 2 Feb 2021 14:32:58 +0000 (22:32 +0800)]
net/i40e: fix build for Windows MinGW

Adds extra cflags '-fno-asynchronous-unwind-tables'
to avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Fixes: 5c38c33f7880 ("net/i40e: disable AVX512 with MinGW")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet/iavf: fix VLAN insert
Xiaoyun Li [Thu, 4 Feb 2021 03:11:18 +0000 (11:11 +0800)]
net/iavf: fix VLAN insert

The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability allows PF to set the
location of TX VLAN insertion.

So VF needs to insert VLAN tag according to the location flags.

Fixes: 1c301e8c3cff ("net/iavf: support new VLAN capabilities")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/ice: fix QinQ switch rule input set mask
Yuying Zhang [Thu, 4 Feb 2021 06:07:51 +0000 (06:07 +0000)]
net/ice: fix QinQ switch rule input set mask

QinQ switch rule doesn't support ethertype field match.
QinQ ethertype pattern should not be created. Change the
input set mask to fix the issue.

Fixes: bb3386f348dd ("net/ice: enable QinQ filter for switch")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix VLAN strip for double VLAN
Haiyue Wang [Thu, 4 Feb 2021 02:03:33 +0000 (10:03 +0800)]
net/ice: fix VLAN strip for double VLAN

VLAN strip was failing for double VLAN because of hardware
configuration, resulting mbuf not having the vlan_tci information.

Adjusted the strip setting according to current VLAN mode to fix the
VLAN strip.

Fixes: 14e7a4b37b4f ("net/ice/base: support configuring device in double VLAN mode")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/virtio: fix secondary process crash with PCI devices
Maxime Coquelin [Wed, 3 Feb 2021 15:58:11 +0000 (16:58 +0100)]
net/virtio: fix secondary process crash with PCI devices

The Virtio rework series mistakenly moved the rte_pci_device
pointer to struct virtio_hw, which is shared between the two
processes. But this structure is per-process, so this change
made secondary process to try accessing primary process-only
memory, leading to a crash.

This patch reverts to proper behavior, by storing the
rte_pci_device pointer into the per-process
virtio_pci_internal struct. It also provides helper to get
the pointer from the virtio_hw struct pointer.

Bugzilla ID: 633
Fixes: c8d4b02f72ae ("net/virtio: move legacy IO to virtio PCI")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoexamples/vhost: add error propagation in ioat ops
Cheng Jiang [Wed, 3 Feb 2021 14:29:04 +0000 (14:29 +0000)]
examples/vhost: add error propagation in ioat ops

This patch adds add error propagation for rte_ioat_completed_ops call,
and also changes dev_id type from int to uint16_t.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: fix potentially overflowing expression
Cheng Jiang [Tue, 2 Feb 2021 07:24:21 +0000 (07:24 +0000)]
examples/vhost: fix potentially overflowing expression

Change the type of buff_idx from uint64_t to uint32_t to fix coverity
issue.

Coverity issue: 366264
Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: remove async inflight packet counter
Cheng Jiang [Tue, 2 Feb 2021 06:17:51 +0000 (06:17 +0000)]
examples/vhost: remove async inflight packet counter

Remove async inflight packet counter since there is no need to keep
tracking it. Increase MAX_ENQUEUED_SIZE to prevent packet segment number
tracking ring from being exhausted.

Fixes: a68ba8e0a6b6 ("examples/vhost: refactor vhost data path")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>