dpdk.git
2 years agoexamples/ipsec-secgw: support TCP TSO
Radu Nicolau [Thu, 28 Oct 2021 12:22:46 +0000 (13:22 +0100)]
examples/ipsec-secgw: support TCP TSO

Add support to allow user to specific MSS for TCP TSO offload on a per SA
basis. MSS configuration in the context of IPsec is only supported for
outbound SA's in the context of an inline IPsec Crypto offload.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoipsec: support TSO
Radu Nicolau [Thu, 28 Oct 2021 12:22:45 +0000 (13:22 +0100)]
ipsec: support TSO

Add support for transmit segmentation offload to inline crypto processing
mode. This offload is not supported by other offload modes, as at a
minimum it requires inline crypto for IPsec to be supported on the
network interface.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/octeontx2: fix lookaside IPsec IPv6
Tejasree Kondoj [Thu, 28 Oct 2021 11:11:11 +0000 (16:41 +0530)]
crypto/octeontx2: fix lookaside IPsec IPv6

Fixing IPv6 mixed tunnel mode support by updating
inputs to firmware.

Fixes: 4edede7bc6ee ("crypto/octeontx2: support lookaside IPsec IPv6")
Cc: stable@dpdk.org
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agoexamples/fips_validation: fix device start
Fan Zhang [Thu, 28 Oct 2021 10:22:00 +0000 (11:22 +0100)]
examples/fips_validation: fix device start

This patch fixes the missing device start for fips validation
sample app.

Bugzilla ID: 842
Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/octeontx2: fix ESN seqhi
Archana Muniganti [Thu, 28 Oct 2021 07:22:46 +0000 (12:52 +0530)]
crypto/octeontx2: fix ESN seqhi

For current pkt, previous seqhi is used instead of its
guessed seqhi. Fixed it.

Fixes: 5be562bc5b78 ("crypto/octeontx2: support IPsec ESN and anti-replay")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocompress/mlx5: add block size option
Raja Zidane [Tue, 26 Oct 2021 01:52:42 +0000 (01:52 +0000)]
compress/mlx5: add block size option

Currently, the compression block size is 15 by default, which
is the maximum.

Add "log-block-size" devarg to select compression block size manually.
The value provided should be between 4 to 15.
Any out-of-range value will be defaulted to 15.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocompress/mlx5: fix compression level configuration
Raja Zidane [Tue, 26 Oct 2021 01:52:41 +0000 (01:52 +0000)]
compress/mlx5: fix compression level configuration

The mlx5 compress PMD uses HW acceleration for the compress operations.
The mlx5 HW device has no level style mode, which does a tradeoff between
throughput and compression ratio, unlike SW drivers where the CPU is doing
the compress, and more CPU effort can cause a better compression ratio.
The mlx5 driver wrongly defined the Huffman block size configuration
according to the level that doesn't fill the level API requirement for
the tradeoff.

Remove the effect of the level configuration in compress operation.

Fixes: 237aad88245b ("compress/mlx5: fix compression level translation")
Fixes: 39a2c8715f8f ("compress/mlx5: add transformation operations")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocrypto/cnxk: fix bus error on RSA verify
Kiran Kumar K [Mon, 25 Oct 2021 04:00:04 +0000 (09:30 +0530)]
crypto/cnxk: fix bus error on RSA verify

While creating RSA session, private key length is not being
calculated properly. This is causing bus error on RSA verify.
This patch fix the issue with length calculation.

Fixes: 5a3513caeb455 ("crypto/cnxk: add asymmetric session")
Cc: stable@dpdk.org
Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/qat: fix uncleared cookies after operation
Arek Kusztal [Thu, 21 Oct 2021 10:06:01 +0000 (11:06 +0100)]
crypto/qat: fix uncleared cookies after operation

This commit fixes uncleared cookies issue when using
RSA algorithm.

Fixes: e2c5f4ea994c ("crypto/qat: support RSA in asym")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agocrypto/qat: fix status in RSA decryption
Arek Kusztal [Thu, 21 Oct 2021 10:05:43 +0000 (11:05 +0100)]
crypto/qat: fix status in RSA decryption

This commit fixes not set crypto op status when decrypting
with RSA algorithm.

Fixes: e2c5f4ea994c ("crypto/qat: support RSA in asym")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agomaintainers: update for AMD CCP
Chandubabu Namburu [Thu, 21 Oct 2021 06:17:17 +0000 (06:17 +0000)]
maintainers: update for AMD CCP

Updating AMD CCP crypto maintainer.

Signed-off-by: Chandubabu Namburu <chandu@amd.com>
Acked-by: Somalapuram Amaranath <asomalap@amd.com>
2 years agotest/crypto: fix max length for raw data path
Kai Ji [Fri, 8 Oct 2021 11:33:45 +0000 (12:33 +0100)]
test/crypto: fix max length for raw data path

Update the calculation of the max length needed when converting mbuf to
data vec in partial digest test case. This update make sure the enough
vec buffers are allocated for the appended digest in sgl op for raw
datapath api.

Fixes: 4868f6591c6f ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org
Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agobbdev: promote API as stable
Nicolas Chautru [Tue, 31 Aug 2021 16:25:30 +0000 (09:25 -0700)]
bbdev: promote API as stable

This promotes the bbdev interface to stable.
Overdue for some time as bbdev interface has been stable.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: support on Windows
Tal Shnaiderman [Mon, 25 Oct 2021 08:46:17 +0000 (11:46 +0300)]
crypto/mlx5: support on Windows

Add support for mlx5 crypto pmd on Windows OS.
Add changes to release note and PMD guide.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agodrivers/crypto: move Windows build check
Tal Shnaiderman [Mon, 25 Oct 2021 08:46:16 +0000 (11:46 +0300)]
drivers/crypto: move Windows build check

