dpdk.git
2 years agonet/cnxk: add cn9k template Tx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:15 +0000 (21:18 +0530)]
net/cnxk: add cn9k template Tx functions to build

Add cn9k segregated Tx and event Tx functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k segregated Tx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:14 +0000 (21:18 +0530)]
net/cnxk: add cn9k segregated Tx functions

Add cn9k segregated Rx and event Tx enqueue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k template Rx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:13 +0000 (21:18 +0530)]
net/cnxk: add cn9k template Rx functions to build

Add cn9k segregated Rx and event dequeue functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k segregated Rx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:12 +0000 (21:18 +0530)]
net/cnxk: add cn9k segregated Rx functions

Split template functions to multiple files based on the range
of offloads. This allows them to be built in parallel reducing
time spent on compiling single files containing all the template
functions.
The files are added to the build system in later patches modifying
the existing scheme of selecting template lookup with a simple
flat array based lookup.

Add cn9k segregated Rx and event dequeue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: synchronize inline session create and destroy
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:24 +0000 (17:34 +0530)]
net/cnxk: synchronize inline session create and destroy

Synchronize inline session create and destroy using spinlock.
Also move security related error prints outside the spinlock.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agocommon/cnxk: set UDP ports for IPsec UDP encapsulation
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:23 +0000 (17:34 +0530)]
common/cnxk: set UDP ports for IPsec UDP encapsulation

Set UDP ports for IPsec UDP encapsulation feature in
outbound inline.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agonet/cnxk: improve inbound inline error handling for cn9k
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:22 +0000 (17:34 +0530)]
net/cnxk: improve inbound inline error handling for cn9k

Improve inbound inline error handling for CN9K in terms of
packet delivered to application for different kinds of errors.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agocommon/cnxk: fix uninitialized variables
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:21 +0000 (17:34 +0530)]
common/cnxk: fix uninitialized variables

Fix uninitialized variable issues reported by
klockwork(static analysis tool).

Fixes: ed135040f0ab ("common/cnxk: add CPT LF configuration")
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")
Fixes: 58debb813a8d ("common/cnxk: enable TM to listen on Rx pause frames")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix null pointer dereferences
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:20 +0000 (17:34 +0530)]
common/cnxk: fix null pointer dereferences

Fix null pointer dereference issues reported by
klockwork(static analysis tool).

Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration")
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")
Fixes: 665ff1ccc2c4 ("common/cnxk: add base device class")
Fixes: da57d4589a6f ("common/cnxk: support NIX flow control")
Fixes: 218d022e1f3f ("common/cnxk: support NIX stats")
Fixes: 4efa6e82fe43 ("common/cnxk: support NIX extended stats")
Fixes: 0885429c3028 ("common/cnxk: add NIX TM hierarchy enable/disable")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: always use single interrupt ID with NIX
Harman Kalra [Fri, 21 Jan 2022 12:04:19 +0000 (17:34 +0530)]
common/cnxk: always use single interrupt ID with NIX

An errata exists whereby, in certain cases NIX may use an
incorrect QINT_IDX for SQ interrupts. As a result, the
interrupt may not be delivered to software, or may not be
associated with the correct SQ.
When NIX uses an incorrect QINT_IDX :
1. NIX_LF_QINT(0..63)_CNT[COUNT] will be incremented for
incorrect QINT.
2. NIX_LF_QINT(0..63)_INT[INTR] will be set for incorrect
QINT.

Fixes: ae06070901ab ("common/cnxk: add NIX Tx queue management API")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: reset stale values on error debug registers
Harman Kalra [Fri, 21 Jan 2022 12:04:18 +0000 (17:34 +0530)]
common/cnxk: reset stale values on error debug registers

LF's error debug registers like NIX_LF_SQ_OP_ERR_DBG,
NIX_LF_MNQ_ERR_DBG, NIX_LF_SEND_ERR_DBG captures debug
info for an error detected during LMT operation or meta
enqueue or after meta enqueue granted respectively. HW
sets a valid bit when info is captured and SW is expected
to clear this valid bit by writing 1, else these registers
will show stale values of first interrupt when occurred and
will never update with subsequent interrupts.

Fixes: f6d567b03d28 ("common/cnxk: support NIX IRQ")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix byte order of frag sizes and infos
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:17 +0000 (17:34 +0530)]
common/cnxk: fix byte order of frag sizes and infos

Change the byte order of frag sizes and infos to match HW
implementation.

Fixes: 64a73ebd87bd ("common/cnxk: add CPT hardware definitions")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2 years agocommon/cnxk: use for loop in shaper profiles cleanup
Gowrishankar Muthukrishnan [Fri, 21 Jan 2022 12:04:16 +0000 (17:34 +0530)]
common/cnxk: use for loop in shaper profiles cleanup

In shaper profiles cleanup, Klockwork static analyzer tool reports
infinite loop although existing loop condition is alright.
False positive may be due to tqh_first not checked in loop,
hence switching to FOREACH_SAFE to make Klockwork happy.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix shift offset for TL3 length disable
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:15 +0000 (17:34 +0530)]
common/cnxk: fix shift offset for TL3 length disable

Fix shift offset for length disable flag in NIXX_AF_TL3X_SHAPE
register to be 24 instead of zero similar to other level SHAPE
registers. Also mask unused bits in adjust value.

Fixes: 0885429c3028 ("common/cnxk: add NIX TM hierarchy enable/disable")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2 years agocommon/cnxk: support extensions attributes in IPv6 item
Satheesh Paul [Fri, 21 Jan 2022 06:26:41 +0000 (11:56 +0530)]
common/cnxk: support extensions attributes in IPv6 item

