Commit Graph

46 Commits

Author SHA1 Message Date
Viacheslav Galaktionov
3037e6cf3d net/sfc: support regioned NIC DMA memory mapping type
DMA on SN1022 SoC requires extra mapping of the memory via MCDI.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2021-11-17 12:37:07 +01:00
Andrew Rybchenko
50448dd3ab net/sfc: merge Rx and Tx doorbell counters into one
Datapath queue is either Rx or Tx, so just one counter is sufficient
for doorbells. It can count Tx doorbells in the case of Tx queue and
Rx doorbells in the case of Rx queue.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-11-04 17:42:05 +01:00
Olivier Matz
daa02b5cdd mbuf: add namespace to offload flags
Fix the mbuf offload flags namespace by adding an RTE_ prefix to the
name. The old flags remain usable, but a deprecation warning is issued
at compilation.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-10-24 13:37:43 +02:00
Olivier Matz
5b63493241 mbuf: mark old VLAN offload flags as deprecated
The flags PKT_TX_VLAN_PKT and PKT_TX_QINQ_PKT are
marked as deprecated since commit 380a7aab1a ("mbuf: rename deprecated
VLAN flags") (2017). But they were not using the RTE_DEPRECATED
macro, because it did not exist at this time. Add it, and replace
usage of these flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-24 13:30:40 +02:00
Ferruh Yigit
295968d174 ethdev: add namespace
Add 'RTE_ETH' namespace to all enums & macros in a backward compatible
way. The macros for backward compatibility can be removed in next LTS.
Also updated some struct names to have 'rte_eth' prefix.

All internal components switched to using new names.

Syntax fixed on lines that this patch touches.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-10-22 18:15:38 +02:00
Ivan Ilchenko
fdd7719eb3 net/sfc: add xstats for Rx/Tx doorbells
Rx/Tx doorbells statistics are collected in software and
available per queue. These stats are useful for performance
investigation.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-07-23 23:26:45 +02:00
Andrew Rybchenko
98d26ef7b8 net/sfc: update copyright year
Bump copyright year to 2021.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-12 15:57:16 +01:00
Ivan Malov
be56d20ff1 net/sfc: fix TSO and checksum offloads for EF10
This is workaround for 8000-series EF10 hardware TSO bug.
Innermost IP length and outer UDP datagram length must be
greater than or equal to the corresponding values derived
from the MSS; otherwise, the checksum offloads will break.

Fixes: c1ce2ba218 ("net/sfc: support tunnel TSO on EF10 native Tx datapath")
Fixes: 6bc985e411 ("net/sfc: support TSO in EF10 Tx datapath")
Fixes: fec33d5bb3 ("net/sfc: support firmware-assisted TSO")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2021-02-03 11:37:08 +01:00
Andrew Rybchenko
31113761e2 net/sfc: use compat for 128-bit unsigned integer
Prepare to support ARMv8.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2020-11-03 23:35:06 +01:00
Ivan Malov
38109b5b08 net/sfc: add header segments check for EF100 Tx
EF100 native Tx datapath demands that packet header be contiguous
when partial checksum offloads are used since helper function is
used to calculate pseudo-header checksum (and the function requires
contiguous header).

Add an explicit check for this assumption and restructure the code
to avoid TSO header linearisation check since TSO header
linearisation is not done on EF100 native Tx datapath.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 19:48:18 +02:00
Andrew Rybchenko
e7fbf6f5db net/sfc: log doorbell addresses useful for debugging
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-10-16 19:48:17 +02:00
Andrew Rybchenko
1b0236e2e7 net/sfc: include header with debug helpers directly
Avoid build failures on further restructuring.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2020-09-30 19:19:08 +02:00
Andrew Rybchenko
a0147be547 net/sfc: add Xilinx copyright
Xilinx acquired Solarflare in 2019.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: James Fox <jamesfox@xilinx.com>
2020-04-21 13:57:06 +02:00
Andrew Rybchenko
9aa0afd1e9 net/sfc: advertise offload capabilities by Tx datapaths
Tx datapath feature bits were useful on migration from the old offload API
to the new one. However, right now it just adds indirection which
complicates code reading and understanding. Also addition of a new
offloads requires addition of a new feature bits and makes patches longer
and harder to understand. So, remove feature bits which correspond to Tx
offloads and simply advertise device and per-queue offloads directly.
Generic code could still mask some offloads if running HW or FW does not
support it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2019-06-13 23:54:29 +09:00
Olivier Matz
f41b5156fe net: add rte prefix to TCP structure
Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-05-24 13:34:46 +02:00
Ivan Malov
c1ce2ba218 net/sfc: support tunnel TSO on EF10 native Tx datapath
Handle VXLAN and GENEVE TSO on EF10 native Tx datapath.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Ivan Malov
41ef1ad50a net/sfc: factor out function to get IPv4 packet ID for TSO
As a result, code duplication will be avoided in the current
TSO implementations (EFX and EF10 native). The future patch to
add support for tunnel TSO will also reuse the new function.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
9b70500cf2 net/sfc: add TSO header length check to Tx prepare
Make Tx prepare function able to detect packets with invalid header
size when header linearization is required.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
f7a66f9365 net/sfc: introduce descriptor space check in Tx prepare
Add descriptor space check to Tx prepare function to inform a caller
that a packet that needs more than maximum Tx descriptors of a queue
can not be sent.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
a3895ef38c net/sfc: move TSO header checks from Tx burst to Tx prepare
Tx offloads checks should be done in Tx prepare.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
8c27fa78f1 net/sfc: support Tx preparation in EF10 simple datapath
Implement tx_prepare callback. The implementation checks for anything
only in RTE debug mode. No checks are done otherwise because EF10
simple datapath ignores Tx offloads.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
67330d32b8 net/sfc: support Tx preparation in EF10 datapath
Implement tx_prepare callback and update Tx burst function accordingly.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
11c3712fc9 net/sfc: make TSO descriptor numbers EF10-specific
Numbers of extra descriptors required for TSO are EF10-specific
in fact. Highlight it in define names.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
3985802ecf net/sfc: improve TSO header length check in EF10 datapath
Move the check inside xmit function to the branch in which
the check is mandatory. It makes case when TSO header is not
fragmented a bit more faster.

Fixes: 6bc985e411 ("net/sfc: support TSO in EF10 Tx datapath")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +02:00
Igor Romanov
9dbd28df2d net/sfc: use NIC min number of Tx descs instead of define
Min limit is not common for all NIC families. Use the variable from
NIC configuration instead of deprecated define.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Igor Romanov
c2303617e6 net/sfc: fix crash in EF10 TSO if no payload
Fixes: 6bc985e411 ("net/sfc: support TSO in EF10 Tx datapath")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-24 10:08:31 +01:00
Igor Romanov
2631dced95 net/sfc: support Tx descriptor status on EF10 datapath
The implementation is shared by ef10 and ef10_simple datapaths.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 18:53:49 +02:00
Igor Romanov
6bc985e411 net/sfc: support TSO in EF10 Tx datapath
Implementation includes following limitations:

1) Packet's header length must be less than 256 (SFC_TSOH_STD_LEN);
2) Offset of the TCP header must be less than 208
   (EF10_TCP_HEADER_OFFSET_LIMIT);