Remove the check and build failure from crypto/meson.build
in case building for Windows OS.

Add this check/failure in the meson.build file of each crypto PMD
that is not enforcing it to allow PMD support for Windows
per driver when applicable.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: fix size of UMR WQE
Tal Shnaiderman [Mon, 25 Oct 2021 08:46:15 +0000 (11:46 +0300)]
crypto/mlx5: fix size of UMR WQE

The size of the UMR WQE allocated object is decided by a sizof
operation on the struct, however since the struct contains
a union of flexible array members this sizeof results can differ
between compilers.

GCC for example treats the union as 0 sized, MSVC adds a padding
of 16Bits.

To resolve the ambiguity the allocation size will be calculated
by the sizes of the members excluding the flexible union.

Fixes: a1978aa23bf4 ("crypto/mlx5: add maximum segments configuration")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocrypto/mlx5: replace mutex initializer
Tal Shnaiderman [Mon, 25 Oct 2021 08:46:14 +0000 (11:46 +0300)]
crypto/mlx5: replace mutex initializer

Remove the usage of PTHREAD_MUTEX_INITIALIZER which is not
supported in Windows and initialize priv_list_lock in RTE_INIT.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: add Direct Verbs constants for Windows
Tal Shnaiderman [Mon, 25 Oct 2021 08:46:13 +0000 (11:46 +0300)]
common/mlx5: add Direct Verbs constants for Windows

Add needed DV enums used by the crypto PMD and missing
for Windows OS.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocryptodev: add telemetry endpoint for capabilities
Gowrishankar Muthukrishnan [Tue, 26 Oct 2021 13:13:10 +0000 (18:43 +0530)]
cryptodev: add telemetry endpoint for capabilities

Add telemetry endpoint for getting cryptodev capabilities.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: support telemetry
Rebecca Troy [Tue, 26 Oct 2021 12:00:45 +0000 (12:00 +0000)]
cryptodev: support telemetry

The cryptodev library now registers commands with telemetry, and
implements the corresponding callback functions. These commands
allow a list of cryptodevs to be queried, as well as info and stats
for the corresponding cryptodev.

An example usage can be seen below:

Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 21.11.0-rc0", "pid": 1135019, "max_output_len": 16384}
--> /
{"/": ["/", "/cryptodev/info", "/cryptodev/list", "/cryptodev/stats", ...]}
--> /cryptodev/list
{"/cryptodev/list": [0,1,2,3]}
--> /cryptodev/info,0
{"/cryptodev/info": {"device_name": "0000:1c:01.0_qat_sym", \
 "max_nb_queue_pairs": 2}}
--> /cryptodev/stats,0
{"/cryptodev/stats": {"enqueued_count": 0, "dequeued_count": 0, \
"enqueue_err_count": 0, "dequeue_err_count": 0}}

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodoc: remove deprecation notice for interrupt
Harman Kalra [Wed, 3 Nov 2021 17:50:56 +0000 (23:20 +0530)]
doc: remove deprecation notice for interrupt

Deprecation notice targeted for 21.11 has been committed with
following as the first commit of the series.

Fixes: b7c984291611 ("interrupts: add allocator and accessors")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agonet/sfc: allow control threads for counter queue polling
Viacheslav Galaktionov [Wed, 3 Nov 2021 13:13:31 +0000 (16:13 +0300)]
net/sfc: allow control threads for counter queue polling

MAE counters can be polled from a control thread if no service core is
allocated for this.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/sfc: merge Rx and Tx doorbell counters into one
Andrew Rybchenko [Tue, 2 Nov 2021 13:13:40 +0000 (16:13 +0300)]
net/sfc: merge Rx and Tx doorbell counters into one

Datapath queue is either Rx or Tx, so just one counter is sufficient
for doorbells. It can count Tx doorbells in the case of Tx queue and
Rx doorbells in the case of Rx queue.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agodoc: add flow flex item to default NIC features
Gregory Etelson [Thu, 4 Nov 2021 16:00:14 +0000 (18:00 +0200)]
doc: add flow flex item to default NIC features

Flex item or flex parser is port infrastructure that allows
application to add support for a custom network header and
offload flows to match the header elements.

Flex item API adds FLEX flow item to RTE flows.

Fixes: dc4d860e8a89 ("ethdev: introduce configurable flexible item")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/txgbe: fix packet statistics
Jiawen Wu [Tue, 2 Nov 2021 08:10:25 +0000 (16:10 +0800)]
net/txgbe: fix packet statistics

Fix specific length packet statistics caused by wrong register
addresses.

Fixes: 24a4c76aff4d ("net/txgbe: add error types and registers")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/hns3: refactor multi-process initialization
Huisong Li [Tue, 2 Nov 2021 01:38:29 +0000 (09:38 +0800)]
net/hns3: refactor multi-process initialization

Currently, the logic of the PF and VF initialization codes for multiple
process is the same. A common function can be extracted to initialize
and unload multiple process.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: unregister MP action on close for secondary
Huisong Li [Tue, 2 Nov 2021 01:38:28 +0000 (09:38 +0800)]
net/hns3: unregister MP action on close for secondary

This patch fixes lack of unregistering MP action for secondary process
when PMD is closed.

Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix multi-process action register and unregister
Huisong Li [Tue, 2 Nov 2021 01:38:27 +0000 (09:38 +0800)]
net/hns3: fix multi-process action register and unregister

The multi-process has the following problems:
1) After a port in primary process is closed, the mp action of the
   process is unregistered. Which will cause that other device in the
   primary process cannot respond to requests from secondary processes.
2) Because variable "hns3_inited" is set to true without returning an
   initial value, the mp action cannot be registered again after it is
   unregistered.
