dpdk.git
3 years agocommon/mlx5: add Verbs usage flag
Ophir Munk [Mon, 28 Dec 2020 09:54:16 +0000 (11:54 +0200)]
common/mlx5: add Verbs usage flag

Add a Verbs file presence indication. Under Linux it is required that
file infiniband/verbs.h is installed for building DPDK.  Other
operating systems (e.g. Windows) ignore Verbs completely.  This commit
adds definition HAVE_INFINIBAND_VERBS_H (file mlx5_autoconf.h) to
indicate whether DPDK compiles with Verbs or not.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix flow action destroy wrapper
Ophir Munk [Mon, 28 Dec 2020 09:54:15 +0000 (11:54 +0200)]
net/mlx5: fix flow action destroy wrapper

Glue function destroy_flow_action() was wrapped by OS specific operation
mlx5_flow_os_destroy_flow_action(). It was skipped in file mlx5.c.

Fixes: b293fbf9672b ("net/mlx5: add OS specific flow actions operations")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: wrap glue reg/dereg UMEM per OS
Tal Shnaiderman [Mon, 28 Dec 2020 09:54:14 +0000 (11:54 +0200)]
net/mlx5: wrap glue reg/dereg UMEM per OS

Wrap glue calls for UMEM registration and deregistration with generic OS
calls since each OS (Linux or Windows) has a different glue API
parameters.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: wrap glue alloc/dealloc PD per OS
Ophir Munk [Mon, 28 Dec 2020 09:54:13 +0000 (11:54 +0200)]
net/mlx5: wrap glue alloc/dealloc PD per OS

Wrap glue calls alloc_pd() and dealloc_pd() with generic OS calls.  In
Linux - protection domain allocations are implemented by Verbs glue API
while in Windows it is by DevX API.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: move static asserts to global scope
Ophir Munk [Mon, 28 Dec 2020 09:54:12 +0000 (11:54 +0200)]
net/mlx5: move static asserts to global scope

Some Windows compilers consider static_assert() as calls to another
function rather than a compiler directive which allows checking type
information at compile time.  This only occurs if the static_assert call
appears inside another function scope. To solve it move the
static_assert calls to global scope in the files where they are used.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: do not define static assert in Windows
Ophir Munk [Mon, 28 Dec 2020 09:54:11 +0000 (11:54 +0200)]
net/mlx5: do not define static assert in Windows

In Linux 'static_assert' is defined in file mlx5_defs.h:

 #ifndef HAVE_STATIC_ASSERT
    #define static_assert _Static_assert
 #endif

The same definition can originate from Linux file /usr/include/assert.h.

In Windows static_assert is used while _Static_assert is unknown.
Therefore update the definition condition to be:

 #if !defined(HAVE_STATIC_ASSERT) && !defined(RTE_EXEC_ENV_WINDOWS)
    #define static_assert _Static_assert
 #endif

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: define MPRQ functions as static inline
Ophir Munk [Mon, 28 Dec 2020 09:54:10 +0000 (11:54 +0200)]
net/mlx5: define MPRQ functions as static inline

Functions mlx5_check_mprq_support(), mlx5_rxq_mprq_enabled(),
mlx5_mprq_enabled() are moved from source file mlx5_rxq.c to header file
mlx5_rxtx.h and their type is updated to 'static __rte_always_inline'.
Previously the functions were declared as 'inline' in the source file
which was reported as 'unresolved external symbol' error by some Windows
linkers.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: replace Linux sleep
Ophir Munk [Mon, 28 Dec 2020 09:54:09 +0000 (11:54 +0200)]
net/mlx5: replace Linux sleep

Replace Linux API usleep() and nanosleep() with rte_delay_us_sleep().
The replacement occurs in shared files compiled under different
operating systems.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix freeing packet pacing
Ophir Munk [Mon, 28 Dec 2020 09:54:08 +0000 (11:54 +0200)]
net/mlx5: fix freeing packet pacing

Packet pacing is allocated under condition #ifdef HAVE_MLX5DV_PP_ALLOC.
In a similar way - free packet pacing index under the same condition.
This update is required to successfully compile under operating systems
which do not support packet pacing.

Fixes: aef1e20ebeb2 ("net/mlx5: allocate packet pacing context")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: remove Linux files from Windows compilation
Ophir Munk [Mon, 28 Dec 2020 09:54:07 +0000 (11:54 +0200)]
net/mlx5: remove Linux files from Windows compilation

This commit removes Linux files flow_verbs.c and mlx5_rxtx_vec.c
from Windows compilation.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: extend device attributes getter
Ophir Munk [Mon, 28 Dec 2020 09:54:06 +0000 (11:54 +0200)]
net/mlx5: extend device attributes getter

This commit adds device attributes parameters to be reported by
mlx5_os_get_dev_attr(): max_cqe, max_mr, max_pd, max_srq, max_srq_wr

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix constant array size
Tal Shnaiderman [Mon, 28 Dec 2020 09:54:05 +0000 (11:54 +0200)]
net/mlx5: fix constant array size

Before this commit the PMD used:
   const int elt_n = 8
   const int *stack[elt_n];

In Windows clang compiler complains:
net/mlx5/mlx5_flow.c:215:19: error: variable length array folded
to constant array as an extension [-Werror,-Wgnu-folding-constant]

Fix it by using a constant macro definition instead of a variable:
   #define MLX5_RSS_EXP_ELT_N 8
   const int *stack[MLX5_RSS_EXP_ELT_N];

Fixes: c7870bfe09dc ("ethdev: move RSS expansion code to mlx5 driver")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: fix tunnel rules validation on VF representor
Gregory Etelson [Fri, 11 Dec 2020 14:46:14 +0000 (16:46 +0200)]
net/mlx5: fix tunnel rules validation on VF representor

MLX5 PMD implicitly adds vxlan_decap flow action to tunnel offload
match type rules. However, VXLAN decap action on VF representors is
not supported on MLX5 PMD hardware.

The patch rejects attempt to create tunnel offload flow rules on VF
representor.

Refer commit 9c4971e5231d ("net/mlx5: update VLAN and encap actions validation")

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/iavf: support TCP/UDP flow item without input set
Yuying Zhang [Wed, 6 Jan 2021 10:49:13 +0000 (10:49 +0000)]
net/iavf: support TCP/UDP flow item without input set

