Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sfc: falcon: refactor and document ef4_ethtool_get_rxfh_fields

The code had some rather odd control flow inherited from when it was
shared with siena and ef10 before this driver was split out.
Simplify that for easier reading.
Also add a comment explaining why we return the values we do, since
some Falcon documents and datasheets confusingly mention the part
supporting 4-tuple UDP hashing.
(I couldn't find any record of exactly what was "broken" about the
original Falcon A hash, I'm just trusting that falcon_init_rx_cfg()
had a good reason for not using it.)

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250710173213.1638397-1-edward.cree@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Edward Cree and committed by
Jakub Kicinski
4159a55f f45b45cb

+8 -4
+8 -4
drivers/net/ethernet/sfc/falcon/ethtool.c
··· 948 948 struct ethtool_rxfh_fields *info) 949 949 { 950 950 struct ef4_nic *efx = netdev_priv(net_dev); 951 - unsigned int min_revision = 0; 952 951 953 952 info->data = 0; 953 + /* Falcon A0 and A1 had a 4-tuple hash for TCP and UDP, but it was 954 + * broken so we do not enable it. 955 + * Falcon B0 adds a Toeplitz hash, 4-tuple for TCP and 2-tuple for 956 + * other IPv4, including UDP. 957 + * See falcon_init_rx_cfg(). 958 + */ 959 + if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0) 960 + return 0; 954 961 switch (info->flow_type) { 955 962 case TCP_V4_FLOW: 956 963 info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; ··· 967 960 case AH_ESP_V4_FLOW: 968 961 case IPV4_FLOW: 969 962 info->data |= RXH_IP_SRC | RXH_IP_DST; 970 - min_revision = EF4_REV_FALCON_B0; 971 963 break; 972 964 default: 973 965 break; 974 966 } 975 - if (ef4_nic_rev(efx) < min_revision) 976 - info->data = 0; 977 967 return 0; 978 968 } 979 969