Commit Graph

30020 Commits

Author SHA1 Message Date
Tal Shnaiderman
6a86ee2e6d net/mlx5: query tunneling support on Windows
Query tunneling supported on the NIC.

Save the offloads values in a config parameter.
This is needed for the following TSO support:

DEV_TX_OFFLOAD_VXLAN_TNL_TSO
DEV_TX_OFFLOAD_GRE_TNL_TSO
DEV_TX_OFFLOAD_GENEVE_TNL_TSO

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:36 +02:00
Tal Shnaiderman
cf9b3c1bbc common/mlx5: read tunneling capabilities from DevX
mlx5 in Windows needs the tunneling hca capabilities
to query the NIC for Inner TSO offloading support.

Added the capability as part of the capabilities
queried by the PMD using DevX.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:35 +02:00
Tal Shnaiderman
c1a320bf89 net/mlx5: fix tunneling support query
Currently, the PMD decides if the tunneling offload
can enable VXLAN/GRE/GENEVE tunneled TSO support by checking
config->tunnel_en (single bit) and config->tso.

This is incorrect, the right way is to check the following
flags returned by the mlx5dv_query_device function:

MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN - if supported the offload
DEV_TX_OFFLOAD_VXLAN_TNL_TSO can be enabled.
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE - if supported the offload
DEV_TX_OFFLOAD_GRE_TNL_TSO can be enabled.
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE - if supported the offload
DEV_TX_OFFLOAD_GENEVE_TNL_TSO can be enabled.

The fix enables the offloads according to the correct
flags returned by the kernel.

Fixes: dbccb4cddc ("net/mlx5: convert to new Tx offloads API")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:34 +02:00
Tal Shnaiderman
d47fe9dabc net/mlx5: query software parsing support on Windows
Query software parsing supported on the NIC.

Save the offloads values in a config parameter.
This is needed for the outer IPv4 checksum and
IP and UDP tunneled packet TSO support.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:34 +02:00
Tal Shnaiderman
643e4db076 common/mlx5: read software parsing capabilities from DevX
mlx5 in Windows needs the software parsing hca capabilities
to query the NIC for TSO and Checksum offloading support.

Added the capability as part of the capabilities
queried by the PMD using DevX.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:33 +02:00
Tal Shnaiderman
accf3cfce4 net/mlx5: fix software parsing support query
Currently, the PMD decides if the software parsing
offload can enable outer IPv4 checksum and tunneled
TSO support by checking config->hw_csum and config->tso
respectively.

This is incorrect, the right way is to check the following
flags returned by the mlx5dv_query_device function:

MLX5DV_SW_PARSING - check general swp support.
MLX5DV_SW_PARSING_CSUM - check swp checksum support.
MLX5DV_SW_PARSING_LSO - check swp LSO/TSO support.

The fix enables the offloads according to the correct
flags returned by the kernel.

Fixes: e46821e9fc ("net/mlx5: separate generic tunnel TSO from the standard one")
Cc: stable@dpdk.org

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
2021-10-12 15:29:25 +02:00
Tomasz Duszynski
e200fb6ba1 config/cn10k: disable octeontx2 drivers
Common octeontx2 code shares some of the PCI identifiers
with cn10k platform and if built wrong drivers may be probed.

octeontx2 configuration disables common cn10k code so disable
common octeontx2 on cn10k.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-10-08 11:07:47 +02:00
Tomasz Duszynski
b89f023e54 common/cnxk: add helpers for reading runplatform
Add helper functions that allow one to check platform
ROC is running on. Platform type is retrieved from device
tree attribute runplatform which is updated by EBF accordingly.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-10-08 10:12:49 +02:00
Jakub Palider
3d1cd3a803 raw/cnxk_bphy: use ROC calls for max IRQ get
Maximum interrupt number function used direct access to
structure field while ROC helper exists and serves the
same purpose.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-10-07 13:02:48 +02:00
Tomasz Duszynski
bb85a78d2f raw/cnxk_bphy: add wrappers for available message types
One sends commands and receive responses by enqueuing or dequeuing
custom messages. In order to simplify this scheme simple wrappers
were added which take care of all the heavy lifting.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2021-10-07 13:02:38 +02:00
Dapeng Yu
435d523112 net/iavf: fix multi-process shared data
When the iavf_adapter instance is not initialized completely in the
primary process, the secondary process accesses its "rte_eth_dev"
member, it causes secondary process crash.

This patch replaces eth_dev with eth_dev_data in iavf_adapter.

