]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
eth: sxgbe: migrate to new RXFH callbacks
authorJakub Kicinski <kuba@kernel.org>
Tue, 17 Jun 2025 01:48:48 +0000 (18:48 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Jun 2025 20:19:01 +0000 (13:19 -0700)
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

RXFH is all this driver supports in RXNFC so old callbacks are
completely removed.

Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20250617014848.436741-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.c

index 4a439b34114df83f344a55049b9b0cc4fc2d1cab..ad73733644f95b3397e82bf059417b5d97dd3551 100644 (file)
@@ -308,8 +308,8 @@ static int sxgbe_set_coalesce(struct net_device *dev,
        return 0;
 }
 
-static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,
-                                  struct ethtool_rxnfc *cmd)
+static int sxgbe_get_rxfh_fields(struct net_device *dev,
+                                struct ethtool_rxfh_fields *cmd)
 {
        cmd->data = 0;
 
@@ -344,26 +344,11 @@ static int sxgbe_get_rss_hash_opts(struct sxgbe_priv_data *priv,
        return 0;
 }
 
-static int sxgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
-                          u32 *rule_locs)
+static int sxgbe_set_rxfh_fields(struct net_device *dev,
+                                const struct ethtool_rxfh_fields *cmd,
+                                struct netlink_ext_ack *extack)
 {
        struct sxgbe_priv_data *priv = netdev_priv(dev);
-       int ret = -EOPNOTSUPP;
-
-       switch (cmd->cmd) {
-       case ETHTOOL_GRXFH:
-               ret = sxgbe_get_rss_hash_opts(priv, cmd);
-               break;
-       default:
-               break;
-       }
-
-       return ret;
-}
-
-static int sxgbe_set_rss_hash_opt(struct sxgbe_priv_data *priv,
-                                 struct ethtool_rxnfc *cmd)
-{
        u32 reg_val = 0;
 
        /* RSS does not support anything other than hashing
@@ -421,22 +406,6 @@ static int sxgbe_set_rss_hash_opt(struct sxgbe_priv_data *priv,
        return 0;
 }
 
-static int sxgbe_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
-{
-       struct sxgbe_priv_data *priv = netdev_priv(dev);
-       int ret = -EOPNOTSUPP;
-
-       switch (cmd->cmd) {
-       case ETHTOOL_SRXFH:
-               ret = sxgbe_set_rss_hash_opt(priv, cmd);
-               break;
-       default:
-               break;
-       }
-
-       return ret;
-}
-
 static void sxgbe_get_regs(struct net_device *dev,
                           struct ethtool_regs *regs, void *space)
 {
@@ -489,8 +458,8 @@ static const struct ethtool_ops sxgbe_ethtool_ops = {
        .get_channels = sxgbe_get_channels,
        .get_coalesce = sxgbe_get_coalesce,
        .set_coalesce = sxgbe_set_coalesce,
-       .get_rxnfc = sxgbe_get_rxnfc,
-       .set_rxnfc = sxgbe_set_rxnfc,
+       .get_rxfh_fields = sxgbe_get_rxfh_fields,
+       .set_rxfh_fields = sxgbe_set_rxfh_fields,
        .get_regs = sxgbe_get_regs,
        .get_regs_len = sxgbe_get_regs_len,
        .get_eee = sxgbe_get_eee,