]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
eth: igc: migrate to new RXFH callbacks
authorJakub Kicinski <kuba@kernel.org>
Sat, 14 Jun 2025 18:09:02 +0000 (11:09 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 17 Jun 2025 01:14:52 +0000 (18:14 -0700)
Migrate to new callbacks added by commit 9bb00786fc61 ("net: ethtool:
add dedicated callbacks for getting and setting rxfh fields").

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250614180907.4167714-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/igc/igc_ethtool.c

index 3fc1eded9605ff8fe0e1f2a4ef683905a57914e3..e6cac8d4b862c7ca9cc16f9d220e0bdc06c9c5da 100644 (file)
@@ -1045,9 +1045,11 @@ static int igc_ethtool_get_nfc_rules(struct igc_adapter *adapter,
        return 0;
 }
 
-static int igc_ethtool_get_rss_hash_opts(struct igc_adapter *adapter,
-                                        struct ethtool_rxnfc *cmd)
+static int igc_ethtool_get_rxfh_fields(struct net_device *dev,
+                                      struct ethtool_rxfh_fields *cmd)
 {
+       struct igc_adapter *adapter = netdev_priv(dev);
+
        cmd->data = 0;
 
        /* Report default options for RSS on igc */
@@ -1103,8 +1105,6 @@ static int igc_ethtool_get_rxnfc(struct net_device *dev,
                return igc_ethtool_get_nfc_rule(adapter, cmd);
        case ETHTOOL_GRXCLSRLALL:
                return igc_ethtool_get_nfc_rules(adapter, cmd, rule_locs);
-       case ETHTOOL_GRXFH:
-               return igc_ethtool_get_rss_hash_opts(adapter, cmd);
        default:
                return -EOPNOTSUPP;
        }
@@ -1112,9 +1112,11 @@ static int igc_ethtool_get_rxnfc(struct net_device *dev,
 
 #define UDP_RSS_FLAGS (IGC_FLAG_RSS_FIELD_IPV4_UDP | \
                       IGC_FLAG_RSS_FIELD_IPV6_UDP)
-static int igc_ethtool_set_rss_hash_opt(struct igc_adapter *adapter,
-                                       struct ethtool_rxnfc *nfc)
+static int igc_ethtool_set_rxfh_fields(struct net_device *dev,
+                                      const struct ethtool_rxfh_fields *nfc,
+                                      struct netlink_ext_ack *extack)
 {
+       struct igc_adapter *adapter = netdev_priv(dev);
        u32 flags = adapter->flags;
 
        /* RSS does not support anything other than hashing
@@ -1425,8 +1427,6 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev,
        struct igc_adapter *adapter = netdev_priv(dev);
 
        switch (cmd->cmd) {
-       case ETHTOOL_SRXFH:
-               return igc_ethtool_set_rss_hash_opt(adapter, cmd);
        case ETHTOOL_SRXCLSRLINS:
                return igc_ethtool_add_nfc_rule(adapter, cmd);
        case ETHTOOL_SRXCLSRLDEL:
@@ -2144,6 +2144,8 @@ static const struct ethtool_ops igc_ethtool_ops = {
        .get_rxfh_indir_size    = igc_ethtool_get_rxfh_indir_size,
        .get_rxfh               = igc_ethtool_get_rxfh,
        .set_rxfh               = igc_ethtool_set_rxfh,
+       .get_rxfh_fields        = igc_ethtool_get_rxfh_fields,
+       .set_rxfh_fields        = igc_ethtool_set_rxfh_fields,
        .get_ts_info            = igc_ethtool_get_ts_info,
        .get_channels           = igc_ethtool_get_channels,
        .set_channels           = igc_ethtool_set_channels,