This patch adds an input set refinement function to support outer
and inner TCP/UDP patterns without input set for flow director filter.

For example:
1. flow create 0 ingress pattern eth / ipv4 / udp / end
   actions rss queues 0 1 2 3 end / end
2. flow create 0 ingress pattern eth / ipv6 / tcp / end
   actions queue index 3 / end

This patch will refine the input set when it is empty and generate
a dummy proto type as input set in L3 header which is required
by the hardware.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agoapp/testpmd: release flows left before port stop
Gregory Etelson [Thu, 26 Nov 2020 16:43:02 +0000 (18:43 +0200)]
app/testpmd: release flows left before port stop

According to RTE flow user guide, PMD will not keep flow rules after
port stop. Application resources that refer to flow rules become
obsolete after port stop and must not be used.
Testpmd maintains linked list of active flows for each port. Entries in
that list are allocated dynamically and must be explicitly released to
prevent memory leak.
The patch releases testpmd port flow_list that holds remaining flows
before port is stopped.

Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: set correct checksum status in mbuf
Lance Richardson [Fri, 18 Dec 2020 20:28:37 +0000 (15:28 -0500)]
net/bnxt: set correct checksum status in mbuf

The setting of the mbuf ol_flags field for tunneled packets
should be different depending upon whether DEV_RX_OFFLOAD_OUTER_*
offloads are enabled. Initialize ol_flags mappings based on
the receive offload configuration when the receive ring is
initialized.

Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: make offload flags mapping per-ring
Lance Richardson [Fri, 18 Dec 2020 20:28:36 +0000 (15:28 -0500)]
net/bnxt: make offload flags mapping per-ring

Refactor offload flags mapping table to be dynamic  and
per-ring instead of static and global.

Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: remove support for some PCI IDs
Ajit Khaparde [Fri, 18 Dec 2020 01:10:54 +0000 (17:10 -0800)]
net/bnxt: remove support for some PCI IDs

As announced the deprecation notice during the 20.11 release,
remove support for NetXtreme devices belonging to BCM573xx and
BCM5740x families. Specifically the support for the following Broadcom
PCI device IDs: 0x16c8, 0x16c9, 0x16ca, 0x16ce, 0x16cf, 0x16df, 0x16d0,
0x16d1, 0x16d2, 0x16d4, 0x16d5, 0x16e7, 0x16e8, 0x16e9 has been removed.

Deprecation notice has been removed and release notes for 21.02 has
been updated accordingly.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix outer UDP checksum Rx offload capability
Lance Richardson [Thu, 17 Dec 2020 19:24:31 +0000 (14:24 -0500)]
net/bnxt: fix outer UDP checksum Rx offload capability

Rx outer UDP checksum offload has been supported for
some time, but this has not been advertised in offload
capability flags. Fix this, and allow vector mode
receive to be enabled when DEV_RX_OFFLOAD_OUTER_UDP_CKSUM
is requested.

Fixes: 04a681426d49 ("net/bnxt: fix L4 checksum error indication in Rx")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix fallback mbuf allocation logic
Lance Richardson [Wed, 16 Dec 2020 15:06:18 +0000 (10:06 -0500)]
net/bnxt: fix fallback mbuf allocation logic

Fixes for fallback mbuf allocation logic.
   - Preserve raw (unmasked) producer index.
   - Iterate over all processed descriptors (representor and
     non-representor) when checking allocation status.
   - Invoke fallback allocation logic when an allocation
     failure has occurred for any received packet, not
     just the last.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Fixes: d9dd0b29ed31 ("net/bnxt: fix Rx handling and buffer allocation logic")
Fixes: c7de4195cc4c ("net/bnxt: modify ring index logic")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix doorbell write ordering
Lance Richardson [Mon, 14 Dec 2020 18:56:38 +0000 (13:56 -0500)]
net/bnxt: fix doorbell write ordering

Write completion queue doorbell before receive descriptor
doorbell to avoid possibility of completion queue overflow
when completion queue size is equal to receive descriptor
ring size. Remove unnecessary compiler barriers (db write
functions have the necessary barriers.)

Fixes: 637e34befd9c ("net/bnxt: optimize Rx processing")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: limit Rx representor packets per poll
Lance Richardson [Mon, 14 Dec 2020 18:53:52 +0000 (13:53 -0500)]
net/bnxt: limit Rx representor packets per poll

Without some limit on the number of packets transferred from the
HW ring to the representor ring per burst receive call, an entire ring's
worth of packets can be transferred. This can break assumptions
about ring indices (index on return could be identical to the index
on entry, which is assumed to mean that no packets were processed),
and can result in representor packets being dropped unnecessarily
due to representor ring overflow.

Fix by limiting the number of representor packets transferred per
poll to requested burst size.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/i40e: fix flex payload rule conflict
Beilei Xing [Tue, 5 Jan 2021 03:12:56 +0000 (11:12 +0800)]
net/i40e: fix flex payload rule conflict

With the following commands, the second flow can't
be created successfully.

1. flow create 0 ingress pattern eth / ipv4 / udp /
   raw relative is 1 pattern is 0102030405 / end
   actions drop / end
2. flow destroy 0 rule 0
3. flow create 0 ingress pattern eth / ipv4 / udp /
   raw relative is 1 pattern is 010203040506 / end
   actions drop / end

The root cause is that a flag for flex pit isn't reset.

Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
Cc: stable@dpdk.org
Reported-by: Chenmin Sun <chenmin.sun@intel.com>
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/iavf: fix GTPU UL and DL support for flow director
Junfeng Guo [Thu, 31 Dec 2020 05:13:07 +0000 (13:13 +0800)]
net/iavf: fix GTPU UL and DL support for flow director

For AVF FDIR, GTPU uplink and downlink are not supported in previous
code. This patch distinguishes GTPU with IP/EH/DL/UL for AVF FDIR.

Fixes: 4c7a41ae6b23 ("net/iavf: support flow director GTPU outer IPv4/IPv6")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix queue pairs configuration
Alvin Zhang [Wed, 23 Dec 2020 05:29:36 +0000 (13:29 +0800)]
net/iavf: fix queue pairs configuration

