Commit Graph

677 Commits

Author SHA1 Message Date
Igor Romanov
6c0cc77a2d net/sfc: fix MTU change to check Rx scatter consistency
Rx queue setup function checks configured MTU to make sure that
no oversized packets can be received. But a following call to
set MTU function might make this check irrelevant.

Add a function to check MTU size against Rx buffer size and
additional Rx queue info, including Rx scatter offload.

Fixes: e961cf425e ("net/sfc: support MTU change")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-05-03 18:45:22 +02:00
Thomas Monjalon
b7ed955a20 ethdev: deprecate legacy filter API
As stated in the deprecation notice from December 2016,
"the legacy filter API, including rte_eth_dev_filter_supported(),
rte_eth_dev_filter_ctrl() as well as filter types MACVLAN, ETHERTYPE,
FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded
by the generic flow API (rte_flow)".

After a long wait of more than two years, the legacy filter API
is marked as deprecated, while still tested with testpmd and
the tep_termination example.

The next step will be to announce a deadline for complete removal.
As preparation of the removal of rte_eth_ctrl.h,
RTE_ETH_FLOW_*, RTE_TUNNEL_TYPE_* and RTE_ETH_HASH_FUNCTION_* definitions
are moved to rte_ethdev.h and rte_flow.h.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2019-04-19 14:51:54 +02:00
Andrew Rybchenko
bac46c6fef net/sfc: set min and max MTU
Advertise minimum and maximum MTU value in device information.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-12 11:02:02 +02:00
Andrew Rybchenko
06b186a01d net/sfc: improve Rx free threshold default
Rx refill in one bulk (which is just 8 descriptors) by default is too
aggressive and makes too many MMIO writes (Rx doorbells) if packet rate
is high. Setting default to 1/8 of Rx descriptors number shows good
performance results. Anyway it is a default value which may be
overridden by Rx configuration provided by application.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-04-05 17:45:22 +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
9906cb2959 net/sfc: improve log about missing HW TSO support
Said message cannot be considered as warning since
the PMD anyway reports available offload capabilities
by means of device info interface. Make this log
message informational and improve its formatting
by placing the text itself on the same line.

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
07685524c9 net/sfc: support Tx preparation in EFX datapath
Implement generic checks in Tx prepare function 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
ac30699e9c net/sfc: improve TSO header length check in EFX 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: fec33d5bb3 ("net/sfc: support firmware-assisted TSO")
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
Andrew Rybchenko
cf6a73fc3f net/sfc: fix speed capabilities reported in device info
Phy capabilities are bit offsets in libefx, but was used as bit masks.

Fixes: d23f3a89ab ("net/sfc: support link speed and duplex settings")
Fixes: f82e33afbb ("net/sfc: support link speeds up to 100G")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-03-21 18:57:09 +01:00
Bruce Richardson
742bde12f3 build/linux: rename macro from LINUXAPP to LINUX
Rename the macro to make things shorter and more comprehensible. For
both meson and make builds, keep the old macro around for backward
compatibility.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2019-03-12 17:31:22 +01:00
Stephen Hemminger
42c807fee5 net/sfc: do not use PMD log type
The sfc driver was still using RTE_LOGTYPE_PMD which was superseded
by local logging.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-03-01 18:17:36 +01:00
Bruce Richardson
d23e141ffa build: set RTE_ARCH_64 based on pointer size
Rather than relying on the target machine architecture, use the
size of a pointer from the compiler to determine if we are 64-bits
or not. This allows correct behaviour when you pass -m32 as a compile
option. It also allows us to use this value repeatedly throughout the
repo rather than continually testing for the sizeof(void*).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Acked-by: Luca Boccassi <bluca@debian.org>
2019-02-26 18:34:28 +01:00
Andrew Rybchenko
e5ed1e5f38 net/sfc/base: share macro to increment per-event type stats
Move duplicate macro to increment per-event type stats to
internal header. These stats are NIC family independent and
stored in generic event queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
a6b9ee49f0 net/sfc/base: improve MCDI interface header inclusion
Include efx_mcdi.h from main internal header efx_impl.h directly
instead of indirect inclusion via family-specific header.
It avoids duplication and fixes Medford and Medford2 cases where
the header inclusion is lost.
Correctness is still guaranteed by checks in efx_check.h which
require EFSYS_OPT_MCDI for corresponding families and do not
allow to enable the option if no family requires it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
40d2864c8a net/sfc/base: avoid division by 0 if no event queue timers
If event queue timers are not supported, enc_evq_timer_quantum_ns and
enc_evq_timer_max_us should be set to 0. Make sure that division by 0
does not happen in libefx, if public function efx_ev_usecs_to_ticks()
is used in this case.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
5661516f22 net/sfc/base: simplify EF10 family run-time checks
Add EFX_FAMILY_IS_EF10() which may be used as synonym of any EF10-based
NIC family (i.e. Huntigton, Medford or Medford2 at the time of addition).

Suggested-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
dc82cc97ee net/sfc/base: simplify EF10 family conditional code checks
Add EFX_OPTS_EF10() which may be used as synonym of any EF10-based
NIC (i.e. Huntigton, Medford or Medford2 at the time of addition).

