]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ixgbe: create E610 specific ethtool_ops structure
authorJedrzej Jagielski <jedrzej.jagielski@intel.com>
Mon, 3 Mar 2025 12:06:27 +0000 (13:06 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 29 Apr 2025 22:13:43 +0000 (15:13 -0700)
E610's implementation of various ethtool ops is different than
the ones corresponding to ixgbe legacy products. Therefore create
separate E610 ethtool_ops struct which will be filled out in the
forthcoming patches.

Add adequate ops struct basing on MAC type. This step requires
changing a bit the flow of probing by placing ixgbe_set_ethtool_ops
after hw.mac.type is assigned. So move the whole netdev assignment
block after hw.mac.type is known. This step doesn't have any additional
impact on probing sequence.

Suggested-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Bharath R <bharath.r@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index c86103eccc8aa372ff26247f6f9682c0fae2f7c1..83d9ee3941e583c1a7823729d283ffd7d96add92 100644 (file)
@@ -3650,7 +3650,57 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
        .set_link_ksettings     = ixgbe_set_link_ksettings,
 };
 
+static const struct ethtool_ops ixgbe_ethtool_ops_e610 = {
+       .supported_coalesce_params = ETHTOOL_COALESCE_USECS,
+       .get_drvinfo            = ixgbe_get_drvinfo,
+       .get_regs_len           = ixgbe_get_regs_len,
+       .get_regs               = ixgbe_get_regs,
+       .get_wol                = ixgbe_get_wol,
+       .set_wol                = ixgbe_set_wol,
+       .nway_reset             = ixgbe_nway_reset,
+       .get_link               = ethtool_op_get_link,
+       .get_eeprom_len         = ixgbe_get_eeprom_len,
+       .get_eeprom             = ixgbe_get_eeprom,
+       .set_eeprom             = ixgbe_set_eeprom,
+       .get_ringparam          = ixgbe_get_ringparam,
+       .set_ringparam          = ixgbe_set_ringparam,
+       .get_pause_stats        = ixgbe_get_pause_stats,
+       .get_pauseparam         = ixgbe_get_pauseparam,
+       .set_pauseparam         = ixgbe_set_pauseparam,
+       .get_msglevel           = ixgbe_get_msglevel,
+       .set_msglevel           = ixgbe_set_msglevel,
+       .self_test              = ixgbe_diag_test,
+       .get_strings            = ixgbe_get_strings,
+       .set_phys_id            = ixgbe_set_phys_id,
+       .get_sset_count         = ixgbe_get_sset_count,
+       .get_ethtool_stats      = ixgbe_get_ethtool_stats,
+       .get_coalesce           = ixgbe_get_coalesce,
+       .set_coalesce           = ixgbe_set_coalesce,
+       .get_rxnfc              = ixgbe_get_rxnfc,
+       .set_rxnfc              = ixgbe_set_rxnfc,
+       .get_rxfh_indir_size    = ixgbe_rss_indir_size,
+       .get_rxfh_key_size      = ixgbe_get_rxfh_key_size,
+       .get_rxfh               = ixgbe_get_rxfh,
+       .set_rxfh               = ixgbe_set_rxfh,
+       .get_eee                = ixgbe_get_eee,
+       .set_eee                = ixgbe_set_eee,
+       .get_channels           = ixgbe_get_channels,
+       .set_channels           = ixgbe_set_channels,
+       .get_priv_flags         = ixgbe_get_priv_flags,
+       .set_priv_flags         = ixgbe_set_priv_flags,
+       .get_ts_info            = ixgbe_get_ts_info,
+       .get_module_info        = ixgbe_get_module_info,
+       .get_module_eeprom      = ixgbe_get_module_eeprom,
+       .get_link_ksettings     = ixgbe_get_link_ksettings,
+       .set_link_ksettings     = ixgbe_set_link_ksettings,
+};
+
 void ixgbe_set_ethtool_ops(struct net_device *netdev)
 {
-       netdev->ethtool_ops = &ixgbe_ethtool_ops;
+       struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
+
+       if (adapter->hw.mac.type == ixgbe_mac_e610)
+               netdev->ethtool_ops = &ixgbe_ethtool_ops_e610;
+       else
+               netdev->ethtool_ops = &ixgbe_ethtool_ops;
 }
index cdfafc477ee0d6258292915b272adc36694ddfca..40daab34e4fed0e215366694a23a059b10c130b4 100644 (file)
@@ -11433,11 +11433,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                goto err_ioremap;
        }
 
-       netdev->netdev_ops = &ixgbe_netdev_ops;
-       ixgbe_set_ethtool_ops(netdev);
-       netdev->watchdog_timeo = 5 * HZ;
-       strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
-
        /* Setup hw api */
        hw->mac.ops   = *ii->mac_ops;
        hw->mac.type  = ii->mac;
@@ -11467,6 +11462,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        hw->phy.mdio.mdio_read = ixgbe_mdio_read;
        hw->phy.mdio.mdio_write = ixgbe_mdio_write;
 
+       netdev->netdev_ops = &ixgbe_netdev_ops;
+       ixgbe_set_ethtool_ops(netdev);
+       netdev->watchdog_timeo = 5 * HZ;
+       strscpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
+
        /* setup the private structure */
        err = ixgbe_sw_init(adapter, ii);
        if (err)