dpdk.git
23 months agonet/ngbe: fix customized device probing
Jiawen Wu [Wed, 29 Jun 2022 03:34:17 +0000 (11:34 +0800)]
net/ngbe: fix customized device probing

The devices with OEM subsystem vendor ID failed to be initialized,
because flash was read before memory address was set.

Fixes: 240422edbf84 ("net/ngbe: support OEM subsystem vendor ID")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
23 months agonet/txgbe: fix customized device probing
Jiawen Wu [Wed, 29 Jun 2022 03:34:16 +0000 (11:34 +0800)]
net/txgbe: fix customized device probing

The devices with OEM subsystem vendor ID failed to be initialized,
because flash was read before memory address was set.

Fixes: 138d869e41c0 ("net/txgbe: support OEM subsystem vendor ID")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
23 months agoapp/testpmd: remove duplicated flow type name table
Ferruh Yigit [Wed, 29 Jun 2022 08:34:51 +0000 (16:34 +0800)]
app/testpmd: remove duplicated flow type name table

Flow type table has two instance, one is used for flow type to string
conversion, and other is used for string to flow type conversion.
And tables are diverged by time.

Unifying tables to prevent maintaining two different tables.

Note: made 'flowtype_to_str()' and 'str_to_flowtype()' non-static to
prevent build error for the case PMDs using it disables. Making the two
functions generic, not for some PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
23 months agoapp/testpmd: reorder RSS type table
Huisong Li [Wed, 29 Jun 2022 08:34:50 +0000 (16:34 +0800)]
app/testpmd: reorder RSS type table

There are group and individual types in rss_type_table[]. However, group
types are very scattered, and individual types are not arranged based on
the bit number order in 'RTE_ETH_RSS_xxx'. For a clear distribution of
types and better maintenance, this patch reorders this table.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
23 months agoapp/testpmd: compact RSS types output
Ferruh Yigit [Wed, 29 Jun 2022 08:34:49 +0000 (16:34 +0800)]
app/testpmd: compact RSS types output

In port info command output, 'show port info all', supported RSS offload
types printed one type per line, and although this information is not
most important part of the command it takes big part of the command
output.

In port RSS hash and flow RSS command output, 'show port 0 rss-hash',
and 'flow query 0 0 rss', all enabled RSS types are printed on one line.
If there are many types, the print will be very long.

Compacting these RSS offloads and types output by fixing the length of
the character string printed on each line, instead of one per line or
one line.
Output becomes as following:

Supported RSS offload flow types:
  ipv4-frag  ipv4-tcp  ipv4-udp  ipv4-sctp  ipv4-other
  ipv6-frag  ipv6-tcp  ipv6-udp  ipv6-sctp  ipv6-other
  l4-dst-only  l4-src-only  l3-dst-only  l3-src-only

Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
23 months agoapp/testpmd: unify RSS types display
Huisong Li [Wed, 29 Jun 2022 08:34:48 +0000 (16:34 +0800)]
app/testpmd: unify RSS types display

The 'rss_type_table[]' maintains the name and value of RSS types. This
patch unifies a common interface to display RSS types.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
23 months agoapp/testpmd: refactor config all RSS command
Huisong Li [Wed, 29 Jun 2022 08:34:47 +0000 (16:34 +0800)]
app/testpmd: refactor config all RSS command

The "port config <port_id> rss-hash-key" and "show port <port_id>
rss-hash key" commands both use the 'rss_type_table[]' to get
'rss_types' or the RSS type name. So this patch uses the
'rss_type_table[]' to get the RSS types.  In this way, this command
naturally supports more individual types.

Suggested-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
23 months agoapp/testpmd: unify name of L2 payload offload
Huisong Li [Wed, 29 Jun 2022 08:34:45 +0000 (16:34 +0800)]
app/testpmd: unify name of L2 payload offload

Currently, the "port config all rss xx" command uses 'ether' name to match
and to set 'RTE_ETH_RSS_L2_PAYLOAD' offload. However, others RSS command,
such as, "port config <port_id> rss-hash-key" and "show port <port_id>
rss-hash key", use 'l2-payload' to represent this offload. So this patch
unifies the name of 'RTE_ETH_RSS_L2_PAYLOAD' offload.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
23 months agoapp/testpmd: fix supported RSS offload display
Huisong Li [Wed, 29 Jun 2022 08:34:44 +0000 (16:34 +0800)]
app/testpmd: fix supported RSS offload display

The rte_eth_dev_info.flow_type_rss_offloads is populated in terms of
RTE_ETH_RSS_* bits. If PMD sets RTE_ETH_RSS_L3_SRC_ONLY to
dev_info->flow_type_rss_offloads. testpmd will display "user defined 63"
when run 'show port info 0'. Because testpmd use flowtype_to_str()
to display the supported RSS offload of PMD. In fact, the function is
used to display flow type in FDIR commands for i40e or ixgbe. This patch
uses the RTE_ETH_RSS_* bits to display supported RSS offload of PMD.

Fixes: b12964f621dc ("ethdev: unification of RSS offload types")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
23 months agodoc: update DLB2 guide
Timothy McDaniel [Sat, 2 Jul 2022 19:35:00 +0000 (14:35 -0500)]
doc: update DLB2 guide

Updated DLB2 guide to document following features.
1) CQ Weight
2) Port COS
3) Maximum CQ depth
4) Maximum enqueue depth

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoevent/dlb2: fix port COS initialization
Timothy McDaniel [Sat, 2 Jul 2022 16:22:39 +0000 (11:22 -0500)]
event/dlb2: fix port COS initialization

Fix cos initialization, handling the default case too.

Substitute the semicolon for the comma
that was expected in the cos_bw command line override.
Commas are not allowed within a multi field option.
The new format is cos_bw=%d:%d:%d:%d, where the sum of
the 4 decimal values must be less than or equal to 100.

Corrected probe-time initialization order.

Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoevent/dlb2: fix CQ depth override credit deadlock
Timothy McDaniel [Sat, 2 Jul 2022 16:22:38 +0000 (11:22 -0500)]
event/dlb2: fix CQ depth override credit deadlock

