dpdk.git
2 years agonet/i40e/base: add raw format for 32 bytes Rx description
Robin Zhang [Sat, 9 Oct 2021 01:39:53 +0000 (01:39 +0000)]
net/i40e/base: add raw format for 32 bytes Rx description

Add raw format for i40e_32byte_rx_desc, right now this only be used
by kernel driver, the commit is just to sync with kernel driver.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: add MAC frequency calculation if no link
Robin Zhang [Sat, 9 Oct 2021 01:39:52 +0000 (01:39 +0000)]
net/i40e/base: add MAC frequency calculation if no link

Add macros and structures for MAC frequency calculation in case the link
is not present.

Remove duplicate definition in i40e_ethdev.c

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix using checksum before check
Robin Zhang [Sat, 9 Oct 2021 01:39:51 +0000 (01:39 +0000)]
net/i40e/base: fix using checksum before check

The variable checksum from i40e_calc_nvm_checksum is used before return
value is checked. Fix this logic.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Fixes: 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
Cc: stable@dpdk.org
Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix potentially uninitialized variables
Robin Zhang [Sat, 9 Oct 2021 01:39:50 +0000 (01:39 +0000)]
net/i40e/base: fix potentially uninitialized variables

The status of i40e_read_nvm_word is not checked, so variables set
from this function could be used uninitialized. In this case, preserve
the existing flow that does not block initialization by initializing
these values from the start.

Fixes: 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes: 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
Cc: stable@dpdk.org
Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix function name in comments
Robin Zhang [Sat, 9 Oct 2021 01:39:49 +0000 (01:39 +0000)]
net/i40e/base: fix function name in comments

Fix mismatched function name in comments.

Fixes: 8db9e2a1b232 ("i40e: base driver")
Fixes: 842ea1996335 ("i40e/base: save link module type")
Fixes: fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes: 788fc17b2dec ("i40e/base: support proxy config for X722")
Cc: stable@dpdk.org
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: add flags and fields for double VLAN
Robin Zhang [Sat, 9 Oct 2021 01:39:48 +0000 (01:39 +0000)]
net/i40e/base: add flags and fields for double VLAN

Add flags for outer VLAN and include set port parameters.
Add flags, which describe port and switch state for both double VLAN
functionality and outer VLAN processing.

Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix AOC media type
Robin Zhang [Sat, 9 Oct 2021 01:39:47 +0000 (01:39 +0000)]
net/i40e/base: fix AOC media type

For Active Optical Cable (AOC) the correct media type is "Fibre",
not "Direct Attach Copper".

Fixes: d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes: aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and ACC")
Cc: stable@dpdk.org
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix update link data for X722
Robin Zhang [Sat, 9 Oct 2021 01:39:46 +0000 (01:39 +0000)]
net/i40e/base: fix update link data for X722

The X722 card has 'Link Type' information elsewhere than the X710.
Previously, for all cards, the 'Link Type' information was retrieved by
opcode 0x0607 and this value was wrong for all X722 cards.
Now this information for X722 only is taken by opcode 0x0600
(function: i40e_aq_get_phy_capabilities) instead of an opcode
0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes: e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes: 75c3de654ead ("net/i40e/base: fix long link down notification time")
Cc: stable@dpdk.org
Signed-off-by: Jaroslaw Gawin <jaroslawx.gawin@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix PF reset
Robin Zhang [Sat, 9 Oct 2021 01:39:45 +0000 (01:39 +0000)]
net/i40e/base: fix PF reset

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take
more than 200 ms to finish the reset resulting in timeout during pf_reset
and PF reset failed, -15 error indication.

Increasing the timeout value for PF reset from 200 to 1000 to give PF
more time to finish reset if it is loaded with filters.

Fixes: 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
Cc: stable@dpdk.org
Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: fix PHY identifiers for 2.5G and 5G adapters
Robin Zhang [Sat, 9 Oct 2021 01:39:44 +0000 (01:39 +0000)]
net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters

Unlike other supported adapters, 2.5G and 5G use different PHY type
identifiers for reading/writing PHY settings and for reading link status.
This commit introduces separate PHY identifiers for these two operation
types.

Fixes: 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
Cc: stable@dpdk.org
Signed-off-by: Dawid Lukwinski <dawid.lukwinski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: define new shadow RAM pointers
Robin Zhang [Sat, 9 Oct 2021 01:39:43 +0000 (01:39 +0000)]
net/i40e/base: define new shadow RAM pointers

Add definitions for Shadow RAM pointers: 6th FPA (Free Provisioning Area)
module, 5th FPA module in X722 and Preservation Rules module.

These definitions are not using by DPDK now, the purpose of this commit
is to sync base code with kernel driver.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: set TSA table values when parsing CEE config
Robin Zhang [Sat, 9 Oct 2021 01:39:42 +0000 (01:39 +0000)]
net/i40e/base: set TSA table values when parsing CEE config