3) The mp action of primary and secondary process need to be registered
   only once regardless of port numbers in the process. That's what
   variable "hns3_inited" does. But the variable is difficult to
   understand.

This patch adds a hns3_process_local_data structure to resolve above
problems.

Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result")
Fixes: 23d4b61fee5d ("net/hns3: support multiple process")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix secondary process reference count
Huisong Li [Tue, 2 Nov 2021 01:38:26 +0000 (09:38 +0800)]
net/hns3: fix secondary process reference count

The "secondary_cnt" will be increased when a secondary process
initialized. But the value of this variable is not decreased when the
secondary process exits, which causes the primary process senses that
the secondary process still exists. As a result, the primary process
fails to send messages to the secondary process after the secondary
process exits.

Fixes: 23d4b61fee5d ("net/hns3: support multiple process")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/ice: fix flow redirect
Dapeng Yu [Thu, 4 Nov 2021 08:45:35 +0000 (16:45 +0800)]
net/ice: fix flow redirect

It's possible that a switch rule can't be redirect successfully due
to kernel driver is busy to handle an ongoing VF reset, so the
redirect action need to be deferred into next redirect request which
is promised by kernel driver after VF reset done.

This patch uses the saved flow rule's data to replay switch rule
remove/add during next flow redirect.

Fixes: 397b4b3c5095 ("net/ice: enable flow redirect on switch")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: save rule on switch filter creation
Dapeng Yu [Thu, 4 Nov 2021 08:45:34 +0000 (16:45 +0800)]
net/ice: save rule on switch filter creation

The VSI number, lookup elements and rule information for creating switch
filter are abandoned when switch filter is created in original
implementation.

This patch saved the abandoned data in RTE flow, it is for future
use on replay when handling exception at flow redirect.

Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix order of flow filter parser list
Yuying Zhang [Tue, 2 Nov 2021 10:45:05 +0000 (10:45 +0000)]
net/ice: fix order of flow filter parser list

The order of flow filter parser list was not definite and
linked to the register order of parsers. It caused ACL filter
covered by switch filter in some cases.

This patch fixed order of parser list to guarantee the usage
of each filter. Below lists the order.
ACL filter > Switch filter > FDIR > Hash filter.

Fixes: e4a0a7599d97 ("net/ice: fix flow priority support in non-pipeline mode")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agoethdev: fix variable length flow elements support
Gregory Etelson [Thu, 4 Nov 2021 11:27:21 +0000 (13:27 +0200)]
ethdev: fix variable length flow elements support

RTE flow API defines two flow elements types - common and PMD private.
Common RTE flow types are defined in rte_flow.h while PMD private
types exists inside specific PMD only. Application can create a flow
rule with PMD private items or actions. RTE flow API restricts
private PMD types to negative values.

Current implementation tried to use negative PMD private item type
value as index in the rte_flow_desc_item[] array.

The patch allows access to rte_flow_desc_item[] and
rte_flow_desc_action[] arrays to non-private PMD types only.

Fixes: 6cf72047332b ("ethdev: support flow elements with variable length")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/af_packet: fix ignoring full ring on Tx
Tudor Cornea [Tue, 2 Nov 2021 15:47:24 +0000 (17:47 +0200)]
net/af_packet: fix ignoring full ring on Tx

The poll call can return POLLERR which is ignored, or it can return
POLLOUT, even if there are no free frames in the mmap-ed area.

We can account for both of these cases by re-checking if the next
frame is empty before writing into it.

We have attempted to reproduce this issue with pktgen-dpdk, using the
following configuration.

pktgen -l 1-4 -n 4 --proc-type=primary --no-pci --no-telemetry \
    --no-huge -m 512 \
    --vdev=net_af_packet0,iface=eth1,blocksz=16384,framesz=8192, \
    framecnt=2048,qpairs=1,qdisc_bypass=0 \
    -- \
    -P \
    -T \
    -m "3.0" \
    -f themes/black-yellow.theme

We configure a low tx rate (~ 335 packets / second) and a small
packet size, of about 300 Bytes from the pktgen CLI.

set 0 size 300
set 0 rate 0.008
set 0 burst 1
start 0

After bringing the interface down, and up again, we seem to arrive
in a state in which the tx rate is inconsistent, and does not recover.

ifconfig eth1 down; sleep 7; ifconfig eth1 up

[1] http://code.dpdk.org/pktgen-dpdk/pktgen-20.11.2/source/INSTALL.md

Fixes: 364e08f2bbc0 ("af_packet: add PMD for AF_PACKET-based virtual devices")
Cc: stable@dpdk.org
Signed-off-by: Mihai Pogonaru <pogonarumihai@gmail.com>
Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/sfc: support Xilinx Riverhead VF
Igor Romanov [Fri, 29 Oct 2021 15:33:30 +0000 (18:33 +0300)]
net/sfc: support Xilinx Riverhead VF

Add the device and vendor numbers to the PCI ID map so
that a VF can be probed.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/enic: support GTP header flow matching
John Daley [Thu, 28 Oct 2021 20:04:24 +0000 (13:04 -0700)]
net/enic: support GTP header flow matching

The GTP, GTP-U, GTP-C header fields can be matched, however NIC does not
support GTP tunneling so no items after the GTP header can be specified.
If a GTP-U or GTP-C item is specified without a preceding UDP item, the
UDP destination port is implicitly matched. For GTP, the destination UDP
port must be specified but its value is not enforced.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Hyong Youb Kim <hyonkim@cisco.com>
2 years agoethdev: promote device removal check function as stable
Thomas Monjalon [Thu, 28 Oct 2021 08:35:13 +0000 (10:35 +0200)]
ethdev: promote device removal check function as stable