This commit fixes a bug, where we could encounter a credit
deadlock due to changing the CQ depth. To remedy this situation,
the commit reduces the maximum CQ depth from 1024 to 128,
and also allows configuring the maximum enqueue depth. Maximum
enqueue depth must be tuned to the CQ depth, if the CQ depth
is increased.

Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoevent/dlb2: fix CQ depth override
Timothy McDaniel [Sat, 2 Jul 2022 16:22:37 +0000 (11:22 -0500)]
event/dlb2: fix CQ depth override

This commit fixes a bug, where we could assign a CQ depth
of zero, leading to a subsequent divide-by-zero fault.
It also fixes an issue where the original default CQ depth
was returned on a query, instead of the overridden value.

Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoevent/dlb2: fix initialization of COS bandwidth args
Timothy McDaniel [Sat, 2 Jul 2022 16:22:36 +0000 (11:22 -0500)]
event/dlb2: fix initialization of COS bandwidth args

This commit fixes a typo and resultant bug that triggered a
coverity warning.

Coverity issue: 4607286
Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoevent/dlb2: fix array overflow
Timothy McDaniel [Sat, 2 Jul 2022 16:22:35 +0000 (11:22 -0500)]
event/dlb2: fix array overflow

This commit fixes a segfault that resulted from reading
beyond the end of the port_cos array. The root cause was using
the DLB num ports define instead of the eventdev num ports define.

Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
23 months agoeventdev/eth_tx: fix queue delete
Naga Harish K S V [Thu, 23 Jun 2022 10:05:11 +0000 (15:35 +0530)]
eventdev/eth_tx: fix queue delete

Add spinlock protection in queue delete function.
This protects the data path while the queue delete operation
is in progress.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
23 months agoexamples/fips_validation: fix print for zero length payload
Archana Muniganti [Thu, 30 Jun 2022 11:21:23 +0000 (16:51 +0530)]
examples/fips_validation: fix print for zero length payload

NIST GCM decrypt result vectors expects to have following print
for zero length payload instead of having no print.
"pt" = ""

Fixes: b09aac2d6e2b ("examples/fips_validation: add JSON to GCM test")

Signed-off-by: Archana Muniganti <marchana@marvell.com>
23 months agoexamples/ipsec-secgw: fix fallback session create
Radu Nicolau [Thu, 30 Jun 2022 11:45:27 +0000 (12:45 +0100)]
examples/ipsec-secgw: fix fallback session create

Fix fallback session create for inline sessions.

Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
23 months agodoc: update QAT driver location
Rebecca Troy [Fri, 1 Jul 2022 18:08:07 +0000 (18:08 +0000)]
doc: update QAT driver location

This commit removes any references to the old QAT
driver location 01.org in the documentation and
replaces them with the updated location IDZ (Intel
Development Zone).

This commit also adds a note to the docs to alert
users of a possible error when building the new QAT
driver and provides the patch needed to resolve this
error.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agodoc: fix grammar and parameters in l2fwd-crypto guide
Jakub Poczatek [Wed, 1 Jun 2022 09:35:52 +0000 (09:35 +0000)]
doc: fix grammar and parameters in l2fwd-crypto guide

Doc was updated with fixed grammar in most cases. These
include adding periods to ends of sentences and capitalizing
some words. Some instances of "a" were changed to "an". The
option "-n 4" has also been removed from the example of
running the application.

Fixes: ba7b86b1419 ("doc: add l2fwd-crypto sample app guide")
Fixes: 2661f4fbe93 ("examples/l2fwd-crypto: add AEAD parameters")
Fixes: 4790f99d2d3 ("examples/l2fwd-crypto: use cryptodev algorithm parser")
Fixes: 5949e30dae6 ("doc: fix typo in l2fwd-crypto usage")
Fixes: acf8616901b ("cryptodev: add auth IV")
Fixes: b79e4c00af0 ("cryptodev: use AES-GCM/CCM as AEAD algorithms")
Fixes: d2797f51cc6 ("examples/l2fwd-crypto: add cryptodev mask option")
Fixes: e2a94f9ad3e ("doc: remove references to make from apps guide")
Fixes: 10b9d471a6f ("doc: update minimum requirement of l2fwd-crypto")
Fixes: 3cc28001a33 ("doc: fix typo in l2fwd-crypto guide")
Cc: stable@dpdk.org
Signed-off-by: Jakub Poczatek <jakub.poczatek@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agodoc: fix grammar and formatting in compressdev guide
Ciara Power [Mon, 30 May 2022 16:03:42 +0000 (16:03 +0000)]
doc: fix grammar and formatting in compressdev guide

Small improvements made to the compressdev programmer's guide.
This includes rephrasing some sentences, fixing grammar,
and aligning formatting.

Fixes: a584d3bea902 ("doc: add compressdev library guide")
Fixes: f7095d41bba6 ("doc: clarify data plane error handling in compressdev")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agocrypto/qat: fix DOCSIS crash
Rebecca Troy [Wed, 29 Jun 2022 16:10:36 +0000 (16:10 +0000)]
crypto/qat: fix DOCSIS crash

Currently if AES or DES algorithms fail for DOCSIS test suite,
a segmentation fault occurs when cryptodev_qat_autotest is ran.

This is due to a duplicate call of EVP_CIPHER_CTX_free for the
session context. Ctx is freed firstly in the bpi_cipher_ctx_init
function and then again at the end of qat_sym_session_configure_cipher
function.

This commit fixes this bug by removing the first instance
of EVP_CIPHER_CTX_free, leaving just the dedicated function in
the upper level to free the ctx.

Fixes: 98f060891615 ("crypto/qat: add symmetric session file")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agoexamples/fips_validation: add parsing for SHA
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:06 +0000 (18:05 +0530)]
examples/fips_validation: add parsing for SHA

Added function to parse algorithm for SHA test.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agoexamples/fips_validation: add parsing for AES-XTS
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:05 +0000 (18:05 +0530)]
examples/fips_validation: add parsing for AES-XTS

Added function to parse algorithm for AES XTS test.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agoexamples/fips_validation: add AES-CBC in the enum
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:04 +0000 (18:05 +0530)]
examples/fips_validation: add AES-CBC in the enum

Add algorithm enum specifically for AES_CBC instead of relying on
AES as such.

Fixes: 8b8546aaedf ("examples/fips_validation: add parsing for AES-CBC")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agoexamples/fips_validation: handle empty payload
Gowrishankar Muthukrishnan [Tue, 28 Jun 2022 13:11:09 +0000 (18:41 +0530)]
examples/fips_validation: handle empty payload