Check if there are enough queue pairs currently allocated, and if not,
request PF to allocate them.

Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ixgbe: clear all queues on VF reset
Simon Ellmann [Thu, 17 Dec 2020 17:14:52 +0000 (18:14 +0100)]
net/ixgbe: clear all queues on VF reset

ixgbe devices support up to 8 Rx and Tx queues per virtual function.
Currently, the registers of only seven queues are set to default when
resetting a VF.

Signed-off-by: Simon Ellmann <simon.ellmann@tum.de>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ice/base: refactor structure field
Qi Zhang [Tue, 15 Dec 2020 05:30:57 +0000 (13:30 +0800)]
net/ice/base: refactor structure field

The change is for kernel driver RDMA usage, DPDK driver does not
enable RDMA, just for code sync.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: remove unused struct member
Qi Zhang [Tue, 15 Dec 2020 05:27:45 +0000 (13:27 +0800)]
net/ice/base: remove unused struct member

The only time you can ever have a rq_last_status is if
a firmware event was somehow reporting a status on the receive
queue, which are generally firmware initiated events or
mailbox messages from a VF.  Mostly this struct member was unused.

Fix this problem by still printing the value of the field in a debug
print, but don't store the value forever in a struct, potentially
creating opportunities for callers to use the wrong struct member.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: support eCPRI over UDP type 0 flow
Qi Zhang [Tue, 15 Dec 2020 05:25:04 +0000 (13:25 +0800)]
net/ice/base: support eCPRI over UDP type 0 flow

This patch adds extracting field for flow type eCPRI over UDP message
type 0 and field PC_ID which is used for FDIR/RSS packet steering.

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: support eCPRI over MAC type 0 flow
Qi Zhang [Tue, 15 Dec 2020 05:18:27 +0000 (13:18 +0800)]
net/ice/base: support eCPRI over MAC type 0 flow

This patch adds extracting field for flow type eCPRI over mac message
type 0 and field PC_ID which is used for FDIR/RSS packet steering.

This patch also removes redundant hdr bitmask ops for PPPOE hdr.

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: align macro names to specification
Qi Zhang [Tue, 15 Dec 2020 05:08:20 +0000 (13:08 +0800)]
net/ice/base: align macro names to specification

For get PHY abilities AQ, the specification defines "report modes"
as "with media", "without media" and "active configuration". For
clarity, rename macros to align with the specification.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: use report default config to get PHY capa
Qi Zhang [Tue, 15 Dec 2020 04:58:27 +0000 (12:58 +0800)]
net/ice/base: use report default config to get PHY capa

In case of new link establishment flow we should use
Report Default Configuration if FW AQ API version
supports it. This patch adds check function for Report
Default Configuration support and updates ice_set_fc(),
ice_cfg_phy_fec() and ice_aq_get_phy_caps() accordingly.

Signed-off-by: Mateusz Pacuszka <mateuszx.pacuszka@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: fix null pointer dereference
Qi Zhang [Tue, 15 Dec 2020 04:42:46 +0000 (12:42 +0800)]
net/ice/base: fix null pointer dereference

Added handling of allocation fault for ice_vsi_list_map_info
Should also check dereference of NULL pointer to filters VSI list
information for FWD_TO_VSI_LISt type only, otherwise, the FWD_TO_VSI type
filters by the given VSI can't be located.

Also the point *pi should not be NULL pointer, it is a reference to raw
data field, so remove this variable, use the reference directly.

Fixes: c7dd15931183 ("net/ice/base: add virtual switch code")
Cc: stable@dpdk.org
Signed-off-by: Jacek BuĊ‚atek <jacekx.bulatek@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: modify recursive way of adding nodes
Qi Zhang [Tue, 15 Dec 2020 04:33:53 +0000 (12:33 +0800)]
net/ice/base: modify recursive way of adding nodes

Remove the recursive way of adding the nodes to the layer in order
to reduce the stack usage. Instead the algorithm is modified to use
a while loop.

The previous code was scanning recursively the nodes horizontally.
The total stack consumption will be based on number of nodes present
on that layer. In some cases it can consume more stack.

Signed-off-by: Victor Raj <victor.raj@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: change get PHY capability log level
Qi Zhang [Tue, 15 Dec 2020 04:30:32 +0000 (12:30 +0800)]
net/ice/base: change get PHY capability log level

As the user may be expected to take action on this issue, change the
message to a warning so that the message is more easily accessible than
a debug. Also, add the error code to further aide in identifying the
problem.

Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: resend some AQ commands when EBUSY
Qi Zhang [Tue, 15 Dec 2020 04:26:12 +0000 (12:26 +0800)]
net/ice/base: resend some AQ commands when EBUSY

Retry sending some AQ commands, as result of EBUSY AQ error.
This change follows the latest guidelines from HW. It is better
to retry the same AQ command several times, as the result of
EBUSY, instead of returning error to the caller right away.

Signed-off-by: Chinh T Cao <chinh.t.cao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: support checking double VLAN mode
Qi Zhang [Tue, 15 Dec 2020 04:21:21 +0000 (12:21 +0800)]
net/ice/base: support checking double VLAN mode

If a driver wants to configure double VLAN mode (DVM) it needs to
first check if the DDP supports DVM. To do this the driver needs to read
the package metadata section via the upload section AQ (0x04C1).

If the DDP doesn't support configuring double VLAN mode (DVM), then
there is nothing to do regarding configuring the VLAN mode of the
device.

The set_svm() or set_dvm() ops should only be called if the current
configuration supports configuring the VLAN mode of the device.

Suggested-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: fix tunnel destroy
Qi Zhang [Tue, 15 Dec 2020 04:13:57 +0000 (12:13 +0800)]
net/ice/base: fix tunnel destroy

The TCAM information in AQ command buffer is not correct when destroying
the tunnel entries. The TCAM count was always ONE even multiple entries
are destroyed, and the offset of TCAM memory was also incorrect.
This patch is to fix this issue.

Fixes: 884efe3ca1f3 ("net/ice/base: add VXLAN/generic tunnel management")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: support VXLAN VNI field in flow director
Qi Zhang [Tue, 15 Dec 2020 04:10:40 +0000 (12:10 +0800)]
net/ice/base: support VXLAN VNI field in flow director