The function rte_eth_dev_is_removed() was introduced in DPDK 18.02,
and is integrated in error checks of ethdev library.

It is promoted as stable ABI.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/ice: enable protocol agnostic flow offloading in RSS
Ting Xu [Thu, 4 Nov 2021 02:22:28 +0000 (10:22 +0800)]
net/ice: enable protocol agnostic flow offloading in RSS

Enable protocol agnostic flow offloading to support raw pattern input
for RSS hash flow rule creation. It is based on Parser Library feature.
Current rte_flow raw API is utilized.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: support add HW profile for RSS raw flow
Ting Xu [Thu, 4 Nov 2021 02:22:27 +0000 (10:22 +0800)]
net/ice/base: support add HW profile for RSS raw flow

Based on the parser library, we can directly set HW profile and
associate VSI for RSS raw flows. Add symmetric hash configuration
for raw flow.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/enic: avoid error message when no advanced filtering
Hyong Youb Kim [Tue, 26 Oct 2021 00:04:18 +0000 (17:04 -0700)]
net/enic: avoid error message when no advanced filtering

Probing the availability of Flow Manager API may print the following
error log.

PMD: rte_enic_pmd: Devcmd 88 failed with error code -1

The error indicates a flow manager operation failed and happens when
advanced filtering is disabled on vNIC. It is harmless but confusing
to the user. Since advanced filtering is a prerequisite, check first
if it is available and avoid the error message altogether.

Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2 years agonet/enic: fix crash caused by changing MTU
Hyong Youb Kim [Tue, 26 Oct 2021 00:02:56 +0000 (17:02 -0700)]
net/enic: fix crash caused by changing MTU

Changing MTU after the device start causes a segfault in the Rx
handler. The MTU handler (enic_set_mtu) performs the following steps.
1. Stop NIC Rx
2. Change Rx handler '(struct rte_eth_dev)->rx_pkt_burst' to
   the dummy handler and sleep a while to quiesce
3. Re-allocate/initialize Rx structures
4. Change Rx handler back to the real handler
   (e.g. enic_noscatter_recv_pkts)

enic_set_mtu does not update the recently introduced fast-path pointer
'(struct rte_eth_fp_ops)->rx_pkt_burst'. Since rte_eth_rx_burst only
uses the fast-path pointer, it keeps invoking the real Rx handler, not
the dummy one set by (2). And, (3) causes a segfault in the real Rx
handler (e.g. dereferencing freed structures).

Fix the segfault by updating the fast-path pointer as well.

Fixes: c87d435a4d79 ("ethdev: copy fast-path API into separate structure")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2 years agodoc: add BPHY to list of cnxk platform blocks
Tomasz Duszynski [Tue, 2 Nov 2021 18:41:34 +0000 (19:41 +0100)]
doc: add BPHY to list of cnxk platform blocks

Add BPHY to the list of platform hardware accelerator blocks.

Fixes: 3d27e49e0722 ("raw/cnxk_bphy: add BPHY CGX/RPM skeleton driver")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoraw/cnxk_bphy: add header includes
Tomasz Duszynski [Tue, 2 Nov 2021 18:41:33 +0000 (19:41 +0100)]
raw/cnxk_bphy: add header includes

Generally it is good practice to include all headers that provide APIs
which are being used. This is especially true in situations where 3rd
party apps include our public headers and assume that all should work
out of the box.

Including all headers explicitly helps to achieve that.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoraw/cnxk_bphy: keep leading zero in device name
Tomasz Duszynski [Tue, 2 Nov 2021 18:41:32 +0000 (19:41 +0100)]
raw/cnxk_bphy: keep leading zero in device name

Device naming might be misleading which is especially true if one takes
it from lspci output. In order to keep naming consistent keep leading
zero in front of pci bus number.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: integrate BPF count get mailbox
Rakesh Kudurumalla [Tue, 2 Nov 2021 06:41:36 +0000 (12:11 +0530)]
net/cnxk: integrate BPF count get mailbox

Bandwidth profile count is updated in meter capabilities during device
initialization using mbox interface.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoraw/cnxk_bphy: remove dependencies from internal headers
Jakub Palider [Tue, 2 Nov 2021 18:41:31 +0000 (19:41 +0100)]
raw/cnxk_bphy: remove dependencies from internal headers

This patch resolves problem with internal header
inclusion. In addition prevents C++ name mangling.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix device MSI-X greater than default value
Harman Kalra [Wed, 3 Nov 2021 07:59:14 +0000 (13:29 +0530)]
common/cnxk: fix device MSI-X greater than default value

Handling the case where number of MSIX interrupts are greater
than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe
device is queried for supported MSIX interrupts, and respective
interrupt resources are reallocated with this value. Same MSIX
count should be used while registering new interrupt vectors.

Fixes: 8cb5d08db940 ("interrupts: extend event list")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix typos
Tomasz Duszynski [Tue, 2 Nov 2021 18:47:13 +0000 (19:47 +0100)]
common/cnxk: fix typos

Fix a few typos.

Fixes: fa8f86a14e2e ("common/cnxk: add build infrastructre and HW definition")
Fixes: f6d567b03d28 ("common/cnxk: support NIX IRQ")
Fixes: 5e076b609f2a ("common/cnxk: add SE set key for crypto")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: consider adjust value for TM burst calculation
Satha Rao [Mon, 1 Nov 2021 07:28:57 +0000 (03:28 -0400)]
common/cnxk: consider adjust value for TM burst calculation

To support lower pps in packet mode we are changing adjust value,
same needs to be consider for burst size calculations.

When both peak and committed rates requested, then peak rate should
be larger than committed rate.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: change policer time unit to configured value
Rakesh Kudurumalla [Tue, 2 Nov 2021 06:41:35 +0000 (12:11 +0530)]
common/cnxk: change policer time unit to configured value

