dpdk.git
2 years agodoc: remove repeated repeated words
Thomas Monjalon [Fri, 5 Nov 2021 21:10:30 +0000 (22:10 +0100)]
doc: remove repeated repeated words

Some duplicate words were detected with a script.

Fixes: fdec9301f52d ("doc: add flow classify guides")
Fixes: 4dc6d8e63c16 ("doc: add graph library guide")
Fixes: 30d3aa861db5 ("doc: rework VM power manager user guide")
Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
Fixes: e64833f2273a ("examples/l2fwd-keepalive: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agodoc: announce removal of octeontx2 drivers
Jerin Jacob [Tue, 9 Nov 2021 15:51:32 +0000 (21:21 +0530)]
doc: announce removal of octeontx2 drivers

In the view of enabling unified driver for octeontx2(cn9k)/
octeontx3(cn10k), removing drivers/octeontx2 drivers and
replace with drivers/cnxk/ which supports both octeontx2(cn9k)
and octeontx3(cn10k) SoCs.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agodoc: update release notes for 21.11
John McNamara [Mon, 22 Nov 2021 17:00:59 +0000 (17:00 +0000)]
doc: update release notes for 21.11

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

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agodoc: add tested Intel platforms with Intel NICs
Yan Xia [Fri, 19 Nov 2021 18:18:33 +0000 (18:18 +0000)]
doc: add tested Intel platforms with Intel NICs

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

Signed-off-by: Yan Xia <yanx.xia@intel.com>
Acked-by: Xueqin Lin <xueqin.lin@intel.com>
2 years agoexamples/ptpclient: fix delay request message
Vanshika Shukla [Mon, 22 Nov 2021 07:31:22 +0000 (13:01 +0530)]
examples/ptpclient: fix delay request message

The size of delay request message sent out by the DPDK
ptpclient application was observed to have extra length
than expected. Due to this, bad messages were observed
on the master side and delay response was not received.
This patch fixes this bug.

Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
2 years agobus: fix device iterator match from arguments
Xueming Li [Wed, 24 Nov 2021 12:45:24 +0000 (13:45 +0100)]
bus: fix device iterator match from arguments

Device iterator RTE_DEV_FOREACH() failed to return devices from
classifier like "class=vdpa", because matching name from empty kvargs
returns no result. If device name not specified in kvargs, the function
should iterate all devices.

This patch allows empty devargs or devargs without name specified.

Fixes: 6aebb942907d ("kvargs: add function to get from key and value")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
2 years agobus/auxiliary: fix device iteration
David Marchand [Mon, 22 Nov 2021 09:25:43 +0000 (10:25 +0100)]
bus/auxiliary: fix device iteration

rte_kvargs_parse() expects a NULL terminated keys array.

Fixes: 1afce3086cf4 ("bus/auxiliary: introduce auxiliary bus")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
2 years agodoc: strip build artefacts for examples file list
Timothy Redaelli [Tue, 23 Nov 2021 14:48:42 +0000 (15:48 +0100)]
doc: strip build artefacts for examples file list

examples.dox is built inside builddir/doc/api and so doxygen generates
some dir_HASH.html that includes the builddir name and this may prevent
DPDK documentation to be correctly generated in some distributions, for
example CentOS Stream 9 and RHEL9, since the builddir includes the
architecture.

This commit adds builddir/doc/api (the path where examples.dox is
generated) to STRIP_FROM_PATH, so the generated documentation doesn't
change if builddir changes.

Fixes: a6090630f4e5 ("doc: automate examples file list for API")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Tested-by: David Marchand <david.marchand@redhat.com>
2 years agombuf: fix dump of dynamic fields and flags
Alexander Bechikov [Wed, 24 Nov 2021 12:57:04 +0000 (13:57 +0100)]
mbuf: fix dump of dynamic fields and flags

The dump of dynamic fields and flags fails if the shm is already
allocated. Add a check to fix the issue.

Fixes: d4902ed31c63 ("mbuf: check shared memory before dumping dynamic space")
Cc: stable@dpdk.org
Signed-off-by: Alexander Bechikov <asb.tyum@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agokni: restrict bifurcated device support
Ferruh Yigit [Tue, 23 Nov 2021 16:46:17 +0000 (16:46 +0000)]
kni: restrict bifurcated device support

To enable bifurcated device support, rtnl_lock is released before calling
userspace callbacks and asynchronous requests are enabled.

But these changes caused more issues, like bug #809, #816. To reduce the
scope of the problems, the bifurcated device support related changes are
only enabled when it is requested explicitly with new 'enable_bifurcated'
module parameter.
And bifurcated device support is disabled by default.

So the bifurcated device related problems are isolated and they can be
fixed without impacting all use cases.

Bugzilla ID: 816
Fixes: 631217c76135 ("kni: fix kernel deadlock with bifurcated device")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoexamples/l3fwd-power: revert wakeup log
David Hunt [Tue, 23 Nov 2021 15:57:49 +0000 (15:57 +0000)]
examples/l3fwd-power: revert wakeup log

Wakeup happens quite often (several hundred times a second) in
l3fwd-power example app in PMD power management mode, so this
message is appearing too often to be useful.
This patch reverts that info message addition.

Fixes: 931e3a994597 ("examples/l3fwd-power: add wakeup log")

Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2 years agoapp/crypto-perf: increase segment size for IPsec
Gagandeep Singh [Wed, 17 Nov 2021 07:40:31 +0000 (13:10 +0530)]
app/crypto-perf: increase segment size for IPsec

Application calculates segment size based on buffer size plus
digest size only, But if the operation mode is IPsec then
packet length can be increased by some more bytes depending on
the algorithm.

In this patch, increasing segment size with RTE_PKTMBUF_HEADROOM
when there is no user given segment size.

Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodoc: support IPsec Multi-buffer lib v1.1
Pablo de Lara [Thu, 18 Nov 2021 14:34:07 +0000 (14:34 +0000)]
doc: support IPsec Multi-buffer lib v1.1

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>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agodrivers/crypto: return error for not supported SA lifetime
Gagandeep Singh [Thu, 18 Nov 2021 07:30:30 +0000 (13:00 +0530)]
drivers/crypto: return error for not supported SA lifetime

dpaa, dpaa2 and caam_jr drivers do not support
SA expiry. This result in failure of test cases in
test app. This patch returns ENOTSUP to skip the
SA lifetime test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodrivers/crypto: fix IPsec TTL decrement option
Gagandeep Singh [Thu, 18 Nov 2021 07:00:18 +0000 (12:30 +0530)]
drivers/crypto: fix IPsec TTL decrement option

dpaa, dpaa2 and caam_jr drivers decrement the inner IP header
TTL for all packets and ignoring the dec_ttl option of SA.

In this patch, using the dec_ttl to decide to decrement the
packets inner IP header TTL or not.

Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec")
Fixes: 3e33486f80a5 ("crypto/caam_jr: add security offload")
Fixes: 1f14d500bce1 ("crypto/dpaa_sec: support IPsec protocol offload")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: fix maximum number of queue pairs
Raja Zidane [Sun, 21 Nov 2021 12:59:43 +0000 (12:59 +0000)]
crypto/mlx5: fix maximum number of queue pairs

An indirect mkey is created for each descriptor in a QP, number of
descriptors per QP is configured by the user on QP setup callback.
In mlx cryptodev autotest, the max number of QPs (provided by the driver)
is created, and due to mkey resource limits, QPs creation fail which leads
to the test failing.
Since there is no capability of max number of descriptors provided to
the user, we can't give an exact number of max QPs available.
Reduce the max number of QPs to 128, which supports standard descriptors
numbers, including the 4K number provided in the test.

Fixes: 6152534e211e ("crypto/mlx5: support queue pairs operations")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocrypto/ipsec_mb: fix cipher key setting
Pablo de Lara [Mon, 22 Nov 2021 17:47:29 +0000 (17:47 +0000)]
crypto/ipsec_mb: fix cipher key setting

When authenticating with SNOW3G, KASUMI and ZUC,
the pointers for encryption/decryption keys is not set.
If a cipher algorithm such as AES-CBC is also used,
the application would seg fault.
Hence, these pointers should be set to some value by default.

Command line to replicate the issue:
./build/app/dpdk-test-crypto-perf -l 4,5 -n 6 --vdev="crypto_aesni_mb" -- \
 --devtype="crypto_aesni_mb" --optype=cipher-then-auth --auth-algo \
 snow3g-uia2 --auth-key-sz 16 --auth-iv-sz 16 --digest-sz 4 --silent \
 --total-ops 1000000 --auth-op generate --burst-sz 32 \
 --cipher-algo aes-ctr --cipher-key-sz 16 --cipher-iv-sz 16

Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9")
Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2")
Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agogpu/cuda: set rte_errno
Elena Agostini [Wed, 24 Nov 2021 18:34:09 +0000 (18:34 +0000)]
gpu/cuda: set rte_errno

Set correct rte_errno variable in CUDA driver
and return -rte_errno in case of error.

rte_errno values are compliant with the gpudev library documentation.

Fixes: 1306a73b1958 ("gpu/cuda: introduce CUDA driver")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agogpudev: manage null parameters in memory functions
Elena Agostini [Tue, 23 Nov 2021 00:42:07 +0000 (00:42 +0000)]
gpudev: manage null parameters in memory functions

The gpudev functions free, register and unregister
return gracefully if input pointer is NULL or size 0,
as API doc was indicating no-op accepted values.

CUDA driver checks are removed because redundant
with the checks added in gpudev library.

Fixes: e818c4e2bf50 ("gpudev: add memory API")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agoversion: 21.11-rc3
Thomas Monjalon [Wed, 17 Nov 2021 19:19:47 +0000 (20:19 +0100)]
version: 21.11-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2 years agonet: add macro for VLAN header length
Ferruh Yigit [Wed, 17 Nov 2021 18:24:26 +0000 (18:24 +0000)]
net: add macro for VLAN header length

Multiple drivers are defining macros for VLAN header length, to remove
the redundancy defining macro in the ether header.
And updated drivers to use the new macro.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agoexamples/ethtool: close port before exit
Huisong Li [Thu, 6 May 2021 03:46:08 +0000 (11:46 +0800)]
examples/ethtool: close port before exit

Currently, ethtool directly ends the process after 'quit' cmd. In this
case, software resources are not released and hardware resources of the
device are not uninstalled.

This patch adds closing port operation to release resources.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoexamples/ethtool: enhance Rx/Tx queue NUMA affinity
Chengwen Feng [Thu, 6 May 2021 03:46:07 +0000 (11:46 +0800)]
examples/ethtool: enhance Rx/Tx queue NUMA affinity

In DPDK, 'rte_socket_id' means the running socket while
'rte_eth_dev_socket_id' is the device socket.
For better performance, memory which queue setup used and device
should be in the same socket.

This patch make sure it calls rte_eth_dev_socket_id API to get device
socket_id when setting ringparam.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agohash: clarify comment for bucket entries number
Vladimir Medvedkin [Wed, 10 Nov 2021 18:36:14 +0000 (18:36 +0000)]
hash: clarify comment for bucket entries number

This patch adds a comment for RTE_HASH_BUCKET_ENTRIES
explaining why a particular value was chosen.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2 years agobuild: make gpudev optional
Elena Agostini [Wed, 17 Nov 2021 21:39:01 +0000 (21:39 +0000)]
build: make gpudev optional

This library can be made optional.
drivers/gpu and app/test-gpudev depend on this library,
so they are automatically disabled if the lib is disabled.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agonet/mlx5: fix modify field destination bit offset
Viacheslav Ovsiienko [Wed, 17 Nov 2021 11:14:35 +0000 (13:14 +0200)]
net/mlx5: fix modify field destination bit offset

If the modify field action requests the field copy/set transaction
from other field, the destination field hardware bit offset was
assigned incorrectly with non-zero byte offset, causing wrong
translations for the fields with sizes larger than 32 bits.

Fixes: 40c8fb1fd3b3 ("net/mlx5: update modify field action")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix memory leak in Windows MR deregistration
Michael Baum [Wed, 17 Nov 2021 11:02:55 +0000 (13:02 +0200)]
common/mlx5: fix memory leak in Windows MR deregistration

The "mlx5_devx_cmd_mkey_create" DevX cmd allocates DevX object using
mlx5_malloc and then creates MKey using glue function.
Compatibly, "mlx5_devx_cmd_destroy" cmd releases first the MKey using
glue function, and then free the DevX object using mlx5_free.

On Windows OS, the reg_mr function creates Mkey using
"mlx5_devx_cmd_mkey_create" cmd, but dereg_mr function using directly
glue function without freeing the object.
This behavior causes memory leak at each MR release.

In addition, the dereg_mr function makes sure that the MR pointer is
valid before destroying its fields, but always calls the memset function
that makes a difference to it.

This patch moves the dereg_mr function to use "mlx5_devx_cmd_destroy"
instead of glue function, and extends the validity test to the whole
function.

Fixes: ba420719823c ("common/mlx5: add reg/dereg MR on Windows")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: fix user mode register access attribute
Michael Baum [Wed, 17 Nov 2021 10:57:09 +0000 (12:57 +0200)]
common/mlx5: fix user mode register access attribute

To detect the timestamp mode configured on the NIC the mlx5 PMD uses the
firmware command ACCESS_REGISTER_USER.
The HCA capability command has an attribute flag checking whether
firmware supports the command.

However, the HCA capability query command read the flag from wrong place
in PRM structure.

This patch move the flag to correct place.

Fixes: 972a1bf8120d ("common/mlx5: fix user mode register access command")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix MPLS tunnel outer layer overwrite
Dariusz Sosnowski [Wed, 17 Nov 2021 09:59:33 +0000 (11:59 +0200)]
net/mlx5: fix MPLS tunnel outer layer overwrite

mlx5 PMD incorrectly overwrote outer layer fields in MPLS tunnel
rte_flow patterns using defaults for MPLS tunnels. This included
overwriting UDP destination port in MPLSoUDP and GRE protocol field in
MPLSoGRE.

This patch fixes this behavior. If application provides the values in
flow pattern items preceding the MPLS flow item the provided values will
be used, otherwise the defaults will be applied.

Fixes: d1abe664ddde ("net/mlx5: add MPLS to Direct Verbs flow engine")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix partial inline of fine grain packets
Dariusz Sosnowski [Wed, 17 Nov 2021 09:50:50 +0000 (11:50 +0200)]
net/mlx5: fix partial inline of fine grain packets

Assuming a user tried to send multi-segment packets, with
RTE_PMD_MLX5_FINE_GRANULARITY_INLINE flag set, using a device with
minimum inlining requirements (such as ConnectX-4 Lx or when user
specified them explicitly), sending such packets caused segfault.
Segfault was caused by failed invariants in
mlx5_tx_packet_multi_inline function.

This patch introduces a logic for multi-segment packets, with
RTE_PMD_MLX5_FINE_GRANULARITY_INLINE flag set, to omit mbuf scanning for
filling inline buffer and inline only minimal amount of data required.

Fixes: ec837ad0fc7c ("net/mlx5: fix multi-segment inline for the first segments")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: explain partially supported features for ice PMD
Qi Zhang [Sun, 14 Nov 2021 03:40:57 +0000 (11:40 +0800)]
doc: explain partially supported features for ice PMD

Users are confused with a feature with "P", added necessary
explanation for this.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/sfc: support MAC address edits in transfer flows
Ivan Malov [Wed, 17 Nov 2021 11:44:38 +0000 (14:44 +0300)]
net/sfc: support MAC address edits in transfer flows

These edits affect the outermost header in the current processing state
of the packet, which might have been decapsulated by prior action DECAP.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: support MAC address edit actions in MAE
Ivan Malov [Wed, 17 Nov 2021 11:44:37 +0000 (14:44 +0300)]
common/sfc_efx/base: support MAC address edit actions in MAE

In a tunnel packet, these actions affect the inner header if
action DECAP is set; otherwise, they affect the outer header.

Adding these actions is done in two steps: add the action to
the action mask and indicate the MAC address entry ID to use.
This allows the user to check the order of actions first and
allocate resources when time comes to enable the action rule.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: organise MAE flow action parsing function arguments
Ivan Malov [Wed, 17 Nov 2021 11:44:36 +0000 (14:44 +0300)]
net/sfc: organise MAE flow action parsing function arguments

Add a context structure to simplify handling of action sets.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: refine order of checks on MAE action set attach
Ivan Malov [Wed, 17 Nov 2021 11:44:35 +0000 (14:44 +0300)]
net/sfc: refine order of checks on MAE action set attach

The number of counters being non-zero can be detected before
the action set registry traversal, so move the check outside.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agoapp/testpmd: fix tunnel offload validation
Gregory Etelson [Tue, 2 Nov 2021 12:24:21 +0000 (14:24 +0200)]
app/testpmd: fix tunnel offload validation

Tunnel offload API allows application to restore packet to
its original form if chain of flows missed after DECAP action.
The main idea of the tunnel offload API was to query port PMD
to provide flow elements - actions or items.
Flow elements supplied by PMD are merged with original flow rule
elements provided by testpmd operator to create a new flow rule,
optimal for PMD, to implement the tunnel offload API.
That flow rule transformation is hidden form testpmd operator and uses
internal testpmd resources.

Current testpmd did not release tunnel offload resources if flow rule
validation failed.

The patch always releases tunnel offload resources after flow rule
validation returns.

Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2 years agonet/failsafe: fix secondary process probe
Kumara Parameshwaran [Thu, 11 Nov 2021 12:44:58 +0000 (18:14 +0530)]
net/failsafe: fix secondary process probe

Remove the vdev args check for secondary process which prevents the
secondary from attaching to the device created by the primary process
via the hotplug framework. This check was removed for other vdevs but
was missed for failsafe.

Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Cc: stable@dpdk.org
Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/sfc: support regioned NIC DMA memory mapping type
Viacheslav Galaktionov [Wed, 17 Nov 2021 07:05:45 +0000 (10:05 +0300)]
net/sfc: support regioned NIC DMA memory mapping type

DMA on SN1022 SoC requires extra mapping of the memory via MCDI.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: support NIC DMA memory regions API
Andrew Rybchenko [Wed, 17 Nov 2021 07:05:44 +0000 (10:05 +0300)]
common/sfc_efx/base: support NIC DMA memory regions API

NIC DMA memory regions API allows to establish mapping of DMA addresses
used by NIC to host IOVA understood by the host when IOMMU is absent
and NIC cannot address entire host IOVA space because of too small
DMA mask.

The API does not allow to address entire host IOVA space, but allows
arbitrary regions of the space really used for the NIC DMA.

A DMA region needs to be mapped in order to perform MCDI initialization.
Since the NIC has not been probed at that point, its configuration cannot
be accessed and there an UNKNOWN mapping type is assumed.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: fix printout labels for decrease TTL actions
Ivan Malov [Tue, 16 Nov 2021 21:41:27 +0000 (00:41 +0300)]
net/sfc: fix printout labels for decrease TTL actions

Fixes: 60e53c078d01 ("net/sfc: support decrement IP TTL actions in transfer flows")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: fix printout label for count action
Ivan Malov [Tue, 16 Nov 2021 21:41:26 +0000 (00:41 +0300)]
net/sfc: fix printout label for count action

Fixes: 96fd2bd69b58 ("net/sfc: support flow action count in transfer rules")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/bnxt: fix Rx next consumer index in mbuf alloc fail
Somnath Kotur [Wed, 17 Nov 2021 03:12:06 +0000 (08:42 +0530)]
net/bnxt: fix Rx next consumer index in mbuf alloc fail

The driver internal variable to track the next consumer index on
the Rx ring was not being set if there was an mbuf allocation
failure. In that scenario, eventually it would fall out of sync
with the actual consumer index and raise a false alarm on Thor
needlessly causing a segmentation fault with testpmd

Fixes: 03c8f2fe111c ("net/bnxt: detect bad opaque in Rx completion")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2 years agonet/bnxt: fix ULP context list deadlock
Kishore Padmanabha [Tue, 16 Nov 2021 13:04:37 +0000 (18:34 +0530)]
net/bnxt: fix ULP context list deadlock

The ULP context list was not updated when high availability
feature was deinitialized. This caused the ULP context list
to acquire the lock when it is not supposed to causing a
deadlock. The fix is to correctly clear the list.

Fixes: 3184b1ef666a ("net/bnxt: add HA support in ULP")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix multi adapter
Kishore Padmanabha [Tue, 16 Nov 2021 13:04:36 +0000 (18:34 +0530)]
net/bnxt: fix multi adapter

1. removed the global flag for TruFlow global config initialization.

2. Modified the TruFlow context lock to be a global lock instead
of per context lock.

3. The ULP context list is modified to check on the ULP configuration
data so alarm handlers can operate on the correct ULP context.

These changes help in support of multiple network cards using
single DPDK application.

Fixes: d75b55121bcd ("net/bnxt: add context list for timers")
Cc: stable@dpdk.org
Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix SRAM resource free block list
Kishore Padmanabha [Tue, 16 Nov 2021 13:04:35 +0000 (18:34 +0530)]
net/bnxt: fix SRAM resource free block list

The SRAM resource free did not reset the next block to be used
when the block is not empty. This caused the flows not be created
when max flows limit is reached and you delete one flow and try to
add a new flow. The fix calls the update of the next free block
even when block is not empty.

Fixes: 37ff91c158a3 ("net/bnxt: add SRAM manager model")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: remove settings for multiple session
Jay Ding [Tue, 16 Nov 2021 13:04:34 +0000 (18:34 +0530)]
net/bnxt: remove settings for multiple session

Move wc_tcam_slices_per_row and database structure of
global_cfg and if_tbl to session structure to support
multiple TruFlow sessions with different card type under single
DPDK application instance.

Signed-off-by: Jay Ding <jay.ding@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agodoc: update release note for bnxt PMD
Ajit Khaparde [Fri, 5 Nov 2021 18:46:34 +0000 (11:46 -0700)]
doc: update release note for bnxt PMD

Updated support for RTE_FLOW_ACTION_TYPE_RSS.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This fixes the length calculation of the header length.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add Ethernet to GRE RSS expansion.

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

RFC-8926 allows inner Ethernet header after GENEVE tunnel.

Current GENEVE RSS expansion created IPv4 and IPv6 paths only.

The patch adds Ethernet to RSS expansion scheme.

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

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

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

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

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

Fix wrong VLAN insertion position as inner.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Remove the unnecessary rte_atomic.h included in app modules.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fix spelling errors in comments including doxygen found using codespell.

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

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

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

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

Signed-off-by: David Marchand <david.marchand@redhat.com>