Driver did not Set TSA (Transmit Selection Algorithm) table values when
parsing CEE (Converged Enhanced Ethernet) configuration obtained from FW

Signed-off-by: Pawel Malinowski <pawel.malinowski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: add min SRev for 4 more X722 modules
Robin Zhang [Sat, 9 Oct 2021 01:39:41 +0000 (01:39 +0000)]
net/i40e/base: add min SRev for 4 more X722 modules

Some customers want to downgrade to an earlier FW security revision, this
already implemented by FW so that customers can have more control over
the security revisions they can use. FW also implemented a mechanism via
NVMupdate to allow the users to accept or not a baseline Min SRev version
that will limit the secure version rollback only down to that level.

This commit increments X722 API version and adds new minimal rollback
revision that related to the extended implementation of Security Revision
Opt-In for 4 more X722 modules.

These definitions are not using by DPDK now, the purpose of this commit
is sync with latest share code.

Signed-off-by: Stanislaw Grzeszczak <stanislaw.a.grzeszczak@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/i40e/base: add send ASQ command v2 functions
Robin Zhang [Sat, 9 Oct 2021 01:39:40 +0000 (01:39 +0000)]
net/i40e/base: add send ASQ command v2 functions

ASQ(Admin Send Queue) send command functions are returning only i40e
status codes yet some calling functions also need Admin Queue status that
is stored in hw->aq.asq_last_status. Since hw object is stored on a heap
it introduces a possibility for a race condition in access to hw if
calling function is not fast enough to read hw->aq.asq_last_status before
next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue
status on the stack to avoid race conditions in access to
hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan
that is using new _v2 versions of ASQ send command functions and returns
the Admin Queue status on the stack.

Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2 years agonet/ixgbe: fix queue release
Julien Meunier [Tue, 28 Sep 2021 08:12:38 +0000 (10:12 +0200)]
net/ixgbe: fix queue release

On the vector implementation, during the tear-down, the mbufs not
drained in the RxQ and TxQ are freed based on an algorithm which
supposed that the number of descriptors is a power of 2 (max_desc).
Based on this hypothesis, this algorithm uses a bitmask in order to
detect an index overflow during the iteration, and to restart the loop
from 0.

However, there is no such power of 2 requirement in the ixgbe for the
number of descriptors in the RxQ / TxQ. The only requirement is to have
a number correctly aligned.

If a user requested to configure a number of descriptors which is not a
power of 2, as a consequence, during the tear-down, it was possible to
be in an infinite loop, and to never reach the exit loop condition.

By removing the bitmask and changing the loop method, we can avoid this
issue, and allow the user to configure a RxQ / TxQ which is not a power
of 2.

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/i40e: fix Rx packet statistics
Alvin Zhang [Thu, 30 Sep 2021 05:19:57 +0000 (13:19 +0800)]
net/i40e: fix Rx packet statistics

Some packets are discarded by the NIC because they are larger than
the MTU, these packets should be counted as "RX error" instead of
"RX packet", for example:

  pkt1 = Ether()/IP()/Raw('x' * 1400)
  pkt2 = Ether()/IP()/Raw('x' * 1500)

  ---------------- Forward statistics for port 0 -----------------
  RX-packets: 2 RX-dropped: 0 RX-total: 2
  TX-packets: 1 TX-dropped: 0 TX-total: 1
  ----------------------------------------------------------------

  Here the packet pkt2 has been discarded, but still was counted
  by "RX-packets"

The register 'GL_RXERR1' can count above discarded packets.
This patch adds reading and calculation of the 'GL_RXERR1' counter
when reporting DPDK statistics.

Fixes: f4a91c38b4ad ("i40e: add extended stats")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix QFI field bit check for GTPU EH
Junfeng Guo [Fri, 8 Oct 2021 10:41:43 +0000 (10:41 +0000)]
net/iavf: fix QFI field bit check for GTPU EH

If GTPU Extension header has no pdu_type setting, the parsed value of
gtp_psc_spec->hdr.type will be 0, which is same as IAVF_GTPU_EH_DWLINK.
Thus, for this case, we should check gtp_psc_mask->hdr.type instead,
to set QFI field bit of GTPU_EH first.

Fixes: cd212c466992 ("net/iavf: fix QFI fields of GTPU UL/DL for flow director")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agoethdev: remove deprecated shared counter attribute
Andrew Rybchenko [Fri, 8 Oct 2021 10:26:15 +0000 (13:26 +0300)]
ethdev: remove deprecated shared counter attribute

Indirect actions should be used to do shared counters.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoapp/testpmd: add command to print representor info
Viacheslav Galaktionov [Mon, 11 Oct 2021 13:08:40 +0000 (16:08 +0300)]
app/testpmd: add command to print representor info