Ingress meter rate is calculated based on hardcoded
policer time unit. Patch adds mbox interface to
retrieve configured policer time unit.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoevent/cnxk: disable drop Rx error on vector enable
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:20 +0000 (21:24 +0530)]
event/cnxk: disable drop Rx error on vector enable

Disable drop_re i.e dropping packets with receive errors on
vector enable for few cn10k revisions due to HW errata.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: allow FC on LBK and enable TM BP on Rx pause
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:19 +0000 (21:24 +0530)]
net/cnxk: allow FC on LBK and enable TM BP on Rx pause

Allow flow control on LBK VF's and enable TM to listen on
backpressure when Rx pause is enabled.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support CPT CTX write through microcode op
Srujana Challa [Tue, 2 Nov 2021 15:54:18 +0000 (21:24 +0530)]
net/cnxk: support CPT CTX write through microcode op

Adds support to write CPT CTX through microcode op(SET_CTX/WRITE_SA)
for cn10k inline mode.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support changing drop Rx error flag
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:17 +0000 (21:24 +0530)]
common/cnxk: support changing drop Rx error flag

Added API to toggle drop_re flag after nix_lf_alloc() so that it
can be used to toggle it runtime.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable backpressure on CPT with inline inbound
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:16 +0000 (21:24 +0530)]
common/cnxk: enable backpressure on CPT with inline inbound

Enable backpressure on CPT with inline inbound enabled.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable TM to listen on Rx pause frames
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:15 +0000 (21:24 +0530)]
common/cnxk: enable TM to listen on Rx pause frames

Enable TM topology to listen on backpressure received when
Rx pause frame is enabled. Only one TM node in Tl3/TL2 per
channel can listen on backpressure on that channel.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support flow control on loopback interface
Nithin Dabilpuram [Tue, 2 Nov 2021 15:54:14 +0000 (21:24 +0530)]
common/cnxk: support flow control on loopback interface

Support flow control enable/disable on LBK VF's as HW
supports backpressure on LBK links.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support CPT CTX sync mailbox
Srujana Challa [Tue, 2 Nov 2021 15:54:13 +0000 (21:24 +0530)]
common/cnxk: support CPT CTX sync mailbox

Add CPT CTX sync mailbox API and flush IPsec inbound entries
at application exit.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support CPT CTX write through microcode op
Srujana Challa [Tue, 2 Nov 2021 15:54:12 +0000 (21:24 +0530)]
common/cnxk: support CPT CTX write through microcode op

Adds APIs to write CPT CTX through microcode op(SET_CTX/WRITE_SA).

Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agovhost: rename driver callbacks struct
Maxime Coquelin [Tue, 2 Nov 2021 10:47:48 +0000 (11:47 +0100)]
vhost: rename driver callbacks struct

As previously announced, this patch renames struct
vhost_device_ops to struct rte_vhost_device_ops.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agodoc: remove deprecation notice for vhost
Chenbo Xia [Wed, 3 Nov 2021 05:00:26 +0000 (13:00 +0800)]
doc: remove deprecation notice for vhost

Ten vhost APIs were announced to be stable and promoted in below
commit, so remove the related deprecation notice.

Fixes: 945ef8a04098 ("vhost: promote some APIs to stable")

Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: mark vDPA driver API as internal
Maxime Coquelin [Tue, 2 Nov 2021 09:56:11 +0000 (10:56 +0100)]
vhost: mark vDPA driver API as internal

This patch marks the vDPA driver APIs as internal and
rename the corresponding header file to vdpa_driver.h.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/ice: enable protocol agnostic flow offloading in FDIR
Junfeng Guo [Wed, 3 Nov 2021 04:40:03 +0000 (12:40 +0800)]
net/ice: enable protocol agnostic flow offloading in FDIR

Protocol agnostic flow offloading in Flow Director is enabled by this
patch based on the Parser Library, using existing rte_flow raw API.

Note that the raw flow requires:
1. byte string of raw target packet bits.
2. byte string of mask of target packet.

Here is an example:
FDIR matching ipv4 dst addr with 1.2.3.4 and redirect to queue 3:

flow create 0 ingress pattern raw \
pattern spec \
00000000000000000000000008004500001400004000401000000000000001020304 \
pattern mask \
000000000000000000000000000000000000000000000000000000000000ffffffff \
/ end actions queue index 3 / mark id 3 / end

Note that mask of some key bits (e.g., 0x0800 to indicate ipv4 proto)
is optional in our cases. To avoid redundancy, we just omit the mask
of 0x0800 (with 0xFFFF) in the mask byte string example. The prefix
'0x' for the spec and mask byte (hex) strings are also omitted here.

Also update the ice feature list with rte_flow item raw.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agoapp/testpmd: increase max raw pattern size to 512
Junfeng Guo [Wed, 3 Nov 2021 04:40:02 +0000 (12:40 +0800)]
app/testpmd: increase max raw pattern size to 512

Update max size for pattern in struct rte_flow_item_raw to enable
protocol agnostic flow offloading.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: add function to set HW profile for raw flow
Junfeng Guo [Wed, 3 Nov 2021 04:40:01 +0000 (12:40 +0800)]
net/ice/base: add function to set HW profile for raw flow

Based on the parser library, we can directly set HW profile and
associate the main/ctrl vsi.

This patch set also updated the base code BSD release version.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: add method to disable FDIR swap option
Junfeng Guo [Wed, 3 Nov 2021 04:40:00 +0000 (12:40 +0800)]
net/ice/base: add method to disable FDIR swap option

In this patch, we introduced a new parameter to enable/disable the
FDIR SWAP option by setting the swap and inset register set with
certain values.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/bnxt: fix firmware version query
Stephen Hemminger [Tue, 2 Nov 2021 21:27:44 +0000 (14:27 -0700)]
net/bnxt: fix firmware version query