Suggested-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
ec6080a1ac net/sfc/base: pass Rx buffer size to RxQ init if supported
Riverhead requires Rx buffer size to be specified in INIT_RXQ.
If the parameter is not supported (e.g. on EF10 family adapters),
zero must be used on INIT_RXQ.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
5df5d2647f net/sfc/base: allow to specify Rx buffer size on queue setup
Rx buffer size must be specified on Rx queue creation on
Riverhead.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Richard Houldsworth
17cbefa181 net/sfc/base: make bundle partition type available for X2
Supports the firmware update mechanism described in SF-121352-AN.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Lee
b4e0f7d04e net/sfc/base: add Rx parse incomplete event queue statistic
Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
f702c073e0 net/sfc/base: rename header with MCDI strings
The header was incorrectly named on addition since it did not
match naming conventions.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Mark Spender
2d91dd27a8 net/sfc/base: support the Rx event mode w/o continue
The recently added NO_CONT_EV mode is recommended for when looking for
maximum throughput on 100G links as it allows the firmware to operate
more efficiently. The biggest benefit is when using scatter and jumbo
frames, but it is also necessary to achieve line rate in other cases.

Support for NO_CONT_EV when scatter is disabled is simple - the main
datapath change is to always read the packet length from the prefix,
not the event. This requires storing a flag with the event queue so
the event handler knows NO_CONT_EV mode is in use.

Supporting NO_CONT_EV with scatter would require an API change.

(Now the ee_flags field in efx_evq_t is used on the datapath, move it
next to other fields which are also read on the datapath to try to avoid
reading an additional cache line.)

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Andrew Rybchenko
a826a7c6f9 net/sfc/base: update auto-generated MCDI definition headers
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:41 +01:00
Igor Romanov
8fcf28a295 net/sfc/base: remove deprecated macros that get queue sizes
The macros are deprecated and are not used anymore, so they can
be deleted.

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
2baa200ec1 net/sfc/base: remove deprecated min/max desc defines
Symbols for maximum and minimum number of Tx, Rx and event descriptors
are deprecated. They are not used anymore, so they can be deleted.

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
afe3c7563a net/sfc: use NIC event descriptor size instead of common
Use of the macro for calculating a Rx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

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
8c5ca0c628 net/sfc: use NIC Rx descriptor size instead of common
Use of the macro for calculating a Rx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

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
5638b1f0e8 net/sfc: use NIC Tx descriptor size instead of common
Use of the macro for calculating a Tx queue size is deprecated. Replace
it with a call to a function that uses descriptor size specified for
every NIC.

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
b914326157 net/sfc/base: round number of queue buffers up
Functions efx_*q_nbufs return the number of a queue buffers by dividing
the queue size by page size. If minimum size of a queue is smaller than
one page, we still need the page and number of buffers should not be 0.

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
d6b55d5682 net/sfc/base: support different event descriptor sizes
For consistency with the size of Tx descriptors, the size of event
descriptors should be a part of NIC config, not a macro that is
common for all NIC families. Also, add a max number of EvQ buffers
define which is needed to initialize an MCDI buffer at compile time.

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
eebbd4250d net/sfc/base: support different Rx descriptor sizes
For consistency with the size of Tx descriptors, the size of Rx
descriptors should be a part of NIC config, not a macro that is
common for all NIC families.

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
914e878cd9 net/sfc/base: support different Tx descriptor sizes
Size of Tx descriptor is different on Riverhead. So, the size
should be a part of NIC config, not a macro that is common for
all NIC families.

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
70c9ab84b2 net/sfc/base: make NIC pointer const in NIC config get
The change is needed for the functions that accept const efx_nic_t
pointer and have to get efx_nic_cfg_t.

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
217688651d net/sfc/base: make max number of TxQ bufs EF10-specific
The define EFX_TXQ_MAX_BUFS is used only by EF10 family implementation.
Since the macro is not used by any drivers, it does not require
exposed libefx interface.
Make the define EF10-specific.

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
5b5c345c1e net/sfc/base: move a macro to Siena implementation header
The macro EFX_RXQ_DC_NDESCS() is used only by Siena implementation.
Since the macro is not used by any drivers, it does not require
exposed libefx interface.
Make the macro Siena-specific.

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
802354e5a6 net/sfc/base: move EVQ descs number check to generic place
Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be
made common. It removes code duplication and makes NIC family
specific functions a bit shorter.

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
863f76ca71 net/sfc/base: move Rx descs number check to generic place
Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be
made common. It removes code duplication and makes NIC family
specific functions a bit shorter.

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
5f9238dc68 net/sfc/base: move Tx descs number check to generic place
Now we have min/max limits in NIC config, so we can do check against
min/max in a generic place instead of NIC family specific functions.
Check that the descriptors number is a power of 2 is also can be made
common. It removes code duplication and makes NIC family
specific functions a bit shorter.

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
d5371f3dfa net/sfc: use NIC EVQ descs limits instead of defines
Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

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
048a0d1a81 net/sfc: use NIC Rx descs limits instead of defines
Descriptor limits are not common for all NIC families. Use the variables
from NIC configuration instead of deprecated defines.

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
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