Make it simpler to debug configurations and code related to the representor
info API.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/sfc: update comment about representor support
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:57 +0000 (17:48 +0300)]
net/sfc: update comment about representor support

The representor support has been implemented to some extent, and the fact
that ethdev mport is equivalent to entity mport is by design.

Fixes: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer rules")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: support representor info get
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:56 +0000 (17:48 +0300)]
net/sfc: support representor info get

Let the driver provide the user with information about available
representors by implementing the representor_info_get operation.

Due to the lack of any structure to representor IDs, every ID range
describes exactly one representor.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: use switch port ID as representor ID
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:55 +0000 (17:48 +0300)]
net/sfc: use switch port ID as representor ID

Representor IDs must be unique for each representor. VFs, which are
currently used, are not unique as they may repeat in combination with
different PCI controllers and PFs. On the other hand, switch port IDs
are unique, so they are a better fit for this role.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: support new representor parameter syntax
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:54 +0000 (17:48 +0300)]
net/sfc: support new representor parameter syntax

Allow the user to specify representor entities using the structured
parameter values.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: include controller and port in representor name
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:53 +0000 (17:48 +0300)]
net/sfc: include controller and port in representor name

Make representor names unique on multi-host configurations.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: store PCI address for represented entities
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:52 +0000 (17:48 +0300)]
net/sfc: store PCI address for represented entities

This information will be useful when representor info API is implemented.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: maintain controller to EFX interface mapping
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:51 +0000 (17:48 +0300)]
net/sfc: maintain controller to EFX interface mapping

Newer hardware may have arbitrarily complex controller configurations,
and for this reason the mapping has been made dynamic: it is represented
with a dynamic array that is indexed by controller numbers and each
element contains an EFX interface number. Since the number of controllers
is expected to be small, this approach should not hurt the performance.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: allow getting VNIC MCDI client handles
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:50 +0000 (17:48 +0300)]
common/sfc_efx/base: allow getting VNIC MCDI client handles

Equality checks between VNICs should be done by comparing their client
handles. This means that clients should be able to retrieve client
handles for arbitrary functions and themselves.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: add API to read MAE mport journal
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:49 +0000 (17:48 +0300)]
common/sfc_efx/base: add API to read MAE mport journal

This is required to provide the driver with the current state of mports.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: retrieve function interfaces for VNICs
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:48 +0000 (17:48 +0300)]
common/sfc_efx/base: retrieve function interfaces for VNICs

This information is required to be able to fully identify the function.
Add this information to the NIC configuration structure for easy access.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: add multi-host function mport selector
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:47 +0000 (17:48 +0300)]
common/sfc_efx/base: add multi-host function mport selector

Provide helper function to compose multi-host aware PCIe
function M-port selector.

The firmware expects mport selectors to use different sets of values to
represent a PCIe interface in mport selectors and elsewhere. In order to
avoid having the user perform the conversion themselves, it is now done
automatically when a selector is constructed.

In addition, a type has been added to libefx for possible PCIe
interfaces.
This is done to abstract different representations away from the users.

Allow to support matching traffic coming from an arbitrary PCIe
end-point of the NIC and redirect traffic to it.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: free MAE lock once switch domain is assigned
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:46 +0000 (17:48 +0300)]
net/sfc: free MAE lock once switch domain is assigned

If for some reason the hardware switch ID initialization function fails,
MAE lock is still held after the function finishes. This patch fixes that.

Fixes: 1e7fbdf0ba19 ("net/sfc: support concept of switch domains/ports")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: add simple port representor statistics
Igor Romanov [Mon, 11 Oct 2021 14:48:45 +0000 (17:48 +0300)]
net/sfc: add simple port representor statistics

Gather statistics of enqueued and dequeued packets in Rx and Tx burst
callbacks to report in stats_get callback.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement representor Rx
Igor Romanov [Mon, 11 Oct 2021 14:48:44 +0000 (17:48 +0300)]
net/sfc: implement representor Rx

Implement traffic forwarding for representor and representor proxy
from virtual functions to representor Rx queues.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: handle ingress mport in EF100 Rx prefix
Igor Romanov [Mon, 11 Oct 2021 14:48:43 +0000 (17:48 +0300)]
net/sfc: handle ingress mport in EF100 Rx prefix

Set ingress mport dynamic field in mbuf in EF100.

For a given PF, Rx queues of representor devices
function on top of the only Rx queue operated by
the PF representor proxy facility. This field is
a means to demultiplex traffic hitting the queue.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: use xword type for EF100 Rx prefix
Igor Romanov [Mon, 11 Oct 2021 14:48:42 +0000 (17:48 +0300)]
net/sfc: use xword type for EF100 Rx prefix

Layout of the EF100 Rx prefix is defined in terms of a 32 bytes long
value type (xword). Replace oword with xword to avoid truncation.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement representor Tx
Igor Romanov [Mon, 11 Oct 2021 14:48:41 +0000 (17:48 +0300)]
net/sfc: implement representor Tx