Fixes: f978c1c9b3 ("net/iavf: add RSS hash parsing in AVX path")
Fixes: 9c9aa00403 ("net/iavf: add offload path for Rx AVX512 flex descriptor")
Fixes: 63660ea3ee ("net/iavf: add RSS hash parsing in SSE path")
Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2021-10-11 04:59:09 +02:00
Robin Zhang
dbabb7b157 net/i40e/base: update version
Update base code version in README.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-10-09 07:37:05 +02:00
Robin Zhang
3a386d08c3 net/i40e/base: add defines related to DDP
This patch adds some defines related to DDP Track ID.

Signed-off-by: Artur Tyminski <arturx.tyminski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-10-09 07:37:05 +02:00
Robin Zhang
364067380e net/i40e/base: update FW API version to 1.15
Update FVL FW API version to 1.15

Signed-off-by: Maciej Paczkowski <maciej.paczkowski@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2021-10-09 07:37:05 +02:00
Robin Zhang
3ff8325528 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>
2021-10-09 07:37:05 +02:00
Robin Zhang
a1efb97105 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>
2021-10-09 07:37:05 +02:00
Robin Zhang
e59d949182 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: 8db9e2a1b2 ("i40e: base driver")
Fixes: 3ed6c3246f ("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>
2021-10-09 07:37:05 +02:00
Robin Zhang
bc99971d10 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: 8d6c51fcd2 ("i40e/base: get OEM version")
Fixes: 2db7057424 ("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>
2021-10-09 07:37:05 +02:00
Robin Zhang
bd3c90715b net/i40e/base: fix function name in comments
Fix mismatched function name in comments.

Fixes: 8db9e2a1b2 ("i40e: base driver")
Fixes: 842ea19963 ("i40e/base: save link module type")
Fixes: fd72a2284a ("i40e/base: support LED blinking with new PHY")
Fixes: 788fc17b2d ("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>
2021-10-09 07:35:41 +02:00
Robin Zhang
675b917ba6 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>
2021-10-09 07:22:30 +02:00
Robin Zhang
6acdc4263c net/i40e/base: fix AOC media type
For Active Optical Cable (AOC) the correct media type is "Fibre",
not "Direct Attach Copper".

Fixes: d749d4d899 ("i40e/base: add AOC PHY types")
Fixes: aa153cc89f ("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>
2021-10-09 07:22:12 +02:00
Robin Zhang
74bd407299 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: e6691b428e ("i40e/base: fix PHY NVM interaction")
Fixes: 75c3de654e ("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>
2021-10-09 07:21:41 +02:00
Robin Zhang
25829b55b4 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: 1e32378f07 ("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>
2021-10-09 07:21:10 +02:00
Robin Zhang
dafd6c6308 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: 988ed63c74 ("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>
2021-10-09 07:20:50 +02:00
Robin Zhang
6c751fd18e 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>
2021-10-09 07:20:23 +02:00
Robin Zhang
2c4207fc0e 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>
2021-10-09 07:17:39 +02:00
Robin Zhang
de38da0cbc 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>
2021-10-09 07:17:39 +02:00
Robin Zhang
77c2df5e64 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>
2021-10-09 07:17:39 +02:00
Julien Meunier
6507e67af8 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: c95584dc2b ("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>
2021-10-09 06:45:03 +02:00
Alvin Zhang
39e4a2577f 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: f4a91c38b4 ("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>
2021-10-08 08:18:31 +02:00
Junfeng Guo
9381e4c04b 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: cd212c4669 ("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>
2021-10-08 08:18:07 +02:00
Andrew Rybchenko
92ef4b8f16 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>
2021-10-12 19:20:57 +02:00
Viacheslav Galaktionov
c4045f3455 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>
2021-10-12 19:05:43 +02:00
Viacheslav Galaktionov
e28938e621 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: 1fb65e4dae ("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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
599e4e9a06 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
96a46ead5b 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
6ded2e0138 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
c75d560db3 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
768d1e44df 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
44db08d53b 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
1bf9ff57cc 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
2374806971 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
7d104a8db6 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
4917b69db0 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>
2021-10-12 18:44:11 +02:00
Viacheslav Galaktionov
c7e64eea52 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: 1e7fbdf0ba ("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>
2021-10-12 18:44:11 +02:00
Igor Romanov
6764c3bbdf 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>
2021-10-12 18:44:11 +02:00
Igor Romanov
a3fbef1967 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>
2021-10-12 18:44:11 +02:00
Igor Romanov
d0f981a3ef 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>
2021-10-12 18:44:11 +02:00
Igor Romanov
8dae7087c7 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>
2021-10-12 18:44:11 +02:00
Igor Romanov
788dedcfcb 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>
2021-10-12 18:44:11 +02:00