]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
eth: enetc: migrate to new RXFH callbacks
authorJakub Kicinski <kuba@kernel.org>
Sat, 14 Jun 2025 18:06:38 +0000 (11:06 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Jun 2025 01:14:26 +0000 (18:14 -0700)
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 trivial.

Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20250614180638.4166766-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

index d38cd36be4a658a5c373caf5596614fda228184e..2e5cef646741a497d5578ee4faea5d7e4194029c 100644 (file)
@@ -467,7 +467,8 @@ static void enetc_get_rmon_stats(struct net_device *ndev,
 #define ENETC_RSSHASH_L3 (RXH_L2DA | RXH_VLAN | RXH_L3_PROTO | RXH_IP_SRC | \
                          RXH_IP_DST)
 #define ENETC_RSSHASH_L4 (ENETC_RSSHASH_L3 | RXH_L4_B_0_1 | RXH_L4_B_2_3)
-static int enetc_get_rsshash(struct ethtool_rxnfc *rxnfc)
+static int enetc_get_rxfh_fields(struct net_device *netdev,
+                                struct ethtool_rxfh_fields *rxnfc)
 {
        static const u32 rsshash[] = {
                        [TCP_V4_FLOW]    = ENETC_RSSHASH_L4,
@@ -584,9 +585,6 @@ static int enetc_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc,
        case ETHTOOL_GRXRINGS:
                rxnfc->data = priv->num_rx_rings;
                break;
-       case ETHTOOL_GRXFH:
-               /* get RSS hash config */
-               return enetc_get_rsshash(rxnfc);
        case ETHTOOL_GRXCLSRLCNT:
                /* total number of entries */
                rxnfc->data = priv->si->num_fs_entries;
@@ -639,8 +637,6 @@ static int enetc4_get_rxnfc(struct net_device *ndev, struct ethtool_rxnfc *rxnfc
        case ETHTOOL_GRXRINGS:
                rxnfc->data = priv->num_rx_rings;
                break;
-       case ETHTOOL_GRXFH:
-               return enetc_get_rsshash(rxnfc);
        default:
                return -EOPNOTSUPP;
        }
@@ -1228,6 +1224,7 @@ const struct ethtool_ops enetc_pf_ethtool_ops = {
        .get_rxfh_indir_size = enetc_get_rxfh_indir_size,
        .get_rxfh = enetc_get_rxfh,
        .set_rxfh = enetc_set_rxfh,
+       .get_rxfh_fields = enetc_get_rxfh_fields,
        .get_ringparam = enetc_get_ringparam,
        .get_coalesce = enetc_get_coalesce,
        .set_coalesce = enetc_set_coalesce,
@@ -1258,6 +1255,7 @@ const struct ethtool_ops enetc_vf_ethtool_ops = {
        .get_rxfh_indir_size = enetc_get_rxfh_indir_size,
        .get_rxfh = enetc_get_rxfh,
        .set_rxfh = enetc_set_rxfh,
+       .get_rxfh_fields = enetc_get_rxfh_fields,
        .get_ringparam = enetc_get_ringparam,
        .get_coalesce = enetc_get_coalesce,
        .set_coalesce = enetc_set_coalesce,
@@ -1284,6 +1282,7 @@ const struct ethtool_ops enetc4_pf_ethtool_ops = {
        .get_rxfh_indir_size = enetc_get_rxfh_indir_size,
        .get_rxfh = enetc_get_rxfh,
        .set_rxfh = enetc_set_rxfh,
+       .get_rxfh_fields = enetc_get_rxfh_fields,
 };
 
 void enetc_set_ethtool_ops(struct net_device *ndev)