Allocate at least onebyte to handle empty payload in a test vector
when defined.

Fixes: 3d0fad56b74 ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
23 months agocrypto/cnxk: decrement ESN to be used in session
Anoob Joseph [Mon, 27 Jun 2022 08:12:33 +0000 (13:42 +0530)]
crypto/cnxk: decrement ESN to be used in session

ESN provided in the session would be the next sequence number to be
used. Hence predecrement the value, so that in datapath, incremented
value will be as expected.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
23 months agotest/crypto: add additional stream cipher cases
Tejasree Kondoj [Thu, 23 Jun 2022 18:19:47 +0000 (23:49 +0530)]
test/crypto: add additional stream cipher cases

Added ZUC, SNOW3G and AES-CTR-CMAC auth-cipher
test vectors with same auth and cipher offsets
and total digest data encrypted.
Existing tests have different cipher and
auth offsets and partial or no digest encrypted.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
23 months agobaseband/acc100: remove prefix of internal file
Nicolas Chautru [Fri, 24 Jun 2022 23:32:42 +0000 (16:32 -0700)]
baseband/acc100: remove prefix of internal file

File renamed to avoid the rte_ file prefix since rte_acc100_pmd.h
is actually internal only.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agotest/crypto: fix SNOW3G vector IV format
Ciara Power [Thu, 23 Jun 2022 14:42:50 +0000 (14:42 +0000)]
test/crypto: fix SNOW3G vector IV format

Some of the cipher and authentication IVs did not follow the spec for
SNOW3G algorithm [1].

Cipher IVs must have the last 3 bytes of each 8 byte block as 0x0.
IV[4] and IV[12] must have the last 2 bits set to 0.
Each 8 byte block is repeated.

Auth IVs must also have a repeated 8 byte block.
IV[8] and IV[14] may have a flipped bit based on direction.

[1] https://www.gsma.com/aboutus/wp-content/uploads/2014/12/uea2uia2d1v21.pdf

Fixes: 8bdf665fe6c0 ("app/test: add SNOW 3G")
Fixes: 24342ade2c9d ("test/crypto: check SNOW3G when digest is encrypted")
Fixes: 02ed7b3871d6 ("test/crypto: add SNOW3G test cases for auth-cipher")
Fixes: 11c5485bb276 ("test/crypto: add scatter-gather tests for IP and OOP")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
23 months agotest/crypto: fix ZUC vector IV format
Ciara Power [Thu, 23 Jun 2022 14:42:49 +0000 (14:42 +0000)]
test/crypto: fix ZUC vector IV format

Some authentication and cipher IV formats were not following the spec [1].

For ZUC128 cipher IV, an 8 byte block is repeated,
with the last 3 bytes of each being 0x0.
IV[4] and IV[12] must have the last 2 bits set to 0.

Auth IVs must also have repeated bytes with the last 3 bytes
containing 0x0 in each 8 byte block.
IV[4] and IV[12] must have the last 3 bits set to 0.
IV[8] and IV[14] may have a flipped bit based on direction.

[1] https://www.gsma.com/security/wp-content/uploads/2019/05/EEA3_EIA3_specification_v1_8.pdf

Fixes: a81a81850fb1 ("test/crypto: add ZUC test cases for QAT")
Fixes: b1c1df46878d ("test/crypto: add ZUC test cases for auth-cipher")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
23 months agotest/crypto: fix authentication IV for ZUC SGL
Ciara Power [Thu, 23 Jun 2022 14:31:42 +0000 (14:31 +0000)]
test/crypto: fix authentication IV for ZUC SGL

The wireless operation for ZUC SGL tests was being passed NULL instead
of a pointer to the test data authentication IV, and IV length 0.
This is now corrected to use the IV from the test data.

Fixes: 11c5485bb276 ("test/crypto: add scatter-gather tests for IP and OOP")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
23 months agoexamples/ipsec-secgw: support poll mode NEON LPM lookup
Rahul Bhansali [Thu, 23 Jun 2022 09:38:16 +0000 (15:08 +0530)]
examples/ipsec-secgw: support poll mode NEON LPM lookup

This adds the support of NEON based LPM lookup along with
multi packet processing for burst send in packets routing.

Performance impact:
On cn10k, with poll mode inline protocol, outbound performance
increased by ~8% and inbound performance increased by ~6%.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agoexamples/l3fwd: move packet group function in common
Rahul Bhansali [Thu, 23 Jun 2022 09:38:15 +0000 (15:08 +0530)]
examples/l3fwd: move packet group function in common

This will make the packet grouping function common, so
that other examples can utilize as per need.

For each architecture sse/neon/altivec, port group
headers will be created under examples/common/<arch>.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Tested-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
23 months agoexamples/ipsec-secgw: fix Tx checksum offload flag
Radu Nicolau [Wed, 29 Jun 2022 16:46:07 +0000 (17:46 +0100)]
examples/ipsec-secgw: fix Tx checksum offload flag

For the inline crypto path set the Tx checksum offload flag
only if the device supports it.

Fixes: d24471e5786b ("examples/ipsec-secgw: disable Tx checksum for inline")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agotest/security: add event inline IPsec cases
Volodymyr Fialko [Wed, 22 Jun 2022 11:33:20 +0000 (13:33 +0200)]
test/security: add event inline IPsec cases

Enable ability to run inline security tests using event
API(rte_event_eth_tx_adapter_enqueue/rte_event_dequeue_burst).
New test command - event_inline_ipsec_autotest will run same list of
test cases as inline_ipsec_autotest, but packets will go through eventdev.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agoexamples/ipsec-secgw: support more flow patterns and actions
Satheesh Paul [Wed, 22 Jun 2022 01:22:23 +0000 (06:52 +0530)]
examples/ipsec-secgw: support more flow patterns and actions

Added support to create flow rules with count, mark and
security actions and mark pattern.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
23 months agoversion: 22.07-rc2
Thomas Monjalon [Mon, 27 Jun 2022 02:03:44 +0000 (04:03 +0200)]
version: 22.07-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
23 months agonet/bnxt: fix check for autoneg enablement in the PHY FW
Somnath Kotur [Wed, 15 Jun 2022 14:57:03 +0000 (20:27 +0530)]
net/bnxt: fix check for autoneg enablement in the PHY FW