Support matching existence of specific extension headers
after RTE_FLOW_ITEM_TYPE_IPV6 item.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2 years agocommon/cnxk: support matching VLAN existence
Satheesh Paul [Fri, 21 Jan 2022 06:26:40 +0000 (11:56 +0530)]
common/cnxk: support matching VLAN existence

Support matching existence of VLAN after
RTE_FLOW_ITEM_TYPE_ETH and RTE_FLOW_ITEM_TYPE_VLAN items.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2 years agocommon/cnxk: support custom pre L2 header parsing as raw
Kiran Kumar K [Fri, 21 Jan 2022 06:26:39 +0000 (11:56 +0530)]
common/cnxk: support custom pre L2 header parsing as raw

Add ROC API for parsing custom pre_l2 headers as raw data.
Only relative offset is supported and search and limit is
not supported with this raw item type.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
2 years agonet/cnxk: support pre L2 switch header type
Kiran Kumar K [Fri, 21 Jan 2022 06:26:38 +0000 (11:56 +0530)]
net/cnxk: support pre L2 switch header type

Adding changes to configure switch header type pre_l2 for cnxk.
pre_l2 headers are custom headers placed before the ethernet
header. Along with switch header type, user needs to provide the
offset within the custom header that holds the size of the
custom header and mask for the size within the size offset.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
2 years agonet/dpaa2: fix build with musl
Thomas Monjalon [Tue, 1 Feb 2022 09:46:37 +0000 (10:46 +0100)]
net/dpaa2: fix build with musl

PAGE_SIZE is already defined in musl libc:

drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined
/usr/include/limits.h:97: note:
   this is the location of the previous definition
   97 | #define PAGE_SIZE PAGESIZE

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
2 years agonet/nfp: remove useless range checks
Maxime Gouin [Wed, 5 Jan 2022 10:32:03 +0000 (11:32 +0100)]
net/nfp: remove useless range checks

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfpcore/nfp_target.h
> 375   Condition "island < 1" is always evaluated to false
> 415   Condition "island < 1" is always evaluated to false
> 547   Condition "target < 0" is always evaluated to false

