netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610
@ 2025-03-03 12:06 Jedrzej Jagielski
  2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Jedrzej Jagielski @ 2025-03-03 12:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, netdev, andrew, pmenzel, Jedrzej Jagielski

As E610 adapter introduces different approach to communicate with FW than
the previous adapters using the ixgbe driver, there is a need to adjust
some of the ethtool callbacks implementations to the new pattern. Some of
the features are now set using Admin Command Interface (eg. controlling
LEDs) which among the ixgbe supported device is specific for E610 only.
That means ethtool callbacks related to these features need to be handled
specifically in case of E610 adapter. E610 introduces also different rules
(eg. setting FC, setting WoL) for some of the features what also needs to
be adjusted.

This series is based on the series introducing initial E610 device
support:
https://lore.kernel.org/intel-wired-lan/20241205084450.4651-1-piotr.kwapulinski@intel.com/


Jedrzej Jagielski (4):
  ixgbe: create E610 specific ethtool_ops structure
  ixgbe: add support for ACPI WOL for E610
  ixgbe: apply different rules for setting FC on E610
  ixgbe: add E610 .set_phys_id() callback implementation

 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c |  29 +++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h |   1 +
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 171 +++++++++++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  10 +-
 .../ethernet/intel/ixgbe/ixgbe_type_e610.h    |  14 ++
 5 files changed, 212 insertions(+), 13 deletions(-)
---
NOTE: initial version of the series has been sent as V2 - it had been
tagged by mistake. Sorry for messing out.
So this revision is in fact V2.
link to the initial version:
https://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=446487
---


