Commit Graph

891 Commits

Author SHA1 Message Date
Andrew Rybchenko
596bff316d net/sfc/base: do not rely on indirect header inclusion
Types defined in efx_types.h are used in efx.h and it is better do
not rely on the header inclusion from somewhere else (typically from
efsys.h).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-20 23:42:04 +02:00
Mark Spender
dffa4534d5 net/sfc/base: improve code style in sensors decoding
Add more comments to simplify code reading and understanding.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-20 23:42:04 +02:00
Mark Spender
1dcd3a9895 net/sfc/base: fix shift by more bits than field width
This was probably an oversight when support for multiple sensor pages
was added.

Despite being undefined behaviour in C, it probably worked on Intel
x32/x64 as on them bit shift operations wrap round.

Fixes: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-20 23:42:04 +02:00
Andrew Lee
b69259cd15 net/sfc/base: fix signed/unsigned mismatch
Use UINT32_MAX instead of assigning -1 to a uint32_t variable to
resolve "conversion from 'int' to 'uint32_t', signed/unsigned mismatch"
errors produced by the Visual Studio 2017 toolchain [with the default
/W4 /WX C compiler options which set warning level 4 and treat warnings
as errors].

Fixes: 107cf1d792 ("net/sfc/base: move limits config to ef10 NIC board config")
Cc: stable@dpdk.org

Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-20 23:42:04 +02:00
Gautam Dawar
9b1d5e45c0 net/sfc/base: enable chained multicast on all EF10 cards
Set WORKAROUND_BUG26807 which does the job.

Fix the misunderstanding in the Medford code: i.e. the workaround is
always supported by firmware, but the driver still needs to enable it.
Also, as it now applies to all EF10 controllers, the implementation is
moved to EF10 common place.

Fixes: 94190e3543 ("net/sfc/base: import SFN8xxx family support")
Fixes: 2b38e7b7b7 ("net/sfc/base: add Medford2 support to NIC module")
Cc: stable@dpdk.org

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-20 23:42:04 +02:00
Georgiy Levashov
1245e3fabc net/sfc: support Rx interrupts for ef10 datapath
Similar to support for efx datapath, Rx interrupt disabling
just avoids rearming the next time.

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-14 00:01:06 +09:00
Georgiy Levashov
4279b54e28 net/sfc: support Rx interrupts for efx datapath
When Rx interrupts are disabled, we simply disable rearm when
the interrupt fires the next time. So, the next packet will
trigger interrupt (if it is not happened yet after previous Rx
burst processing).

Signed-off-by: Georgiy Levashov <georgiy.levashov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-06-14 00:01:00 +09: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
Andrew Rybchenko
f08d113d55 net/sfc: advertise offload capabilities by Rx datapaths
Rx 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 Rx
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
Olivier Matz
a7c528e5d7 net: add rte prefix to IP structure
Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_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
Olivier Matz
35b2d13fd6 net: add rte prefix to ether defines
Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

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:45 +02:00
Olivier Matz
538da7a1ca net: add rte prefix to ether functions
Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

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:45 +02:00
Olivier Matz
6d13ea8e8e net: add rte prefix to ether structures
Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

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:45 +02:00
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
Igor Romanov
0b5bedc23e net/sfc/base: remove min/max defines for number of events
EF100/Riverhead has different min/max limits. So, these limits should
be a part of NIC config, not defines 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
24b4d1f095 net/sfc/base: remove min/max defines for number of Rx descs
EF100/Riverhead has different min/max limits. So, these limits should
be a part of NIC config, not defines 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
61d820eba0 net/sfc/base: define max desc number for every EF10 NIC
For consistency with defines of min descriptor number, define max
descriptor number for Huntington, Medford and Medford2.

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
a025fdd98c net/sfc/base: remove min define for number of Tx descs
EF100/Riverhead has different min limit. So, this limit should
be a part of NIC config, not define common for all NIC families.
Define maximum Tx descriptor number for Siena in the same way as
minimum for consistency.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:40 +01:00
Ivan Malov
fb720b7d8b net/sfc/base: report support for Tx checksum op descriptors
FreeBSD driver needs a patch to provide a means for packets
which do not need checksum offload but have flow ID set
to avoid hitting only the first Tx queue (which has been used
for packets not needing checksum offload).

This should be possible on Huntington, Medford or Medford2 chips
since these support toggling checksum offload on any given queue
dynamically by means of pushing option descriptors.

The patch for FreeBSD driver will then need a means to figure out
whether the feature can be used, and testing adapter family might
not be a good solution.

This patch adds a feature bit specifically to indicate support
for checksum option descriptors. The new feature bits may have
more users in future, apart from the mentioned FreeBSD patch.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:35:28 +01:00
Mark Spender
4b4b84caf9 net/sfc/base: ensure EvQ poll stops when abort is requested
If an event handler requested an abort, only the inner loop was
guaranteed to be broken out of - the outer loop could continue
if total == batch.

Fix this by poisoning batch to ensure it is different to total.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:32:42 +01:00
Richard Houldsworth
fc3c5bbd05 net/sfc/base: update external port number calculation
Revise the external port calculation to support all
X2 port modes. The previous algorithm could not
handle different port numbering schemes on each cage.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:32:42 +01:00
Richard Houldsworth
2373aafb43 net/sfc/base: correct annotations where NULL input is OK
Correct annotations where NULL input can be permitted

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-08 11:32:42 +01:00
Andrew Rybchenko
2646d42fff net/sfc: support Rx packet types get in secondary process
Secondary process needs to know packet classes supported
by the NIC on Rx.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
5313b441d8 net/sfc: separate adapter primary process and shared data
Make sfc_adapter primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
bc93289309 net/sfc: remove adapter locks from secondary process ops
Adapter lock will become primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
e0d5ba7eaa net/sfc: move isolated flag in adapter shared
The flag is required in default RSS RETA get which does not make sense
in isolated mode.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
e295f175bf net/sfc: move RSS config to adapter shared
RSS get requests are supported in secondary process.

Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
113a14a63e net/sfc: move TxQ shared information to adapter shared
Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
dda791c2b6 net/sfc: move RxQ shared information to adapter shared
Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
36653b7d85 net/sfc: make main logging macro reusable in secondary
Logging should be supported in secondary process and now we have
everything required to share at least main logging macro.
sfc_adapter is going to become primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
50f34eed3c net/sfc: move Rx/Tx datapath names to shared state
Prepare to make sfc_adapter primary process private data.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
1d3c7f9c0f net/sfc: start to factor out multi-process shared data
sfc_adapter structure will become primary process only private data.
Start to factor out shared data into dedicated structure which will
become separate structure finally.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
29e4237d46 net/sfc: remove TxQ control from shared TxQ info
libefx is not multi-process aware and all related structures
should be moved to primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
4e8938dd1f net/sfc: remove RxQ control from shared RxQ info
libefx is not multi-process aware and all related structures
should be moved to primary process only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
dbe26517cd net/sfc: remove unnecessary functions to get TxQ index
TxQ index is stored in generic datapath queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
9f25da76b9 net/sfc: remove unnecessary functions to get RxQ index
RxQ index is stored in generic datapath queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
128da6924a net/sfc: support RSS RETA and hash config get in secondary
RSS RETA query and hash configuration get functions use shared
adapter data only. No libefx functions are called.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
3cf4b9c24b net/sfc: support Tx descriptor status in secondary process
If Tx datapath supports multi-process, secondary process should be
able to use Tx descriptor status API.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
42ce2521a8 net/sfc: move datapath TxQ handle to shared TxQ info
If datapath supports multi-process, it should be possible to get
its TxQ structure by the queue index.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
561508da06 net/sfc: move TxQ state to multi-process shared location
Secondary process needs to know TxQ state.
TxQ control structure will become primary process private.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
b76e1b2c91 net/sfc: support Rx descriptor status in secondary process
If Rx datapath supports multi-process, secondary process should be
able to use Rx descriptor status and related API.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
bfea01bc1e net/sfc: move datapath RxQ handle to shared RxQ info
If datapath supports multi-process, it should be possible to get
its RxQ structure by the queue index.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
2e42d78ddd net/sfc: move RxQ state to multi-process shared location
Secondary process needs to know RxQ state.
RxQ control structure will become primary process private.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
f52fa243fd net/sfc: move main log type to process private data
Dynamic log type value may differ in primary and secondary processes.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
5dec95e36d net/sfc: move datapath ops pointers to process private data
The change is required to support datapath-dependent device operations
for secondary process. It is just a step in the direction.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
c7b57f0075 net/sfc: make it simpler to change datapath ops location
Rx and Tx datapath ops should be stored in process private
data since these structures are located in the data section
(not allocated from shared memory).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
768629c69a net/sfc: remove wrappers around Rx descriptor count and done
These wrappers are used in single place and just complicate reading
and understanding if these ops could be supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
b57870f2ab net/sfc: avoid usage of TxQ control structure in info get
TxQ control structure contains primary process only data and will become
primary process only. TxQ info get is supported in secondary process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
5befcecbe0 net/sfc: avoid usage of RxQ control structure in info get
RxQ control structure contains primary process only data and will
become primary process only. RxQ info get is supported in secondary
process.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
e2c3639abf net/sfc: fix logging from secondary process
Dynamic log type value may differ in different processes.

Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Andrew Rybchenko
bd6e510658 net/sfc: remove control path logging from Rx queue count
Rx queue count may be used from data core and it should not
generate control path logs.