Forward traffic that is transmitted from a port representor to the
corresponding virtual function using the dedicated TxQ.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: support multiple device probe
Igor Romanov [Mon, 11 Oct 2021 14:48:40 +0000 (17:48 +0300)]
net/sfc: support multiple device probe

Support probing the device multiple times so that additional port
representors can be created with hotplug EAL API. To hotplug a
representor, the PF must be hotplugged with different representor
device argument.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement port representor link update
Igor Romanov [Mon, 11 Oct 2021 14:48:39 +0000 (17:48 +0300)]
net/sfc: implement port representor link update

Implement the callback by reporting link down if the representor
is not started, otherwise report link up with undefined link speed.

Link speed is undefined since representors can pass traffic to each
other even if the PF link is down.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement port representor start and stop
Igor Romanov [Mon, 11 Oct 2021 14:48:38 +0000 (17:48 +0300)]
net/sfc: implement port representor start and stop

Implement queue start and stop operation both in port
representors and representor proxy.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement representor Tx queue start/stop
Igor Romanov [Mon, 11 Oct 2021 14:48:37 +0000 (17:48 +0300)]
net/sfc: implement representor Tx queue start/stop

Implement Tx queue start and stop in port representor proxy.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement representor Rx queue start/stop
Igor Romanov [Mon, 11 Oct 2021 14:48:36 +0000 (17:48 +0300)]
net/sfc: implement representor Rx queue start/stop

Add extra libefx flags to Rx queue information initialization
function interface to be able to specify the ingress m-port
flag for a representor RxQ. Rx prefix of packets on that queue
will contain ingress m-port field required for packet forwarding
in representor proxy.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: implement representor queue setup and release
Igor Romanov [Mon, 11 Oct 2021 14:48:35 +0000 (17:48 +0300)]
net/sfc: implement representor queue setup and release

Implement queue creation and destruction both in port representors
and representor proxy.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: add representor proxy port API
Igor Romanov [Mon, 11 Oct 2021 14:48:34 +0000 (17:48 +0300)]
net/sfc: add representor proxy port API

The API is required to create and destroy representor proxy
port assigned to representor.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: add mport alias MCDI wrappers
Igor Romanov [Mon, 11 Oct 2021 14:48:33 +0000 (17:48 +0300)]
common/sfc_efx/base: add mport alias MCDI wrappers

The APIs allow creation of mports for port representor
traffic filtering.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: add API to get mport selector by ID
Igor Romanov [Mon, 11 Oct 2021 14:48:32 +0000 (17:48 +0300)]
common/sfc_efx/base: add API to get mport selector by ID

The conversion is required when mport ID is received via
mport allocation and mport selector is required for filter
creation.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: add filter ingress mport matching field
Igor Romanov [Mon, 11 Oct 2021 14:48:31 +0000 (17:48 +0300)]
common/sfc_efx/base: add filter ingress mport matching field

The field changes the mport for which the filter is created.
It is required to filter traffic from VF on an alias mport.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: add port representors infrastructure
Igor Romanov [Mon, 11 Oct 2021 14:48:30 +0000 (17:48 +0300)]
net/sfc: add port representors infrastructure

Provide minimal implementation for port representors that only can be
configured and can provide device information.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: allow creating invalid mport selectors
Viacheslav Galaktionov [Mon, 11 Oct 2021 14:48:29 +0000 (17:48 +0300)]
common/sfc_efx/base: allow creating invalid mport selectors

There isn't always a valid mport that can be used. For these cases,
special invalid selectors can be generated. Requests that use such
selectors in any way will be rejected.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agonet/sfc: move adapter state enum to separate header
Igor Romanov [Mon, 11 Oct 2021 14:48:28 +0000 (17:48 +0300)]
net/sfc: move adapter state enum to separate header

Adapter state will be reused by representors, that will have
a separate adapter. Rename adapter state to ethdev state
so that the meaning of it is clearer.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: reserve queues for port representors
Igor Romanov [Mon, 11 Oct 2021 14:48:27 +0000 (17:48 +0300)]
net/sfc: reserve queues for port representors

A Tx/Rx queue pair is required to forward traffic between
port representors and virtual functions.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: add representors proxy infrastructure
Igor Romanov [Mon, 11 Oct 2021 14:48:26 +0000 (17:48 +0300)]
net/sfc: add representors proxy infrastructure

Representor proxy is a mediator between virtual functions and port
representors. It forwards traffic between virtual functions and port
representors performing base PF ethdev + VF's representor traffic
(de-)multiplexing. The implementation will be provided by later patches.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: support EF100 Tx override prefix
Igor Romanov [Mon, 11 Oct 2021 14:48:25 +0000 (17:48 +0300)]
net/sfc: support EF100 Tx override prefix