The current combination of checks to determine whether autoneg is
enabled in the card is a bit convoluted and may become incorrect
as well in the future as one of the fields being used - auto_link_speed
might become deprecated.
Switch to using the 'auto_mode' field obtained from the response of
HWRM_PHY_QCFG cmd as that is always deterministically set by the PHY
FW.
Fixed a bug in the 40G check to only look for the bit setting and
not the actual value.
Also, check the forced speeds first before trying to enforce the
auto speeds

Allow the user to set autoneg speed in all cases except for PAM4 200G
as PAM4 200G will come up only in forced mode.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
23 months agonet/bnxt: cleanup MTU setting
Damodharam Ammepalli [Wed, 15 Jun 2022 14:57:02 +0000 (20:27 +0530)]
net/bnxt: cleanup MTU setting

Minor cleanup in bnxt_mtu_set_op() to move pre-mature
setting of jumbo flag post mtu check and remove
a redundant mtu set operation from rxq vnic configs.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
23 months agonet/bnxt: disallow MTU change when device is started
Damodharam Ammepalli [Wed, 15 Jun 2022 14:57:01 +0000 (20:27 +0530)]
net/bnxt: disallow MTU change when device is started

With this patch, bnxt_mtu_set_op() will return an error code if the
device has already started. The user application will have to take
care to bring down device before invoking the mtu_set()

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
23 months agonet/bnxt: fix setting forced speed
Kalesh AP [Wed, 15 Jun 2022 14:57:00 +0000 (20:27 +0530)]
net/bnxt: fix setting forced speed

The "active_fec_signal_mode" in HWRM_PORT_PHY_QCFG response
does not return correct value till the link is up. Driver cannot
rely on active_fec_signal_mode while setting forced speed.

While setting forced speed of 50G/100G/200G, check if PAM4 speeds
are supported for the port first and then populate the HWRM request
accordingly.

Also, If PAM4 speed is supported, use PAM4 supported speed while
reporting speed capabilities.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
23 months agonet/bnxt: allow Tx only or Rx only
Damodharam Ammepalli [Wed, 15 Jun 2022 14:56:59 +0000 (20:26 +0530)]
net/bnxt: allow Tx only or Rx only

Currently, we fail the init/probe of PMD if eth_dev->data->nb_tx_queues
or eth_dev->data->nb_rx_queues is 0. We are removing this check.

Fixes: daef48efe5e5 ("net/bnxt: support set MTU")
Cc: stable@dpdk.org
Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
23 months agonet/bnxt: reduce level of an Rx setup log
Kalesh AP [Wed, 15 Jun 2022 14:56:58 +0000 (20:26 +0530)]
net/bnxt: reduce level of an Rx setup log

Broadcom HW drops packets when there are no descriptors available.
It does not matter what flag the application specifies in "rx_drop_en"
when configuring the Rx ring.

Reduce the verbosity of the log to print the status of the "rx_drop_en"
when configuring the Rx ring.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
23 months agonet/bnxt: fix switch domain allocation
Ajit Khaparde [Wed, 15 Jun 2022 14:56:57 +0000 (20:26 +0530)]
net/bnxt: fix switch domain allocation

Allocate switch domain after the trusted VF capability is queried
from the FW. Currently we are calling the function earlier.
Since the switch domain is allocated only for PFs or trusted VF,
the current location of code fails to allocate the domain during init.
But during cleanup we try to free the domain incorrectly.
Fix the behavior by changing the sequence of function calls.

Fixes: 3127f99274b67 ("net/bnxt: refactor init/uninit")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
23 months agonet/bnxt: remove assert for zero data length in Tx
Somnath Kotur [Wed, 15 Jun 2022 14:56:56 +0000 (20:26 +0530)]
net/bnxt: remove assert for zero data length in Tx

Currently the PMD tries to detect a potential 0 byte DMA by
using RTE_VERIFY.
But since RTE_VERIFY internally calls rte_panic() it is fatal to
the application and some applications want to avoid that.
So return an error from the bnxt xmit handler if such a bad pkt is
encountered by logging an error message, dumping the pkt header and
dump the current stack as well

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
23 months agonet/bnxt: reduce barriers in NEON vector Rx
Ruifeng Wang [Mon, 13 Jun 2022 06:22:25 +0000 (14:22 +0800)]
net/bnxt: reduce barriers in NEON vector Rx

To read descriptors in expected order, barriers are inserted after each
descriptor read. The excessive use of barriers is unnecessary and could
cause performance drop.

Removed barriers between descriptor reads. And changed counting of valid
packets so as to handle discontinuous valid packets. Because out of
order read could lead to valid descriptors that fetched being
discontinuous.

In VPP L3 routing test, 6% performance gain was observed. The test was
done on a platform with ThunderX2 CPU and Broadcom PS225 NIC.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
23 months agodoc: add note about running as non-root in virtio guide
Dmitry Kozlyuk [Fri, 24 Jun 2022 13:19:56 +0000 (16:19 +0300)]
doc: add note about running as non-root in virtio guide

The requirement of SYS_ADMIN capability in legacy virtio mode
was missing. Add it to the driver-specific page.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
23 months agodoc: update running as non-root in mlx5 guide
Dmitry Kozlyuk [Fri, 24 Jun 2022 13:19:55 +0000 (16:19 +0300)]
doc: update running as non-root in mlx5 guide

Reference the common guide for generic setup.
Remove excessive capabilities from the recommended list.

Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
23 months agodoc: add more instructions for running as non-root
Dmitry Kozlyuk [Fri, 24 Jun 2022 13:19:54 +0000 (16:19 +0300)]
doc: add more instructions for running as non-root

The guide to run DPDK applications as non-root in Linux
did not provide specific instructions to configure the required access
and did not explain why each bit is needed.
The latter is important because running as non-root
is one of the ways to tighten security and grant minimal permissions.

Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agousertools: add options for hugetlbfs mount point owner
Dmitry Kozlyuk [Fri, 24 Jun 2022 13:19:53 +0000 (16:19 +0300)]
usertools: add options for hugetlbfs mount point owner

Per mount(8), the previous owner and mode of the mount point
become invisible as long as this filesystem remains mounted.
Because dpdk-hugepages.py must be run as root,
the new owner would be root.
This is undesirable if the hugepage directory is being set up
by the administrator for an unprivileged user.
HugeTLB filesystem has options to set the mount point owner.
Add --user/-U and --group/-G options to apply this when mounting.
The benefit of performing this in dpdk-hugepages.py
is that the user does not need to care about this detail
of mount command operation.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agousertools: add option for hugetlbfs directory
Dmitry Kozlyuk [Fri, 24 Jun 2022 13:19:52 +0000 (16:19 +0300)]
usertools: add option for hugetlbfs directory

