numam-dpdk/drivers/net
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
..
af_packet ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
ark net/ark: use SPDX tags 2018-07-04 21:21:31 +02:00
avf ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
avp ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
axgbe ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
bnx2x net/bnx2x: move SPDX tags to source files 2018-08-03 17:08:39 +02:00
bnxt ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
bonding net/bonding: do not ignore RSS key on device config 2018-09-14 20:08:41 +02:00
cxgbe ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
dpaa drivers/net: remove double assignment of driver 2018-09-28 18:02:49 +02:00
dpaa2 drivers/net: remove double assignment of driver 2018-09-28 18:02:49 +02:00
e1000 net/*/base: allow use of experimental APIs in base code 2018-09-28 01:41:01 +02:00
ena remove useless constructor headers 2018-07-12 00:00:35 +02:00
enic ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
failsafe net/failsafe: support runtime Tx queues setup 2018-09-28 01:41:02 +02:00
fm10k net/*/base: allow use of experimental APIs in base code 2018-09-28 01:41:01 +02:00
i40e net/*/base: allow use of experimental APIs in base code 2018-09-28 01:41:01 +02:00
ifc net/ifc: support live migration 2018-09-28 01:41:02 +02:00
ixgbe net/ixgbe: check firmware status at init 2018-09-28 01:41:02 +02:00
kni ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
liquidio remove useless constructor headers 2018-07-12 00:00:35 +02:00
mlx4 net/mlx4: support meson build 2018-09-28 01:41:01 +02:00
mlx5 net/mlx5: add bluefield VF support 2018-09-28 01:41:01 +02:00
mvpp2 ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
netvsc net/netvsc: support integrated VF 2018-09-14 20:08:41 +02:00
nfp net/nfp: fix mbuf flags with checksum good 2018-09-28 01:41:01 +02:00
null ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
octeontx net/*/base: allow use of experimental APIs in base code 2018-09-28 01:41:01 +02:00
pcap net/pcap: generate unique MAC addresses for interfaces 2018-09-28 01:41:02 +02:00
qede net/qede: support device reset 2018-09-28 01:41:01 +02:00
ring ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
sfc net/sfc/base: improve handling of legacy RSS hash flags 2018-09-28 01:41:02 +02:00
softnic ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
szedata2 ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
tap net/tap: add in meson build 2018-09-18 22:48:49 +02:00
thunderx net/*/base: allow use of experimental APIs in base code 2018-09-28 01:41:01 +02:00
vdev_netvsc net/vdev_netvsc: add in meson build 2018-09-18 22:49:39 +02:00
vhost ethdev: make default behavior CRC strip on Rx 2018-09-14 20:08:41 +02:00
virtio net/virtio-user: fix memory hotplug support in vhost-kernel 2018-09-28 01:41:01 +02:00
vmxnet3 net/vmxnet3: support stats reset 2018-09-28 01:41:02 +02:00
Makefile net/netvsc: add Hyper-V network device 2018-07-13 23:48:07 +02:00
meson.build net/mlx4: support meson build 2018-09-28 01:41:01 +02:00