Add internal mbuf dynamic flag and field to request EF100 native
Tx datapath to use Tx prefix descriptor to override egress m-port.
Overriding egress m-port is necessary on representor Tx burst
so that the packet will reach corresponding VF.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: add API to get mport ID by selector
Igor Romanov [Mon, 11 Oct 2021 14:48:24 +0000 (17:48 +0300)]
common/sfc_efx/base: add API to get mport ID by selector

The mport ID is required to set appropriate egress mport ID
in Tx prefix for port representor TxQ.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: insert switchdev mode MAE rules
Igor Romanov [Mon, 11 Oct 2021 14:48:23 +0000 (17:48 +0300)]
net/sfc: insert switchdev mode MAE rules

By default, the firmware is in EVB mode, but insertion of the first MAE
rule resets it to switchdev mode automatically and removes all automatic
MAE rules added by EVB support. On initialisation, insert MAE rules that
forward traffic between PHY and PF.

Add an API for creation and insertion of driver-internal MAE
rules(flows).

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agonet/sfc: add switch mode device argument
Igor Romanov [Mon, 11 Oct 2021 14:48:22 +0000 (17:48 +0300)]
net/sfc: add switch mode device argument

Add the argument that allows user to choose either switchdev or legacy
mode. Legacy mode enables switching by using Ethernet virtual bridging
(EVB) API. In switchdev mode, VF traffic goes via port representor
(if any) on PF, and software virtual switch (for example, Open vSwitch)
steers the traffic.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2 years agocommon/sfc_efx/base: update EF100 registers definitions
Andrew Rybchenko [Mon, 11 Oct 2021 14:48:21 +0000 (17:48 +0300)]
common/sfc_efx/base: update EF100 registers definitions

Pick up all changes and extra definitions.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agocommon/sfc_efx/base: update MCDI headers
Andrew Rybchenko [Mon, 11 Oct 2021 14:48:20 +0000 (17:48 +0300)]
common/sfc_efx/base: update MCDI headers

Pickup new FW interface definitions.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: fix representor port ID search by name
Viacheslav Galaktionov [Mon, 11 Oct 2021 12:53:06 +0000 (15:53 +0300)]
ethdev: fix representor port ID search by name

The patch is required for all PMDs which do not provide representors
info on the representor itself.

The function, rte_eth_representor_id_get(), is used in
eth_representor_cmp() which is required in ethdev class iterator to
search ethdev port ID by name (representor case). Before the patch
the function is called on the representor itself and tries to get
representors info to match.

Search of port ID by name is used after hotplug to find out port ID
of the just plugged device.

Getting a list of representors from a representor does not make sense.
Instead, a backer device should be used.

To this end, extend the rte_eth_dev_data structure to include the port ID
of the backing device for representors.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/sfc: collect per queue stats in EF100 Tx
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:12 +0000 (14:29 +0300)]
net/sfc: collect per queue stats in EF100 Tx

If Tx datapath collects per queue statistics, use these stats
to provide opackets and obytes in basic ethdev stats.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
2 years agonet/sfc: collect per queue stats in EF100 Rx
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:11 +0000 (14:29 +0300)]
net/sfc: collect per queue stats in EF100 Rx

If Rx datapath collects per queue statistics, use these stats
to provide ipackets and ibytes in basic ethdev stats.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
2 years agonet/sfc: support SW stats groups
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:10 +0000 (14:29 +0300)]
net/sfc: support SW stats groups

Add support for grouping SW stats together. When stats are
grouped the corresponding stats values for each queue
are obtained during calling one read callback. This is useful
to group per-queue stats 'packets' and 'bytes' to keep stats
consistent, i.e. a number of bytes corresponds to a number of
packets. These stats will be added in the following patches.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: add toggle to disable total stat
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:09 +0000 (14:29 +0300)]
net/sfc: add toggle to disable total stat

Add toggle to disable total SW stat. This is useful
for per-queue 'packets' and 'bytes' to not conflict
with corresponding basic stats. These stats will be
added in the following patches.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: prepare not having some SW stats on adapter
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:08 +0000 (14:29 +0300)]
net/sfc: prepare not having some SW stats on adapter

Global description structure of SW stats is used currently.
Following patches introduce SW stats that may be unavailable
for some adapters, so add per-adapter descriptions to safely
work with multiple adapters.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: optimize getting number of SW stats
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:07 +0000 (14:29 +0300)]
net/sfc: optimize getting number of SW stats

Optimize getting number of SW stats by caching the
value during device configure since it's the only
place it may change.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: fix missing const of SW stats descriptions
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:06 +0000 (14:29 +0300)]
net/sfc: fix missing const of SW stats descriptions

Description is a global variable shared by all adapters and must
not be modified.