UBSan testing revealed undefined shift here.

The firmware returns the version in bytes; and shifting a 8 bit
quantity here can lead to undefined behaviour or truncation.
The fix is to promote the bytes to 32 bit before shifting.

Bugzilla ID: 838
Fixes: 9a891c1764ea ("net/bnxt: update HWRM to version 1.9.2")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/sfc: ignore direction attributes in transfer flows
Ivan Malov [Mon, 25 Oct 2021 11:04:15 +0000 (14:04 +0300)]
net/sfc: ignore direction attributes in transfer flows

[1] has deprecated the use of direction attributes in "transfer"
flows. Ignore them during the transition period.

[1]
commit 9d2a349b388a ("ethdev: deprecate direction attributes in transfer flows")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: support port representor related flow actions
Ivan Malov [Mon, 25 Oct 2021 11:04:14 +0000 (14:04 +0300)]
net/sfc: support port representor related flow actions

Add support for actions PORT_REPRESENTOR and REPRESENTED_PORT.

The former should be used instead of ambiguous PORT_ID.

The latter sends traffic to the entity represented by
the given ethdev (network port or VF).

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: support represented port flow item
Ivan Malov [Mon, 25 Oct 2021 11:04:13 +0000 (14:04 +0300)]
net/sfc: support represented port flow item

Add support for item REPRESENTED_PORT to match on traffic entering
the embedded switch from the entity represented by the given
ethdev (network port or VF).

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: assign correct m-ports to independent switch ports
Ivan Malov [Mon, 25 Oct 2021 11:04:12 +0000 (14:04 +0300)]
net/sfc: assign correct m-ports to independent switch ports

In accordance with patches [1-4], MAE admin ethdev represents a
network port and not the PF which it sits on. Rework the way
how "ethdev" and "entity" m-ports are assigned in SW switch
port entries of independent ethdevs. Explain in comments.

[1] commit 081e42dab11d ("ethdev: add port representor item to flow API")
[2] commit 49863ae2bf95 ("ethdev: add represented port item to flow API")
[3] commit 8edb6bc0263e ("ethdev: add port representor action to flow API")
[4] commit 88caad251c8d ("ethdev: add represented port action to flow API")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: improve m-port related log messages
Ivan Malov [Mon, 25 Oct 2021 11:04:11 +0000 (14:04 +0300)]
net/sfc: improve m-port related log messages

Make these messages more specific.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: rename ethdev m-port retrieval helper
Ivan Malov [Mon, 25 Oct 2021 11:04:10 +0000 (14:04 +0300)]
net/sfc: rename ethdev m-port retrieval helper

The function in question has an unfortunate name that reads
like finding a SW switch port entry. In fact just one of
the two m-ports is retrieved from that entry.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: do not allow flow rules to refer to VF representors
Ivan Malov [Mon, 25 Oct 2021 11:04:09 +0000 (14:04 +0300)]
net/sfc: do not allow flow rules to refer to VF representors

VF representors do not own dedicated m-ports and thus cannot
be referred to as traffic endpoints in flow items or actions.

Fixes: a62ec90522a6 ("net/sfc: add port representors infrastructure")
Fixes: f55b61cec94a ("net/sfc: support port representor flow item")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/mlx5: preserve indirect actions on restart
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:35 +0000 (19:01 +0200)]
net/mlx5: preserve indirect actions on restart

MLX5 PMD uses reference counting to manage RX queue resources.
After port stop shared RSS actions kept references to RX queues,
preventing resource release. As a result, internal PMD mempool
for such queues had been exhausted after a number of port restarts.
Diagnostic message from rte_eth_dev_start():

    Rx queue allocation failed: Cannot allocate memory

Dereference RX queues used by indirect actions on port stop (detach)
and restore references on port start (attach) in order to allow RX queue
resource release, but keep indirect RSS across the port restart.
Replace queue IDs in HW by drop queue ID on detach and restore actual
queue IDs on attach.

When the port is stopped, create indirect RSS in the detached state.
As a result, MLX5 PMD is able to keep all its indirect actions
across port restart. Advertise this capability.

Fixes: 4b61b8774be9 ("ethdev: introduce indirect flow action")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: create drop queue using DevX
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:34 +0000 (19:01 +0200)]
net/mlx5: create drop queue using DevX

Drop queue creation and destruction were not implemented for DevX
flow engine and Verbs engine methods were used as a workaround.
Implement these methods for DevX so that there is a valid queue ID
that can be used regardless of queue configuration via API.

Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: discover max flow priority using DevX
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:33 +0000 (19:01 +0200)]
net/mlx5: discover max flow priority using DevX

Maximum available flow priority was discovered using Verbs API
regardless of the selected flow engine. This required some Verbs
objects to be initialized in order to use DevX engine. Make priority
discovery an engine method and implement it for DevX using its API.

Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agodrivers/net: advertise no support for keeping flow rules
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:32 +0000 (19:01 +0200)]
drivers/net: advertise no support for keeping flow rules

When RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP capability bit is zero,
the specified behavior is the same as it had been before
this bit was introduced. Explicitly reset it in all PMDs
supporting rte_flow API in order to attract the attention
of maintainers, who should eventually choose to advertise
the new capability or not. It is already known that
mlx4 and mlx5 will not support this capability.

For RTE_ETH_DEV_CAPA_FLOW_SHARED_OBJECT_KEEP
similar action is not performed,
because no PMD except mlx5 supports indirect actions.
Any PMD that starts doing so will anyway have to consider
all relevant API, including this capability.

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agoethdev: add capability to keep shared objects on restart
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:31 +0000 (19:01 +0200)]
ethdev: add capability to keep shared objects on restart