dpdk-hugepages.py had /dev/hugepages hardcoded as the mount point.
It may be desirable to setup hugepage directory at another path,
for example, when using hugepages of multiple sizes in different
directories or when granting different permissions to mount points.
Add --directory/-d option to the script.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agodoc: make doc roadmap common for Linux and BSD guides
Bruce Richardson [Wed, 16 Mar 2022 16:05:46 +0000 (16:05 +0000)]
doc: make doc roadmap common for Linux and BSD guides

Both the Linux and FreeBSD GSG docs had a "Documentation Roadmap"
section as part of the introduction page, and this contained the same
information, with only the reference to the GSGs themselves being
different. This text can be consolidated into a single text file which
is included by both GSG intro sections - using relative links for the
self reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
23 months agoexamples/distributor: fix distributor on Rx core
Abdullah Ömer Yamaç [Mon, 20 Jun 2022 16:31:46 +0000 (19:31 +0300)]
examples/distributor: fix distributor on Rx core

This patch fixes the syntax error when using the single-core
for both Rx and distributor functions.

Fixes: 4a7f40c0ff9a ("examples/distributor: add dedicated core")
Cc: stable@dpdk.org
Signed-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Tested-by: David Hunt <david.hunt@intel.com>
23 months agoapp/testpmd: support different input color method
Sunil Kumar Kori [Thu, 23 Jun 2022 12:57:01 +0000 (18:27 +0530)]
app/testpmd: support different input color method

To enable input coloring, based on VLAN or DSCP, patch adds
command line interface to configure the following:

 - configuring input coloring using VLAN or DSCP while creating
   meter i.e. during rte_mtr_create()

 - Update VLAN input coloring table at runtime.

 - configures protocol priorities.

 - retrieve protocol and priority information

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
23 months agonet/hns3: delete unused code
Dongdong Liu [Fri, 24 Jun 2022 08:59:51 +0000 (16:59 +0800)]
net/hns3: delete unused code

The RTE_HNS3_ONLY_1630_FPGA macro is not in use, so delete the code.

Fixes: 2192c428f9a6 ("net/hns3: fix firmware compatibility configuration")
Fixes: bdaf190f8235 ("net/hns3: support link speed autoneg for PF")
Cc: stable@dpdk.org
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: clean some functions
Dongdong Liu [Fri, 24 Jun 2022 08:59:50 +0000 (16:59 +0800)]
net/hns3: clean some functions

Delete unnecessary code and adjust code to make code more clean.

Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: fix descriptors check with SVE
Chengwen Feng [Fri, 24 Jun 2022 08:59:49 +0000 (16:59 +0800)]
net/hns3: fix descriptors check with SVE

The SVE algorithm and NEON algorithm have the same requirements for
nb-desc, but the nb-desc is verified only when using NEON.

Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: fix statistics locking
Huisong Li [Fri, 24 Jun 2022 08:59:48 +0000 (16:59 +0800)]
net/hns3: fix statistics locking

The stats_lock is used to protect statistics update in stats APIs and
periodic task, but current code only protect queue related statistics.

Fixes: a65342d9d5d2 ("net/hns3: fix MAC and queues HW statistics overflow")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: fix PTP interrupt logging
Huisong Li [Fri, 24 Jun 2022 08:59:47 +0000 (16:59 +0800)]
net/hns3: fix PTP interrupt logging

PMD driver will receive a PTP interrupt when receive a PTP packet.
But driver doesn't distinguish it. As a result, many unknown events
are printed when many PTP packets are received on the link. The PTP
interrupt is normal, so this patch doesn't log and ignores it.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: cancel heartbeat alarm when VF reset
Huisong Li [Fri, 24 Jun 2022 08:59:46 +0000 (16:59 +0800)]
net/hns3: cancel heartbeat alarm when VF reset

The purpose of the heartbeat alarm is to keep alive for VF. The mailbox
channel is disabled when VF is reset, and the heartbeat mailbox message
will fail to send. If the reset is not complete, the error information
about the heartbeat sending failure will be printed continuously.
In fact, VF does set alive when VF restore its configuration. So the
heartbeat alarm can be canceled to prepare to start reset and start the
alarm when start service.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: support backplane media type
Chengwen Feng [Wed, 22 Jun 2022 03:09:57 +0000 (11:09 +0800)]
net/hns3: support backplane media type

The 802.11 physical PMA sub-layer defines three media: copper, fiber and
backplane. For PMD, the backplane is similar to the fiber, the main
differences are that backplane doesn't have optical module.

Because the interface of firmware fiber is also applicable to the
backplane, this patch supports the backplane only through simple
extension.

Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agonet/hns3: fix link status capability query from VF
Huisong Li [Sat, 11 Jun 2022 07:42:26 +0000 (15:42 +0800)]
net/hns3: fix link status capability query from VF

Currently, the VF LSC capability is obtained from PF driver in
the interrupt mailbox interrupt thread, it is asynchronous.
The VF driver waits for 500ms to get this capability in probe
process.

The primary process will receive a message and do probe in the
interrupt thread context when attach a device in the secondary
process. At this case, VF driver never obtains this capability
from PF.

The root cause is that 'vf->pf_push_lsc_cap' is not updated by
the handling mailbox thread until finishing probe. The reason
this update wouldn't be done is that the handling mailbox interrupt
thread and the probe alarm thread are both in epool thread, and
the probe alarm thread is before the mailbox interrupt thread.

Fixes: 9bc2289fe5ea ("net/hns3: refactor VF LSC event report")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
23 months agomaintainers: update for hns3
Dongdong Liu [Wed, 22 Jun 2022 10:49:11 +0000 (18:49 +0800)]
maintainers: update for hns3

Lijun Ou and Min Hu currently do not work for the hns3 PMD.
I will do the work, so update the hns3 maintainers.

Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Yisen Zhuang <yisen.zhuang@huawei.com>
23 months agoapp/testpmd: fix GTP PSC raw processing
Gregory Etelson [Thu, 16 Jun 2022 18:01:04 +0000 (21:01 +0300)]
app/testpmd: fix GTP PSC raw processing