Enable VXLAN VNI field in FDIR.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: add interface to support configuring VLAN mode
Qi Zhang [Tue, 15 Dec 2020 04:00:55 +0000 (12:00 +0800)]
net/ice/base: add interface to support configuring VLAN mode

The VLAN mode of the device has to be configured while the global
configuration lock is held while downloading the DDP, specifically after
the DDP has been downloaded. In order to support this a VLAN mode
interface was added. By default the device will stay in single VLAN
mode (SVM), which is the current implementation. However, this can be
changed by implementing the .set_dvm op.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: add condition to copy module info into memory
Qi Zhang [Tue, 15 Dec 2020 03:29:46 +0000 (11:29 +0800)]
net/ice/base: add condition to copy module info into memory

There is added condition,to copy information about used module into
memory

Signed-off-by: Szymon T Cudzilo <szymon.t.cudzilo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: add function for NVM checksum verification
Qi Zhang [Tue, 15 Dec 2020 03:22:08 +0000 (11:22 +0800)]
net/ice/base: add function for NVM checksum verification

AQ 0x0706 lets user to verify and recalculate NVM checksum. The usage
depends on command flags.

Signed-off-by: Milena Olech <milena.olech@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: add definitions for FW health status codes
Qi Zhang [Tue, 15 Dec 2020 03:14:25 +0000 (11:14 +0800)]
net/ice/base: add definitions for FW health status codes

Add definitions for the various health status codes that can be reported
by firmware.

Signed-off-by: Nick Nunley <nicholas.d.nunley@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: cleanup some macros
Qi Zhang [Tue, 15 Dec 2020 03:12:12 +0000 (11:12 +0800)]
net/ice/base: cleanup some macros

Replaced the netlist related macro and removed some unused macro

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: add GTP filtering via advanced switch filter
Qi Zhang [Tue, 15 Dec 2020 03:05:01 +0000 (11:05 +0800)]
net/ice/base: add GTP filtering via advanced switch filter

Add support to enable GTP filtering using advanced switch filter mechanism.
Example of GTP filter criteria:
  Outer UDP + GTP (Optional) + Inner IPv4[6] + Inner TCP/UDP

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: implement inactive NVM version get
Qi Zhang [Tue, 15 Dec 2020 02:44:39 +0000 (10:44 +0800)]
net/ice/base: implement inactive NVM version get

Similar to ice_get_inactive_orom_ver, add a function to read the NVM
version data from the inactive section of flash. The primary motivation
of this function is to allow the driver to report the version of
a pending update that has not yet been activated.

To do this, refactor ice_get_nvm_ver_info to allow it to take a bank
parameter. Read from the copy of the Shadow RAM in the NVM bank, rather
than reading from the RAM copy that is loaded by the device. This
ensures we get the accurate value when reading the inactive section.

Note that the start of the Shadow RAM copy is not directly following the
CSS header, but is actually aligned to the next 64-byte boundary. The
correct word offset must be rounded up to 32-bytes.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: read option ROM combo version from CIVD
Qi Zhang [Tue, 15 Dec 2020 02:39:28 +0000 (10:39 +0800)]
net/ice/base: read option ROM combo version from CIVD

The driver currently reads the combo image version data from within the
Boot Configuration TLV block of the PFA area of the NVM. This allows
access to the active Option ROM version data, assuming that it has been
properly copied into this section.

There is no equivalent method for reading the Option ROM version data
from a pending Option ROM update, as it will not yet have been copied
into the PFA boot configuration block. Instead, replace this
implementation with one which scans for the CIVD data section of the
Option ROM image data.

This CIVD data is stored in a packed structured format within the Option
ROM. It is always aligned to a 512 byte boundary, and starts with
a special '$CIV' 4-byte signature. Data integrity is checked using
a simple modulo 256 sum of the structure bytes.

Implement a new ice_get_orom_civd_data function which allows reading
from the selected flash bank (active or inactive), and scans for valid
CIVD data. Use this instead of the boot configuration TLV in order to
report the combo version data of precisely what is in the Option ROM
data.

To allow access to reading the inactive Option ROM bank, introduce a new
ice_get_inactive_orom_ver function. Use of a new function is done in
order to avoid leaking the bank selection abstraction outside of
ice_nvm.c

With this new function, the driver can now read and display the version
of the to-be-activated Option ROM when an update has been initiated but
not yet finalized.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: allow flash read with arbitrary size
Qi Zhang [Tue, 15 Dec 2020 02:29:16 +0000 (10:29 +0800)]
net/ice/base: allow flash read with arbitrary size

Refactor ice_read_flash_module so that it takes a size and a length
value, rather than always reading in 2-byte increments. The
ice_read_nvm_module and ice_read_orom_module wrapper functions will
still read a u16 with the byte-swapping enabled.

This will be used in a future change to implement reading of the CIVD
data from the Option ROM module.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: allow reading inactive flash security revision
Qi Zhang [Tue, 15 Dec 2020 02:25:32 +0000 (10:25 +0800)]
net/ice/base: allow reading inactive flash security revision

Modify ice_get_nvm_srev and ice_get_orom_srev to take the
ice_flash_bank enumeration that specifies whether to read from the
active or the inactive flash module. Rename and refactor the
ice_read_active_nvm_module and ice_read_active_orom_module functions to
take the bank enum value as well.

With this change, ice_get_nvm_srev and ice_get_orom_srev will be usable
in a future change to implement reading the version data for a pending
flash image.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: refactor interface for flash read
Qi Zhang [Tue, 15 Dec 2020 01:45:41 +0000 (09:45 +0800)]
net/ice/base: refactor interface for flash read

The ice_read_flash_module interface for reading from the various NVM
modules was introduced.

It's purpose is two-fold. First, it enables reading data from the CSS
header, used to allow accessing the image security revisions. Second, it
allowed reading from either the 1st or the 2nd NVM bank. This interface
was necessary because the device has two copies of each module. Only one
bank is active at a time, but it could be different for each module. The
driver had to determine which bank was active and then use that to
calculate the offset into the flash to read.

Future plans include allowing access to read not just from the active
flash bank, but also the inactive bank. This will be useful for enabling
display of the version information for a pending flash update.

The current abstraction in ice_read_flash_module is to specify the exact
bank to read. This requires callers to know whether to read from the 1st
or 2nd flash bank. This is the wrong abstraction level, since in most
cases the decision point from a caller's perspective is whether to read
from the active bank or the inactive bank.