rte_flow_action_handle_create() did not mention what happens
with an indirect action when a device is stopped and started again.
It is natural for some indirect actions, like counter, to be persistent.
Keeping others at least saves application time and complexity.
However, not all PMDs can support it, or the support may be limited
by particular action kinds, that is, combinations of action type
and the value of the transfer bit in its configuration.

Add a device capability to indicate if at least some indirect actions
are kept across the above sequence. Without this capability the behavior
is still unspecified, and application is required to destroy
the indirect actions before stopping the device.
In the future, indirect actions may not be the only type of objects
shared between flow rules. The capability bit intends to cover all
possible types of such objects, hence its name.

Declare that the application can test for the persistence
of a particular indirect action kind by attempting to create
an indirect action of that kind when the device is stopped
and checking for the specific error type.
This is logical because if the PMD can to create an indirect action
when the device is not started and use it after the start happens,
it is natural that it can move its internal flow shared object
to the same state when the device is stopped and restore the state
when the device is started.

Indirect action persistence across a reconfigurations is not required.
In case a PMD cannot keep the indirect actions across reconfiguration,
it is allowed just to report an error.
Application must then flush the indirect actions before attempting it.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add capability to keep flow rules on restart
Dmitry Kozlyuk [Tue, 2 Nov 2021 17:01:30 +0000 (19:01 +0200)]
ethdev: add capability to keep flow rules on restart

Previously, it was not specified what happens to the flow rules
when the device is stopped, possibly reconfigured, then started.
If flow rules were kept, it could be convenient for application
developers, because they wouldn't need to save and restore them.
However, due to the number of flows and possible creation rate it is
impractical to save all flow rules in DPDK layer. This means that flow
rules persistence really depends on whether PMD and HW can implement it
efficiently. It can also be limited by the rule item and action types,
and its attributes transfer bit (a combination of an item/action type
and a value of the transfer bit is called a rule feature).

Add a device capability bit for PMDs that can keep at least some
of the flow rules across restart. Without this capability behavior
is still unspecified and it is declared that the application must
flush the rules before stopping the device.
Allow the application to test for persistence of rules using
a particular feature by attempting to create a flow rule
using that feature when the device is stopped
and checking for the specific error.
This is logical because if the PMD can to create the flow rule
when the device is not started and use it after the start happens,
it is natural that it can move its internal flow rule object
to the same state when the device is stopped and restore the state
when the device is started.

Rule persistence across a reconfigurations is not required,
because tracking all the rules and configuration-dependent resources
they use may be infeasible. In case a PMD cannot keep the rules
across reconfiguration, it is allowed just to report an error.
Application must then flush the rules before attempting it.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agobonding: show Tx policy for 802.3AD mode
Min Hu (Connor) [Mon, 25 Oct 2021 03:15:11 +0000 (11:15 +0800)]
bonding: show Tx policy for 802.3AD mode

As balance xmit policy is supported in bonding mode 4(802.3AD). This
patch adds balance xmit policy show in testpmd commands for mode 4. Like:
testpmd> show bonding config 2
        Bonding mode: 4
        Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER34
        IEEE802.3AD Aggregator Mode: stable
        Slaves (2): [0 1]
        Active Slaves (2): [1 0]
        Primary: [1]

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/af_xdp: use BPF link for XDP programs
Ciara Loftus [Fri, 22 Oct 2021 10:42:53 +0000 (10:42 +0000)]
net/af_xdp: use BPF link for XDP programs

Since v0.4.0, if the underlying kernel supports it, libbpf uses 'bpf
link' to manage the programs on the interfaces of the xsks. This has two
repercussions for the PMD.

1. In the case where the PMD asks libbpf to load the default XDP
   program, the PMD no longer needs to remove it on teardown. This is
   because bpf link handles the unloading under the hood.
2. In the case where the PMD loads a custom program, libbpf expects this
   program to be linked via bpf link prior to creating the socket.

This patch introduces probes for the libbpf version and kernel support
for bpf link and orchestrates the loading and unloading of
programs according to the capabilities of the kernel and libbpf. The
libbpf version is checked with meson and pkg-config. The probe for
kernel support mirrors how it is implemented in libbpf. A bpf_link is
created and looked up on loopback device. If successful, bpf_link will
be used for the AF_XDP netdev.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
2 years agonet/mlx5: fix RSS expansion with EtherType
Lior Margalit [Mon, 1 Nov 2021 06:38:41 +0000 (08:38 +0200)]
net/mlx5: fix RSS expansion with EtherType

The RSS expansion algorithm is using a graph to find the possible
expansion paths. A graph node with the 'explicit' flag will be skipped,
if it is not found in the flow pattern.
The current implementation misses a check for the explicit flag when
expanding the pattern according to ETH item with EtherType.
For example:
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / vxlan / eth
type is 2048 / end actions rss level 2 types udp end / end
The "eth type is 2048" item in the pattern may be expanded to "ETH IPv4".
The ETH node in the expansion graph is followed by VLAN node marked as
explicit. The fix is to skip the VLAN node and continue the expansion
with its next nodes, IPv4 and IPv6.
The expansion paths for the above example will be:
ETH IPV6 UDP VXLAN ETH END
ETH IPV6 UDP VXLAN ETH IPV4 UDP END

Fixes: 69d268b4fff3 ("net/mlx5: fix RSS expansion for explicit graph node")
Cc: stable@dpdk.org
Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix meter action pool protection
Jiawei Wang [Mon, 1 Nov 2021 06:30:40 +0000 (08:30 +0200)]
net/mlx5: fix meter action pool protection

The ASO meter action with flows creation could be supported on
multiple threads. The meter pools were created to manage the meter
object resources, if there is no room in the current meter pool then
resize the meter pool to the new pool size and free the old one.