Use generic GTP PSC header definition in raw handler.

Fixes: 9213c50e36fa ("app/testpmd: support GTP PSC option in raw sets")
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>
23 months agonet: fix GTP PSC headers
Gregory Etelson [Thu, 16 Jun 2022 18:01:03 +0000 (21:01 +0300)]
net: fix GTP PSC headers

Fix bitmap fields order in little endian section of GTP PSC headers.

Fixes: e8ca1479cdc4 ("net: add extension header for GTP PSC")
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>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
23 months agoapp/testpmd: fix flex parser destroy command
Gregory Etelson [Thu, 16 Jun 2022 09:15:35 +0000 (12:15 +0300)]
app/testpmd: fix flex parser destroy command

Separate flex item destruction function implementation.

Setups with installed JSON development library can use any value in
range [0, FLEX_MAX_PARSERS_NUM - 1] as input flex item ID.
In setups without JSON development library flex item destruction
function is resolved to empty stub.

Fixes: 2d3d84013508 ("app/testpmd: fix flex item flush")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
23 months agoapp/testpmd: cleanup port resources after implicit close
Dmitry Kozlyuk [Wed, 15 Jun 2022 23:12:12 +0000 (02:12 +0300)]
app/testpmd: cleanup port resources after implicit close

When a port is closed implicitly by the PMD, for example,
if it is a representor port and its master port is detached,
flow indirect actions could remain with their handles no longer valid.
If a newly attached device is assigned the same ID as the closed port,
those indirect actions became accessible again.
Any attempt to use them resulted in an undefined behavior.
Flow flex items had no such issue on close, but had it on detach.

Introduce flush_port_owned_resources() function for consistent
cleanup and call it when a port is closed or detached.
Make it flush flow rules and multicast addresses too
because they logically belong to the port being removed.

Fixes: 55509e3a49fb ("app/testpmd: support shared flow action")
Fixes: 59f3a8acbcdb ("app/testpmd: add flex item commands")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
23 months agonet/af_xdp: allow using copy mode in XSK
Xiaoyun Li [Tue, 14 Jun 2022 09:10:13 +0000 (17:10 +0800)]
net/af_xdp: allow using copy mode in XSK

DPDK assumes that users only want AF_XDP socket (XSK) into zero copy
mode when the kernel supports it. However, sometimes kernel driver
doesn't support it well and copy mode is more stable and preferred.

This patch allows using devarg "-a xx:xx.x,force_copy=1" to force the
AF_XDP socket into copy mode.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
23 months agonet/nfp: add NFDk Tx
Jin Liu [Thu, 23 Jun 2022 02:26:14 +0000 (04:26 +0200)]
net/nfp: add NFDk Tx

Implement NFP3800 card packet transmit function for firmware
with NFDk.

Signed-off-by: Jin Liu <jin.liu@corigine.com>
Signed-off-by: Diana Wang <na.wang@corigine.com>
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
23 months agotest: check memory allocation for CRC
Hongbo Zheng [Mon, 19 Apr 2021 13:34:44 +0000 (21:34 +0800)]
test: check memory allocation for CRC

The rte_zmalloc is called in test_crc_calc without null pointer
check. This patch adds null pointer checks on return value of
rte_zmalloc.

Fixes: 9c77b848b1c1 ("test: add CRC computation")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
23 months agoapp/procinfo: dump device private info
Min Hu (Connor) [Mon, 6 Jun 2022 14:39:32 +0000 (22:39 +0800)]
app/procinfo: dump device private info

This patch adds support for dump the device private info
from a running application.
It can help developers locate a problem.

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
23 months agoapp/procinfo: show all non-owned ports
Subendu Santra [Wed, 25 May 2022 05:46:05 +0000 (22:46 -0700)]
app/procinfo: show all non-owned ports

Show all non-owned ports when no port mask is specified.

The show-port option, without the mask option,
was showing only the last non-owned port.
Show all the non-owned ports instead.

Fixes: 1dd6cffb6571 ("app/procinfo: provide way to request info on owned ports")
Cc: stable@dpdk.org
Signed-off-by: Subendu Santra <subendu@arista.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
23 months agotest/hash: fix out of bound access
Heinrich Schuchardt [Sat, 4 Jun 2022 08:37:11 +0000 (10:37 +0200)]
test/hash: fix out of bound access

rwc_non_lf_results->multi_rw, rwc_lf_results->multi_rw, and
rwc_perf_results->multi_rw are accessed at indexes
[0..NUM_TEST-1][0..1][0..NUMTEST-1]. Currently the first index
overflows the array size in struct rwc_perf.

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
23 months agoeal: promote experimental sleep function
Stephen Hemminger [Wed, 16 Feb 2022 19:39:17 +0000 (11:39 -0800)]
eal: promote experimental sleep function

This has been around since 2018 release.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
23 months agointerrupts: promote some experimental functions
Stephen Hemminger [Wed, 16 Feb 2022 19:39:16 +0000 (11:39 -0800)]
interrupts: promote some experimental functions

These are functions related to interrupts that have been
in since 20.02 release or earlier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
23 months agoeal: promote some lcore experimental accessors
Stephen Hemminger [Wed, 16 Feb 2022 19:39:15 +0000 (11:39 -0800)]
eal: promote some lcore experimental accessors

These API's have been around for a long time and by now are fixed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
23 months agolog: promote some experimental macros and function
Stephen Hemminger [Wed, 16 Feb 2022 19:39:14 +0000 (11:39 -0800)]
log: promote some experimental macros and function

The RTE_LOG_REGISTER is not experimental, and the experimental
tag was never enforced on these.

Make rte_log_can_log a fully supported function.
It was introduced nearly 2yrs ago.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
23 months agoraw/ifpga/base: check null pointer in PMCI
Wei Huang [Thu, 23 Jun 2022 03:11:30 +0000 (23:11 -0400)]
raw/ifpga/base: check null pointer in PMCI

Do null-checking on hw->adapter in fme_pmci_init() before dereference it.

Coverity issue: 379202
Fixes: ca6eb0f7c836 ("raw/ifpga/base: add PMCI base driver")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
23 months agoraw/ifpga: fix integer overflow for N3000
Wei Huang [Thu, 23 Jun 2022 03:11:40 +0000 (23:11 -0400)]
raw/ifpga: fix integer overflow for N3000