Add a new ice_bank_select enumeration, used to indicate whether a flow
wants to read from the active, or inactive flash bank. Refactor
ice_read_flash_module to take this new enumeration instead of a raw
flash bank.

Have ice_read_flash_module select which bank to read from based on the
cached data we load during NVM initialization. With this change, it will
be come easier to implement reading version data from the inactive flash
banks in a future change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: read more security revision options
Qi Zhang [Tue, 15 Dec 2020 01:14:30 +0000 (09:14 +0800)]
net/ice/base: read more security revision options

Added read of security revision disabled and updated disabled.

Signed-off-by: Fabio Pricoco <fabio.pricoco@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: increase control queue timeout
Qi Zhang [Tue, 15 Dec 2020 01:09:01 +0000 (09:09 +0800)]
net/ice/base: increase control queue timeout

250 msec timeout is insufficient for some AQ commands. Advice from FW
team was to increase the timeout. Increased to 1 second.

Signed-off-by: Fabio Pricoco <fabio.pricoco@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice/base: modify ptype map for UDP
Qi Zhang [Tue, 15 Dec 2020 01:04:11 +0000 (09:04 +0800)]
net/ice/base: modify ptype map for UDP

Add below ptypes into ice_ptypes_udp_il.

MAC_IPV4_GTPC_TEID
MAC_IPV6_GTPC_TEID
MAC_IPV4_GTPC
MAC_IPV6_GTPC
MAC_IPV4_GTPU
MAC_IPV6_GTPU

So outer UDP can also be selected as input set for GTPC and
GTPU non IP packet.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
3 years agonet/ice: check Rx queue number on RSS init
Dapeng Yu [Wed, 23 Dec 2020 05:30:18 +0000 (13:30 +0800)]
net/ice: check Rx queue number on RSS init

When RSS is initialized, rx queues number is used as denominator to set
default value into the RSS lookup table. If it is zero, there will be
error of being divided by 0. So add value check to avoid the error.

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: improve default RSS
Xuan Ding [Wed, 23 Dec 2020 12:52:28 +0000 (12:52 +0000)]
net/iavf: improve default RSS

Add support to actively configure the RSS through port config.

Any kernel PF enabled default RSS will be disabled during
initialization.

Besides, default RSS will be configured based on
rte_eth_rss_conf->rss_hf.
Currently supported default rss_type: ipv4[6], ipv4[6]_udp, ipv4[6]_tcp,
ipv4[6]_sctp.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support eCPRI message type 0 for RSS
Simei Su [Mon, 14 Dec 2020 06:49:13 +0000 (14:49 +0800)]
net/iavf: support eCPRI message type 0 for RSS

This patch enables eCPRI Message Type 0 with input set physical
channel ID in rte_flow for RSS.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support eCPRI message type 0 for flow director
Junfeng Guo [Mon, 14 Dec 2020 06:49:12 +0000 (14:49 +0800)]
net/iavf: support eCPRI message type 0 for flow director

For eCPRI MSG Type 0, ecpriRtcid/ecpriPcid field within the eCPRI
header will be extracted to Field Vector for AVF FDIR.

SPEC for eCPRI:
http://www.cpri.info/downloads/eCPRI_v_2.0_2019_05_10c.pdf

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support eCPRI flow patterns
Simei Su [Mon, 14 Dec 2020 06:49:10 +0000 (14:49 +0800)]
net/iavf: support eCPRI flow patterns

Add patterns support for eCPRI.
Added patterns are as follows:
        eth_ecpri
        eth_ipv4_ecpri

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/iavf: support eCPRI protocol header fields
Junfeng Guo [Mon, 14 Dec 2020 06:49:09 +0000 (14:49 +0800)]
common/iavf: support eCPRI protocol header fields

Add eCPRI header and its field selectors, including MSG_TYPE, PCID
and RTCID. Since the offset of PCID is same as RTCID, we just add one
MACRO for these two fields. For MSG Type 0, ecpriRtcid/ecpriPcid field
within the eCPRI header will be extracted to Field Vector for FDIR and
RSS.

SPEC for eCPRI:
http://www.cpri.info/downloads/eCPRI_v_2.0_2019_05_10c.pdf

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix Rx bytes statistics
Alvin Zhang [Tue, 15 Dec 2020 09:50:59 +0000 (17:50 +0800)]
net/i40e: fix Rx bytes statistics

Update the Rx-bytes statistics by subtract CRC bytes count from original
bytes count.

Fixes: bd7883c07d4a ("net/i40e: refactor some stats related functions")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ixgbe: fix flex bytes flow director rule
Dapeng Yu [Tue, 15 Dec 2020 10:10:31 +0000 (18:10 +0800)]
net/ixgbe: fix flex bytes flow director rule

When a flexbytes flow director rule is created, the FDIRCTRL.FLEX_OFFSET
register is set, and it keeps its affect even after the flow director
flexbytes rule is destroyed, causing packets to be transferred to the
wrong place.

It is because setting FDIRCTRL shall only be permitted on Flow Director
initialization flow or clearing the Flow Director table according to the
datasheet, otherwise device may behave unexpectedly.

In order to evade this limitation, simulate the Flow Director
initialization flow or clearing the Flow Director table by setting
FDIRCMD.CLEARHT to 0x1B and then clear it back to 0x0B.

Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/i40e: fix VLAN stripping in VF
Souvik Dey [Tue, 15 Dec 2020 13:28:15 +0000 (08:28 -0500)]
net/i40e: fix VLAN stripping in VF

When VF adds VLAN, Linux PF driver enables VLAN stripping by default,
this might have issues if the app configured DEV_RX_OFFLOAD_VLAN_STRIP.

This behavior of the Linux driver causes confusion with the DPDK app
using i40e_pmd. So it is better to reconfigure the vlan_offload, which
checks for DEV_RX_OFFLOAD_VLAN_STRIP flag in the dev_conf and enables or
disables the vlan strip in the PF.

Application cannot use rte_eth_dev_set_vlan_offload() to set
the VLAN_STRIP, as this will only work for the first time when
original and current config mismatch, but for all subsequent call
it will be ignored.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Souvik Dey <sodey@rbbn.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agodoc: fix some statements for ice vector PMD
Qi Zhang [Wed, 16 Dec 2020 00:21:58 +0000 (08:21 +0800)]
doc: fix some statements for ice vector PMD