There's a race condition while one thread resizes the meter pool and
the old pool resource be freed, and another thread query the meter
object by index on the old pool, the return value is invalid.

This patch adds a read-write lock to protect the pool resource while
resizing and query.

Fixes: a5835d530f00 ("net/mlx5: optimize Rx queue match")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix age action pool protection
Jiawei Wang [Mon, 1 Nov 2021 06:30:39 +0000 (08:30 +0200)]
net/mlx5: fix age action pool protection

The age action with flows creation could be supported on the multiple
threads. The age pools were created to manage the age resources, if
there is no room in the current pool then resize the age pool to the new
pool size and free the old one.

There's a race condition while one thread resizes the age pool and the
old pool resource be freed, and another thread query the age action
value of the old pool so the queried value is invalid.

This patch uses the read-write lock to protect the pool resource while
resizing and query.

Fixes: a5835d530f00 ("net/mlx5: optimize Rx queue match")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoethdev: remove deprecation notice for shared Rx queue
Xueming Li [Tue, 2 Nov 2021 11:42:20 +0000 (19:42 +0800)]
ethdev: remove deprecation notice for shared Rx queue

Shared Rx queue feature has been supported, remove deprecation notice.

Fixes: dd22740cc291 ("ethdev: introduce shared Rx queue")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agoraw/cnxk_bphy: support telemetry
Tomasz Duszynski [Fri, 22 Oct 2021 11:56:25 +0000 (13:56 +0200)]
raw/cnxk_bphy: support telemetry

Added /cnxk/bphy/info telemetry endpoint.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/txgbe: fix link negotiation value
Ferruh Yigit [Mon, 1 Nov 2021 13:19:32 +0000 (13:19 +0000)]
net/txgbe: fix link negotiation value

Macro is changed unintentionally while adding RTE_ prefix, fixing the
original value.

Fixes: 295968d17407 ("ethdev: add namespace")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/hns3: unify multicast MAC address set list
Huisong Li [Fri, 22 Oct 2021 09:20:05 +0000 (17:20 +0800)]
net/hns3: unify multicast MAC address set list

This patch removes hns3vf_set_mc_mac_addr_list() and uses
hns3_set_mc_mac_addr_list() to do this.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor multicast MAC address set for PF
Huisong Li [Fri, 22 Oct 2021 09:20:04 +0000 (17:20 +0800)]
net/hns3: refactor multicast MAC address set for PF

Currently, when configuring a group of multicast MAC addresses, the PF
driver reorder mc_addr array in hw struct to remove multicast MAC
addresses that are not in mc_addr_set array from user and then adds new
multicast MAC addresses. Actually, it can be simplified by removing all
previous MAC addresses and then adding new MAC addresses.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: unify multicast address check
Huisong Li [Fri, 22 Oct 2021 09:20:03 +0000 (17:20 +0800)]
net/hns3: unify multicast address check

This patch uniforms a common function to check multicast address
validity for PF and VF.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: unify MAC address add and remove
Huisong Li [Fri, 22 Oct 2021 09:20:02 +0000 (17:20 +0800)]
net/hns3: unify MAC address add and remove

The code logic of adding and removing MAC address in PF and VF is the
same.
This patch extracts two common interfaces to add and remove them
separately.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: unify MAC and multicast address configuration
Huisong Li [Fri, 22 Oct 2021 09:20:01 +0000 (17:20 +0800)]
net/hns3: unify MAC and multicast address configuration

Currently, the interface logic for adding and deleting all MAC address
and multicast address in PF and VF driver is the same. This patch
extracts two common interfaces to configure them separately.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: use HW ops to config MAC features
Huisong Li [Fri, 22 Oct 2021 09:20:00 +0000 (17:20 +0800)]
net/hns3: use HW ops to config MAC features

This patch uses APIs in hns3_hw_ops to configure MAC related features.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: add HW ops structure to operate hardware
Huisong Li [Fri, 22 Oct 2021 09:19:59 +0000 (17:19 +0800)]
net/hns3: add HW ops structure to operate hardware

This patch adds hns3_hw_ops structure to operate hardware in PF and VF
driver.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove redundant multicast removal interface
Huisong Li [Fri, 22 Oct 2021 09:19:58 +0000 (17:19 +0800)]
net/hns3: remove redundant multicast removal interface

This patch removes redundant hns3_remove_mc_addr_common(), which can be
replaced by hns3_remove_mc_mac_addr().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: rename unicast address removal function
Huisong Li [Fri, 22 Oct 2021 09:19:57 +0000 (17:19 +0800)]
net/hns3: rename unicast address removal function

This patch renames hns3_remove_uc_addr_common() to
hns3_remove_uc_mac_addr() in PF.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove redundant multicast MAC interface
Huisong Li [Fri, 22 Oct 2021 09:19:56 +0000 (17:19 +0800)]
net/hns3: remove redundant multicast MAC interface

This patch removes hns3_add_mc_addr_common() in PF and
hns3vf_add_mc_addr_common() in VF.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: extract common interface to check duplicates
Huisong Li [Fri, 22 Oct 2021 09:19:55 +0000 (17:19 +0800)]
net/hns3: extract common interface to check duplicates

Extract a common interface for PF and VF to check whether the configured
multicast MAC address from rte_eth_dev_mac_addr_add() is the same as the
multicast MAC address from rte_eth_dev_set_mc_addr_list().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: rename multicast address removal function
Huisong Li [Fri, 22 Oct 2021 09:19:54 +0000 (17:19 +0800)]
net/hns3: rename multicast address removal function

This patch renames hns3_remove_mc_addr() to hns3_remove_mc_mac_addr().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>