linux-stable/drivers/net/ethernet/intel/igc
Jesper Dangaard Brouer 84214ab468 igc: Enable and fix RX hash usage by netstack
When function igc_rx_hash() was introduced in v4.20 via commit 0507ef8a03
("igc: Add transmit and receive fastpath and interrupt handlers"), the
hardware wasn't configured to provide RSS hash, thus it made sense to not
enable net_device NETIF_F_RXHASH feature bit.

The NIC hardware was configured to enable RSS hash info in v5.2 via commit
2121c2712f ("igc: Add multiple receive queues control supporting"), but
forgot to set the NETIF_F_RXHASH feature bit.

The original implementation of igc_rx_hash() didn't extract the associated
pkt_hash_type, but statically set PKT_HASH_TYPE_L3. The largest portions of
this patch are about extracting the RSS Type from the hardware and mapping
this to enum pkt_hash_types. This was based on Foxville i225 software user
manual rev-1.3.1 and tested on Intel Ethernet Controller I225-LM (rev 03).

For UDP it's worth noting that RSS (type) hashing have been disabled both for
IPv4 and IPv6 (see IGC_MRQC_RSS_FIELD_IPV4_UDP + IGC_MRQC_RSS_FIELD_IPV6_UDP)
because hardware RSS doesn't handle fragmented pkts well when enabled (can
cause out-of-order). This results in PKT_HASH_TYPE_L3 for UDP packets, and
hash value doesn't include UDP port numbers. Not being PKT_HASH_TYPE_L4, have
the effect that netstack will do a software based hash calc calling into
flow_dissect, but only when code calls skb_get_hash(), which doesn't
necessary happen for local delivery.

For QA verification testing I wrote a small bpftrace prog:
 [0] https://github.com/xdp-project/xdp-project/blob/master/areas/hints/monitor_skb_hash_on_dev.bt

Fixes: 2121c2712f ("igc: Add multiple receive queues control supporting")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Yoong Siang <yoong.siang.song@intel.com>
Link: https://lore.kernel.org/bpf/168182464270.616355.11391652654430626584.stgit@firesoul
2023-04-27 18:42:19 +02:00
..
igc.h igc: Enable and fix RX hash usage by netstack 2023-04-27 18:42:19 +02:00
igc_base.c igc: remove I226 Qbv BaseTime restriction 2023-01-03 09:35:37 -08:00
igc_base.h igc: remove I226 Qbv BaseTime restriction 2023-01-03 09:35:37 -08:00
igc_defines.h igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_diag.c
igc_diag.h
igc_dump.c igb/igc: use strongly typed pointer 2021-05-26 09:11:41 -07:00
igc_ethtool.c igc: Add qbv_config_change_errors counter 2023-03-07 13:45:56 -08:00
igc_hw.h igc: offload queue max SDU from tc-taprio 2023-03-07 13:45:56 -08:00
igc_i225.c igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_i225.h
igc_mac.c intel/igc:fix repeated words in comments 2022-06-30 11:06:23 -07:00
igc_mac.h
igc_main.c igc: Enable and fix RX hash usage by netstack 2023-04-27 18:42:19 +02:00
igc_nvm.c
igc_nvm.h
igc_phy.c igc: Change type of the 'igc_check_downshift' method 2022-05-10 14:02:53 -07:00
igc_phy.h igc: Change type of the 'igc_check_downshift' method 2022-05-10 14:02:53 -07:00
igc_ptp.c igc: return an error if the mac type is unknown in igc_ptp_systim_to_hwtstamp() 2023-02-01 21:19:57 -08:00
igc_regs.h igc: Remove obsolete DMA coalescing code 2023-03-21 11:37:16 -07:00
igc_tsn.c igc: Add qbv_config_change_errors counter 2023-03-07 13:45:56 -08:00
igc_tsn.h igc: Remove reset adapter task for i226 during disable tsn config 2023-01-03 09:36:25 -08:00
igc_xdp.c drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00
igc_xdp.h igc: Enable RX via AF_XDP zero-copy 2021-05-20 10:21:42 -07:00
Makefile igc: Add initial XDP support 2021-03-29 09:09:53 -07:00