1. Add descriptions for how to select avx512 datapath.
2. Add explanation for "P" in ice.ini.

Fixes: 7f85d5ebcfe1 ("net/ice: add AVX512 vector path")
Fixes: 271cc8c5028a ("doc: update ice features list")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
3 years agonet/i40e: fix stats counters
Igor Ryzhov [Tue, 17 Nov 2020 08:56:39 +0000 (11:56 +0300)]
net/i40e: fix stats counters

When low and high registers are read separately, this opens the door to
a race condition:
- low register is read
- NIC updates the registers
- high register is read

Because of this, we may end up with an incorrect counter value.
Let's read the registers in one shot, as it is done in Linux kernel
since the introduction of the i40e driver.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agobuild: update meson for Marvell Armada drivers
Liron Himi [Wed, 16 Dec 2020 21:36:52 +0000 (23:36 +0200)]
build: update meson for Marvell Armada drivers

With pkg-config support available within musdk library
(from musdk-release-SDK-10.3.5.0-PR2 version),
meson option 'lib_musdk_dir' can be removed.
PKG_CONFIG_PATH environment variable should be set appropriately
to use the musdk library.

docs are updated with new musdk version and meson instructions.

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/bonding: fix PCI address comparison on non-PCI ports
Gaetan Rivet [Fri, 17 Apr 2020 16:42:07 +0000 (18:42 +0200)]
net/bonding: fix PCI address comparison on non-PCI ports

The bonding PMD will iterate over all available ETH ports and for each,
compare a chunk of bytes at an offset that would correspond to the PCI
address in an rte_pci_device.

This is incorrect and unsafe. Also, the rte_device using this PCI
address is already found, no need to compare again the PCI address of
all eth devices.

Refactoring the code to fix this, the initial check to find the PCI bus
is out of scope.

Fixes: c848b518bbc7 ("net/bonding: support bifurcated driver in eal")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <grive@u256.net>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/mlx5: fix buffer split offload advertising
Viacheslav Ovsiienko [Fri, 11 Dec 2020 11:44:52 +0000 (11:44 +0000)]
net/mlx5: fix buffer split offload advertising

The buffer split Rx offload is not compatible with Multi-Packet
Receiving Queue (MPRQ) Rx offload, hence, the buffer split
offload flag RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT and other related
values should be advertised only if there is no MPRQ engaged.

Fixes: 6c8f7f1c1877 ("net/mlx5: report Rx buffer split capabilities")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Asaf Penso <asafp@nvidia.com>
3 years agonet/mlx5: fix mbuf freeing in vectorized MPRQ
Alexander Kozyrev [Thu, 10 Dec 2020 15:14:23 +0000 (15:14 +0000)]
net/mlx5: fix mbuf freeing in vectorized MPRQ

Wrong index is used to find mbufs belonging to an application in
the rxq_free_elts_sprq() function in the case of vectorized MPRQ.
elts_ci points to the last allocated mbuf in this case, not rq_ci.
Use this field to avoid double free of mbuf and segmentation fault.

Fixes: 0f20acbf5eda ("net/mlx5: implement vectorized MPRQ burst")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix Direct Verbs flow descriptor allocation
Gregory Etelson [Tue, 8 Dec 2020 08:17:05 +0000 (10:17 +0200)]
net/mlx5: fix Direct Verbs flow descriptor allocation

Initialize flow descriptor tunnel member during flow creation.
Prevent access to stale data and pointers when flow descriptor is
reallocated after release.
Fix flow index validation.

Fixes: e7bfa3596a0a ("net/mlx5: separate the flow handle resource")
Fixes: 8bb81f2649b1 ("net/mlx5: use thread specific flow workspace")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/ice: fix outer checksum flags
Murphy Yang [Tue, 15 Dec 2020 08:10:52 +0000 (08:10 +0000)]
net/ice: fix outer checksum flags

When received tunneled packets, the testpmd output log shows 'ol_flags'
value always is 'PKT_RX_OUTER_L4_CKSUM_UNKNOWN', but expected value is
'PKT_RX_OUTER_L4_CKSUM_GOOD' or 'PKT_RX_OUTER_L4_CKSUM_BAD'.

Add the 'PKT_RX_OUTER_L4_CKSUM_GOOD' and 'PKT_RX_OUTER_L4_CKSUM_BAD' to
'flags' for normal path, 'l3_l4_flags_shuf' for AVX2 and AVX512 vector
path and 'cksum_flags' for SSE vector path to ensure that the 'ol_flags'
can match correct flags.

Fixes: dbf3c0e77a22 ("net/ice: handle Rx flex descriptor")
Fixes: 4ab7dbb0a0f6 ("net/ice: switch to Rx flexible descriptor in AVX path")
Fixes: ece1f8a8f1c8 ("net/ice: switch to flexible descriptor in SSE path")
Cc: stable@dpdk.org
Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix memory leak in large VF
Ting Xu [Mon, 14 Dec 2020 06:04:10 +0000 (14:04 +0800)]
net/iavf: fix memory leak in large VF

This patch fixed the issue that the memory allocated for structure
virtchnl_del_ena_dis_queues is not released at the end of the functions
iavf_enable_queues_lv, iavf_disable_queues_lv and iavf_switch_queue_lv.

Fixes: 9cf9c02bf6ee ("net/iavf: add enable/disable queues for large VF")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/netvsc: ignore unsupported packet on sync command
Long Li [Fri, 11 Dec 2020 20:48:21 +0000 (12:48 -0800)]
net/netvsc: ignore unsupported packet on sync command

On netvsc initialization, the host VSP may send a NVS_TYPE_TXTBL_NOTE
packet while executing a VSP command synchronously.

Instead of returning an error, ignore this packet as we don't use it for
DPDK.

Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
3 years agocommon/sfc_efx/base: check for MAE privilege
Ivan Malov [Fri, 11 Dec 2020 15:34:21 +0000 (18:34 +0300)]
common/sfc_efx/base: check for MAE privilege

VFs can't control MAE, so it's important to override the general
MAE capability bit by taking MAE privilege into account. Reorder
the code slightly to have the privileges queried before datapath
capabilities are discovered and add required MAE privilege check.