All of these conditions have the same error. They call
NFP_CPP_ID_ISLAND_of or NFP_CPP_ID_TARGET_of which return a uint8_t and
put the result in "island" or "target" which are integers. These
variables can only contain values between 0 and 255.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/nfp: remove duplicated check when setting MAC address
Maxime Gouin [Wed, 5 Jan 2022 10:32:02 +0000 (11:32 +0100)]
net/nfp: remove duplicated check when setting MAC address

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfp_net.c
> 546   Conditions "(hw->ctrl &NFP_NET_CFG_CTRL_ENABLE) &&
        !! (hw->cap &NFP_NET_CFG_C" is always evaluated to false
> 547   Condition "! (hw->cap &NFP_NET_CFG_C" is always evaluated to false

The previous "if" checks exactly the same condition. Removal of duplicate
code.

Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change")
Cc: stable@dpdk.org
Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/mlx5: fix MPRQ WQE size assertion
Alexander Kozyrev [Thu, 13 Jan 2022 14:36:09 +0000 (16:36 +0200)]
net/mlx5: fix MPRQ WQE size assertion

Preparation of the stride size and the number of strides for
Multi-Packet RQ was updated recently to accommodate the hardware
limitation about minimum WQE size. The wrong assertion was
introduced to ensure this limitation is met. Assert that the
configured WQE size is not less than the minimum supported size.

Fixes: 34776af600df ("net/mlx5: fix MPRQ stride devargs adjustment")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix maximum packet headers size for TSO
Alexander Kozyrev [Thu, 13 Jan 2022 14:32:29 +0000 (16:32 +0200)]
net/mlx5: fix maximum packet headers size for TSO

The maximum packet headers size for TSO is calculated as a sum of
Ethernet, VLAN, IPv6 and TCP headers (plus inner headers).
The rationale  behind choosing IPv6 and TCP is their headers
are bigger than IPv4 and UDP respectively, giving us the maximum
possible headers size. But it is not true for L3 headers.
IPv4 header size (20 bytes) is smaller than IPv6 header size
(40 bytes) only in the default case. There are up to 10
optional header fields called Options in case IHL > 5.
This means that the maximum size of the IPv4 header is 60 bytes.

Choosing the wrong maximum packets headers size causes inability
to transmit multi-segment TSO packets with IPv4 Options present.
PMD check that it is possible to inline all the packet headers
and the packet headers size exceeds the expected maximum size.
The maximum packet headers size was set to 192 bytes before,
but its value has been reduced during Tx path refactor activity.
Restore the proper maximum packet headers size for TSO.

Fixes: 50724e1bba76 ("net/mlx5: update Tx definitions")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/bnxt: restore dependency on kernel modules
Geoffrey Le Gourriérec [Wed, 12 Jan 2022 13:41:52 +0000 (14:41 +0100)]
net/bnxt: restore dependency on kernel modules

During a large refactoring sweep for 21.11, a previous commit
removed the dependency the bnxt driver had on Linux virtual
bus drivers, such as vfio-pci. This breaks port detection.

This patch adds the kmod dependency back as it was.

Fixes: 295968d17407 ("ethdev: add namespace")
Cc: stable@dpdk.org
Signed-off-by: Geoffrey Le Gourriérec <geoffrey.le_gourrierec@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agocommon/cnxk: update meter algorithm in band profile
Rakesh Kudurumalla [Thu, 13 Jan 2022 12:28:07 +0000 (17:58 +0530)]
common/cnxk: update meter algorithm in band profile

Update meter algorithm in NIX's band profile structure.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: update meter BPF ID in Rx queue
Rakesh Kudurumalla [Thu, 13 Jan 2022 12:28:06 +0000 (17:58 +0530)]
net/cnxk: update meter BPF ID in Rx queue

Patch updates configured meter BPF (Bandwidth profile) ID is in
receive queue context during meter creation.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support getting queue status
Rahul Bhansali [Wed, 19 Jan 2022 09:43:27 +0000 (15:13 +0530)]
net/cnxk: support getting queue status

Provides ethdev callback support of rx_queue_count,
rx_descriptor_status and tx_descriptor_status.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: get head and tail of Rx and Tx queues
Rahul Bhansali [Wed, 19 Jan 2022 09:43:26 +0000 (15:13 +0530)]
common/cnxk: get head and tail of Rx and Tx queues

Adds roc APIs roc_nix_cq_head_tail_get(), roc_nix_sq_head_tail_get()
to get tail and head of receive and transmit queue respectively.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable LMTST burst for batch free
Ashwin Sekhar T K [Sat, 4 Dec 2021 10:30:46 +0000 (16:00 +0530)]
common/cnxk: enable LMTST burst for batch free

Use LMTST (Large atomic block store) burst as a performance optimization
when more than 15 pointers are requested to be freed.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/enic: support GENEVE flow item
Hyong Youb Kim [Thu, 20 Jan 2022 14:26:37 +0000 (06:26 -0800)]
net/enic: support GENEVE flow item

Recent VIC models can parse GENEVE, including options, and inner
packet headers. Enable GENEVE header and option flow items. Currently,
only the first option that follows the GENEVE header can be matched,
and the GENEVE header item must specify option length.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2 years agonet/pfe: remove unused link status setting
Apeksha Gupta [Mon, 3 Jan 2022 10:01:29 +0000 (15:31 +0530)]
net/pfe: remove unused link status setting

remove setting link status where it is not being used

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/pfe: reduce driver initialization time
Gagandeep Singh [Mon, 3 Jan 2022 10:01:28 +0000 (15:31 +0530)]
net/pfe: reduce driver initialization time

This patch reduces the delay in the device init.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/enetc: support VF
Gagandeep Singh [Mon, 3 Jan 2022 10:01:27 +0000 (15:31 +0530)]
net/enetc: support VF

Add virtual function support for enetc devices

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa: enable checksum for shared MAC interface
Nipun Gupta [Mon, 3 Jan 2022 10:01:26 +0000 (15:31 +0530)]
net/dpaa: enable checksum for shared MAC interface

In case of shared MAC B0V bit in contextA is required
to be set to set so that ASPID is 0.

Signed-off-by: Brick Yang <brick.yang@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa: check status before configuring shared MAC
Nipun Gupta [Mon, 3 Jan 2022 10:01:25 +0000 (15:31 +0530)]
net/dpaa: check status before configuring shared MAC

For shared MAC interface, it is a prerequisite to enable the
interface in the kernel, before using it in user-space. This
patch makes sure that device is not getting configured in
case shared MAC interface is not enabled in the kernel.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support recycle loopback port
Jun Yang [Mon, 3 Jan 2022 10:01:24 +0000 (15:31 +0530)]
net/dpaa2: support recycle loopback port

DPAA2 recycle port is used for configuring the device
in the loopback mode. Loopback configuration can be at
dpni level or at serdes level.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: add and scan DPRC devices
Jun Yang [Mon, 3 Jan 2022 10:01:23 +0000 (15:31 +0530)]
bus/fslmc: add and scan DPRC devices

In order to get connection endpoint of each objects,
scan the dprc object.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: handle secondary process for DPNI
Jun Yang [Mon, 3 Jan 2022 10:01:22 +0000 (15:31 +0530)]
net/dpaa2: handle secondary process for DPNI

This change uses 'dev->process_private' instead of 'priv->hw'
to get dpmcp per process while setting flow distribution,
as priv->hw is only valid for primary process.
It also initialize rte_dpaa2_bpid_info in secondary process.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support level 2 in traffic management
Gagandeep Singh [Mon, 3 Jan 2022 10:01:21 +0000 (15:31 +0530)]
net/dpaa2: support level 2 in traffic management

This patch adds support for level 2 for QoS shaping.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support multiple Tx queues enqueue for ordered
Jun Yang [Mon, 3 Jan 2022 10:01:20 +0000 (15:31 +0530)]
net/dpaa2: support multiple Tx queues enqueue for ordered

Support the tx enqueue in order queue mode, where queue id
for each event may be different.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: fix timestamping for IEEE1588
Vanshika Shukla [Mon, 3 Jan 2022 10:01:19 +0000 (15:31 +0530)]
net/dpaa2: fix timestamping for IEEE1588

The current implementation of DPAA2 driver code is such
that it records Rx and Tx timestamp for PTP without checking
if they are PTP packets or not. Packets for which
RTE_MBUF_F_RX_IEEE1588_TMST and RTE_MBUF_F_TX_IEEE1588_TMST
is not set, Rx and Tx timestamp should not be recorded.

This patch fixes this issue by checking if the required
flags are set in the mbuf before recording timestamps.

Also this change defines separate values for
DPAA2_TX_CONF_ENABLE and DPAA2_NO_PREFETCH_RX

Fixes: e806bf878c17 ("net/dpaa2: support timestamp")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: fix unregistering interrupt handler
Vanshika Shukla [Mon, 3 Jan 2022 10:01:18 +0000 (15:31 +0530)]
net/dpaa2: fix unregistering interrupt handler

This patch fixes code that handles unregistering LSC
interrupt handler in dpaa2_dev_stop API.

Fixes: c5acbb5ea20e ("net/dpaa2: support link status event")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: warn on high Rx descriptor number
Rohit Raj [Mon, 3 Jan 2022 10:01:17 +0000 (15:31 +0530)]
net/dpaa2: warn on high Rx descriptor number

Added warning message if application is configuring nb_desc
more than supported by PEB memory suggesting user to configure
HW descriptors in normal memory rather than in faster PEB
memory.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: use DMB OSHST for synchronization before I/O
Nipun Gupta [Mon, 3 Jan 2022 10:01:16 +0000 (15:31 +0530)]
bus/fslmc: use DMB OSHST for synchronization before I/O

Outer Shareable Store (oshst) is sufficient for Data Memory
Barrier (dmb) when doing IO on the interface via QBMAN.

This will sync L3/DDR with the L1/L2 cached data.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: update management complex FW to 10.29
Nipun Gupta [Mon, 3 Jan 2022 10:01:15 +0000 (15:31 +0530)]
bus/fslmc: update management complex FW to 10.29

update MC firmware library version to 10.29

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/cxgbe: fix dangling pointer by mailbox access rework
Rahul Lakkireddy [Wed, 19 Jan 2022 21:56:40 +0000 (03:26 +0530)]
net/cxgbe: fix dangling pointer by mailbox access rework

Rework mailbox access serialization to dynamically allocate and
free mbox entry. Also remove unnecessary temp memory and macros.

Observed with: gcc-12.0 (GCC) 12.0.1 20220118 (experimental)

In file included from ../lib/eal/linux/include/rte_os.h:14,
                 from ../lib/eal/include/rte_common.h:28,
                 from ../lib/eal/include/rte_log.h:25,
                 from ../lib/ethdev/rte_ethdev.h:164,
                 from ../lib/ethdev/ethdev_driver.h:18,
                 from ../drivers/net/cxgbe/base/t4vf_hw.c:6:
In function ‘t4_os_atomic_add_tail’,
    inlined from ‘t4vf_wr_mbox_core’ at
../drivers/net/cxgbe/base/t4vf_hw.c:115:2:
../drivers/net/cxgbe/base/adapter.h:742:9:
      warning: storing the address of local variable ‘entry’ in
      ‘((struct mbox_list *)adapter)[96].tqh_last’ [-Wdangling-pointer=]
  742 |         TAILQ_INSERT_TAIL(head, entry, next);
      |         ^~~~~~~~~~~~~~~~~
../drivers/net/cxgbe/base/t4vf_hw.c: In function ‘t4vf_wr_mbox_core’:
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘entry’ declared here
   86 |         struct mbox_entry entry;
      |                           ^~~~~
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘adapter’ declared here

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agoapp/testpmd: fix external buffer allocation
Dmitry Kozlyuk [Fri, 17 Dec 2021 09:58:16 +0000 (11:58 +0200)]
app/testpmd: fix external buffer allocation

External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.

Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.

Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.

Fixes: 72512e1897b2 ("app/testpmd: add mempool with external data buffers")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agoapp/testpmd: fix dereference before null check
Sean Morrissey [Tue, 18 Jan 2022 10:53:09 +0000 (10:53 +0000)]
app/testpmd: fix dereference before null check

Assign 'left' variable only after null check on 'size'
as function returns if 'size' is null.

Coverity issue: 374381
Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/bonding: fix mode type mismatch
Yunjian Wang [Fri, 10 Dec 2021 11:41:01 +0000 (19:41 +0800)]
net/bonding: fix mode type mismatch

There were some type-mismatch issues in bonding and fix them:
- Use %u to fix argument type mismatch in RTE_BOND_LOG.
- The internals->mode is of type uint8_t. But the function
  parameter 'mode' is of type int. So change the mode type
  from int to uint8_t.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Fixes: a45b288ef21a ("bond: support link status polling")
Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/af_xdp: fix build with -Wunused-function
Ciara Loftus [Thu, 9 Dec 2021 17:19:47 +0000 (17:19 +0000)]
net/af_xdp: fix build with -Wunused-function

The get_shared_umem function is only called when the kernel
flag XDP_UMEM_UNALIGNED_CHUNK_FLAG is defined. Move the
function implementation and associated helper so that it only
gets compiled when that flag is set.

Fixes: 74b46340e2d4 ("net/af_xdp: support shared UMEM")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/tap: remove maintainer
Keith Wiles [Thu, 2 Dec 2021 17:15:37 +0000 (17:15 +0000)]
net/tap: remove maintainer

I no longer have the bandwidth to support the TAP PMD, so I am
removing myself as the maintainer so as to not hold up commits.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/axgbe: use PCI root complex device to distinguish device
Chandubabu Namburu [Thu, 2 Dec 2021 16:10:34 +0000 (16:10 +0000)]
net/axgbe: use PCI root complex device to distinguish device

"bus/pci: optimize bus scan" broke axgbe on V1000/R1000.
RV root complex pci device does not have any kernel driver assigned
so it is removed from pci scan list which is used in
"net/axgbe: add a HW quirk for register definitions".

Get root complex device id directly from pci sysfs instead of
pci scan list.

Fixes: 991e0b1dbc4a ("net/axgbe: add a HW quirk for register definitions")
Cc: stable@dpdk.org
Signed-off-by: Chandubabu Namburu <chandu@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
2 years agoapp/testpmd: fix Tx scheduling interval
Viacheslav Ovsiienko [Tue, 23 Nov 2021 16:32:58 +0000 (18:32 +0200)]
app/testpmd: fix Tx scheduling interval

The first "set txtimes" command parameter specifies the time
interval between scheduled send bursts for single queue. This
interval should be the same for all the forwarding ports.
It requires to maintain the timing related variables on per
queue basis instead of per core, as currently implemented.
This resulted in wrong burst intervals if two or more cores
were generating the scheduled traffic for two or more ports
in txonly mode.

This patch moves the timing variable to the fstream structure.
Only txonly forwarding mode with enabled send scheduling is
affected.

Fixes: 4940344dab1d ("app/testpmd: add Tx scheduling command")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/bonding: fix offloading configuration
Chengchang Tang [Tue, 9 Nov 2021 07:57:26 +0000 (15:57 +0800)]
net/bonding: fix offloading configuration

Currently, part offloadings of the bonding device will not take effect
by using dev_configure(). Because the related configuration will not be
delivered to the slave devices in this way.

The offloading capability of the bonding device is the intersection of
the capability of all slave devices. Based on this, the following
functions are added to the bonding driver:
1. If a Tx offloading is within the capability of the bonding device
   (i.e, all the slave devices support this Tx offloading), the enabling
   status of the offloading of all slave devices depends on the
   configuration of the bonding device.

2. For the Tx offloading that is not within the Tx offloading capability
   of the bonding device, the enabling status of the offloading on the
   slave devices is irrelevant to the bonding device configuration. And
   it depends on the original configuration of the slave devices.

Fixes: e8b3e1a9b1bb ("net/bonding: switch to new offloading API")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoethdev: mark old macros as deprecated
Ferruh Yigit [Wed, 12 Jan 2022 14:36:23 +0000 (14:36 +0000)]
ethdev: mark old macros as deprecated

Old macros kept for backward compatibility, but this cause old macro
usage to sneak in silently.

Marking old macros as deprecated. Downside is this will cause some noise
for applications that are using old macros.

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

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agonet/cnxk: fix promiscuous mode in multicast enable flow
Asaf Ravid [Wed, 1 Dec 2021 10:29:53 +0000 (15:59 +0530)]
net/cnxk: fix promiscuous mode in multicast enable flow

When multicast promiscuous was being enabled it caused the unicast
promiscuous to be disabled. This fix resolves this by setting
NIX_RX_MODE_PROMISC when eth_dev->data->promiscuous is set, regardless.

Fixes: 325d79c00a5a ("net/cnxk: support all multicast")
Cc: stable@dpdk.org
Signed-off-by: Asaf Ravid <aravid@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/bnxt: check VF representor pointer before access
Ajit Khaparde [Tue, 4 Jan 2022 08:38:24 +0000 (14:08 +0530)]
net/bnxt: check VF representor pointer before access

The PF or trusted VF Rx handler could invoke the VF representor's
Rx function without knowledge of the application cleaning up the
representor ports. Check if the vfr_bp pointer is valid before
accessing it.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix xstats query
Kalesh AP [Tue, 4 Jan 2022 08:38:23 +0000 (14:08 +0530)]
net/bnxt: fix xstats query

Fix incorrect memset in bnxt_dev_xstats_get_op.
In bnxt_dev_xstats_get_op(), the PMD is not zeroing the whole
buffer supplied by the application. This can end up passing
junk statistics values to the application when the FW does not
support extended stats on a function.
Fixed to call memset() with correct size.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
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>
2 years agonet/bnxt: fix crash by validating pointer
Ajit Khaparde [Tue, 4 Jan 2022 08:38:22 +0000 (14:08 +0530)]
net/bnxt: fix crash by validating pointer

Validate the pointers in rxq before accessing them.
Otherwise it can cause a segfault.

Fixes: 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix PAM4 mask setting
Ajit Khaparde [Tue, 4 Jan 2022 08:38:21 +0000 (14:08 +0530)]
net/bnxt: fix PAM4 mask setting

Set the PAM4 mask setting only when PAM4 signaling is enabled.
Setting it otherwise seems to result in link negotiation.
Also auto_pam4_link_speeds has been renamed to
auto_pam4_link_speed_mask to reflect its real usage.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix ring teardown
Ajit Khaparde [Tue, 4 Jan 2022 08:38:20 +0000 (14:08 +0530)]
net/bnxt: fix ring teardown

Check for valid bit while scanning for hwrm_done completion
during ring teardown. Not checking the valid bit could cause a
ring overflow when we ring the doorbell.

Fixes: 4fb6ab3f866d ("net/bnxt: check flush status during ring free")
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>
2 years agonet/bnxt: fix handling of VF configuration change
Kalesh AP [Tue, 4 Jan 2022 08:38:19 +0000 (14:08 +0530)]
net/bnxt: fix handling of VF configuration change

When there is a change in the default VLAN of the VF,
FW sends the VF_CFG_CHANGE async event to the driver.
Upon receiving this async event, driver currently only queries
the FW using HWRM_FUNC_QCFG. But this is not enough.

Driver has to clean up the existing filter and recreate filters
so the FW can apply the default VLAN to the filter.

Fixes: 12213821a8a3 ("net/bnxt: register for more async events")
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>
2 years agonet/bnxt: refactor datapath stop for reuse
Somnath Kotur [Tue, 4 Jan 2022 08:38:18 +0000 (14:08 +0530)]
net/bnxt: refactor datapath stop for reuse

Refactor bnxt_stop_rxtx() for reuse.
By accepting rte_eth_dev as input, bnxt_stop_rxtx() can be used
in multiple scenarios such as representor devices.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2 years agonet/bnxt: get maximum supported multicast filters count
Kalesh AP [Tue, 4 Jan 2022 08:38:17 +0000 (14:08 +0530)]
net/bnxt: get maximum supported multicast filters count

The HWRM_FUNC_QCAPS response indicates the maximum number
of multicast filters that can be supported by this function
on the RX side.

Fixed to use this value instead of the hard coded value 16.

Fixes: d69851df12b2 ("net/bnxt: support multicast filter and set MAC addr")
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>
2 years agonet/bnxt: fix flow create when RSS is disabled
Kalesh AP [Tue, 4 Jan 2022 08:38:16 +0000 (14:08 +0530)]
net/bnxt: fix flow create when RSS is disabled

This patch reverts the commit "5d47d06b2c83".
Revert this commit as it caused a regression on legacy chips.
On newer chips we use TruFlow based flow creation instead of
HWRM based flow creation.

Fixes: 5d47d06b2c83 ("net/bnxt: modify VNIC accounting")
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>
2 years agonet/bnxt: add null check for mark table
Kalesh AP [Tue, 4 Jan 2022 08:38:15 +0000 (14:08 +0530)]
net/bnxt: add null check for mark table

During the port start, driver ignores mark table allocation failure.
This could cause a segfault due to NULL pointer dereference in
bnxt_set_mark_in_mbuf(). Fix this by checking the pointer validity
before accessing it.

Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
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>
2 years agonet/bnxt: improve recovery related log messages
Kalesh AP [Tue, 4 Jan 2022 08:38:14 +0000 (14:08 +0530)]
net/bnxt: improve recovery related log messages

Make these messages more specific.

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>
2 years agonet/bnxt: set fast-path pointers only if recovery succeeds
Kalesh AP [Tue, 4 Jan 2022 08:38:13 +0000 (14:08 +0530)]
net/bnxt: set fast-path pointers only if recovery succeeds

During reset recovery, fixed to set the fast-path pointers
only if recovery succeeds.

Fixes: 720b55ad278e ("net/bnxt: fix crash caused by error recovery")
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>
2 years agonet/bnxt: cap maximum number of unicast MAC addresses
Kalesh AP [Tue, 4 Jan 2022 08:38:12 +0000 (14:08 +0530)]
net/bnxt: cap maximum number of unicast MAC addresses

The Maximum number of receive mac addr is hard coded to 128
in the ethdev library(RTE_ETH_NUM_RECEIVE_MAC_ADDR).
But the bnxt devices support more than 128 unicast MAC filters
which could result in a segfault while user tries to add more
than 128 unicast MAC addresses to the port.

Fixes: a2033fda22ab ("net/bnxt: fix number of MAC addresses for VMDq")
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>
2 years agonet/bnxt: fix restoring VLAN filtering after recovery
Kalesh AP [Tue, 4 Jan 2022 08:38:11 +0000 (14:08 +0530)]
net/bnxt: fix restoring VLAN filtering after recovery

During port start, driver calls bnxt_vlan_offload_set_op()
to program VLAN Filter/VLAN Strip setting to the HW. This
in turns add the vlan filters.

This results in a failure when bnxt_restore_filters() invokes
bnxt_restore_vlan_filters() during the recovery as the vlans are
already programmed.

Fix to ignore the error(-EEXIST).

Fixes: 151c8240ac6a ("net/bnxt: restore VLAN filters during reset recovery")
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>
2 years agonet/bnxt: restore RSS configuration after reset recovery
Kalesh AP [Tue, 4 Jan 2022 08:38:10 +0000 (14:08 +0530)]
net/bnxt: restore RSS configuration after reset recovery

During reset recovery, driver is not restoring the VNIC rss hash key.
It's generating a new random hash key which results in unexpected
RSS behavior after recovery. Fixed this by storing the VNIC RSS
configuration to a local struct and then applying the cached value
during the recovery.

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
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>
2 years agonet/bnxt: fix queue stop operation
Kalesh AP [Tue, 4 Jan 2022 08:38:09 +0000 (14:08 +0530)]
net/bnxt: fix queue stop operation

When there are no active Rx queues(i.e when all queues have been
stopped), clear the RSS redirection table of the VNIC on Thor.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
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>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2 years agonet/bnxt: fix multicast MAC restore during reset recovery
Kalesh AP [Tue, 4 Jan 2022 08:38:08 +0000 (14:08 +0530)]
net/bnxt: fix multicast MAC restore during reset recovery

During reset recovery, driver is not restoring the multicast
mac addresses. Added code to restore them during reset recovery.

Fixes: b02f1573cd07 ("net/bnxt: restore MAC filters during reset recovery")
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>
2 years agonet/bnxt: fix multicast address set
Kalesh AP [Tue, 4 Jan 2022 08:38:07 +0000 (14:08 +0530)]
net/bnxt: fix multicast address set

Fix bnxt_dev_set_mc_addr_list_op.
Fix to cache the multicast mac addresses added to the port
to the driver private structure memory. Use this cached mc list
to program the FW.

This fixes an issue where multicast packets reception is
successful only if the multicast mac address of the packets
is the first one in the multicast address list of the port.

This is in preparation for another fix in the series.

Fixes: d69851df12b2 ("net/bnxt: support multicast filter and set MAC addr")
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>
2 years agonet/bnxt: fix xstats names query overrun
Lance Richardson [Tue, 30 Nov 2021 14:42:26 +0000 (09:42 -0500)]
net/bnxt: fix xstats names query overrun

When the xstats_names parameter to rte_eth_xstats_get_names()
is non-NULL and the size parameter is less than the required
number of entries, the driver must return the required size
without modifying (and over-running) the caller's xstats_names
array.

Update bnxt_dev_xstats_get_names_op() in accordance with this
requirement.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/mlx5: relax headroom assertion
Dmitry Kozlyuk [Tue, 28 Dec 2021 09:20:43 +0000 (11:20 +0200)]
net/mlx5: relax headroom assertion

A debug assertion in Single-Packet Receive Queue (SPRQ) mode
required all Rx mbufs to have a 128 byte headroom,
based on the assumption that rte_pktmbuf_init() sets it.
However, rte_pktmbuf_init() may set a smaller headroom
if the dataroom is insufficient, e.g. this is a natural case
for split buffer segments. The headroom can also be larger.
Only check the headroom size when vectored Rx routines
are used because they rely on it. Relax the assertion
to require sufficient headroom size, not an exact one.

Fixes: a0a45e8af723 ("net/mlx5: configure Rx queue for buffer split")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix GCC uninitialized variable warning
Dmitry Kozlyuk [Tue, 28 Dec 2021 09:17:03 +0000 (11:17 +0200)]
net/mlx5: fix GCC uninitialized variable warning

When building with -Db_sanitize=thread, GCC gives a warning:

drivers/net/mlx5/mlx5_flow_meter.c: In function ‘mlx5_flow_meter_create’:
drivers/net/mlx5/mlx5_flow_meter.c:1170:33: warning: ‘legacy_fm’ may be
    used uninitialized in this function [-Wmaybe-uninitialized]

This is a false-positive: legacy_fm is initialized and used
if and only if priv->sh->meter_aso_en is false.
Work around this by initializing legacy_fm to NULL.
Add an assertion before legacy_fm use in case the logic changes.

Fixes: 444320186393 ("net/mlx5: support meter creation with policy")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support imissed counter on Windows
Tal Shnaiderman [Fri, 24 Dec 2021 06:46:46 +0000 (08:46 +0200)]
net/mlx5: support imissed counter on Windows

Add support for the imissed counter using the DevX API on Windows.

imissed is queried by creating a queue counter for the port, attaching
it to all created RQs and querying the "out_of_buffer" field.

If the counter cannot be created, imissed will always report 0.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix GRE protocol type translation for Verbs
Gregory Etelson [Thu, 23 Dec 2021 13:16:38 +0000 (15:16 +0200)]
net/mlx5: fix GRE protocol type translation for Verbs

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

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

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix RSS expansion with explicit next protocol
Gregory Etelson [Thu, 23 Dec 2021 13:08:17 +0000 (15:08 +0200)]
net/mlx5: fix RSS expansion with explicit next protocol

The PMD RSS expansion scheme by default compiles flow rules for all
flow item types that may branch out from a stub supplied
by application.
For example,
ETH can lead to VLAN, IPv4 or IPv6.
IPv4 can lead to UDP, TCP, IPv4 or IPv6.

If application explicitly specified next protocol type, expansion must
use that option only and not create flows with other protocol types.

The PMD ignored explicit next protocol values in GRE and VXLAN-GPE.

The patch updates RSS expansion for GRE and VXLAN-GPE with explicit
next protocol settings.

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>
2 years agonet/mlx5: fix assertion on flags set in packet mbuf
Lior Margalit [Thu, 23 Dec 2021 08:15:41 +0000 (10:15 +0200)]
net/mlx5: fix assertion on flags set in packet mbuf

Fixed the assertion on the flags set in pkt->ol_flags for vectorized
MPRQ.  With vectorized MPRQ the CQs are processed before copying the
MPRQ bufs so the valid assertion is that the expected flag is set and
not that the pkt->ol_flags equlas this flag alone.

Fixes: 0f20acbf5eda ("net/mlx5: implement vectorized MPRQ burst")
Cc: stable@dpdk.org
Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix missing validation in devargs parsing
Michael Baum [Thu, 16 Dec 2021 18:40:40 +0000 (20:40 +0200)]
common/mlx5: fix missing validation in devargs parsing

The rte_kvargs_parse function parses the arguments
"key=value,key=value,..." string and return an allocated structure that
contains a key/value list.
It enables also to send a key without value and updates the values in
the following ways:
 - "key=value,key,..." - value is updated as NULL.
 - "key=value,key=,..." - value is updated as "" (empty string).

Mlx5 PMDs use this function to parse, but they don't support key without
value. They send the value as an argument to strtol function.
When strtol gets NULL as a parameter it cause a crash, when it gets ""
(empty string) it returns 0.

Adds a check that will prevent an argument in these formats, and returns
an error for it.

Fixes: 85209924039c ("common/mlx5: share memory related devargs")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix memory socket selection in ASO management
Michael Baum [Wed, 8 Dec 2021 14:51:34 +0000 (16:51 +0200)]
net/mlx5: fix memory socket selection in ASO management

In ASO objects creation (WQE, CQE and MR), socket number is given as
a parameter.

The selection was wrongly socket 0 hardcoded even if the user didn't
configure memory for this socket.

This patch replaces the selection to default socket (SOCKET_ID_ANY).

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: fix error handling in multi-class probe
Michael Baum [Wed, 24 Nov 2021 22:02:38 +0000 (00:02 +0200)]
common/mlx5: fix error handling in multi-class probe

The common drivers_probe function calls in a loop to all probe functions
for classes requested by the user. After it manages to probe them all,
it updates this on the device in the "classes_loaded" field.

If one of them fails, all those probed to it are remove using the
drivers_remove function. However, this function only releases the
classes in the "classes_loaded" field on the given device and misses the
newly probed classes.

This patch removes the condition from the release function, and ensures
that the caller function sends a more accurate parameter.

Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class drivers")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/ixgbe: add vector Rx parameter check
Bin Zheng [Fri, 10 Dec 2021 08:22:09 +0000 (16:22 +0800)]
net/ixgbe: add vector Rx parameter check

Under the circumstance that `rx_tail` wrap back to zero
and the advance speed of `rx_tail` is greater than `rxrearm_start`,
`rx_tail` will catch up with `rxrearm_start` and surpass it.
This may cause some mbufs be reused by application.

So we need to make some restrictions to ensure that
 `rx_tail` will not exceed `rxrearm_start`.

e.g.

RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
...
RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994

when `rx_tail` catches up with `rxrearm_start`,
2(994 - 992) mbufs be reused by application !

Bugzilla ID: 882
Fixes: 5a3cca342417 ("net/ixgbe: fix vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Liang Ma <liangma@liangbit.com>
2 years agonet/iavf: fix segmentation offload condition
Radu Nicolau [Mon, 22 Nov 2021 15:30:00 +0000 (15:30 +0000)]
net/iavf: fix segmentation offload condition

Apply segmentation offload when requested for non tunneled
packets e.g. IPsec transport mode.

Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix Tx checksum offload
Kevin Liu [Sun, 12 Dec 2021 14:35:20 +0000 (14:35 +0000)]
net/ice: fix Tx checksum offload

The tunnel packets is missing some information after Tx forwarding.

In ice_txd_enable_offload, when set tunnel packet Tx checksum
offload enable, td_offset should be set with outer l2/l3 len instead
of inner l2/l3 len.

In ice_txd_enable_checksum, td_offset should also be set with outer
l3 len.

This patch fix the bug that the checksum engine can forward Ipv4/Ipv6
tunnel packets.

Fixes: 28f9002ab67f ("net/ice: add Tx AVX512 offload path")
Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: track DCF state of PF
Dapeng Yu [Wed, 24 Nov 2021 08:12:20 +0000 (16:12 +0800)]
net/ice: track DCF state of PF

When VF is reset, PF will change DCF state from ON to other state, if
flow creation, destroy, or redirect command is sent to DCF at this
time, it will fail.

This patch tracks DCF state and returns try-again error to caller when
DCF state is not ON.

Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/iavf: remove git residue symbol
Haiyue Wang [Thu, 16 Dec 2021 04:43:42 +0000 (12:43 +0800)]
net/iavf: remove git residue symbol

This extra symbol '+' should be added when patch was reapplied, and the
compiler treats it as unsigned type, so the code still runs well.

Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2 years agonet/ice: fix Tx checksum offload capability
Qi Zhang [Wed, 24 Nov 2021 01:09:28 +0000 (09:09 +0800)]
net/ice: fix Tx checksum offload capability

Add missing capability for outer UDP Tx checksum.
Also fixed the feature list in ice_dcf.ini

Fixes: bf89db4409bb ("net/ice: complete device info get in DCF")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2 years agonet/ice: fix pattern check for flow director parser
Junfeng Guo [Wed, 22 Dec 2021 08:11:38 +0000 (16:11 +0800)]
net/ice: fix pattern check for flow director parser

FDIR rules with masks are not supported in current code. Thus add
pattern check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR
programming stage.

Fixes: 1b71ed2cdd5d ("net/ice: refactor flow pattern parser")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/cnxk: add devargs for configuring SDP channel mask
Satheesh Paul [Tue, 9 Nov 2021 09:42:04 +0000 (15:12 +0530)]
net/cnxk: add devargs for configuring SDP channel mask

This patch adds support to configure channel mask which will
be used by rte flow when adding flow rules on SDP interfaces.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support setting channel mask for SDP interfaces
Satheesh Paul [Tue, 9 Nov 2021 09:42:03 +0000 (15:12 +0530)]
common/cnxk: support setting channel mask for SDP interfaces

ROC changes to support setting channel mask for SDP interfaces.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/qede: fix redundant condition in debug code
Anatoly Burakov [Tue, 30 Nov 2021 16:59:13 +0000 (16:59 +0000)]
net/qede: fix redundant condition in debug code

Expression "a && 1" is equivalent to just "a", so fix the accidental
inclusion of a literal in code.

Fixes: ec55c118792b ("net/qede: add infrastructure for debug data collection")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Reviewed-by: Igor Russkikh <irusskikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2 years agocommon/cnxk: wait for XAQ pool to fill
Ashwin Sekhar T K [Tue, 30 Nov 2021 06:07:02 +0000 (11:37 +0530)]
common/cnxk: wait for XAQ pool to fill

Wait for XAQ pool to get filled with the freed pointers
before proceeding.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: wait for SQB pool to fill
Ashwin Sekhar T K [Tue, 30 Nov 2021 06:07:01 +0000 (11:37 +0530)]
common/cnxk: wait for SQB pool to fill

Wait for SQB pool to get filled with the freed pointers
before proceeding.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support waiting for pool filling
Ashwin Sekhar T K [Tue, 30 Nov 2021 06:07:00 +0000 (11:37 +0530)]
common/cnxk: support waiting for pool filling

Add roc_npa_aura_op_available_wait() API which can be used to wait
until an NPA pool gets filled up to a certain count of pointers.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: update CPU directive in NPA assembly code
Ashwin Sekhar T K [Tue, 30 Nov 2021 05:48:09 +0000 (11:18 +0530)]
common/cnxk: update CPU directive in NPA assembly code

Use arch_extension instead of .cpu directive in NPA assembly code
snippets. Using .cpu directive with generic causes it to override
the micro architecture selected by march,mcpu.
For example if march=armv8.5-a+crypto+sve2 provided then the .cpu
directive overrides it to generic+crypto+sve2, use arch_extension
to get the expected result.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: use CAS with release semantics for batch alloc
Ashwin Sekhar T K [Tue, 30 Nov 2021 05:45:27 +0000 (11:15 +0530)]
common/cnxk: use CAS with release semantics for batch alloc

Before issuing the batch alloc, we clear the first word of
cache lines so that NPA can update the status. Make sure that
this line clear is flushed before the batch alloc is issued.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: ensure ROC cache alignment of NPA stack size
Ashwin Sekhar T K [Tue, 30 Nov 2021 05:38:22 +0000 (11:08 +0530)]
common/cnxk: ensure ROC cache alignment of NPA stack size

When PLT_CACHE_LINE_SIZE is set to 64B, the memzone size reserved for
NPA stack could be a multiple of 64B. In such a case, when NDC SYNC
is initiated for the NPA LF, it could go and corrupt an additional
64B bytes as NDC flushes in multiples of ROC cache line size (128B).

So ensure that NPA stack size requested is a multiple of 128B.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>