base-commit: 35c698223836714535e5413753b5899ca2a05d0a
-- 
2.31.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure
  2025-03-03 12:06 [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610 Jedrzej Jagielski
@ 2025-03-03 12:06 ` Jedrzej Jagielski
  2025-03-05 11:15   ` Simon Horman
  2025-03-07 14:32   ` [Intel-wired-lan] " R, Bharath
  2025-03-03 12:06 ` [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610 Jedrzej Jagielski
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 13+ messages in thread
From: Jedrzej Jagielski @ 2025-03-03 12:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, netdev, andrew, pmenzel, Jedrzej Jagielski,
	Aleksandr Loktionov

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>
---
v3: correct the commit msg
---
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 52 ++++++++++++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++--
 2 files changed, 56 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index c86103eccc8a..83d9ee3941e5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -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;
 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 90cffa50221c..b6ce1017bf13 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -11610,11 +11610,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;
@@ -11644,6 +11639,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)
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610
  2025-03-03 12:06 [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610 Jedrzej Jagielski
  2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
@ 2025-03-03 12:06 ` Jedrzej Jagielski
  2025-03-05 11:16   ` Simon Horman
  2025-03-07 10:55   ` [Intel-wired-lan] " R, Bharath
  2025-03-03 12:06 ` [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610 Jedrzej Jagielski
  2025-03-03 12:06 ` [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation Jedrzej Jagielski
  3 siblings, 2 replies; 13+ messages in thread
From: Jedrzej Jagielski @ 2025-03-03 12:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, netdev, andrew, pmenzel, Jedrzej Jagielski,
	Michal Swiatkowski, Aleksandr Loktionov

Currently only APM (Advanced Power Management) is supported by
the ixgbe driver. It works for magic packets only, as for different
sources of wake-up E610 adapter utilizes different feature.

Add E610 specific implementation of ixgbe_set_wol() callback. When
any of broadcast/multicast/unicast wake-up is set, disable APM and
configure ACPI (Advanced Configuration and Power Interface).

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 46 ++++++++++++++++++-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 83d9ee3941e5..abc8c279192a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2365,6 +2365,50 @@ static int ixgbe_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
 	return 0;
 }
 
+static int ixgbe_set_wol_acpi(struct net_device *netdev,
+			      struct ethtool_wolinfo *wol)
+{
+	struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
+	struct ixgbe_hw *hw = &adapter->hw;
+	u32 grc;
+
+	if (ixgbe_wol_exclusion(adapter, wol))
+		return wol->wolopts ? -EOPNOTSUPP : 0;
+
+	/* disable APM wakeup */
+	grc = IXGBE_READ_REG(hw, IXGBE_GRC_X550EM_a);
+	grc &= ~IXGBE_GRC_APME;
+	IXGBE_WRITE_REG(hw, IXGBE_GRC_X550EM_a, grc);
+
+	/* erase existing filters */
+	IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0);
+	adapter->wol = 0;
+
+	if (wol->wolopts & WAKE_UCAST)
+		adapter->wol |= IXGBE_WUFC_EX;
+	if (wol->wolopts & WAKE_MCAST)
+		adapter->wol |= IXGBE_WUFC_MC;
+	if (wol->wolopts & WAKE_BCAST)
+		adapter->wol |= IXGBE_WUFC_BC;
+
+	IXGBE_WRITE_REG(hw, IXGBE_WUC, IXGBE_WUC_PME_EN);
+	IXGBE_WRITE_REG(hw, IXGBE_WUFC, adapter->wol);
+
+	hw->wol_enabled = adapter->wol;
+	device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
+
+	return 0;
+}
+
+static int ixgbe_set_wol_e610(struct net_device *netdev,
+			      struct ethtool_wolinfo *wol)
+{
+	if (wol->wolopts & (WAKE_UCAST | WAKE_MCAST | WAKE_BCAST))
+		return ixgbe_set_wol_acpi(netdev, wol);
+	else
+		return ixgbe_set_wol(netdev, wol);
+}
+
 static int ixgbe_nway_reset(struct net_device *netdev)
 {
 	struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
@@ -3656,7 +3700,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops_e610 = {
 	.get_regs_len           = ixgbe_get_regs_len,
 	.get_regs               = ixgbe_get_regs,
 	.get_wol                = ixgbe_get_wol,
-	.set_wol                = ixgbe_set_wol,
+	.set_wol                = ixgbe_set_wol_e610,
 	.nway_reset             = ixgbe_nway_reset,
 	.get_link               = ethtool_op_get_link,
 	.get_eeprom_len         = ixgbe_get_eeprom_len,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610
  2025-03-03 12:06 [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610 Jedrzej Jagielski
  2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
  2025-03-03 12:06 ` [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610 Jedrzej Jagielski
@ 2025-03-03 12:06 ` Jedrzej Jagielski
  2025-03-05 11:16   ` Simon Horman
  2025-03-07 10:53   ` [Intel-wired-lan] " R, Bharath
  2025-03-03 12:06 ` [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation Jedrzej Jagielski
  3 siblings, 2 replies; 13+ messages in thread
From: Jedrzej Jagielski @ 2025-03-03 12:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, netdev, andrew, pmenzel, Jedrzej Jagielski,
	Aleksandr Loktionov

E610 device doesn't support disabling FC autonegotiation.

Create dedicated E610 .set_pauseparam() implementation and assign
it to ixgbe_ethtool_ops_e610.

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 57 ++++++++++++++++---
 1 file changed, 49 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index abc8c279192a..17d937f672dc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -564,6 +564,22 @@ static void ixgbe_get_pauseparam(struct net_device *netdev,
 	}
 }
 
+static void ixgbe_set_pauseparam_finalize(struct net_device *netdev,
+					  struct ixgbe_fc_info *fc)
+{
+	struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
+	struct ixgbe_hw *hw = &adapter->hw;
+
+	/* If the thing changed then we'll update and use new autoneg. */
+	if (memcmp(fc, &hw->fc, sizeof(*fc))) {
+		hw->fc = *fc;
+		if (netif_running(netdev))
+			ixgbe_reinit_locked(adapter);
+		else
+			ixgbe_reset(adapter);
+	}
+}
+
 static int ixgbe_set_pauseparam(struct net_device *netdev,
 				struct ethtool_pauseparam *pause)
 {
@@ -592,15 +608,40 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
 	else
 		fc.requested_mode = ixgbe_fc_none;
 
-	/* if the thing changed then we'll update and use new autoneg */
-	if (memcmp(&fc, &hw->fc, sizeof(struct ixgbe_fc_info))) {
-		hw->fc = fc;
-		if (netif_running(netdev))
-			ixgbe_reinit_locked(adapter);
-		else
-			ixgbe_reset(adapter);
+	ixgbe_set_pauseparam_finalize(netdev, &fc);
+
+	return 0;
+}
+
+static int ixgbe_set_pauseparam_e610(struct net_device *netdev,
+				     struct ethtool_pauseparam *pause)
+{
+	struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
+	struct ixgbe_hw *hw = &adapter->hw;
+	struct ixgbe_fc_info fc = hw->fc;
+
+	if (!ixgbe_device_supports_autoneg_fc(hw))
+		return -EOPNOTSUPP;
+
+	if (pause->autoneg == AUTONEG_DISABLE) {
+		netdev_info(netdev,
+			"Cannot disable autonegotiation on this device.\n");
+		return -EOPNOTSUPP;
 	}
 
+	fc.disable_fc_autoneg = false;
+
+	if (pause->rx_pause && pause->tx_pause)
+		fc.requested_mode = ixgbe_fc_full;
+	else if (pause->rx_pause)
+		fc.requested_mode = ixgbe_fc_rx_pause;
+	else if (pause->tx_pause)
+		fc.requested_mode = ixgbe_fc_tx_pause;
+	else
+		fc.requested_mode = ixgbe_fc_none;
+
+	ixgbe_set_pauseparam_finalize(netdev, &fc);
+
 	return 0;
 }
 
@@ -3710,7 +3751,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops_e610 = {
 	.set_ringparam          = ixgbe_set_ringparam,
 	.get_pause_stats	= ixgbe_get_pause_stats,
 	.get_pauseparam         = ixgbe_get_pauseparam,
-	.set_pauseparam         = ixgbe_set_pauseparam,
+	.set_pauseparam         = ixgbe_set_pauseparam_e610,
 	.get_msglevel           = ixgbe_get_msglevel,
 	.set_msglevel           = ixgbe_set_msglevel,
 	.self_test              = ixgbe_diag_test,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation
  2025-03-03 12:06 [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610 Jedrzej Jagielski
                   ` (2 preceding siblings ...)
  2025-03-03 12:06 ` [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610 Jedrzej Jagielski
@ 2025-03-03 12:06 ` Jedrzej Jagielski
  2025-03-05 11:17   ` Simon Horman
  2025-03-11  7:39   ` [Intel-wired-lan] " R, Bharath
  3 siblings, 2 replies; 13+ messages in thread
From: Jedrzej Jagielski @ 2025-03-03 12:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: anthony.l.nguyen, netdev, andrew, pmenzel, Jedrzej Jagielski,
	Aleksandr Loktionov, Michal Swiatkowski

Legacy implementation of .set_phys_id() ethtool callback is not
applicable for E610 device.

Add new implementation which uses 0x06E9 command by calling
ixgbe_aci_set_port_id_led().

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
---
v3: move the #defines related to ixgbe_aci_cmd_set_port_id_led out of the
struct definition
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 29 +++++++++++++++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h |  1 +
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 22 +++++++++++++-
 .../ethernet/intel/ixgbe/ixgbe_type_e610.h    | 14 +++++++++
 4 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index 7b0a405a305e..f11cd13c18f4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -1485,6 +1485,35 @@ static int ixgbe_start_hw_e610(struct ixgbe_hw *hw)
 	return err;
 }
 
+/**
+ * ixgbe_aci_set_port_id_led - set LED value for the given port
+ * @hw: pointer to the HW struct
+ * @orig_mode: set LED original mode
+ *
+ * Set LED value for the given port (0x06E9)
+ *
+ * Return: the exit code of the operation.
+ */
+int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode)
+{
+	struct ixgbe_aci_cmd_set_port_id_led *cmd;
+	struct ixgbe_aci_desc desc;
+
+	cmd = &desc.params.set_port_id_led;
+
+	ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_port_id_led);
+
+	cmd->lport_num = (u8)hw->bus.func;
+	cmd->lport_num_valid = IXGBE_ACI_PORT_ID_PORT_NUM_VALID;
+
+	if (orig_mode)
+		cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_ORIG;
+	else
+		cmd->ident_mode = IXGBE_ACI_PORT_IDENT_LED_BLINK;
+
+	return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);
+}
+
 /**
  * ixgbe_get_media_type_e610 - Gets media type
  * @hw: pointer to the HW struct
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
index b668ff0ae2e5..c97623fb10ac 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h
@@ -36,6 +36,7 @@ int ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
 			    struct ixgbe_link_status *link);
 int ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask);
 int ixgbe_configure_lse(struct ixgbe_hw *hw, bool activate, u16 mask);
+int ixgbe_aci_set_port_id_led(struct ixgbe_hw *hw, bool orig_mode);
 enum ixgbe_media_type ixgbe_get_media_type_e610(struct ixgbe_hw *hw);
 int ixgbe_setup_link_e610(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 			  bool autoneg_wait);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 17d937f672dc..49ced536d679 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2491,6 +2491,26 @@ static int ixgbe_set_phys_id(struct net_device *netdev,
 	return 0;
 }
 
+static int ixgbe_set_phys_id_e610(struct net_device *netdev,
+				  enum ethtool_phys_id_state state)
+{
+	struct ixgbe_adapter *adapter = ixgbe_from_netdev(netdev);
+	bool led_active;
+
+	switch (state) {
+	case ETHTOOL_ID_ACTIVE:
+		led_active = true;
+		break;
+	case ETHTOOL_ID_INACTIVE:
+		led_active = false;
+		break;
+	default:
+		return -EOPNOTSUPP;
+	}
+
+	return ixgbe_aci_set_port_id_led(&adapter->hw, !led_active);
+}
+
 static int ixgbe_get_coalesce(struct net_device *netdev,
 			      struct ethtool_coalesce *ec,
 			      struct kernel_ethtool_coalesce *kernel_coal,
@@ -3756,7 +3776,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops_e610 = {
 	.set_msglevel           = ixgbe_set_msglevel,
 	.self_test              = ixgbe_diag_test,
 	.get_strings            = ixgbe_get_strings,
-	.set_phys_id            = ixgbe_set_phys_id,
+	.set_phys_id            = ixgbe_set_phys_id_e610,
 	.get_sset_count         = ixgbe_get_sset_count,
 	.get_ethtool_stats      = ixgbe_get_ethtool_stats,
 	.get_coalesce           = ixgbe_get_coalesce,
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
index bea94e5ccb73..09df67f03cf4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
@@ -223,6 +223,7 @@ enum ixgbe_aci_opc {
 	ixgbe_aci_opc_write_mdio			= 0x06E5,
 	ixgbe_aci_opc_set_gpio_by_func			= 0x06E6,
 	ixgbe_aci_opc_get_gpio_by_func			= 0x06E7,
+	ixgbe_aci_opc_set_port_id_led			= 0x06E9,
 	ixgbe_aci_opc_set_gpio				= 0x06EC,
 	ixgbe_aci_opc_get_gpio				= 0x06ED,
 	ixgbe_aci_opc_sff_eeprom			= 0x06EE,
@@ -808,6 +809,18 @@ struct ixgbe_aci_cmd_get_link_topo_pin {
 	u8 rsvd[7];
 };
 
+/* Set Port Identification LED (direct, 0x06E9) */
+struct ixgbe_aci_cmd_set_port_id_led {
+	u8 lport_num;
+	u8 lport_num_valid;
+	u8 ident_mode;
+	u8 rsvd[13];
+};
+
+#define IXGBE_ACI_PORT_ID_PORT_NUM_VALID	BIT(0)
+#define IXGBE_ACI_PORT_IDENT_LED_ORIG		0
+#define IXGBE_ACI_PORT_IDENT_LED_BLINK		BIT(0)
+
 /* Read/Write SFF EEPROM command (indirect 0x06EE) */
 struct ixgbe_aci_cmd_sff_eeprom {
 	u8 lport_num;
@@ -985,6 +998,7 @@ struct ixgbe_aci_desc {
 		struct ixgbe_aci_cmd_restart_an restart_an;
 		struct ixgbe_aci_cmd_get_link_status get_link_status;
 		struct ixgbe_aci_cmd_set_event_mask set_event_mask;
+		struct ixgbe_aci_cmd_set_port_id_led set_port_id_led;
 		struct ixgbe_aci_cmd_get_link_topo get_link_topo;
 		struct ixgbe_aci_cmd_get_link_topo_pin get_link_topo_pin;
 		struct ixgbe_aci_cmd_sff_eeprom read_write_sff_param;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure
  2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
@ 2025-03-05 11:15   ` Simon Horman
  2025-03-07 14:32   ` [Intel-wired-lan] " R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-03-05 11:15 UTC (permalink / raw)
  To: Jedrzej Jagielski
  Cc: intel-wired-lan, anthony.l.nguyen, netdev, andrew, pmenzel,
	Aleksandr Loktionov

On Mon, Mar 03, 2025 at 01:06:27PM +0100, Jedrzej Jagielski wrote:
> 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>
> ---
> v3: correct the commit msg

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610
  2025-03-03 12:06 ` [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610 Jedrzej Jagielski
@ 2025-03-05 11:16   ` Simon Horman
  2025-03-07 10:55   ` [Intel-wired-lan] " R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-03-05 11:16 UTC (permalink / raw)
  To: Jedrzej Jagielski
  Cc: intel-wired-lan, anthony.l.nguyen, netdev, andrew, pmenzel,
	Michal Swiatkowski, Aleksandr Loktionov

On Mon, Mar 03, 2025 at 01:06:28PM +0100, Jedrzej Jagielski wrote:
> Currently only APM (Advanced Power Management) is supported by
> the ixgbe driver. It works for magic packets only, as for different
> sources of wake-up E610 adapter utilizes different feature.
> 
> Add E610 specific implementation of ixgbe_set_wol() callback. When
> any of broadcast/multicast/unicast wake-up is set, disable APM and
> configure ACPI (Advanced Configuration and Power Interface).
> 
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.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>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610
  2025-03-03 12:06 ` [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610 Jedrzej Jagielski
@ 2025-03-05 11:16   ` Simon Horman
  2025-03-07 10:53   ` [Intel-wired-lan] " R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-03-05 11:16 UTC (permalink / raw)
  To: Jedrzej Jagielski
  Cc: intel-wired-lan, anthony.l.nguyen, netdev, andrew, pmenzel,
	Aleksandr Loktionov

On Mon, Mar 03, 2025 at 01:06:29PM +0100, Jedrzej Jagielski wrote:
> E610 device doesn't support disabling FC autonegotiation.
> 
> Create dedicated E610 .set_pauseparam() implementation and assign
> it to ixgbe_ethtool_ops_e610.
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation
  2025-03-03 12:06 ` [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation Jedrzej Jagielski
@ 2025-03-05 11:17   ` Simon Horman
  2025-03-11  7:39   ` [Intel-wired-lan] " R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: Simon Horman @ 2025-03-05 11:17 UTC (permalink / raw)
  To: Jedrzej Jagielski
  Cc: intel-wired-lan, anthony.l.nguyen, netdev, andrew, pmenzel,
	Aleksandr Loktionov, Michal Swiatkowski

On Mon, Mar 03, 2025 at 01:06:30PM +0100, Jedrzej Jagielski wrote:
> Legacy implementation of .set_phys_id() ethtool callback is not
> applicable for E610 device.
> 
> Add new implementation which uses 0x06E9 command by calling
> ixgbe_aci_set_port_id_led().
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
> v3: move the #defines related to ixgbe_aci_cmd_set_port_id_led out of the
> struct definition

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610
  2025-03-03 12:06 ` [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610 Jedrzej Jagielski
  2025-03-05 11:16   ` Simon Horman
@ 2025-03-07 10:53   ` R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: R, Bharath @ 2025-03-07 10:53 UTC (permalink / raw)
  To: Jagielski, Jedrzej, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, netdev@vger.kernel.org, andrew@lunn.ch,
	pmenzel@molgen.mpg.de, Jagielski, Jedrzej, Loktionov, Aleksandr

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jedrzej Jagielski
> Sent: Monday, March 3, 2025 5:36 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> netdev@vger.kernel.org; andrew@lunn.ch; pmenzel@molgen.mpg.de;
> Jagielski, Jedrzej <jedrzej.jagielski@intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3 3/4] ixgbe: apply different rules
> for setting FC on E610
> 
> E610 device doesn't support disabling FC autonegotiation.
> 
> Create dedicated E610 .set_pauseparam() implementation and assign it to
> ixgbe_ethtool_ops_e610.
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
>  .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 57 ++++++++++++++++---
>  1 file changed, 49 insertions(+), 8 deletions(-)
> 

Tested-by: Bharath R <bharath.r@intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610
  2025-03-03 12:06 ` [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610 Jedrzej Jagielski
  2025-03-05 11:16   ` Simon Horman
@ 2025-03-07 10:55   ` R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: R, Bharath @ 2025-03-07 10:55 UTC (permalink / raw)
  To: Jagielski, Jedrzej, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, netdev@vger.kernel.org, andrew@lunn.ch,
	pmenzel@molgen.mpg.de, Jagielski, Jedrzej, Michal Swiatkowski,
	Loktionov, Aleksandr

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jedrzej Jagielski
> Sent: Monday, March 3, 2025 5:36 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> netdev@vger.kernel.org; andrew@lunn.ch; pmenzel@molgen.mpg.de;
> Jagielski, Jedrzej <jedrzej.jagielski@intel.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI
> WOL for E610
> 
> Currently only APM (Advanced Power Management) is supported by the ixgbe
> driver. It works for magic packets only, as for different sources of wake-up
> E610 adapter utilizes different feature.
> 
> Add E610 specific implementation of ixgbe_set_wol() callback. When any of
> broadcast/multicast/unicast wake-up is set, disable APM and configure ACPI
> (Advanced Configuration and Power Interface).
> 
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
>  .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 46 ++++++++++++++++++-
>  1 file changed, 45 insertions(+), 1 deletion(-)
> 

Tested-by: Bharath R <bharath.r@intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure
  2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
  2025-03-05 11:15   ` Simon Horman
@ 2025-03-07 14:32   ` R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: R, Bharath @ 2025-03-07 14:32 UTC (permalink / raw)
  To: Jagielski, Jedrzej, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, netdev@vger.kernel.org, andrew@lunn.ch,
	pmenzel@molgen.mpg.de, Jagielski, Jedrzej, Loktionov, Aleksandr

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jedrzej Jagielski
> Sent: Monday, March 3, 2025 5:36 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> netdev@vger.kernel.org; andrew@lunn.ch; pmenzel@molgen.mpg.de;
> Jagielski, Jedrzej <jedrzej.jagielski@intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3 1/4] ixgbe: create E610 specific
> ethtool_ops structure
> 
> 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>
> ---
> v3: correct the commit msg
> ---
>  .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 52 ++++++++++++++++++-
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 10 ++--
>  2 files changed, 56 insertions(+), 6 deletions(-)
> 

Tested-by: Bharath R <bharath.r@intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation
  2025-03-03 12:06 ` [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation Jedrzej Jagielski
  2025-03-05 11:17   ` Simon Horman
@ 2025-03-11  7:39   ` R, Bharath
  1 sibling, 0 replies; 13+ messages in thread
From: R, Bharath @ 2025-03-11  7:39 UTC (permalink / raw)
  To: Jagielski, Jedrzej, intel-wired-lan@lists.osuosl.org
  Cc: Nguyen, Anthony L, netdev@vger.kernel.org, andrew@lunn.ch,
	pmenzel@molgen.mpg.de, Jagielski, Jedrzej, Loktionov, Aleksandr,
	Michal Swiatkowski

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jedrzej Jagielski
> Sent: Monday, March 3, 2025 5:37 PM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> netdev@vger.kernel.org; andrew@lunn.ch; pmenzel@molgen.mpg.de;
> Jagielski, Jedrzej <jedrzej.jagielski@intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next v3 4/4] ixgbe: add E610
> .set_phys_id() callback implementation
> 
> Legacy implementation of .set_phys_id() ethtool callback is not applicable for
> E610 device.
> 
> Add new implementation which uses 0x06E9 command by calling
> ixgbe_aci_set_port_id_led().
> 
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
> ---
> v3: move the #defines related to ixgbe_aci_cmd_set_port_id_led out of the
> struct definition
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 29 +++++++++++++++++++
> drivers/net/ethernet/intel/ixgbe/ixgbe_e610.h |  1 +
> .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 22 +++++++++++++-
>  .../ethernet/intel/ixgbe/ixgbe_type_e610.h    | 14 +++++++++
>  4 files changed, 65 insertions(+), 1 deletion(-)
> 

Tested-by: Bharath R <bharath.r@intel.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-03-11  7:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-03 12:06 [PATCH iwl-next v3 0/4] ixgbe: add ethtool support for E610 Jedrzej Jagielski
2025-03-03 12:06 ` [PATCH iwl-next v3 1/4] ixgbe: create E610 specific ethtool_ops structure Jedrzej Jagielski
2025-03-05 11:15   ` Simon Horman
2025-03-07 14:32   ` [Intel-wired-lan] " R, Bharath
2025-03-03 12:06 ` [PATCH iwl-next v3 2/4] ixgbe: add support for ACPI WOL for E610 Jedrzej Jagielski
2025-03-05 11:16   ` Simon Horman
2025-03-07 10:55   ` [Intel-wired-lan] " R, Bharath
2025-03-03 12:06 ` [PATCH iwl-next v3 3/4] ixgbe: apply different rules for setting FC on E610 Jedrzej Jagielski
2025-03-05 11:16   ` Simon Horman
2025-03-07 10:53   ` [Intel-wired-lan] " R, Bharath
2025-03-03 12:06 ` [PATCH iwl-next v3 4/4] ixgbe: add E610 .set_phys_id() callback implementation Jedrzej Jagielski
2025-03-05 11:17   ` Simon Horman
2025-03-11  7:39   ` [Intel-wired-lan] " R, Bharath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).