Expression "tx_chunks * ctx->dma_buf_size" in dma_fpga_to_fpga()
is evaluated using 32-bit arithmetic, which would overflow
 potentially. Change tx_chunks to type "uint64_t" to avoid such
issue.

Coverity issue: 379203
Fixes: 7d63899a5c19 ("raw/ifpga: add N3000 AFU driver")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
23 months agorib: fix references for IPv6 implementation
Stephen Hemminger [Wed, 22 Jun 2022 20:41:28 +0000 (13:41 -0700)]
rib: fix references for IPv6 implementation

The comments in rte_rib6 were cut-and-pasted from rte_rib
and because of that some references to rte_rib_node were
not updated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
23 months agoexamples/l3fwd: add include for macro definition
Bruce Richardson [Wed, 15 Jun 2022 17:10:12 +0000 (18:10 +0100)]
examples/l3fwd: add include for macro definition

The header files "l3fwd_em.h" and "l3fwd_em_sequential.h" use the
"__rte_always_inline" macro but don't directly include "rte_common.h" to
get the definition of it. This inclusion is not necessary for
compilation, but the lack of it can confuse some indexers - such as
those in eclipse, which reports the lines:

"static __rte_always_inline uint16_t"

as possible definitions of a variable called "uint16_t". This confusion
leads to uint16_t being flagged as an unknown type in all other parts of
the project being indexed, e.g. across all of DPDK code.

Adding in the include of rte_common.h makes it clear to the indexer that
those lines are  part of a function definition, and that allows eclipse
to correctly recognise uint16_t as a type from stdint.h

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agodma/idxd: fix non-AVX builds with old compilers
Bruce Richardson [Thu, 23 Jun 2022 13:49:33 +0000 (14:49 +0100)]
dma/idxd: fix non-AVX builds with old compilers

When building without AVX2 support using an older compiler e.g. gcc 4.8
on Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics.
This is because the compiler does not support
"__attribute__((target(AVX2)))" function attribute. Disable build of
this driver such edge cases.

Generic builds using recent compilers, and all builds with a minimum
baseline of AVX2 are unaffected by this change.

Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
23 months agoraw/ioat: fix build when ioat dmadev enabled
Bruce Richardson [Thu, 23 Jun 2022 13:49:32 +0000 (14:49 +0100)]
raw/ioat: fix build when ioat dmadev enabled

The build of the raw/ioat driver only occurs when the equivalent dmadev
drivers are disabled. Complications occur when the ioat dmadev is being
built but not the idxd. In this case, only the idxd part of raw/ioat
gets built, but the definition of the logtype is in the ioat part,
causing build errors.

  .../raw_ioat_idxd_bus.c.o: In function `idxd_vdev_mmap_wq':
  idxd_bus.c:(.text+0x116): undefined reference to `ioat_pmd_logtype'

Fix this by moving the logtype definition to the common C file, and
renaming it to avoid conflicts with a similarly named value in the
dma/ioat driver.

Fixes: ff06fa2cf3ba ("raw/ioat: probe idxd PCI")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agoraw/ioat: fix build missing errno include
Bruce Richardson [Thu, 23 Jun 2022 13:49:31 +0000 (14:49 +0100)]
raw/ioat: fix build missing errno include

The inline functions in rte_idxd_rawdev_fns.h make use of rte_errno, but
the header with its definition is not included by that file leading to
build errors.

Fixes: f82c87eb14a4 ("raw/ioat: move idxd functions to separate file")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
23 months agoremove unnecessary null checks
Stephen Hemminger [Sun, 20 Feb 2022 18:21:41 +0000 (10:21 -0800)]
remove unnecessary null checks

Found by nullfree.cocci.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
[David: for lpm parts:]
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
[David: for vdpa/mlx5 parts:]
Acked-by: Matan Azrad <matan@nvidia.com>
[David: for dma/dpaa2, raw/ifpga, vdpa/mlx5:]
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
[David: reran cocci.sh and updated common/mlx5 and cryptodev asym test]
Signed-off-by: David Marchand <david.marchand@redhat.com>
23 months agococci/nullfree: add more functions
Stephen Hemminger [Sun, 20 Feb 2022 18:21:40 +0000 (10:21 -0800)]
cocci/nullfree: add more functions

There are more functions in DPDK which have the semantics
as free() when passed NULL pointer. Also, put the checks
in alphabetical order.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
23 months agolib: document free functions
Stephen Hemminger [Wed, 22 Jun 2022 20:52:57 +0000 (13:52 -0700)]
lib: document free functions

Make sure all functions which use the convention that XXX_free(NULL)
is a nop are all documented.

The wording is chosen to match the documentation of free(3).
"If ptr is NULL, no operation is performed."

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
[David: squashed with other series updates, unified wording]

23 months agoremove passive voice in function description
Stephen Hemminger [Wed, 22 Jun 2022 20:27:37 +0000 (13:27 -0700)]
remove passive voice in function description

Remove extraneous phrase "This API is used to" and use
active instead of passive voice when describing a function.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
[David: for raw/ioat and dmadev parts:]
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
23 months agodoc: fix flow integrity hardware support in mlx5 guide
Gregory Etelson [Thu, 16 Jun 2022 08:43:14 +0000 (11:43 +0300)]
doc: fix flow integrity hardware support in mlx5 guide

Current MLX5 PMD documentation says that entire `ConnectX-6` family
supports flow integrity feature.

Flow integrity offload is not supported on vanilla `ConnectX-6`.
It is available on `ConnectX-6 Dx`, `ConnectX-6 Lx` and
`BlueField 2`.

Fixes: 79f8952783d0 ("net/mlx5: support integrity flow item")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
23 months agonet/mlx5: fix stack buffer overflow in drop action
Yunjian Wang [Fri, 24 Dec 2021 03:06:19 +0000 (11:06 +0800)]
net/mlx5: fix stack buffer overflow in drop action

The mlx5_drop_action_create function use mlx5_malloc for allocating
'hrxq', but don't allocate for 'rss_key'. This is wrong and it can
cause buffer overflow.