3) Number of Tx descriptors must be not less than number of descriptors
   needed for TSO settings plus header plus one data segment.

If above conditions are not met, the packet is dropped.

If the maximum descriptor space is insufficient to hold entire TSO packet,
only a part of the packet is sent.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
714bff55a4 net/sfc: support runtime VI window size
Medford2 uses a configurable VI window size, and requires
updates to register accesses to use a runtime VI window size
rather than the *_STEP register constants used for earlier
controllers.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-03-30 14:08:44 +02:00
Andrew Rybchenko
44c0947bae net/sfc: change license to BSD-3-Clause
Change license from BSD-2-Clause to BSD-3-Clause.
Bump copyright year.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
c7dadc9fb5 net/sfc: support more options for a number of Tx descriptors
The number of Tx descriptors is not used as HW Tx ring size any more.
It simply defines maximum fill level.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
eaab5d96c4 net/sfc: use Tx queue max fill level calculated on init
Prepare to support more options for number of Tx descriptors.

libefx-based datapath is updated just for completeness to
make code more readable and less error-prone.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-01-16 18:47:49 +01:00
Andrew Rybchenko
420efecb54 net/sfc: make Tx free threshold check datapath specific
EFX_TXQ_LIMIT is libefx-specifics and it should not be used
for other Tx datapaths implementations (e.g. EF10 native).