Fixes: fdd7719eb3c1 ("net/sfc: add xstats for Rx/Tx doorbells")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: fix cleanup order of SW stats
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:05 +0000 (14:29 +0300)]
net/sfc: fix cleanup order of SW stats

Fix cleanup order of SW stats structures to be reversed
to initialization order.

Fixes: fdd7719eb3c1 ("net/sfc: add xstats for Rx/Tx doorbells")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: rename SW stats structures
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:04 +0000 (14:29 +0300)]
net/sfc: rename SW stats structures

Delete 'x' in:
    1. per-adapter 'struct sfc_sw_xstats' with corresponding
       field 'sw_xstats'.
    2. 'struct sfc_sw_xstat_descr' and callback prototype
       'sfc_get_sw_xstat_val_t' with its implementations.

The 'x' stands for 'extended' in RTE but from sfc point of
view these are just SW stats.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: rename accumulative SW stats to total
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:03 +0000 (14:29 +0300)]
net/sfc: rename accumulative SW stats to total

This is a better word used in RTE docs.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: rename array of SW stats descriptions
Ivan Ilchenko [Tue, 28 Sep 2021 11:29:02 +0000 (14:29 +0300)]
net/sfc: rename array of SW stats descriptions

Rename global array of SW stats descriptions declared as
'struct sfc_sw_xstat_descr sfc_sw_xstats[]' to
'sfc_sw_stats_descr[]' to avoid ambiguity since there is
structure declared as 'struct sfc_sw_xstats'.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/ena: remove useless address check
Ferruh Yigit [Mon, 4 Oct 2021 17:27:02 +0000 (18:27 +0100)]
net/ena: remove useless address check

Reported by "gcc (GCC) 12.0.0 20211003 (experimental)":

./drivers/net/ena/ena_rss.c: In function ‘ena_rss_reta_query’:
./drivers/net/ena/ena_rss.c:140:66:
error: the comparison will always evaluate as ‘false’ for the
pointer operand in ‘reta_conf + 136’ must not be NULL
[-Werror=address]
  140 |  (reta_size > RTE_RETA_GROUP_SIZE && ((reta_conf + 1) == NULL)))
      |                                                       ^~

Fixing it by removing useless check.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2 years agonet/hns3: remove similar macro function definitions
Chengchang Tang [Sat, 9 Oct 2021 07:48:05 +0000 (15:48 +0800)]
net/hns3: remove similar macro function definitions

For different capabilities, we declare different macro functions to
determine whether the capabilities are supported.

This patch declare a unified macro function to judge capabilities.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoapp/testpmd: retain all original dev conf when config DCB
Huisong Li [Mon, 11 Oct 2021 09:12:46 +0000 (17:12 +0800)]
app/testpmd: retain all original dev conf when config DCB

When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
rte_port->dev_conf. But some configurations, such as the link_speed, were
not saved if they were set before configuring DCB.

Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agoethdev: remove legacy Rx descriptor done API
Andrew Rybchenko [Mon, 11 Oct 2021 13:24:53 +0000 (16:24 +0300)]
ethdev: remove legacy Rx descriptor done API

rte_eth_rx_descriptor_status() should be used as a replacement.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agoapp/testpmd: add command to show LACP bonding info
Chengchang Tang [Fri, 24 Sep 2021 09:57:20 +0000 (17:57 +0800)]
app/testpmd: add command to show LACP bonding info

Add a new cmdline to help diagnostic the bonding mode 4 in testpmd.

Show the lacp information about the bonded device and its slaves:
show bonding lacp info <bonded device port_id>

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/bonding: fix RSS key length
Chengchang Tang [Wed, 22 Sep 2021 07:09:13 +0000 (15:09 +0800)]
net/bonding: fix RSS key length

Currently the hash_key_size information has not been set. So, apps can
not get the key size from dev_info(), this make some problem.

e.g, in testpmd, the hash_key_size will be checked before configure
or get the hash key:
testpmd> show port 4 rss-hash
dev_info did not provide a valid hash key size
testpmd> show port 4 rss-hash key
dev_info did not provide a valid hash key size
testpmd> port config 4 rss-hash-key ipv4 (hash key)
dev_info did not provide a valid hash key size

In this patch, the meaning of rss_key_len has been modified. It only
indicated the length of the configured hash key before. Therefore,
its value depends on the user's configuration. This seems unreasonable.
And now, it indicates the minimum hash key length required by the
bonded device. Its value will be the shortest hash key among all slave
drivers.

Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/bonding: fix dedicated queue mode in vector burst
Chengchang Tang [Wed, 22 Sep 2021 07:09:12 +0000 (15:09 +0800)]
net/bonding: fix dedicated queue mode in vector burst

If the vector burst mode is selected, the dedicated queue mode will not
take effect on some PMDs because these PMDs may have some limitations
in vector burst mode. For example, the limit on burst size. Currently,
both hns3 and intel I40E require four alignments when receiving packets
in vector mode. As a result, they can't accept packets if burst size
below four. However, in dedicated queue mode, the burst size of periodic
packets processing is one.