Fixes: 04aa6b9c5f ("net/sfc: get RxQ pending descriptors count")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Ivan Malov
5e48db8c53 net/sfc: log port ID as 16-bit unsigned integer on panic
Fixes: f8244c6399 ("ethdev: increase port id range")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-02-07 16:06:30 +01:00
Ivan Malov
5a88b9b3f0 net/sfc: fix port ID log
Log port ID as 16-bit unsigned integer.

Fixes: f8244c6399 ("ethdev: increase port id range")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-24 19:14:33 +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
Andrew Rybchenko
ab77a0013a net/sfc: fix Rx packets counter
Errors, missed and pauses should not be included in delivered
good Rx packets reported by ipackets.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Ivan Malov
7f7bdb5987 net/sfc: fix datapath name references in logs
Rx and Tx datapath references were mixed up in a couple
of log statements and commentary blocks in the original
commit. Correct datapath name references in said places.

Fixes: f28ede500c ("net/sfc: support multi-process")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Andrew Rybchenko
24f8a95917 net/sfc: fix VF error/missed stats mapping
VADAPTER_RX_OVERFLOW means Rx statistics overflow, not a missed
packet because of overflow.

VADAPTER_RX_BAD_PACKETS accumulates a number of error conditions,
but mainly impossibility to deliver because of no descriptors
available, so it is better to classify it as imissed.

Fixes: 1caab2f1e6 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-18 09:47:26 +01:00
Andrew Rybchenko
c69f5e0cb1 net/sfc: fix typo in preprocessor check
ISP2() macro function misspelled in a check just before it.

Fixes: e1b9445985 ("net/sfc: build libefx")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-14 17:44:29 +01:00
Igor Romanov
31c2379bad net/sfc/base: fix Tx descriptor max number check
Fix check of maximum descriptor number (compare with maximum Tx
descriptor number instead of maximum EVQ events number).