EF10 native Tx datapath has its own understanding of the maximum
TxQ fill level imposed by EvQ clear strategy and space reserved
for Tx error and flush events.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-01-16 18:47:49 +01:00
Santosh Shukla
df6e0a06a3 drivers/net: rename physical address type to IOVA
Renamed data type from phys_addr_t to rte_iova_t.

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2017-11-06 22:44:26 +01:00
Thomas Monjalon
bfa9a8a460 mbuf: rename data address helpers to IOVA
The following inline functions and macros have been renamed to be
consistent with the IOVA wording:

rte_mbuf_data_dma_addr         -> rte_mbuf_data_iova
rte_mbuf_data_dma_addr_default -> rte_mbuf_data_iova_default
rte_pktmbuf_mtophys            -> rte_pktmbuf_iova
rte_pktmbuf_mtophys_offset     -> rte_pktmbuf_iova_offset

The deprecated functions and macros are kept to avoid breaking the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2017-11-06 22:44:26 +01:00
Ivan Malov
d112a3ecb7 net/sfc: fix Tx reap behaviour on port stop on EF10 datapath
Tx reap mechanism on EF10 native datapath was altered by one
of the recent patches to introduce performance optimisations
using the common technique of freeing mbuf segments in bulks.

From this perspective, the way of associating SW descriptors
with individual mbuf segments rather than with whole packets
was adopted as a key requirement for the entire optimisation.

However, only the fast path reap function was amended to fit
the new scheme whilst the corresponding function on the port
stop path was left intact by mistake. This implies incorrect
usage of rte_pktmbuf_free() with regard to separate segments
rather than calling rte_pktmbuf_free_seg() and must be fixed.

Fixes: d321954343 ("net/sfc: free mbufs in bulks on EF10 native Tx reap")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-10-26 02:33:00 +02:00
Ivan Malov
093e1afa24 net/sfc: free mbufs in bulks on simple EF10 Tx reap
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-10-06 02:49:48 +02:00
Ivan Malov
d321954343 net/sfc: free mbufs in bulks on EF10 native Tx reap
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-10-06 02:49:48 +02:00
Ivan Malov
7df6f8542d net/sfc: support Tx descriptor status API
Support for the feature is added to EFX Tx datapath

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-10-06 02:49:47 +02:00
Andrew Rybchenko
21233dd6c7 net/sfc: rely on one desc is one mbuf in simple EF10 Tx reap
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: David Riddoch <driddoch@solarflare.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
3fd7797fcd net/sfc: check added but not completed descs on EF10 Tx reap
There is not point to check other Tx descriptors.
It is important if Tx datapath does not reset Tx descriptor
mbuf pointer to NULL on completion (EF10 simple Tx will do).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: David Riddoch <driddoch@solarflare.com>
2017-06-12 10:41:27 +01:00
Andrew Rybchenko
f28ede500c net/sfc: support multi-process
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2017-06-12 10:41:26 +01:00
Andrew Rybchenko
b69862719e net/sfc: correct estimation of max DMA descriptors required
Previous too pessimistic estimation made completely impossible to send
packets with many segments (more than 100 with minimum Tx ring size).

Fixes: 8b00f426eb ("net/sfc: implement EF10 native Tx datapath")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
2017-04-28 14:46:17 +02:00
Andrew Rybchenko
5688520075 net/sfc: implement simple EF10 native Tx datapath
The datapath does not support VLAN insertion, TSO and multi-segment
mbufs.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:43 +02:00
Andrew Rybchenko
ea2ed84c2f net/sfc: make multi-segment support a Tx datapath feature
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2017-04-04 18:59:43 +02:00
Andrew Rybchenko
8b00f426eb net/sfc: implement EF10 native Tx datapath
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: David Riddoch <driddoch@solarflare.com>
2017-04-04 18:59:43 +02:00