Fixes: eb4e80085fae ("common/sfc_efx/base: indicate support for MAE")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agocommon/sfc_efx/base: update MCDI headers for MAE privilege
Ivan Malov [Fri, 11 Dec 2020 15:34:20 +0000 (18:34 +0300)]
common/sfc_efx/base: update MCDI headers for MAE privilege

VFs and unprivileged PFs should not be able to control MAE.
Add MAE privilege to MCDI headers in order to reflect that.

Fixes: 84d3fb7d7e1e ("common/sfc_efx/base: add MAE definitions to MCDI")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
3 years agonet/bnxt: modify ring index logic
Ajit Khaparde [Mon, 7 Dec 2020 17:54:30 +0000 (09:54 -0800)]
net/bnxt: modify ring index logic

Change the ring logic so that the index increments
unbounded and mask it only when needed.

Modify the existing macros so that the index is not masked.
Add a new macro RING_IDX() to mask it only when needed.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: add missing comments
Ajit Khaparde [Sun, 6 Dec 2020 21:59:28 +0000 (13:59 -0800)]
net/bnxt: add missing comments

Add and update some missing comments in the code.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: update indentation and coding style
Ajit Khaparde [Sat, 5 Dec 2020 00:15:05 +0000 (16:15 -0800)]
net/bnxt: update indentation and coding style

Indentation and coding style fixes.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix PF resource query
Somnath Kotur [Thu, 3 Dec 2020 06:38:47 +0000 (12:08 +0530)]
net/bnxt: fix PF resource query

This cmd should be called by every driver after 'hwrm_func_cfg'
to get the actual number of resources allocated by the HWRM.
The values returned in the cmd are the max values for that PF.

Also, now that the max values for the PF are computed in probe itself,
no need to invoke FUNC_QCAPs or any other cmd in dev_configure_op()
as that would just override the actual max values obtained above.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix VNIC RSS configure function
Kalesh AP [Wed, 7 Oct 2020 03:41:50 +0000 (09:11 +0530)]
net/bnxt: fix VNIC RSS configure function

1. Moved invalid VNIC id check to the beginning of the function.
2. Removed a duplicate check which avoids unnecessary code indentation.

Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly")
Cc: stable@dpdk.org
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>
3 years agonet/bnxt: remove function declaration
Ajit Khaparde [Fri, 4 Dec 2020 23:22:50 +0000 (15:22 -0800)]
net/bnxt: remove function declaration

Remove an orphan function declaration.
It has not been defined yet and hence not used anywhere.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix freeing mbuf
Ajit Khaparde [Thu, 3 Dec 2020 20:47:31 +0000 (12:47 -0800)]
net/bnxt: fix freeing mbuf

mbufs are being allocated using rte_mbuf_raw_alloc().
Use corresponding rte_mbuf_raw_free() to free mbuf.

Fixes: 84799b868da9 ("net/bnxt: fix freeing mbuf")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: support 236 queues in NS3
Rahul Gupta [Tue, 25 Aug 2020 07:46:33 +0000 (13:16 +0530)]
net/bnxt: support 236 queues in NS3

For NS3, increased CONFIG_RTE_ETHDEV_QUEUE_STAT_CNTRS to support
236 counters and increased MAX_STINGRAY_RINGS in driver to support
more rings.

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix max rings computation
Sriharsha Basavapatna [Fri, 28 Aug 2020 11:13:22 +0000 (07:13 -0400)]
net/bnxt: fix max rings computation

The current max_rings computation does not take into account the case
when max_nq_rings is <= num_async_cpr. This results in a wrong value
like 0, when max_nq_rings is 1. Fix this by subtracting num_async_cpr
only when max_cp_rings > num_async_cpr.

Apart from this, the entire logic is currently spread across a few
macros, making it hard to read and debug this code. Move this code
into an inline function.

max_msix is not used in the max_rings calculation.
Apparently the max_msix field returned in HWRM_RESC_QCAPS is only valid
for Thor and newer chips. On Wh+ it will be equal to min_compl_rings.
Also, when a function reset is performed on an application quit, FW
will not reset the VF resource pool as per design.
This can lead to a strange condition wherein the max_msix field
on Wh+ keeps changing on each application re-load thereby throwing
throwing off the max_rings computation.

Fixes: f03e66cb64ce ("net/bnxt: limit queue count for NS3/Stingray devices")
Cc: stable@dpdk.org
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: fix format specifier for unsigned int
Ajit Khaparde [Thu, 3 Dec 2020 19:17:14 +0000 (11:17 -0800)]
net/bnxt: fix format specifier for unsigned int

&device requires the %u format specifier not the %d specifier, as
&device is unsigned.

Fixes: a46bbb57605b ("net/bnxt: update multi device design")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix cleanup on mutex init failure
Ajit Khaparde [Tue, 1 Dec 2020 20:52:53 +0000 (12:52 -0800)]
net/bnxt: fix cleanup on mutex init failure

In case mutex init fails during initialization, start cleanup and
fail the initialization process.

Fixes: a73b8e939f10 ("net/bnxt: fix race between start and interrupt handler")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: propagate FW command failure to application
Kalesh AP [Thu, 12 Nov 2020 10:47:54 +0000 (16:17 +0530)]
net/bnxt: propagate FW command failure to application

In bnxt_reta_update_op() and bnxt_rss_hash_update_op(), driver does not
propagate the error back to the application when the fw command fails.

Fixes: 378ab645bb0b ("net/bnxt: fix RSS RETA indirection table ops")
Fixes: fcc0aa1edc10 ("net/bnxt: add RSS hash configuration")
Cc: stable@dpdk.org
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>
3 years agonet/bnxt: remove references to Thor
Ajit Khaparde [Tue, 1 Dec 2020 19:15:23 +0000 (11:15 -0800)]
net/bnxt: remove references to Thor

Refactor code to remove references to Thor.
Instead use P5 as in phase 5 of development cycle since it is applicable
to boards other than Thor as well.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: release HWRM lock in error
Kalesh AP [Tue, 17 Nov 2020 07:10:24 +0000 (12:40 +0530)]
net/bnxt: release HWRM lock in error