Fixes: f7dc06bf35 ("net/sfc/base: import 5xxx/6xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-14 17:44:29 +01:00
Ivan Malov
649885c08e net/sfc: discard last seen VLAN TCI if Tx packet is dropped
Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.

Fixes: 7fd636815a ("net/sfc: support VLAN offload on transmit path")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-14 17:44:29 +01:00
Ivan Malov
d542b9577f net/sfc: add missing header guard to TSO header file
Add missing header guard, including compiler directive for cplusplus.

Fixes: f1f575be9b ("net/sfc: put generalised TSO declarations in a header")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-01-14 17:44:29 +01:00
Andrew Rybchenko
7928b0fdf8 net/sfc: pass HW Tx queue index on creation
Software indexes are PMD internal and should not be passed outside.
Right now SW and HW indexes of the Tx queue match, so it is just
a cosmetic fix.

Fixes: dbdc82416b ("net/sfc: factor out libefx-based Tx datapath")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-12-21 16:22:41 +01:00
Igor Romanov
f7c8539801 net/sfc/base: fix field order in filter spec struct
Fields in the struct efx_filter_spec_t starting from efs_outer_vid
are hashed for software filter lookup. efs_mark is not a matching
criteria. Exclude efs_mark from hash.

Fixes: 5f78af5239 ("net/sfc: support MARK and FLAG actions in flow API")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-11-14 00:35:53 +01:00
Ferruh Yigit
b74fd6b842 add missing static keyword to globals
Some global variables can indeed be static, add static keyword to them.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
2018-10-29 02:01:08 +01:00
Thomas Monjalon
e16adf08e5 ethdev: free all common data when releasing port
This is a clean-up of common ethdev data freeing.
All data freeing are moved to rte_eth_dev_release_port()
and done only in case of primary process.

It is probably fixing some memory leaks for PMDs which were
not freeing all data.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-26 22:14:05 +02:00
Ivan Malov
662e382244 net/sfc: allow to query RSS key and HF when RSS is disabled
If global RSS is not enabled in the multiqueue mode setting,
it will not be possible to change RSS configuration. However,
querying default RSS settings should be possible in any case since
it may be needed by RTE flow API users to find out what RSS settings
will be used by default for a flow rule with RSS action if custom
RSS key and hash function choice are not specified.

Fixes: 63ab5e0c8f ("net/sfc: use zero RSS channels as disabled RSS indicator")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 20:35:29 +02:00
Ivan Malov
453e1d4baa net/sfc: allow to query RSS key and HF in isolated mode
Isolated mode prevents global RSS from being enabled and configured.
However, an application may need to query default RSS key and hash
functions when a flow rule with RSS action is added which does not
contain custom RSS key or hash function choice. In this case
global RSS key and hash functions will be used to handle the rule,
and there should be some way for the application to query these
global default settings to clarify expectations on the traffic
distribution.

Fixes: 84a9b48128 ("net/sfc: support flow API isolated mode")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 20:35:29 +02:00
Ivan Malov
5205c436a3 net/sfc: do not skip RSS configuration step on reconfigure
Earlier a patch was made to support change of Rx queue
number. That patch added goto label in wrong place
because reconfiguration with the same number of queues
results in skipping not only queue init but also RSS
settings. If a user configures device with RSS multiqueue
mode and then wants to stop it and reconfigure without RSS,
this change will be ignored and RSS will continue working.

Move the label in the right place and rename it to describe it.

Fixes: 55a539003f ("net/sfc: support changing the number of receive queues")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-10-11 19:34:29 +02: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
Igor Romanov
f1f575be9b net/sfc: put generalised TSO declarations in a header
Move general TSO declarations in a separate header to be able to use
them in other datapaths (not only EFX). Also update the function that
prepares TSO header to make it useful in other 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
1a9d944f5a net/sfc: support Rx descriptor status on EF10 datapath
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
52e10cb09d net/sfc: support Rx scatter in EF10 Rx datapath
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
c4753858ad net/sfc: rename variable to prepare for scatter support
In the case of scattered packet one Rx buffer is just a segment
of the whole packet.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
3be2268435 net/sfc: avoid usage of prepared packets number in EF10 Rx
Number of prepared packets is good when one Rx descriptor is one packet.
Introduce pending Rx descriptor pointer which points to the first not
processed Rx descriptors. Rx descriptors from completed to pending have
buffers ready to be passed to application.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
84b63b5c59 net/sfc: decrease number of variables maintained on EF10 Rx
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
3ac6ddd428 net/sfc: avoid dummy writes to Rx queue state structure
If there is no packets to be processed, it does not make sense
to write the same values back to Rx queue structure.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
f3a5fa85cf net/sfc: check mbufs allocated using mempool API for Rx
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
66e10b8dbb net/sfc: use mbuf raw free instead of mempool put directly
mbuf raw free adds debug build checks to ensure that mbuf is
really OK to be returned to mempool.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Andrew Rybchenko
f609ee3f2a net/sfc: receive prepared packets even in Rx exception case
Make sure that number of prepared packets, completed and added
Rx ring pointers are reset to zeros on queue purge at stop.

Fixes: 638bddc99f ("net/sfc: implement EF10 native Rx datapath")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-10-11 18:53:49 +02:00
Richard Houldsworth
c4084fb3d0 net/sfc/base: use transceiver ID when reading info
In efx_mcdi_phy_module_get_info() probe the
transceiver identification byte rather than assume
the module matches the fixed port type.  This
supports scenarios such as a SFP mounted in a QSFP
port via a QSA module.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
f8683231c9 net/sfc/base: add accessor to whole link status
Add a function which makes an MCDI GET_LINK request and
packages up the results. Currently, the get-link function
is triggered from several entry points which then pass
on or store selected parts of the data. When the driver
needs to obtain the current link state, it is more
efficient to do this in a single call.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Tom Millington
161c9ab395 net/sfc/base: guard Rx scale code with corresponding option
Previously only some of the code was guarded by this which caused
a build error when EFSYS_OPT_RX_SCALE is 0 (e.g. in manftest).

Signed-off-by: Tom Millington <tmillington@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
0c9c1d9ec9 net/sfc/base: infer port mode bandwidth from max link speed
Limit the port mode bandwidth calculations by the maximum
reported link speed. This system detects 25G vs 10G cards,
and 100G port modes vs 40G.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
ac664071e7 net/sfc/base: support improvements to bandwidth calculations
Change the interface to ef10_nic_get_port_mode_bandwidth()
so more NIC information can be used to infer bandwidth
requirements. Huntington calculations separated out
completely.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
cd7dc6c812 net/sfc/base: add X2 port modes to bandwidth calculator
Add cases for the new port modes supported by X2 NICs.
Lane bandwidth is calculated for pre-X2 cards so is an
underestimate for X2 in 25G/100G modes.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
a77a72cdd7 net/sfc/base: update to current port mode terminology
>From Medford onwards, the newer constants enumerating
port modes should be used.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
dad744f763 net/sfc/base: adjust PHY module info interface
Adjust data types in interface to permit the complete
module information buffer to be obtained in a single
call.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:03 +02:00
Richard Houldsworth
c0516b777e net/sfc/base: expose PHY module device address constants
Rearrange so the valid addresses are visible to the caller.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
7624c9442d net/sfc/base: make last byte of module information available
Adjust bounds so the interface supports reading
the last available byte of data.

Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Igor Romanov
5d138ef92d net/sfc: fix a Tx queue double release possibility
There are two function that call sfc_tx_qfini():
sfc_tx_fini_queues() and sfc_tx_queue_release(). But only
sfc_tx_queue_release() sets tx_queues pointer of the device data to NULL.
It may lead to the scenario in which a queue is destroyed by
sfc_tx_fini_queues() and after the queue is attempted to be destroyed again
by sfc_tx_queue_release().

Move NULL assignment to sfc_tx_qfini().

Fixes: b1b7ad933b ("net/sfc: set up and release Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Igor Romanov
7eb7588c99 net/sfc: fix an Rx queue double release possibility
There are two function that call sfc_rx_qfini():
sfc_rx_fini_queues() and sfc_rx_queue_release(). But only
sfc_rx_queue_release() sets rx_queues pointer of the device data to NULL.
It may lead to the scenario in which a queue is destroyed by
sfc_rx_fini_queues() and after the queue is attempted to be destroyed again
by sfc_rx_queue_release().

Move NULL assignment to sfc_rx_qfini().

Fixes: ce35b05c63 ("net/sfc: implement Rx queue setup release operations")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
e3ea742e85 net/sfc/base: add helper API to make Geneve filter spec
Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
42f235911a net/sfc/base: fix MAC Tx stats for less or equal to 64 bytes
This statistic should include 64byte and smaller frames.
Fix EF10 calculation to match Siena code.

Fixes: 8c7c723dfe ("net/sfc/base: import MAC statistics")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
95ea95ec41 net/sfc/base: modify phy caps to indicate FEC request
The capability bits to request FEC modes are implicitly valid
when the corresponding FEC mode is a supported capability.
Drivers expect that it is only valid to advertise those
capabilities explicitly marked as supported. The capabilities
reported by firmware is modified with the implicit capabilities
to present the explicit model to drivers.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
bb53d84843 net/sfc/base: improve handling of legacy RSS hash flags
Client drivers may use either legacy flags, for example,
EFX_RX_HASH_TCPIPV4, or generalised flags, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE), to configure RSS hash.
The libefx is able to recognise what scheme is used.

Legacy flags may be consumed directly by a chip-specific handler to
configure the NIC, that is, on EF10, these flags can be used to fill
in legacy RSS mode field in MCDI request. Generalised flags can also
be directly used in EF10-specific handler as they are fully compatible
with additional fields of the same MCDI request.

Legacy flags undergo conversion to generalised flags before they
are consumed by a chip-specific handler. This conversion is used to
make sure that chip-specific handlers expect only generalised flags
in the input for the sake of clarity of the code.

Depending on firmware capabilities, a chip-specififc handler either
supplies the input to the NIC directly, for example,
EFX_RX_HASH(IPV4_TCP, 4TUPLE) flag will enable 4 bits in
RSS_CONTEXT_SET_FLAGS_IN_TCP_IPV4_RSS_MODE field on EF10, or takes
the opportunity to translate the input to enable bits which don't map
to the generic flag, like setting
RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_TCPV4_EN on EF10 when the firmware
claims no support for additional modes.

However, this approach has introduced a severe problem which can be
reproduced with ultra-low-latency firmware variant. In order to enable
IP hash, EF10-specific handler requires the user to request 2-tuple
hash for IP-other, TCP and UDP traffic classes, unconditionally.
In example, IPv4 hash can be enabled using the following input:
EFX_RX_HASH(IPV4_TCP, 2TUPLE) | EFX_RX_HASH(IPV4_UDP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE).
At the same time, on ultra-low-latency firmware, the common code will
never report support for any UDP tuple to the client driver. That is,
in the same example, the driver will use EFX_RX_HASH(IPV4_TCP, 2TUPLE) |
EFX_RX_HASH(IPV4, 2TUPLE). This input will not be recognised by
EF10-specific handler, and RSS_CONTEXT_SET_FLAGS_IN_TOEPLITZ_IPV4_EN
bit will not be set in the MCDI request.

In order to solve the problem, the patch removes conversion code
from chip-specific handlers and adds appropriate code to convert
EFX_RX_HASH() flags to their legacy counterparts to the common scale
mode set function. If the firmware does not support additional modes,
the function will convert generalised flags to legacy flags correctly
without any demand for UDP flags and pass the result to a chip-specific
handler.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
86dbbc5dbb net/sfc/base: simplify the code to parse RSS hash type
RSS mode bits can be accessed a lot easier in the hash
type value provided that the variable type is uint32_t.
The macro helper can be removed to enhance readability.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
c4ea98c42d net/sfc/base: check buffer size for hash flags
The efx_rx_scale_hash_flags_get interface is unsafe, as it does not
have an argument for the size of the output buffer used to return
the flags. While the only caller currently supplies a sufficiently
large buffer, this should be checked at runtime to avoid writing
past the end of the buffer.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
b65eb10c4d net/sfc/base: use simpler code to check hash algorithm type
The API which is used to list supported hash flags verifies
hash algorithm choice before writing the output. This check
is based on a switch() statement which has only two options
and no distinctive actions to be conducted for each of them.
Use simpler code instead of switch() to improve readability.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
7ec0fca2c0 net/sfc/base: add support to get active FEC type
Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
9673e044a1 net/sfc/base: fix a typo in unicast filter insertion comment
Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Ivan Malov
e7feaba71c net/sfc/base: fix name of the argument to store RSS flags
The function used to retrieve supported RSS flags has an
argument which should be named properly to indicate
that it's a pointer.

Fixes: 613cbe75ae ("net/sfc/base: add a new means to control RSS hash")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Mark Spender
f78fb0a8e1 net/sfc/base: prevent access to the NIC config before probe
NIC config is initialized during NIC probe.

Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
416aa7f1c9 net/sfc/base: fix ID retrieval in v3 licensing
Fixes: 05fce2ce84 ("net/sfc/base: import libefx licensing")
Fixes: f67e471914 ("net/sfc/base: fix coding style")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
efb15738c7 net/sfc/base: add API to inform libefx of hardware removal
The efx_nic_hw_unavailable() checks ensure that if the NIC hardware
has failed or has been physically removed then libefx will stop
further attempts to access the hardware.

Add an interface for libefx clients to force unavailability, so the
hardware is treated as dead or removed even if still physically present.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
2cfbf25105 net/sfc/base: add routine to check for hardware presence
Add efx_nic_hw_unavailable() routine to check for hardware presence
before continuing with NIC operations.

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Gautam Dawar
ed42d18458 net/sfc/base: fix out of bounds read when dereferencing sdup
Introduce and use macro to make sure that MCDI buffers allocated
on stack are rounded up properly.

Fixes: 6f619653b9 ("net/sfc/base: import MCDI implementation")
Fixes: f7dc06bf35 ("net/sfc/base: import 5xxx/6xxx family support")
Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Fixes: 1dae25112a ("net/sfc/base: import built-in selftest")
Fixes: 0a78643491 ("net/sfc/base: import PHY statistics")
Fixes: 8c7c723dfe ("net/sfc/base: import MAC statistics")
Fixes: 5935cd8c47 ("net/sfc/base: import RSS support")
Fixes: 9ee64bd404 ("net/sfc/base: import loopback control")
Fixes: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Fixes: 05fce2ce84 ("net/sfc/base: import libefx licensing")
Fixes: ba6afee9a8 ("net/sfc/base: add advanced function to extract FW version")
Fixes: c7815c1d1f ("net/sfc/base: use proper MCDI command for encap filters")
Fixes: 17551f6dff ("net/sfc/base: add API to control UDP tunnel ports")
Fixes: eff9b666ea ("net/sfc/base: move RxDP config get to EF10 NIC code")
Fixes: 4aab7f07a6 ("net/sfc/base: refactor EF10 get datapath capabilities")
Fixes: 480a13044b ("net/sfc/base: support FW subvariant choice")
Fixes: 6f60cc4a78 ("net/sfc/base: support equal stride super-buffer Rx mode")
Fixes: 9a733758c0 ("net/sfc/base: support MARK and FLAG actions in filters")
Cc: stable@dpdk.org

Signed-off-by: Gautam Dawar <gdawar@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Mark Spender
b2fe569359 net/sfc/base: add information if TSO workaround is required
In SF bug 61297 it's been confirmed that the hardware does not always
calculate the TCP checksum correctly with TSO sends.

The value of the Total Length field (IPv4) or Payload Length field
(IPv6) is the critical factor. We're sufficiently confident that if
these fields are zero then the checksum will be calculated correctly.

The information may be used by the drivers to check if the workaround is
required when FATSOv2 is implemented.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
da8692388e net/sfc/base: avoid usage of too big arrays on stack
Found by PreFAST static analysis.

Fixes: 1dae25112a ("net/sfc/base: import built-in selftest")
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
bb5c3b1691 net/sfc/base: generalise EF10 NVRAM buffer interface
The SFN driver's PartitionControl WMI object requires an API to parse
and filter partition data in TLV format, particularly for the Dynamic
Config partition. The ef10_nvram_buffer functions provide this
functionality but are tied to use with license partition only.
Modify functions so they are applicable to all TLV partitions and add
functions to support in-place tag modification.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
7e63a9a1a5 net/sfc/base: add accessor for default port mode
Extend efx_mcdi_get_port_modes() to optionally pass on the default
port mode field. This provides a more direct way of handling the case
where the dynamic config does not specify the port mode than the
alternative of a lookup table indexed by MCFW subtype.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Richard Houldsworth
45cc346bc9 net/sfc/base: add buffer editing functions to boot config
Functions to process the DHCP option list format used by the expansion
ROM config buffers, to support extracting and updating of individual
options.
The initial use case is the driver presenting the global and per-PF
options as separate items, with the driver implementing the
synchronization of global options across the configuration buffers
for all PFs.

Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
dded2ffdf9 net/sfc/base: add API to retrieve sensor limits
Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
252faf84f4 net/sfc/base: check size of memory to read sensors data to
Size of provided memory should be consistent with specified size.

Fixes: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
0c52235b43 net/sfc/base: add generated description of sensors
Description of sensors is generated from firmware sources.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Mark Spender
05039b815c net/sfc/base: remove probes when a Tx queue is too full
No need for probe messages when a TxQ is too full for a post to be done.

Existing drivers check if there is room in the queue before posting
descriptors, even though efx_tx_qdesc_post() does the check itself.

The new SFN Windows driver doesn't perform the check before calling
efx_tx_qdesc_post(), but that means these probes can get frequently
printed out. It's normal driver behaviour so there's no need to print
an error.

Signed-off-by: Mark Spender <mspender@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
aa0bac03e9 net/sfc/base: refactor monitors support
Remove obsolete monitor types since Falcon SFN4000 series adapters
no longer supported by libefx.
Rename MCDI monitors to be consistent with YML.
The code may be simplified and generalized since only MCDI monitors
remain.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
f933b46a0a net/sfc/base: add check for TUNNEL module in NIC reset API
Fixes: 17551f6dff ("net/sfc/base: add API to control UDP tunnel ports")
Cc: stable@dpdk.org

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
aa9f2e6bc9 net/sfc/base: move empty efsys definitions to EFX headers
Move empty definitions for platform-specific annotations from efsys.h
to EFX headers.

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Lee <alee@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Vijay Srivastava
b5f238171d net/sfc/base: fix outer IPID field in TSO option descriptors
Fixes: 912e603706 ("net/sfc/base: add outer IP ID parameter to TSOv2 descriptor")
Cc: stable@dpdk.org

Signed-off-by: Vijay Srivastava <vijays@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Paul Fox
a5ecbaa7c9 net/sfc/base: add more definitions of partitions
Add definitions of dynamic config and expansion ROM backup
partitions.

Signed-off-by: Paul Fox <pfox@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andrew Rybchenko
5d23ac47e9 net/sfc/base: fix build because of no declaration
Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
The build fails if compiler options require declaration before definition.

Fixes: dfb3b1ce15 ("net/sfc/base: import monitors access via MCDI")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
f64f2a47f0 net/sfc/base: add space after sizeof
Required by GLD cstyle.

Fixes: d4f4b8f9d2 ("net/sfc/base: make RxQ type data an union")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andy Moreton
9d42b13e8c net/sfc/base: properly align on line continuation
Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Cc: stable@dpdk.org

Signed-off-by: Andy Moreton <amoreton@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
d0e22de5bd net/sfc/base: fix SAL annotation for input buffers
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Andrew Jackson
58b1393e75 net/sfc/base: highlight that image layout header generated
EF10 signed image layout header is generated from firmware sources.

Signed-off-by: Andrew Jackson <ajackson@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
a8fb089398 net/sfc/base: fix output buffer SAL annotation
Found by PreFAST warnings.

Fixes: 3f2f0189dd ("net/sfc/base: add signed image layout support")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
b1c25748dd net/sfc/base: fix invalid order of memset arguments
Found by PreFAST.

Fixes: 3f2f0189dd ("net/sfc/base: add signed image layout support")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Martin Harvey
f394c63d2d net/sfc/base: fix PreFAST warnings because of unused return
Fixes: 19b64c6ac3 ("net/sfc/base: import libefx base")
Fixes: d96a34d165 ("net/sfc/base: import NVRAM support")
Fixes: e7cd430c86 ("net/sfc/base: import SFN7xxx family support")
Cc: stable@dpdk.org

Signed-off-by: Martin Harvey <mharvey@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-28 01:41:02 +02:00
Bruce Richardson
589dd86aaf net/*/base: allow use of experimental APIs in base code
The driver setting of "allow_experimental_apis" was not being used when
building the base code. To allow this we can manually put in a check
in the base code files for the setting and set the appropriate cflag
if it's needed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Ilya Maximets <i.maximets@samsung.com>
2018-09-28 01:41:01 +02:00
Ferruh Yigit
323e7b667f ethdev: make default behavior CRC strip on Rx
Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag.
Without any specific Rx offload flag, default behavior by PMDs is to
strip CRC.

PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC
Rx offload capability.

Applications that require keeping CRC should check PMD capability first
and if it is supported can enable this feature by setting
DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure()

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jan Remes <remes@netcope.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
862b35afca net/sfc: support runtime Tx queue setup
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-14 20:08:41 +02:00
Igor Romanov
0668a27a62 net/sfc: support runtime Rx queue setup
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-09-14 20:08:41 +02:00
Andrew Rybchenko
812bb2087d net/sfc: handle unknown L3 packet class in EF10 event parser
Fix debug build assertion if unknown L3 packet is received.

Fixes: 638bddc99f ("net/sfc: implement EF10 native Rx datapath")
Fixes: c121f00836 ("net/sfc: move EF10 Rx event parser to shared header")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-07-23 23:55:26 +02:00
Andrew Rybchenko
d0dcfe9824 net/sfc: fix assert in set multicast address list
Return value equal to zero means success and really expected.

Fixes: 0fa0070e43 ("net/sfc: support multicast addresses list controls")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-07-23 23:55:26 +02:00
Andrew Rybchenko
4a61f16444 net/sfc: prepare to support Rx datapath without checksum
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-23 23:55:26 +02:00
Andrew Rybchenko
b7294d8808 net/sfc: fix Rx queue offloads reporting in queue info
CRC_STRIP offload is always enabled, but lost here.

It is more robust to use device level offloads directly to
compose returned value.

Fixes: ff6a1197c3 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-23 23:55:26 +02:00
Andrew Rybchenko
eacbad7632 net/sfc: move Rx checksum offload check to device level
Rx checksum offloads are on device level and should be checked and
enforced on device level.

Avoid logging of Rx checksum offloads enforced for each Rx queue.

Fixes: ff6a1197c3 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-23 23:55:26 +02:00
Igor Romanov
3d416511b6 net/sfc: fallback to filter with zero vid
Fallback to filter with VLAN=0 if match without VLAN is not supported
Strictly speaking it is not 100% equivalent, but good tradeoff -
untagged and priority only tagged frames will match.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-07-23 23:55:26 +02:00
Igor Romanov
b0df5b32ae net/sfc: fix filter exceptions logic
Now exception logic handles these cases:

When FW variant does not support filters with transport ports, but
IP protocol filters are supported, TCP/UDP protocol filters may be
used. When FW variant does not support filters with IPv4/6 addresses
or IP protocol, but filters with EtherType are supported, IPv4 and
IPv6 EtherTypes may be used

Fixes: 096dba799b ("net/sfc: avoid creation of ineffective flow rules")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-07-23 23:55:26 +02:00
Bruce Richardson
526ca5c6cc net/sfc: disable for 32-bit builds
The sfc driver is not supported on 32-bit so disable in meson in
those cases.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-07-12 12:24:37 +02:00
Thomas Monjalon
f8e9989606 remove useless constructor headers
A constructor is usually declared with RTE_INIT* macros.
As it is a static function, no need to declare before its definition.
The macro is used directly in the function definition.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-07-12 00:00:35 +02:00
Ferruh Yigit
ab3ce1e0c1 ethdev: remove old offload API
In DPDK 17.11, the ethdev offloads API has changed:
	commit cba7f53b71 ("ethdev: introduce Tx queue offloads API")
	commit ce17eddefc ("ethdev: introduce Rx queue offloads API")
The new API is documented in the programmer's guide:
	http://doc.dpdk.org/guides/prog_guide/poll_mode_drv.html#hardware-offload

For reminder, the main concepts in the new API were:
	- All offloads are disabled by default
	- Distinction between per port and per queue offloads.

The transition bits are now removed:
	- Translation of the old API in ethdev
	- rte_eth_conf.rxmode.ignore_offload_bitfield
	- ETH_TXQ_FLAGS_IGNORE

The old API bits are now removed:
	- Rx per-port rte_eth_conf.rxmode.[bit-fields]
	- Tx per-queue rte_eth_txconf.txq_flags
	- ETH_TXQ_FLAGS_NO*

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>
2018-07-04 21:50:32 +02:00
Andrew Rybchenko
886beef83f net/sfc: support Rx descriptor status for EF10 ESSB datapath
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-04 21:21:31 +02:00
Andrew Rybchenko
6e98e4d230 net/sfc: support ops to check ready descriptors in ESSB Rx
Implement EF10 ESSB Rx datapath callback to get number of pending
descriptors.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-04 21:21:31 +02:00
Andrew Rybchenko
20680dae46 net/sfc: fix double-free in EF10 ESSB Rx queue purge
Number of buffers left in completed descriptor may be 0. If so,
all buffers of the descriptor are freed once again.

Fixes: 390f9b8d82 ("net/sfc: support equal stride super-buffer Rx mode")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-04 21:03:02 +02:00
Andrew Rybchenko
aeeb5571ee net/sfc: discard packets with bad CRC on EF10 ESSB Rx
Fixes: 390f9b8d82 ("net/sfc: support equal stride super-buffer Rx mode")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-07-04 20:58:40 +02:00
Andrew Rybchenko
8028142107 net/sfc: cut non VLAN ID bits from TCI
TCI may contain PCP or DEI bits. Matching of these bits is not
supported, but the bits still may be set in specification value and
not covered by mask. So, these bits should be ignored.

Fixes: 894080975e ("net/sfc: support VLAN in flow API filters")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
2018-07-04 20:39:15 +02:00
Ferruh Yigit
70815c9eca ethdev: add new offload flag to keep CRC
DEV_RX_OFFLOAD_KEEP_CRC offload flag is added. PMDs that support
keeping CRC should advertise this offload capability.

DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release
default behavior in PMDs are to keep the CRC until this flag removed

Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed:
- Setting both KEEP_CRC & CRC_STRIP is INVALID
- Setting only CRC_STRIP PMD should strip the CRC
- Setting only KEEP_CRC PMD should keep the CRC
- Not setting both PMD should keep the CRC

A helper function rte_eth_dev_is_keep_crc() has been added to be able to
change the no flag behavior with minimal changes in PMDs.

The PMDs that doesn't report the DEV_RX_OFFLOAD_KEEP_CRC offload can
remove rte_eth_dev_is_keep_crc() checks next release, related code
commented to help the maintenance task.

And DEV_RX_OFFLOAD_CRC_STRIP has been added to virtual drivers since
they don't use CRC at all, when an application requires this offload
virtual PMDs should not return error.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-07-03 01:35:58 +02:00
Andrew Rybchenko
a654e29b50 net/sfc: add missing Rx descriptor status callback
Rx descriptor status callback was lost and request of the Rx
descriptor status crashes application if equal stride super-buffer
Rx mode is used.

Fixes: 390f9b8d82 ("net/sfc: support equal stride super-buffer Rx mode")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-30 12:30:40 +02:00
Roman Zhukov
1613848c2c net/sfc: fix errno if flow API RSS action parse fails
The value of rte_errno must be positive in case of an error.

Fixes: d77d07391d ("net/sfc: support flow API RSS action")
Cc: stable@dpdk.org

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-17 19:44:23 +02:00
Ivan Malov
e4c5216d1c net/sfc: improve unsupported flow pattern message
Such a message could be generated by two places
in the code, and there is a difference in the
text albeit there is no difference in the meaning.
These two messages must be the same so that
automated error log comparison may be carried
out without confusion.

Fixes: a9825ccf5b ("net/sfc: support flow API filters")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-17 19:06:29 +02:00
Andrew Rybchenko
e9ff01b36d net/sfc: fix minimum number of Rx descriptors in ESSB mode
Number of descriptors in equal stride super-buffer Rx mode defines
number of packet buffers to be used. Each HW Rx descriptor has
many packet buffers and the number depends on total size of mbuf
and CONFIG_RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB value.
Typically it makes a bit less than 32 buffers per descriptor.
Since HW Rx descriptors must be pushed by 8, it makes about 256
as required minimum. Double it in advertised minimum to allow for
at least 2 refill blocks.

Fixes: 390f9b8d82 ("net/sfc: support equal stride super-buffer Rx mode")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-17 19:06:28 +02:00
Andy Green
ed5b98483a net/sfc: make sure that stats name is nul-terminated
Fixes: 73280c1e4f ("net/sfc: support xstats retrieval by ID")
Fixes: 7b9891769f ("net/sfc: support extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-14 23:32:23 +02:00
Andrew Rybchenko
4436cf988b net/sfc: fix inner TCP/UDP checksum offload control
If application uses Tx offload API and sets ETH_TXQ_FLAGS_IGNORE flag,
it still should have inner TCP/UDP checksum offload enabled if it is
supported and TCP/UDP checksum offload is requested.

Fixes: c78d280e88 ("net/sfc: convert to new Tx offload API")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-14 22:31:52 +01:00
Wei Dai
a4996bd89c ethdev: new Rx/Tx offloads API
This patch check if a input requested offloading is valid or not.
Any reuqested offloading must be supported in the device capabilities.
Any offloading is disabled by default if it is not set in the parameter
dev_conf->[rt]xmode.offloads to rte_eth_dev_configure() and
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If any offloading is enabled in rte_eth_dev_configure() by application,
it is enabled on all queues no matter whether it is per-queue or
per-port type and no matter whether it is set or cleared in
[rt]x_conf->offloads to rte_eth_[rt]x_queue_setup().
If a per-queue offloading hasn't be enabled in rte_eth_dev_configure(),
it can be enabled or disabled for individual queue in
ret_eth_[rt]x_queue_setup().
A new added offloading is the one which hasn't been enabled in
rte_eth_dev_configure() and is reuqested to be enabled in
rte_eth_[rt]x_queue_setup(), it must be per-queue type,
otherwise trigger an error log.
The underlying PMD must be aware that the requested offloadings
to PMD specific queue_setup() function only carries those
new added offloadings of per-queue type.

This patch can make above such checking in a common way in rte_ethdev
layer to avoid same checking in underlying PMD.

This patch assumes that all PMDs in 18.05-rc2 have already
converted to offload API defined in 17.11 . It also assumes
that all PMDs can return correct offloading capabilities
in rte_eth_dev_infos_get().

In the beginning of [rt]x_queue_setup() of underlying PMD,
add offloads = [rt]xconf->offloads |
dev->data->dev_conf.[rt]xmode.offloads; to keep same as offload API
defined in 17.11 to avoid upper application broken due to offload
API change.
PMD can use the info that input [rt]xconf->offloads only carry
the new added per-queue offloads to do some optimization or some
code change on base of this patch.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
2018-05-14 22:31:51 +01:00
Andrew Rybchenko
a9e0e6747d net/sfc/base: add Medford2 head-of-line blocking stats
These stats are availble on Medford2 DPDK firmware variant
which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE
capability bit is set when the stats are available.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-05-14 22:31:49 +01:00
Andrew Rybchenko
c928f7ca60 net/sfc/base: support RxDP scatter disabled truncate counter
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-05-14 22:31:49 +01:00
Andrew Rybchenko
7bbd316b69 net/sfc/base: generate Medford2 RxDP stats
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-05-14 22:31:49 +01:00
Andrew Rybchenko
af6c389328 net/sfc/base: fix Medford2 FEC stats range
Fixes: 400ba3daee ("net/sfc/base: decode Medford2 FEC stats if available")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-05-14 22:31:49 +01:00
Andrew Rybchenko
c8f24b8a9e net/sfc: rely on ethdev mapping of Tx offloads to TxQ flags
There is no necessity to fill in TxQ flags since ethdev maps
Tx offloads to TxQ flags on device info get for apps which are
not converted yet to Tx offloads API.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-05-14 22:26:36 +01:00
Roman Zhukov
5f78af5239 net/sfc: support MARK and FLAG actions in flow API
Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Roman Zhukov
cc70e8f207 net/sfc: make processing of flow rule actions more uniform
Prepare function that parse flow rule actions to support not
fate-deciding actions.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Roman Zhukov
0f22fe3a5c net/sfc/base: get max supported value for action MARK
The mark value for MATCH_ACTION_MARK has a maximum value.
Requesting a value larger than the maximum will cause the
filter insertion to fail with EINVAL. This patch allows the
driver to check the value at the filter validation.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Roman Zhukov
9a733758c0 net/sfc/base: support MARK and FLAG actions in filters
This patch adds support for DPDK rte_flow "MARK" and "FLAG" filter
actions to filters on EF10 family NICs.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Roman Zhukov
618869b815 net/sfc/base: get actions MARK and FLAG support
Filter actions MARK and FLAG are supported on Medford2 by DPDK
firmware variant.

Signed-off-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
26c4f60823 net/sfc: support flow marks in equal stride super-buffer Rx
Equal stride super-buffer Rx mode allows to mark packets in HW
using filters. Process the data on datapath and advertise
corresponding features to allow flow API support to implement it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
5a1ae82d7b net/sfc: add Rx descriptor wait timeout
Add device argument to customize Rx descriptor wait timeout which
is supported in DPDK firmware variant only in equal stride super-buffer
Rx mode only.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
6e899accd2 net/sfc: support DPDK firmware variant
DPDK firmware variant supports equal stride super-buffer Rx mode which
provides higher packet rate and packet marks but requires dedicated
mempool manager with contiguous object block allocation (e.g. bucket).

Also the firmware supports subvariant without checksumming on Tx which
allows to reach higher packet rates on transmit if checksumming is not
required.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:59 +01:00
Andrew Rybchenko
2a97a82b65 net/sfc: check mempool when equal stride super-buffer used
Equal stride super-buffer requires mempool with contiguous object
block allocation mechanism. Bucket mempool is the only which provides it.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
08d23c67ed net/sfc: support callback to check if mempool is supported
The callback is a dummy yet since no Rx datapath provides its own
callback, so all pools are supported.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
390f9b8d82 net/sfc: support equal stride super-buffer Rx mode
HW Rx descriptor represents many contiguous packet buffers which
follow each other. Number of buffers, stride and maximum DMA
length are setup-time configurable per Rx queue based on provided
mempool. The mempool must support contiguous block allocation and
get info API to retrieve number of objects in the block.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d101da1b9c net/sfc: allow to take mbuf pool into account when sizing
The new argument will be used by the equal stride super-buffer
Rx datapath.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d3ab4fd9bd net/sfc: allow one Rx queue entry carry many packet buffers
One HW Rx descriptor has many packet buffers in the case of equal
stride super-buffer Rx modes. Each packet buffer is still treated
as separate SW Rx descriptor. rxq_entries is the size of HW Rx ring
whereas nb_rx_desc is the number of SW Rx descriptors.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
7ee7e57c34 net/sfc: conditionally compile support for tunnel packets
Equal stride super-buffer Rx datapath does not support tunnels, code to
parse tunnel packet types and inner checksum offload is not required and
it is important to be able to compile it out on build time to avoid
extra CPU load.

Cutting of tunnels support relies on compiler optimizaitons to
be able to drop extra checks and branches if tun_ptype is always 0.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
c121f00836 net/sfc: move EF10 Rx event parser to shared header
Equal stride super-buffer Rx datapath will use it as well.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
a6539283b5 net/sfc: prepare EF10 Rx event parser to be reused
Equal stride super-buffer Rx mode will be handled by the dedicated
Rx datapath and the mode has almost the same Rx event structure as
single packet Rx mode.

Restructure the code to allow the common parts to be shared.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
a2443fdf8f net/sfc: factor out function to push Rx doorbell
The function may be shared by different Rx datapath implementations.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
9a5d5f1805 net/sfc/base: add equal stride super-buffer prefix layout
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
6f60cc4a78 net/sfc/base: support equal stride super-buffer Rx mode
Equal stride super-buffer Rx mode is supported by DPDK firmware
variant. One Rx descriptor provides many Rx buffers to firmware.
Rx buffers follow each other with specified stride.
Also it supports head of line blocking with timeout to address
drops when no Rx descriptors are available. So it gives extra time
to the driver to provide Rx descriptors before drop.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
6c9577bf24 net/sfc/base: detect equal stride super-buffer support
Equal stride super-buffer Rx mode is supported on Medford2 by
DPDK firmware variant.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
d4f4b8f9d2 net/sfc/base: make RxQ type data an union
The type is an internal interface. Single integer is insufficient
to carry RxQ type-specific information in the case of equal stride
super-buffer Rx mode (packet buffers per bucket, maximum DMA length,
packet stride, head of line block timeout).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
b8f96929b5 net/sfc/base: update autogenerated MCDI and TLV headers
Equal stride super-buffer is a new name instead of deprecated equal
stride packed stream to avoid confusion with previous packed stream.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:58 +01:00
Andrew Rybchenko
3cefef5491 net/sfc: do not use RSS context if it is not required
RSS action with only one destination queue and no specific settings
for hash types and key does not require dedicated RSS context and
may be simplified to QUEUE action.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
2018-04-27 18:00:57 +01:00
Andrew Rybchenko
c43e0f6904 net/sfc: ignore spec bits not covered by mask
mask is a simple bit-mask applied before interpreting the contents
of spec and last.

Fixes: a9825ccf5b ("net/sfc: support flow API filters")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
Reviewed-by: Roman Zhukov <roman.zhukov@oktetlabs.ru>
2018-04-27 18:00:57 +01:00
Ivan Malov
01764b20c2 net/sfc: convert to the advanced EFX RSS interface
The current code has the following drawbacks:
 - It is assumed that TCP 4-tuple hash is
   always supported, which is untrue in
   the case of packed stream FW variant.
 - The driver is unaware of UDP hash support
   available with latest firmware.

In order to cope with the mentioned issues, this
patch implements the new approach to handle hash
settings using the advanced EFX RSS interface.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
d1482e21f0 net/sfc: factor out RSS fields from adapter info
RSS handling will need more sophisticated fields
in the adapter context storage in future patches.
This patch groups existing fields in a dedicated
structure and updates the rest of the code.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
5e23c24988 net/sfc: remove conditional compilation for RSS
RSS is one of the most valuable features in the
driver, and one would hardly need to disable it
at build time. This patch withdraws unnecessary
conditionals for RSS snippets.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
7803554a9e net/sfc: process RSS settings on Rx configure step
One may submit advanced RSS settings as part of
rte_eth_conf to customise RSS configuration from
the very beginning. Currently the driver does not
check that piece of settings and proceeds with
default choices for RSS hash functions and RSS key.

This patch implements the required processing.

Fixes: 4ec1fc3ba8 ("net/sfc: add basic stubs for RSS support on driver attach")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
3c97590830 net/sfc/base: honour packed stream RSS restriction
Packed stream firmware variant on EF10 adapters has a
number of properties which must be taken into account:

 - Only one exclusive RSS context is available per port.
 - Only IP addresses can contribute to the hash value.

Huntington and Medford have one more limitation which
is important for the drivers capable of packed stream:

 - Hash algorithm is non-standard (i.e. non-Toeplitz).
   This implies XORing together source + destination
   IP addresses (or last four bytes in the case of IPv6)
   and using the result as the input to a Toeplitz hash.

This patch provides a number of improvements in order
to treat the mentioned limitations in the common code.

If the firmware variant is packed stream, the list of
supported hash tuples will include less variants, and
the maximum number of RSS contexts will be set to one.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
7a1ab3f8db net/sfc/base: support more RSS hash configurations
Modern firmwares on EF10 adapters have support for
more traffic classes eligible for hash computation.
Also, it has become possible to adjust hashing per
individual class and select distinct packet fields
which will be able to contribute to the hash value.

This patch adds support for the mentioned features.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Ivan Malov
613cbe75ae net/sfc/base: add a new means to control RSS hash
Currently, libefx has no support for additional RSS modes
available with later controllers. In order to support this,
libefx should be able to list available hash configurations.

This patch provides basic infrastructure for the new interface.
The client drivers will be able to query the list of supported
hash configurations for a particular hash algorithm. Also, it
will be possible to configure hashing by means of new definitions.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Andrew Rybchenko
eff7d1d2dc net/sfc/base: cope with clang warning on negative shift
clang 4.0.1-6 on Ubuntu generates false positive warning that shift
is negative.  It is done regardless of the fact that the branch is
not taken because of previous check.

The warning is generate in EFX_INSERT_NATIVE32 used by
EFX_INSERT_FIELD_NATIVE32. All similar cases are fixed as well.

It is undesirable to suppress the warning completely.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:55 +01:00
Adrien Mazarguil
76e9a55b5b ethdev: add transfer attribute to flow API
This new attribute enables applications to create flow rules that do not
simply match traffic whose origin is specified in the pattern (e.g. some
non-default physical port or VF), but actively affect it by applying the
flow rule at the lowest possible level in the underlying device.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
e58638c324 ethdev: fix TPID handling in flow API
TPID handling in rte_flow VLAN and E_TAG pattern item definitions is not
consistent with the normal stacking order of pattern items, which is
confusing to applications.

Problem is that when followed by one of these layers, the EtherType field
of the preceding layer keeps its "inner" definition, and the "outer" TPID
is provided by the subsequent layer, the reverse of how a packet looks like
on the wire:

 Wire:     [ ETH TPID = A | VLAN EtherType = B | B DATA ]
 rte_flow: [ ETH EtherType = B | VLAN TPID = A | B DATA ]

Worse, when QinQ is involved, the stacking order of VLAN layers is
unspecified. It is unclear whether it should be reversed (innermost to
outermost) as well given TPID applies to the previous layer:

 Wire:       [ ETH TPID = A | VLAN TPID = B | VLAN EtherType = C | C DATA ]
 rte_flow 1: [ ETH EtherType = C | VLAN TPID = B | VLAN TPID = A | C DATA ]
 rte_flow 2: [ ETH EtherType = C | VLAN TPID = A | VLAN TPID = B | C DATA ]

While specifying EtherType/TPID is hopefully rarely necessary, the stacking
order in case of QinQ and the lack of documentation remain an issue.

This patch replaces TPID in the VLAN pattern item with an inner
EtherType/TPID as is usually done everywhere else (e.g. struct vlan_hdr),
clarifies documentation and updates all relevant code.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Summary of changes for PMDs that implement ETH, VLAN or E_TAG pattern
items:

- bnxt: EtherType matching is supported with and without VLAN, but TPID
  matching is not and triggers an error.

- e1000: EtherType matching is only supported with the ETHERTYPE filter,
  which does not support VLAN matching, therefore no impact.

- enic: same as bnxt.

- i40e: same as bnxt with existing FDIR limitations on allowed EtherType
  values. The remaining filter types (VXLAN, NVGRE, QINQ) do not support
  EtherType matching.

- ixgbe: same as e1000, with additional minor change to rely on the new
  E-Tag macro definition.

- mlx4: EtherType/TPID matching is not supported, no impact.

- mlx5: same as bnxt.

- mvpp2: same as bnxt.

- sfc: same as bnxt.

- tap: same as bnxt.

Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")
Fixes: 99e7003831 ("net/ixgbe: parse L2 tunnel filter")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
18aee2861a ethdev: add encap level to RSS flow API action
RSS hash types (ETH_RSS_* macros defined in rte_ethdev.h) describe the
protocol header fields of a packet that must be taken into account while
computing RSS.

When facing encapsulated (e.g. tunneled) packets, there is an ambiguity as
to whether these should apply to inner or outer packets. Applications need
the ability to tell exactly "where" RSS must be performed.

This is addressed by adding encapsulation level information to the RSS flow
action. Its default value is 0 and stands for the usual unspecified
behavior. Other values provide a specific encapsulation level.

Contrary to the change announced by commit 676b605182 ("doc: announce
ethdev API change for RSS configuration"), this patch does not affect
struct rte_eth_rss_conf but struct rte_flow_action_rss as the former is not
used anymore by the RSS flow action. ABI impact is therefore limited to
rte_flow.

This breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
929e331934 ethdev: add hash function to RSS flow API action
By definition, RSS involves some kind of hash algorithm, usually Toeplitz.

Until now it could not be modified on a flow rule basis and PMDs had to
always assume RTE_ETH_HASH_FUNCTION_DEFAULT, which remains the default
behavior when unspecified (0).

This breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:54 +01:00
Adrien Mazarguil
ac8d22de23 ethdev: flatten RSS configuration in flow API
Since its inception, the rte_flow RSS action has been relying in part on
external struct rte_eth_rss_conf for compatibility with the legacy RSS API.
This structure lacks parameters such as the hash algorithm to use, and more
recently, a method to tell which layer RSS should be performed on [1].

Given struct rte_eth_rss_conf will never be flexible enough to represent a
complete RSS configuration (e.g. RETA table), this patch supersedes it by
extending the rte_flow RSS action directly.

A subsequent patch will add a field to use a non-default RSS hash
algorithm. To that end, a field named "types" replaces the field formerly
known as "rss_hf" and standing for "RSS hash functions" as it was
confusing. Actual RSS hash function types are defined by enum
rte_eth_hash_function.

This patch updates all PMDs and example applications accordingly.

It breaks ABI compatibility for the following public functions:

- rte_flow_copy()
- rte_flow_create()
- rte_flow_query()
- rte_flow_validate()

[1] commit 676b605182 ("doc: announce ethdev API change for RSS
    configuration")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:53 +01:00
Adrien Mazarguil
cc17feb904 ethdev: alter behavior of flow API actions
This patch makes the following changes to flow rule actions:

- List order now matters, they are redefined as performed first to last
  instead of "all simultaneously".

- Repeated actions are now supported (e.g. specifying QUEUE multiple times
  now duplicates traffic among them). Previously only the last action of
  any given kind was taken into account.

- No more distinction between terminating/non-terminating/meta actions.
  Flow rules themselves are now defined as always terminating unless a
  PASSTHRU action is specified.

These changes alter the behavior of flow rules in corner cases in order to
prepare the flow API for actions that modify traffic contents or properties
(e.g. encapsulation, compression) and for which order matter when combined.

Previously one would have to do so through multiple flow rules by combining
PASSTRHU with priority levels, however this proved overly complex to
implement at the PMD level, hence this simpler approach.

This breaks ABI compatibility for the following public functions:

- rte_flow_create()
- rte_flow_validate()

PMDs with rte_flow support are modified accordingly:

- bnxt: no change, implementation already forbids multiple actions and does
  not support PASSTHRU.

- e1000: no change, same as bnxt.

- enic: modified to forbid redundant actions, no support for default drop.

- failsafe: no change needed.

- i40e: no change, implementation already forbids multiple actions.

- ixgbe: same as i40e.

- mlx4: modified to forbid multiple fate-deciding actions and drop when
  unspecified.

- mlx5: same as mlx4, with other redundant actions also forbidden.

- sfc: same as mlx4.

- tap: implementation already complies with the new behavior except for
  the default pass-through modified as a default drop.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 18:00:53 +01:00
Ivan Malov
00b94c1c21 net/sfc: add missing Rx fini on RSS setup fail path
Fixes: 4ec1fc3ba8 ("net/sfc: add basic stubs for RSS support on driver attach")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-04-27 15:54:55 +01:00