mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
eth: sfc: falcon: migrate to new RXFH callbacks
Migrate to new callbacks added by commit 9bb00786fc ("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: Edward Cree <ecree.xilinx@gmail.com>
Link: https://patch.msgid.link/20250618203823.1336156-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
4922ca773d
commit
80ec96cb24
|
|
@ -943,6 +943,33 @@ static int ef4_ethtool_get_class_rule(struct ef4_nic *efx,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
ef4_ethtool_get_rxfh_fields(struct net_device *net_dev,
|
||||
struct ethtool_rxfh_fields *info)
|
||||
{
|
||||
struct ef4_nic *efx = netdev_priv(net_dev);
|
||||
unsigned int min_revision = 0;
|
||||
|
||||
info->data = 0;
|
||||
switch (info->flow_type) {
|
||||
case TCP_V4_FLOW:
|
||||
info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
||||
fallthrough;
|
||||
case UDP_V4_FLOW:
|
||||
case SCTP_V4_FLOW:
|
||||
case AH_ESP_V4_FLOW:
|
||||
case IPV4_FLOW:
|
||||
info->data |= RXH_IP_SRC | RXH_IP_DST;
|
||||
min_revision = EF4_REV_FALCON_B0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (ef4_nic_rev(efx) < min_revision)
|
||||
info->data = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
ef4_ethtool_get_rxnfc(struct net_device *net_dev,
|
||||
struct ethtool_rxnfc *info, u32 *rule_locs)
|
||||
|
|
@ -954,29 +981,6 @@ ef4_ethtool_get_rxnfc(struct net_device *net_dev,
|
|||
info->data = efx->n_rx_channels;
|
||||
return 0;
|
||||
|
||||
case ETHTOOL_GRXFH: {
|
||||
unsigned min_revision = 0;
|
||||
|
||||
info->data = 0;
|
||||
switch (info->flow_type) {
|
||||
case TCP_V4_FLOW:
|
||||
info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
|
||||
fallthrough;
|
||||
case UDP_V4_FLOW:
|
||||
case SCTP_V4_FLOW:
|
||||
case AH_ESP_V4_FLOW:
|
||||
case IPV4_FLOW:
|
||||
info->data |= RXH_IP_SRC | RXH_IP_DST;
|
||||
min_revision = EF4_REV_FALCON_B0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (ef4_nic_rev(efx) < min_revision)
|
||||
info->data = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
case ETHTOOL_GRXCLSRLCNT:
|
||||
info->data = ef4_filter_get_rx_id_limit(efx);
|
||||
if (info->data == 0)
|
||||
|
|
@ -1343,6 +1347,7 @@ const struct ethtool_ops ef4_ethtool_ops = {
|
|||
.get_rxfh_indir_size = ef4_ethtool_get_rxfh_indir_size,
|
||||
.get_rxfh = ef4_ethtool_get_rxfh,
|
||||
.set_rxfh = ef4_ethtool_set_rxfh,
|
||||
.get_rxfh_fields = ef4_ethtool_get_rxfh_fields,
|
||||
.get_module_info = ef4_ethtool_get_module_info,
|
||||
.get_module_eeprom = ef4_ethtool_get_module_eeprom,
|
||||
.get_link_ksettings = ef4_ethtool_get_link_ksettings,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user