This patch fixes the above problem by modifying the burst size to 32.
This approach also makes the packet processing of the dedicated queue
mode more reasonable. Currently, if multiple LACP protocol packets are
received in the hardware queue in a cycle, only one LACP packet will be
processed in this cycle, and the left packets will be processed in the
following cycle. After the modification, all the LACP packets will be
processed at one time, which seems more reasonable and closer to the
behavior of the bonding driver when the dedicated queue is not turned on.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoapp/testpmd: fix txonly forwarding
Alvin Zhang [Thu, 23 Sep 2021 08:01:29 +0000 (16:01 +0800)]
app/testpmd: fix txonly forwarding

When random number of Tx segments is enabled, because the actual
number of segments may be only one, the first segment of the Tx
packets must accommodate a complete being sending Eth/IP/UDP packet.

Besides, if multiple flow is enabled, the forwarding will update
the IP and UDP header, these headers shouldn't cross segments.
This also requires the first Tx segment can accommodate a complete
Eth/IP/UDP packet.

In addition, if time stamp is enabled, the forwarding needs more
Tx segment space for time stamp information.

This patch adds checks in beginning of forward engine to make sure
all above conditions are met.

Bugzilla ID: 797
Fixes: 79bec05b32b7 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agoapp/testpmd: update forward engine beginning
Alvin Zhang [Thu, 23 Sep 2021 08:01:28 +0000 (16:01 +0800)]
app/testpmd: update forward engine beginning

For each forward engine, there may be some special conditions
must be met before the forwarding runs.

Adding checks for these conditions in configuring is not suitable,
because one condition may rely on multiple configurations, and the
conditions required by each forward engine is not general.

The best solution is each forward engine has a callback to check
whether these conditions are met, and then testpmd can call the
callback to determine whether the forwarding can be started.

There was a void callback 'port_fwd_begin' in forward engine,
it did some initialization for forwarding, this patch updates its
return value then we can add some checks in it to confirm whether
the forwarding can be started. In addition, this patch calls the
callback before the forwarding stats is reset and then launches the
forwarding engine.

Bugzilla ID: 797
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/af_xdp: disable secondary process support
Ciara Loftus [Fri, 8 Oct 2021 07:50:20 +0000 (07:50 +0000)]
net/af_xdp: disable secondary process support

Since the AF_XDP PMD does not work for secondary processes as reported
in Bugzilla 805, check for the process type at the beginning of probe
and return ENOTSUP if the process type is secondary.

It is planned that secondary processes will be supported by the PMD in
full in a future release by using rte_mp_msg to pass the state to the
secondary process that it requires in order to work.

Bugzilla ID: 805
Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agotest/bpf: fix undefined behavior with clang
Konstantin Ananyev [Mon, 18 Oct 2021 13:40:52 +0000 (14:40 +0100)]
test/bpf: fix undefined behavior with clang

test_shift1_check() function fails with clang build.
The reason for that is that clang uses 64-bit shift instruction for
what expected to be 32-bit operation.
To be more specific, this C code:
r2 = (uint32_t)r2 >> r4;
With clang produces:
41a4eb:       48 d3 ef                shr    %cl,%rdi
In that particular case it is an allowed choice, as from one side
left-operand value is known to fit into 32 bits, from other side
according to 'C' standard:
"...if the value of the right operand is negative or is greater than
or equal to the width of the promoted left operand, the behavior is
undefined."
The problem is that on x86 behavior for 64-bit and 32-bit shift
operation might differ.
The fix avoids undefined behavior by making sure
that right operand will not exceed width of the promoted left operand.

Bugzilla ID: 811
Fixes: 9f8f9d91a701 ("test/bpf: introduce functional test")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agoapp/crypto-perf: support lookaside IPsec
Akhil Goyal [Tue, 12 Oct 2021 10:07:19 +0000 (15:37 +0530)]
app/crypto-perf: support lookaside IPsec

Added support for lookaside IPsec protocol offload.
Supported cases:
-AEAD
-Cipher+auth

Command used for testing:
./dpdk-test-crypto-perf -c 0xf -- --devtype crypto_octeontx2 --ptest
throughput --optype ipsec --cipher-algo aes-cbc --pool-sz 16384
--cipher-op encrypt --cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo
sha1-hmac --auth-op generate --digest-sz 16 --total-ops 10000000
--burst-sz 32 --buffer-sz 64,128,256,512,1024,1280,2048