Detected with address sanitizer:
0 (/usr/lib64/libasan.so.4+0x7b8e2)
1 in mlx5_devx_tir_attr_set ../drivers/net/mlx5/mlx5_devx.c:765
2 in mlx5_devx_hrxq_new ../drivers/net/mlx5/mlx5_devx.c:800
3 in mlx5_devx_drop_action_create ../drivers/net/mlx5/mlx5_devx.c:1051
4 in mlx5_drop_action_create ../drivers/net/mlx5/mlx5_rxq.c:2846
5 in mlx5_dev_spawn ../drivers/net/mlx5/linux/mlx5_os.c:1743
6 in mlx5_os_pci_probe_pf ../drivers/net/mlx5/linux/mlx5_os.c:2501
7 in mlx5_os_pci_probe ../drivers/net/mlx5/linux/mlx5_os.c:2647
8 in mlx5_os_net_probe ../drivers/net/mlx5/linux/mlx5_os.c:2722
9 in drivers_probe ../drivers/common/mlx5/mlx5_common.c:657
10 in mlx5_common_dev_probe ../drivers/common/mlx5/mlx5_common.c:711
11 in mlx5_common_pci_probe ../drivers/common/mlx5/mlx5_common_pci.c:150
12 in rte_pci_probe_one_driver ../drivers/bus/pci/pci_common.c:269
13 in pci_probe_all_drivers ../drivers/bus/pci/pci_common.c:353
14 in pci_probe ../drivers/bus/pci/pci_common.c:380
15 in rte_bus_probe ../lib/eal/common/eal_common_bus.c:72
16 in rte_eal_init ../lib/eal/linux/eal.c:1286
17 in main ../app/test-pmd/testpmd.c:4112

Fixes: 0c762e81da9b ("net/mlx5: share Rx queue drop action code")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
23 months agonet/mlx5: fix metering on E-Switch Manager
Shun Hao [Sun, 19 Jun 2022 03:21:28 +0000 (06:21 +0300)]
net/mlx5: fix metering on E-Switch Manager

When meter is used by E-Switch Manager port, there's an error that
cannot get correct port ID.

This patch fixes this by using specific parsing process to get port
ID for E-Switch Manager.

Fixes: 3c481324baf3 ("net/mlx5: fix meter flow direction check")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: add limitation for E-Switch Manager match
Shun Hao [Sun, 19 Jun 2022 03:21:27 +0000 (06:21 +0300)]
net/mlx5: add limitation for E-Switch Manager match

For BF with old FW which doesn't expose the E-Switch Manager vport ID,
E-Switch Manager port matching works correctly only when BF is in
embedded CPU mode.

This patch adds the limitation description.

Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: fix RSS expansion for patterns with ICMP item
Gregory Etelson [Fri, 17 Jun 2022 05:22:38 +0000 (08:22 +0300)]
net/mlx5: fix RSS expansion for patterns with ICMP item

MLX5 PMD RSS expansion implementation added L4 UDP or TCP
headers after ICMP.
For example:
ETH / IPv4 / ICMP expanded into  ETH / IPv4 / ICMP / {UDP | TCP}
ETH / IPv6 / ICMPv6 expanded into  ETH / IPv6 / ICMPv6 / {UDP | TCP}

The patch updates PMD expansion scheme to handle ICMP and ICMPv6 types
as non-expandable for RSS.

Fixes: c7870bfe09dc ("ethdev: move RSS expansion code to mlx5 driver")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agoapp/testpmd: add host shaper command
Spike Du [Thu, 16 Jun 2022 08:41:54 +0000 (11:41 +0300)]
app/testpmd: add host shaper command

Add command line options to support host shaper configure.
- Command syntax:
  mlx5 set port <port_id> host_shaper avail_thresh_triggered <0|1> rate
<rate_num>

- Example commands:
To enable avail_thresh_triggered on port 1 and disable current host
shaper:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 1 rate 0

To disable avail_thresh_triggered and current host shaper on port 1:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 0

The rate unit is 100Mbps.
To disable avail_thresh_triggered and configure a shaper of 5Gbps on
port 1:
testpmd> mlx5 set port 1 host_shaper avail_thresh_triggered 0 rate 50

Add sample code to handle rxq available descriptor threshold event, it
delays a while so that rxq empties, then disables host shaper and
rearms available descriptor threshold event.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: add API to configure host port shaper
Spike Du [Thu, 16 Jun 2022 08:41:53 +0000 (11:41 +0300)]
net/mlx5: add API to configure host port shaper

Host port shaper can be configured with QSHR (QoS Shaper Host Register).
Add check in build files to enable this function or not.

The host shaper configuration affects all the ethdev ports belonging to the
same host port.

Host shaper can configure shaper rate and lwm-triggered for a host port.
The shaper limits the rate of traffic from host port to wire port.
If lwm-triggered is enabled, a 100Mbps shaper is enabled automatically
when one of the host port's Rx queues receives available descriptor
threshold event.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: support Rx descriptor threshold event
Spike Du [Thu, 16 Jun 2022 08:41:52 +0000 (11:41 +0300)]
net/mlx5: support Rx descriptor threshold event

Add mlx5 specific available descriptor threshold configuration
and query handler.
In mlx5 PMD, available descriptor threshold is also called
LWM (limit watermark).
While the Rx queue fullness reaches the LWM limit, the driver catches
an HW event and invokes the user callback.
The query handler finds the next Rx queue with pending LWM event
if any, starting from the given Rx queue index.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: handle Rx descriptor LWM event
Spike Du [Thu, 16 Jun 2022 08:41:51 +0000 (11:41 +0300)]
net/mlx5: handle Rx descriptor LWM event

When LWM meets RQ WQE, the kernel driver raises an event to SW.
Use devx event_channel to catch this and to notify the user.
Allocate this channel per shared device.
The channel has a cookie that informs the specific event port and queue.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agocommon/mlx5: share interrupt management
Spike Du [Thu, 16 Jun 2022 08:41:50 +0000 (11:41 +0300)]
common/mlx5: share interrupt management

There are many duplicate code of creating and initializing rte_intr_handle.
Add a new mlx5_os API to do this, replace all PMD related code with this
API.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
23 months agonet/mlx5: support descriptor LWM for Rx queue
Spike Du [Thu, 16 Jun 2022 08:41:49 +0000 (11:41 +0300)]
net/mlx5: support descriptor LWM for Rx queue

Add LWM (Limit WaterMark) field to Rxq object which indicates the percentage
of Rx queue size used by HW to raise descriptor event to the user.
Allow LWM setting in modify_rq command.
Allow the LWM configuration dynamically by adding RDY2RDY state change.

Signed-off-by: Spike Du <spiked@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>