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

eth: lan743x: migrate to new RXFH callbacks

Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").
This driver's RXFH config is read only / fixed so the conversion
is purely factoring out the handling into a helper.

Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20250614180638.4166766-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+19 -12
+19 -12
drivers/net/ethernet/microchip/lan743x_ethtool.c
··· 913 913 } 914 914 } 915 915 916 + static int lan743x_ethtool_get_rxfh_fields(struct net_device *netdev, 917 + struct ethtool_rxfh_fields *fields) 918 + { 919 + fields->data = 0; 920 + 921 + switch (fields->flow_type) { 922 + case TCP_V4_FLOW:case UDP_V4_FLOW: 923 + case TCP_V6_FLOW:case UDP_V6_FLOW: 924 + fields->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; 925 + fallthrough; 926 + case IPV4_FLOW: case IPV6_FLOW: 927 + fields->data |= RXH_IP_SRC | RXH_IP_DST; 928 + return 0; 929 + } 930 + 931 + return 0; 932 + } 933 + 916 934 static int lan743x_ethtool_get_rxnfc(struct net_device *netdev, 917 935 struct ethtool_rxnfc *rxnfc, 918 936 u32 *rule_locs) 919 937 { 920 938 switch (rxnfc->cmd) { 921 - case ETHTOOL_GRXFH: 922 - rxnfc->data = 0; 923 - switch (rxnfc->flow_type) { 924 - case TCP_V4_FLOW:case UDP_V4_FLOW: 925 - case TCP_V6_FLOW:case UDP_V6_FLOW: 926 - rxnfc->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; 927 - fallthrough; 928 - case IPV4_FLOW: case IPV6_FLOW: 929 - rxnfc->data |= RXH_IP_SRC | RXH_IP_DST; 930 - return 0; 931 - } 932 - break; 933 939 case ETHTOOL_GRXRINGS: 934 940 rxnfc->data = LAN743X_USED_RX_CHANNELS; 935 941 return 0; ··· 1374 1368 .get_rxfh_indir_size = lan743x_ethtool_get_rxfh_indir_size, 1375 1369 .get_rxfh = lan743x_ethtool_get_rxfh, 1376 1370 .set_rxfh = lan743x_ethtool_set_rxfh, 1371 + .get_rxfh_fields = lan743x_ethtool_get_rxfh_fields, 1377 1372 .get_ts_info = lan743x_ethtool_get_ts_info, 1378 1373 .get_eee = lan743x_ethtool_get_eee, 1379 1374 .set_eee = lan743x_ethtool_set_eee,