In __bnxt_hwrm_func_qcaps, when memory allocations fails
driver is not releasing the hwrm lock. This patch fixes it
by calling hwrm_unlock in that error case.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
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>
3 years agonet/bnxt: remove unused field
Ajit Khaparde [Thu, 12 Nov 2020 22:45:39 +0000 (14:45 -0800)]
net/bnxt: remove unused field

Remove flow_xstat from bnxt structure.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix VNIC config on Rx queue stop
Samik Gupta [Fri, 6 Nov 2020 21:41:21 +0000 (16:41 -0500)]
net/bnxt: fix VNIC config on Rx queue stop

Reconfigure a vnic's default ring if the current default ring is stopped
by the application. It picks the lowest numbered ring that is currently
active to be the new default, and issues the hwrm_vnic_cfg command to
update the configuration. Applies to adapters that are not Thor-based.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Samik Gupta <samik.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: fix Rx rings in RSS redirection table
Samik Gupta [Thu, 12 Nov 2020 21:28:25 +0000 (13:28 -0800)]
net/bnxt: fix Rx rings in RSS redirection table

This commit introduces a limit on the number of RX rings included in
the RSS redirection table to a value no larger than the size supported
by Thor as defined by BNXT_RSS_TBL_SIZE_THOR.

Fixes: d819382543f3 ("net/bnxt: add RSS redirection table operations")
Cc: stable@dpdk.org
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Samik Gupta <samik.gupta@broadcom.com>
3 years agonet/ixgbe: detect failed VF MTU set
Alvin Zhang [Wed, 2 Dec 2020 09:48:06 +0000 (17:48 +0800)]
net/ixgbe: detect failed VF MTU set

If a VF request to set a invalid maximum packet length value,
The PF kernel driver may disable its reception.

This patch add codes to output information and return the error status.

Fixes: 12cd0cccc3db ("ixgbevf: allow to set MTU")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/i40e: fix global register recovery
Beilei Xing [Fri, 20 Nov 2020 08:49:47 +0000 (16:49 +0800)]
net/i40e: fix global register recovery

PMD configures the global register I40E_GLINT_CTL during
device initialization to work around the Rx write back
issue. But when a device is bound from DPDK to kernel,
the global register is not recovered to the original
state, it will cause kernel driver performance drop issue.
This patch fixes this issue.

Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with multi-driver")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/i40e: fix L4 checksum flag
Murphy Yang [Thu, 3 Dec 2020 07:50:30 +0000 (07:50 +0000)]
net/i40e: fix L4 checksum flag

When tunneled packet received that inner L4 checksum value is correct,
the test_pmd output log shows 'ol_flags' value is
'PKT_RX_L4_CKSUM_UNKNOWN', but expected value is 'PKT_RX_L4_CKSUM_GOOD'.

If the inner l4 checksum is correct, mark the 'PKT_RX_L4_CKSUM_GOOD'
flag to 'l3_l4e_flags' for sse and 'l3_l4_flags_shuf' for avx2 to
ensure that the 'ol_flags' can match correct flags.

Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")
Fixes: dafadd73762e ("net/i40e: add AVX2 Rx function")
Cc: stable@dpdk.org
Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/ice: fix outer UDP Tx checksum offload
Murphy Yang [Mon, 23 Nov 2020 07:05:23 +0000 (07:05 +0000)]
net/ice: fix outer UDP Tx checksum offload

If hardware outer UDP Tx checksum offload enabled, it doesn't take
effect when 'IPv6/UDP/VXLAN' packet sent with wrong outer UDP checksum.

In order to take effect, set the 'L4T_CS' flag valid only when 'L4TUNT'
equals one and 'EIPT' is not zero. If 'L4T_CS' flag marked, the hardware
can calculate the outer tunneling UDP checksum.

Fixes: bd70c451532c ("net/ice: support Tx checksum offload for tunnel")
Cc: stable@dpdk.org
Signed-off-by: Murphy Yang <murphyx.yang@intel.com>
Tested-by: Wei Xie <weix.xie@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ixgbe: enable NEON path with checksum offload
Feifei Wang [Wed, 18 Nov 2020 10:48:59 +0000 (04:48 -0600)]
net/ixgbe: enable NEON path with checksum offload

IXGBE NEON vector PMD now supports checksum offloading, hence can be
used when DEV_RX_OFFLOAD_CHECKSUM is set.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ixgbe: mark good checksum for NEON Rx
Feifei Wang [Wed, 18 Nov 2020 10:48:58 +0000 (04:48 -0600)]
net/ixgbe: mark good checksum for NEON Rx

Add CKSUM_GOOD flag to distinguish a good checksum from an unknown one
in neon vector RX function.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ixgbe: mark bad checksum for NEON Rx
Feifei Wang [Wed, 18 Nov 2020 10:48:57 +0000 (04:48 -0600)]
net/ixgbe: mark bad checksum for NEON Rx

Updated desc_to_olflags_v() to support PKT_RX_IP_CKSUM_BAD and
PKT_RX_L4_CKSUM_BAD in the ol_flags of the mbuf.

And then the NEON vector RX function can be called with hw_ip_checksum
enabled.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ixgbe: set VLAN strip flag for NEON Rx
Feifei Wang [Wed, 18 Nov 2020 10:48:56 +0000 (04:48 -0600)]
net/ixgbe: set VLAN strip flag for NEON Rx

For NEON vector of IXGBE PMD, introduce new flag PKT_RX_VLAN_STRIPPED to
show the case that the VLAN is stripped from the VLAN tagged packet.

This is because that the old flag PKT_RX_VLAN_PKT only indicates that
the packet is VLAN tagged, but cannot show whether VLAN is in
m->vlan_tci or in the packet at present. So add new flag to show the
vlan has been stripped by the hardware and its tci is saved in
m->vlan_tci when vlan stripping is enabled in the RX configuration of
the IXGBE PMD.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/hns3: fix FEC state query
Min Hu (Connor) [Thu, 10 Dec 2020 12:48:43 +0000 (20:48 +0800)]
net/hns3: fix FEC state query

As FEC is not supported below 10 Gbps,
CMD(HNS3_OPC_CONFIG_FEC_MODE) offered from
Firmware read will return fail in 10 Gbps device.

This patch will prevent read this CMD when below 10 Gbps,
as this is non-sense.

Fixes: 9bf2ea8dbc65 ("net/hns3: support FEC")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>