./dpdk-test-crypto-perf -c 0xf -- --devtype crypto_octeontx2 --ptest
throughput --optype ipsec --aead-algo aes-gcm --pool-sz 16384
--aead-op encrypt --aead-key-sz 32 --aead-iv-sz 12 --aead-aad-sz 16
--digest-sz 16 --total-ops 10000000 --burst-sz 32
--buffer-sz 64,128,256,512,1024,1280,2048

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
2 years agosecurity: add reserved bit fields
Akhil Goyal [Mon, 18 Oct 2021 05:22:47 +0000 (10:52 +0530)]
security: add reserved bit fields

In struct rte_security_ipsec_sa_options, for every new option
added, there is an ABI breakage, to avoid, a reserved_opts
bitfield is added to for the remaining bits available in the
structure.
Now for every new sa option, these reserved_opts can be reduced
and new option can be added.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agosecurity: hide internal API
Akhil Goyal [Mon, 18 Oct 2021 05:22:46 +0000 (10:52 +0530)]
security: hide internal API

rte_security_dynfield_register() is an internal
API to be used by the driver, hence moving it to internal.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agoapp/bbdev: handle endianness of test data
Nipun Gupta [Sun, 17 Oct 2021 06:53:31 +0000 (12:23 +0530)]
app/bbdev: handle endianness of test data

With data input, output and harq also supported in big
endian format, this patch updates the testbbdev application
to handle the endianness conversion as directed by the
the driver being used.

The test vectors assumes the data in the little endian order, and
thus if the driver supports big endian data processing, conversion
from little endian to big is handled by the testbbdev application.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agoapp/bbdev: enable la12xx
Hemant Agrawal [Sun, 17 Oct 2021 06:53:30 +0000 (12:23 +0530)]
app/bbdev: enable la12xx

Enabled NXP la12xx bbdev driver in test bbdev app
for unit testing.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/la12xx: support enqueue and dequeue
Hemant Agrawal [Sun, 17 Oct 2021 06:53:29 +0000 (12:23 +0530)]
baseband/la12xx: support enqueue and dequeue

Add support for enqueue and dequeue the LDPC enc/dec
from the modem device.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/la12xx: add queue and modem config
Hemant Agrawal [Sun, 17 Oct 2021 06:53:28 +0000 (12:23 +0530)]
baseband/la12xx: add queue and modem config

This patch add support for connecting with modem
and creating the ipc channel as queues with modem
for the exchange of data.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/la12xx: support multiple modems
Hemant Agrawal [Sun, 17 Oct 2021 06:53:27 +0000 (12:23 +0530)]
baseband/la12xx: support multiple modems

This patch add support for multiple modems by assigning
a modem id as dev args in vdev creation.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/la12xx: add devargs option for max queues
Hemant Agrawal [Sun, 17 Oct 2021 06:53:26 +0000 (12:23 +0530)]
baseband/la12xx: add devargs option for max queues

This patch adds dev args to take  max queues as input

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/la12xx: introduce NXP LA12xx driver
Nipun Gupta [Sun, 17 Oct 2021 06:53:25 +0000 (12:23 +0530)]
baseband/la12xx: introduce NXP LA12xx driver

This patch introduce the baseband device drivers for NXP's
LA1200 series software defined baseband modem.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobbdev: add device info for data endianness
Nicolas Chautru [Sun, 17 Oct 2021 06:53:24 +0000 (12:23 +0530)]
bbdev: add device info for data endianness

Added device information to capture explicitly the assumption
of the input/output data byte endianness being processed.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: add raw API support in 5G algos
Hemant Agrawal [Wed, 13 Oct 2021 19:00:32 +0000 (00:30 +0530)]
test/crypto: add raw API support in 5G algos

This patch add support for RAW API testing with ZUC
and SNOW test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: add raw API test for dpaax
Hemant Agrawal [Wed, 13 Oct 2021 19:00:31 +0000 (00:30 +0530)]
test/crypto: add raw API test for dpaax

This patch add support for raw API tests for
dpaa_sec and dpaa2_sec platforms.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support AEAD and proto with raw API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:30 +0000 (00:30 +0530)]
crypto/dpaa_sec: support AEAD and proto with raw API

This add support for AEAD and proto offload with raw APIs
for dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support authonly and chain with raw API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:29 +0000 (00:30 +0530)]
crypto/dpaa_sec: support authonly and chain with raw API

This patch improves the raw vector support in dpaa_sec driver
for authonly and chain usecase.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support raw datapath API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:28 +0000 (00:30 +0530)]
crypto/dpaa_sec: support raw datapath API

This patch add raw vector API framework for dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: enhance error checks with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:27 +0000 (00:30 +0530)]
crypto/dpaa2_sec: enhance error checks with raw buffer API

This patch improves error conditions and support of
Wireless algos with raw buffers.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support OOP with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:26 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support OOP with raw buffer API

add support for out of order processing with raw vector APIs.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support AEAD with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:25 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support AEAD with raw buffer API

add raw vector API support for AEAD algos.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support authenc with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:24 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support authenc with raw buffer API

This patch supports AUTHENC with raw buufer APIs

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>