Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k)
@ 2026-11-20 22:00 Tony Nguyen
  2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Tony Nguyen @ 2026-11-20 22:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Tony Nguyen, ripatel, xiaolinkui, xiaolinkui, tomasz.lichwala,
	runyu.xiao

Richard Patel fixes an MDIO bus lifetime issue on ixgbe by converting to
the managed MDIO registration over the driver's own handling.

Linkui Xiao preserves and restores the full ACI command data across
retries for ixgbe.

Tomasz Lichwala fixes Hyper-V link speed reporting for E610, on ixgbevf,
by obtaining the data from PCI config space.

Runyu Xiao prevents the service timer from being rearmed after removal by
replacing timer_delete_sync() with timer_shutdown_sync() on fm10k.

The following are changes since commit 00f445721c7f0e48aaff9813cfe1c065c6eb3b71:
  vsock/vmci: reject datagram binds in local network namespaces
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 10GbE

Linkui Xiao (1):
  ixgbe: fix incomplete ACI command buffer backup on retry

Richard Patel (1):
  ixgbe: fix MDIO bus lifetime

Runyu Xiao (1):
  net: fm10k: shut down the service timer during removal

Tomasz Lichwala (1):
  ixgbevf: fix link speed reporting for Hyper-V E610 VFs

 drivers/net/ethernet/intel/fm10k/fm10k_pci.c  |  2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c |  7 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  9 +--
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  |  2 +-
 drivers/net/ethernet/intel/ixgbevf/ethtool.c  | 12 ++++
 drivers/net/ethernet/intel/ixgbevf/vf.c       | 68 ++++++++++++++++---
 6 files changed, 79 insertions(+), 21 deletions(-)

-- 
2.47.1


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

* [PATCH net 1/4] ixgbe: fix MDIO bus lifetime
  2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
@ 2026-11-20 22:00 ` Tony Nguyen
  2026-11-24 22:00   ` netdev-bot+sashiko
  2026-11-20 22:00 ` [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry Tony Nguyen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-20 22:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Richard Patel, anthony.l.nguyen, xiaolinkui, xiaolinkui,
	tomasz.lichwala, runyu.xiao, stephend, f.fainelli, Andrew Lunn,
	Aleksandr Loktionov, Simon Horman, Sunitha Mekala

From: Richard Patel <ripatel@wii.dev>

Plugging in an unsupported SFP module caused ixgbe NICs to get
wedged permanently.

ixgbe unregisters the netdev when rejecting an SFP transceiver as
unsupported.

  ixgbe 0000:3b:00.0: failed to initialize because an unsupported SFP+ module type was detected.
  ixgbe 0000:3b:00.0: Reload the driver after installing a supported module.
  ixgbe 0000:3b:00.0: removed PHC on enp59s0

This code path failed to unregister an MDIO bus owned by that
netdev, so when unregister_netdev() tries to tear it down
(via device_del() -> devres_release_all() -> mdiobus_free()),
it trips over the leaked registration.

  ixgbe-mdio-0000:3b:00.0: not in UNREGISTERED state
  WARNING: drivers/net/phy/mdio_bus_provider.c:711 at mdiobus_free+0x3d/0x50, CPU#21: kworker/u128:0/12

This prevents ixgbe from reloading, even after PCIe remove/rescan:

  sysfs: cannot create duplicate filename '/class/mdio_bus/ixgbe-mdio-0000:3b:00.0'

Switch to devm_mdiobus_register(), drop custom unregister calls.
This is safe because the bus is already devm-allocated, so unregister
always happens before free.

Fixes: 8fa10ef01260 ("ixgbe: register a mdiobus")
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Richard Patel <ripatel@wii.dev>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  | 2 +-
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index b9496f0bee13..2b6d1177adda 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8471,6 +8471,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
 		e_dev_err("Reload the driver after installing a "
 			  "supported module.\n");
 		unregister_netdev(adapter->netdev);
+		adapter->mii_bus = NULL;
 	}
 }
 
@@ -8693,11 +8694,8 @@ static void ixgbe_service_task(struct work_struct *work)
 	}
 	if (ixgbe_check_fw_error(adapter)) {
 		if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
-			if (adapter->mii_bus) {
-				mdiobus_unregister(adapter->mii_bus);
-				adapter->mii_bus = NULL;
-			}
 			unregister_netdev(adapter->netdev);
+			adapter->mii_bus = NULL;
 		}
 		ixgbe_service_event_complete(adapter);
 		return;
@@ -12110,9 +12108,6 @@ static void ixgbe_remove(struct pci_dev *pdev)
 	if (adapter->hw.mac.type == ixgbe_mac_e610)
 		ixgbe_disable_link_status_events(adapter);
 
-	if (adapter->mii_bus)
-		mdiobus_unregister(adapter->mii_bus);
-
 #ifdef CONFIG_IXGBE_DCA
 	if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) {
 		adapter->flags &= ~IXGBE_FLAG_DCA_ENABLED;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index ab733e73927d..74631cb2ddbc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -1086,7 +1086,7 @@ int ixgbe_mii_bus_init(struct ixgbe_hw *hw)
 	hw->phy.mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_SUPPORTS_C22;
 
 	adapter->mii_bus = bus;
-	return mdiobus_register(bus);
+	return devm_mdiobus_register(dev, bus);
 }
 
 /**
-- 
2.47.1


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

* [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry
  2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
  2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
@ 2026-11-20 22:00 ` Tony Nguyen
  2026-11-24 22:00   ` netdev-bot+sashiko
  2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-20 22:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Linkui Xiao, anthony.l.nguyen, ripatel, xiaolinkui,
	tomasz.lichwala, runyu.xiao, jedrzej.jagielski, Przemek Kitszel,
	Aleksandr Loktionov, Alexander Nowlin

From: Linkui Xiao <xiaolinkui@kylinos.cn>

ixgbe_aci_send_cmd() saves only the first byte of the caller's buffer
before an EBUSY retry, using kmalloc() plus a single-byte store. When
retries are exhausted, the caller's output buffer is filled with
uninitialized slab bytes, because only the first byte was saved before
the retry. The firmware itself does not see this data, since the
retryable opcodes do not set LIBIE_AQ_FLAG_RD, but the caller still
receives garbage in its output buffer.

Replace the kmalloc() plus single-byte store with kmemdup() so the whole
indirect command buffer is saved before an EBUSY retry, skip the backup
when buf_size is 0, and key the restore off buf_cpy instead of buf,
exactly like ice_sq_send_cmd_retry() already does.

Fixes: c9e563cae19e ("ixgbe: add support for devlink reload")
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Linkui Xiao <xiaolinkui@kylinos.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index da8519065d81..a6dc214f7771 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -214,11 +214,10 @@ int ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct libie_aq_desc *desc,
 
 	is_cmd_for_retry = ixgbe_should_retry_aci_send_cmd_execute(opcode);
 	if (is_cmd_for_retry) {
-		if (buf) {
-			buf_cpy = kmalloc(buf_size, GFP_KERNEL);
+		if (buf && buf_size) {
+			buf_cpy = kmemdup(buf, buf_size, GFP_KERNEL);
 			if (!buf_cpy)
 				return -ENOMEM;
-			*buf_cpy = *(u8 *)buf;
 		}
 		desc_cpy = *desc;
 	}
@@ -234,7 +233,7 @@ int ixgbe_aci_send_cmd(struct ixgbe_hw *hw, struct libie_aq_desc *desc,
 		    last_status != LIBIE_AQ_RC_EBUSY)
 			break;
 
-		if (buf)
+		if (buf_cpy)
 			memcpy(buf, buf_cpy, buf_size);
 		*desc = desc_cpy;
 
-- 
2.47.1


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

* [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs
  2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
  2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
  2026-11-20 22:00 ` [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry Tony Nguyen
@ 2026-11-20 22:00 ` Tony Nguyen
  2026-11-24 22:00   ` netdev-bot+sashiko
  2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
  2026-11-20 22:03 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) netdev-bot+sinfo
  4 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-20 22:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Tomasz Lichwala, anthony.l.nguyen, ripatel, xiaolinkui,
	xiaolinkui, runyu.xiao, horms, Marcin Szycik, Przemek Kitszel,
	Rafal Romanowski

From: Tomasz Lichwala <tomasz.lichwala@linux.intel.com>

When an E610 VF is running under Hyper-V, the VFLINKS register does not
carry valid link speed. The existing code reads speed from VFLINKS, which
does not reflect the actual negotiated speed. This results in ethtool
reporting a stale or incorrect link speed.

The Hyper-V synthetic NIC exposes the actual link status through
emulated PCI config space at offset 0x209 in VFLINKS register format.
Read and decode link status from there when checking link on E610 VFs.

To avoid generating unnecessary VMBus transactions on every watchdog
cycle, read the PCI config register on demand when ethtool or sysfs
queries link speed, rather than polling it periodically. The cached
value is used by the watchdog and link state notifications as before.

Guard the PCI config space read with IS_ENABLED(CONFIG_PCI_MMCONFIG),
since accessing offsets above 256 requires MMCONFIG support.

Fixes: 4c44b450c69b ("ixgbevf: Add support for Intel(R) E610 device")
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Signed-off-by: Tomasz Lichwala <tomasz.lichwala@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ethtool.c | 12 ++++
 drivers/net/ethernet/intel/ixgbevf/vf.c      | 68 +++++++++++++++++---
 2 files changed, 72 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
index 537a60d5276f..5d0fb4f4d9a3 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
@@ -83,6 +83,18 @@ static int ixgbevf_get_link_ksettings(struct net_device *netdev,
 				      struct ethtool_link_ksettings *cmd)
 {
 	struct ixgbevf_adapter *adapter = netdev_priv(netdev);
+	struct ixgbe_hw *hw = &adapter->hw;
+
+	/* Hyper-V E610 VFs: read current link speed from PCI config space
+	 * on every link speed query.
+	 */
+	if (adapter->pdev->subsystem_device == IXGBE_SUBDEV_ID_E610_VF_HV) {
+		spin_lock_bh(&adapter->mbx_lock);
+		hw->mac.get_link_status = true;
+		hw->mac.ops.check_link(hw, &adapter->link_speed,
+				       &adapter->link_up, false);
+		spin_unlock_bh(&adapter->mbx_lock);
+	}
 
 	ethtool_link_ksettings_zero_link_mode(cmd, supported);
 	ethtool_link_ksettings_add_link_mode(cmd, supported, 10000baseT_Full);
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
index f6df86d124b9..a84b62641e9b 100644
--- a/drivers/net/ethernet/intel/ixgbevf/vf.c
+++ b/drivers/net/ethernet/intel/ixgbevf/vf.c
@@ -1,14 +1,17 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 1999 - 2024 Intel Corporation. */
 
+#include <linux/unaligned.h>
+
 #include "vf.h"
 #include "ixgbevf.h"
 
-/* On Hyper-V, to reset, we need to read from this offset
- * from the PCI config space. This is the mechanism used on
- * Hyper-V to support PF/VF communication.
+/* On Hyper-V the PF/VF communication is through emulated PCI config
+ * space. The reset and link status are exposed at the offsets below.
  */
-#define IXGBE_HV_RESET_OFFSET           0x201
+#define IXGBE_HV_RESET_OFFSET		0x201
+#define IXGBE_HV_LINK_STATUS_OFFSET	0x209
+#define IXGBE_HV_LINK_STATUS_SIZE	4
 
 static inline s32 ixgbevf_write_msg_read_ack(struct ixgbe_hw *hw, u32 *msg,
 					     u32 *retmsg, u16 size)
@@ -901,6 +904,40 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
 	return ret_val;
 }
 
+/**
+ * ixgbevf_hv_read_links_e610 - read link status from PCI config space
+ * @hw: pointer to hardware structure
+ * @links_reg: pointer to store read value
+ *
+ * On Hyper-V E610 VFs the VFLINKS register does not carry valid link speed.
+ * Instead, link status is exposed through emulated PCI config space at offset
+ * 0x209 in VFLINKS register format.
+ *
+ * Return: 0 on success, negative error code on failure.
+ */
+static s32 ixgbevf_hv_read_links_e610(struct ixgbe_hw *hw, u32 *links_reg)
+{
+	struct ixgbevf_adapter *adapter = hw->back;
+	u8 data[IXGBE_HV_LINK_STATUS_SIZE];
+
+	if (!IS_ENABLED(CONFIG_PCI_MMCONFIG)) {
+		dev_err_once(&adapter->pdev->dev,
+			     "cannot read link status, PCI_MMCONFIG is required for Hyper-V\n");
+		return -EOPNOTSUPP;
+	}
+
+	for (int i = 0; i < IXGBE_HV_LINK_STATUS_SIZE; i++) {
+		int ret = pci_read_config_byte(adapter->pdev,
+					       IXGBE_HV_LINK_STATUS_OFFSET + i,
+					       &data[i]);
+		if (ret)
+			return pcibios_err_to_errno(ret);
+	}
+
+	*links_reg = get_unaligned_le32(data);
+	return 0;
+}
+
 /**
  * ixgbevf_hv_check_mac_link_vf - check link
  * @hw: pointer to private hardware struct
@@ -909,6 +946,7 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
  * @autoneg_wait_to_complete: unused
  *
  * Hyper-V variant; there is no mailbox communication.
+ * For E610 VFs, link status is read from emulated PCI config space.
  */
 static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
 					ixgbe_link_speed *speed,
@@ -926,8 +964,16 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
 	if (!mac->get_link_status)
 		goto out;
 
-	/* if link status is down no point in checking to see if pf is up */
-	links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
+	if (mac->type == ixgbe_mac_e610_vf) {
+		if (ixgbevf_hv_read_links_e610(hw, &links_reg)) {
+			*link_up = false;
+			*speed = IXGBE_LINK_SPEED_UNKNOWN;
+			return 0;
+		}
+	} else {
+		links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
+	}
+
 	if (!(links_reg & IXGBE_LINKS_UP))
 		goto out;
 
@@ -941,8 +987,11 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
 			udelay(100);
 			links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
 
-			if (!(links_reg & IXGBE_LINKS_UP))
-				goto out;
+			if (!(links_reg & IXGBE_LINKS_UP)) {
+				*link_up = false;
+				*speed = IXGBE_LINK_SPEED_UNKNOWN;
+				return 0;
+			}
 		}
 	}
 
@@ -956,6 +1005,9 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
 		break;
+	default:
+		*speed = IXGBE_LINK_SPEED_UNKNOWN;
+		break;
 	}
 
 	/* if we passed all the tests above then the link is up and we no
-- 
2.47.1


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

* [PATCH net 4/4] net: fm10k: shut down the service timer during removal
  2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
                   ` (2 preceding siblings ...)
  2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
@ 2026-11-20 22:00 ` Tony Nguyen
  2026-11-24 22:01   ` netdev-bot+sashiko
  2026-11-20 22:03 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) netdev-bot+sinfo
  4 siblings, 1 reply; 10+ messages in thread
From: Tony Nguyen @ 2026-11-20 22:00 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Runyu Xiao, anthony.l.nguyen, ripatel, xiaolinkui, xiaolinkui,
	tomasz.lichwala, jianhao.xu, stable, Aleksandr Loktionov,
	Jacob Keller

From: Runyu Xiao <runyu.xiao@seu.edu.cn>

The fm10k service timer rearms itself from its callback. During PCI
removal, timer_delete_sync() waits for a running callback but does not
prevent a callback or another service path from rearming the timer. This
can leave the timer referencing the fm10k_intfc after free_netdev().

Use timer_shutdown_sync() to permanently prevent rearming before teardown
continues.

The issue was identified by code inspection. No runtime reproduction or
trace demonstrating the failure is available.

The patch was not tested on real hardware. No hardware- or
firmware-specific runtime result is available. Validation used source
review and available build or emulation checks.

Fixes: 54b3c9cfad6b ("fm10k: start service timer on probe")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index afe939f8f4ef..c830417b112c 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -2243,7 +2243,7 @@ static void fm10k_remove(struct pci_dev *pdev)
 	struct fm10k_intfc *interface = pci_get_drvdata(pdev);
 	struct net_device *netdev = interface->netdev;
 
-	timer_delete_sync(&interface->service_timer);
+	timer_shutdown_sync(&interface->service_timer);
 
 	fm10k_stop_service_event(interface);
 	fm10k_stop_macvlan_task(interface);
-- 
2.47.1


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

* Re: [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k)
  2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
                   ` (3 preceding siblings ...)
  2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
@ 2026-11-20 22:03 ` netdev-bot+sinfo
  4 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sinfo @ 2026-11-20 22:03 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev, ripatel,
	xiaolinkui, xiaolinkui, tomasz.lichwala, runyu.xiao

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

 - Whether the issue was actually triggered, or is only theoretical
   (e.g. found by LLM and not proven at runtime). If it was triggered
   please include the symptoms, like the stack trace or kernel messages.

 - What hardware the change was tested on. For driver fixes please
   mention the device (and if relevant firmware version) used for
   testing, or say that the change was not tested on real hardware.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

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

* Re: [PATCH net 1/4] ixgbe: fix MDIO bus lifetime
  2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
@ 2026-11-24 22:00   ` netdev-bot+sashiko
  0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 22:00 UTC (permalink / raw)
  To: anthony.l.nguyen
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	tomasz.lichwala, ripatel, xiaolinkui, xiaolinkui, runyu.xiao,
	horms, marcin.szycik, przemyslaw.kitszel, rafal.romanowski

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch now clears adapter->mii_bus only after
  unregister_netdev() has returned.

--

ixgbe: fix MDIO bus lifetime

This commit changes ixgbe_mii_bus_init() to register the MDIO bus with
devm_mdiobus_register() on the netdev device. The bus is then unregistered
and freed when unregister_netdev() runs device_del(). The explicit
mdiobus_unregister() calls in the FW error path and in ixgbe_remove() are
dropped, and adapter->mii_bus is now cleared after unregister_netdev() in
both the unsupported SFP path and the FW error path.

> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index b9496f0bee131..2b6d1177addab 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -8471,6 +8471,7 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
>  		e_dev_err("Reload the driver after installing a "
>  			  "supported module.\n");
>  		unregister_netdev(adapter->netdev);
> +		adapter->mii_bus = NULL;
>  	}
>  }
>  
> @@ -8693,11 +8694,8 @@ static void ixgbe_service_task(struct work_struct *work)
>  	}
>  	if (ixgbe_check_fw_error(adapter)) {
>  		if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
> -			if (adapter->mii_bus) {
> -				mdiobus_unregister(adapter->mii_bus);
> -				adapter->mii_bus = NULL;
> -			}
>  			unregister_netdev(adapter->netdev);
> +			adapter->mii_bus = NULL;

[Severity: Medium]

With the NULL store moved after unregister_netdev(), does adapter->mii_bus
point at a freed bus for a while?

The bus is now registered via devm on &adapter->netdev->dev in
ixgbe_mii_bus_init(), so unregister_netdev() itself unregisters and frees
it:

unregister_netdev()
  unregister_netdevice_many_notify()
    netdev_unregister_kobject()
      device_del()
        devres_release_all()
          mdiobus_unregister() + mdiobus_free()
            put_device() -> mdiobus_release() -> kfree(bus)

phy_mask is GENMASK(31, 0), so no PHY devices hold extra references. That
means the bus memory really is freed at this point.

Next, unregister_netdev() calls rtnl_unlock() -> netdev_run_todo(). That
function drops RTNL early and then sleeps in rcu_barrier() and
netdev_wait_allrefs_any(). During that whole wait, adapter->mii_bus still
holds the stale pointer and no lock is held.

The old FW error code cleared the pointer before it called
unregister_netdev(). The new hunk in ixgbe_sfp_detection_subtask() has the
same after-the-call ordering.

The reader is ixgbe_mdio_read() (and likewise ixgbe_mdio_write()). It
checks the pointer without a lock and then dereferences it:

	if (adapter->mii_bus) {
		...
			return mdiobus_c45_read(adapter->mii_bus, prtad,
						devad, regnum);

		return mdiobus_read(adapter->mii_bus, prtad, regnum);

Both calls take bus->mdio_lock, which is inside the freed object.

ixgbe_reset() can get to this reader without RTNL, for example from
ixgbe_io_slot_reset() or ixgbe_resume():

ixgbe_reset()
  hw->mac.ops.init_hw / reset_hw
    phy.ops.identify -> ixgbe_identify_phy_generic()
      ixgbe_probe_phy()
        mdio45_probe()
          hw->phy.mdio.mdio_read == ixgbe_mdio_read()

Nothing serializes these paths against the service task. The service task
is only cancelled in ixgbe_remove().

This chain only runs when hw->phy.type == ixgbe_phy_unknown. In the trigger
paths traced so far, phy.type was already known, so no concrete
interleaving has been shown. It also hasn't been ruled out for every
MAC/PHY combination.

Would it be safer to clear adapter->mii_bus before calling
unregister_netdev() in both ixgbe_service_task() and
ixgbe_sfp_detection_subtask(), as the old FW error path did?
WRITE_ONCE()/READ_ONCE() or a shared lock around the pointer might also be
worth considering.

>  		}
>  		ixgbe_service_event_complete(adapter);
>  		return;

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120220022.3133664-1-anthony.l.nguyen%40intel.com

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

* Re: [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry
  2026-11-20 22:00 ` [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry Tony Nguyen
@ 2026-11-24 22:00   ` netdev-bot+sashiko
  0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 22:00 UTC (permalink / raw)
  To: anthony.l.nguyen
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	tomasz.lichwala, ripatel, xiaolinkui, xiaolinkui, runyu.xiao,
	horms, marcin.szycik, przemyslaw.kitszel, rafal.romanowski

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The patch "ixgbe: fix incomplete ACI command buffer backup on
  retry" has the wrong Fixes: tag.

--

ixgbe: fix incomplete ACI command buffer backup on retry

This commit changes the EBUSY retry backup in ixgbe_aci_send_cmd(). It
now copies the whole indirect command buffer with kmemdup() instead of
saving only the first byte. It also skips the backup when buf_size is 0
and keys the restore off buf_cpy, to match ice_sq_send_cmd_retry().

> Fixes: c9e563cae19e ("ixgbe: add support for devlink reload")

[Severity: Medium]
Is this the right commit for the Fixes: tag?

In c9e563cae19e, the only change to ixgbe_e610.c is the new
ixgbe_aci_nvm_update_empr(). That function sends a direct command:

    return ixgbe_aci_send_cmd(hw, &desc, NULL, 0);

Its opcode, ixgbe_aci_opc_nvm_update_empr, is not listed in
ixgbe_should_retry_aci_send_cmd_execute(). With buf == NULL it also never
reaches the buf_cpy path.

The code this patch fixes in ixgbe_aci_send_cmd() looks like it came in
with the original ACI support. Running git blame on the baseline points the
backup:

    if (buf) {
        buf_cpy = kmalloc(buf_size, GFP_KERNEL);
        if (!buf_cpy)
            return -ENOMEM;
        *buf_cpy = *(u8 *)buf;
    }

and the restore:

    if (buf)
        memcpy(buf, buf_cpy, buf_size);

to 46761fd52a88 ("ixgbe: Add support for E610 FW Admin Command Interface").

Kernels that have 46761fd52a88 but not c9e563cae19e still have this bug.
Stable and CVE tooling would treat them as unaffected with the current tag.

Should the tag be the following instead?

    Fixes: 46761fd52a88 ("ixgbe: Add support for E610 FW Admin Command Interface")

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120220022.3133664-1-anthony.l.nguyen%40intel.com

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

* Re: [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs
  2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
@ 2026-11-24 22:00   ` netdev-bot+sashiko
  0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 22:00 UTC (permalink / raw)
  To: anthony.l.nguyen
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	tomasz.lichwala, ripatel, xiaolinkui, xiaolinkui, runyu.xiao,
	horms, marcin.szycik, przemyslaw.kitszel, rafal.romanowski

Thank you for your contribution! Sashiko AI review found 7 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 5 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The new Hyper-V E610 path in ixgbevf_hv_check_mac_link_vf()
  (drivers/net/ethernet/intel/ixgbevf/vf.c:998-1011) decodes the value…
- [Medium] The patch adds a `default:` case to
  ixgbevf_hv_check_mac_link_vf() (vf.c:1008-1010).
- [Medium] The commit message only says VFLINKS "does not carry valid
  link speed" on Hyper-V E610, which implies the VFLINKS link-up bit is…
- [Medium] ixgbevf_hv_read_links_e610() (vf.c:923-927) refuses to read
  offset 0x209 unless CONFIG_PCI_MMCONFIG is set, and the commit…
- [Medium] ixgbevf_get_link_ksettings() (ethtool.c:91) treats a device as
  a Hyper-V E610 VF based only on `adapter->pdev->subsystem_device ==…
- [Medium] The patch adds a second writer of adapter->link_speed and
  adapter->link_up.
- [Low] The commit message says that, to avoid transactions on every
  watchdog cycle, the driver reads the PCI config register on demand…

--

ixgbevf: fix link speed reporting for Hyper-V E610 VFs

This commit changes ixgbevf_hv_check_mac_link_vf() so that E610 VFs read
link status from emulated PCI config space at offset 0x209 instead of the
VFLINKS register. On Hyper-V E610 VFs, ixgbevf_get_link_ksettings() now
forces a fresh link check, and the config space read is gated on
CONFIG_PCI_MMCONFIG.

> diff --git a/drivers/net/ethernet/intel/ixgbevf/ethtool.c b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> index 537a60d5276f0..5d0fb4f4d9a33 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ethtool.c
> @@ -83,6 +83,18 @@ static int ixgbevf_get_link_ksettings(struct net_device *netdev,
>  				      struct ethtool_link_ksettings *cmd)
>  {
>  	struct ixgbevf_adapter *adapter = netdev_priv(netdev);
> +	struct ixgbe_hw *hw = &adapter->hw;
> +
> +	/* Hyper-V E610 VFs: read current link speed from PCI config space
> +	 * on every link speed query.
> +	 */
> +	if (adapter->pdev->subsystem_device == IXGBE_SUBDEV_ID_E610_VF_HV) {

[Severity: Medium]
Should this check also match the device ID? Another option is
hw->mac.type == ixgbe_mac_e610_vf, which is the check vf.c uses.

At probe time the HV board is identified by the device ID and the
subsystem ID together, in ixgbevf_pci_tbl[]:

	PCI_VDEVICE_SUB(INTEL, IXGBE_DEV_ID_E610_VF,
			PCI_ANY_ID, IXGBE_SUBDEV_ID_E610_VF_HV),
	.driver_data = board_e610_vf_hv,

Take a native 82599/X540/X550 VF whose subsystem ID is 0x00FF. This
block forces get_link_status = true and then runs
ixgbevf_check_mac_link_vf(). If no PF message is pending, mbx->ops.read()
fails there:

	if (mbx->ops.read(hw, &in_msg, 1)) {
		if (adapter->pf_features & IXGBEVF_PF_SUP_ESX_MBX)
			mac->get_link_status = false;
		goto out;
	}

get_link_status then stays true and link_up comes back false. Could a
read-only ethtool or sysfs speed query drop the carrier until the PF
sends its next mailbox message?

No non-E610 board with subsystem ID 0x00FF exists in the tree today.

> +		spin_lock_bh(&adapter->mbx_lock);
> +		hw->mac.get_link_status = true;
> +		hw->mac.ops.check_link(hw, &adapter->link_speed,
> +				       &adapter->link_up, false);
> +		spin_unlock_bh(&adapter->mbx_lock);

[Severity: Medium]
Can this race with the watchdog writing adapter->link_speed and
adapter->link_up back?

ixgbevf_watchdog_update_link() copies both fields before it takes
mbx_lock and writes them back after it releases the lock:

	u32 link_speed = adapter->link_speed;
	bool link_up = adapter->link_up;
	...
	spin_lock_bh(&adapter->mbx_lock);
	err = hw->mac.ops.check_link(hw, &link_speed, &link_up, false);
	spin_unlock_bh(&adapter->mbx_lock);
	...
	adapter->link_up = link_up;
	adapter->link_speed = link_speed;

ixgbevf_watchdog_link_is_down() also writes adapter->link_speed = 0
without the lock.

One possible interleaving:

service task                        ethtool
link_speed = 10G (copy)
check_link(), get_link_status
  is false, keeps 10G
                                    check_link() reads 1G from 0x209
                                    into adapter->link_speed,
                                    get_link_status = false
adapter->link_speed = 10G

get_link_status is now false, so later watchdog cycles don't re-read the
register. The stale 10G stays until the next ethtool query.

In the same way, the watchdog could write back a stale link_up = true
after ethtool saw link down. ixgbevf_watchdog_subtask() would then keep
the carrier on for an extra cycle.

The fields are read again below, after spin_unlock_bh(), without the
lock. Could ethtool report link_up and link_speed from two different
updates?

> diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c b/drivers/net/ethernet/intel/ixgbevf/vf.c
> index f6df86d124b9e..a84b62641e9bc 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/vf.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/vf.c

[ ... ]

> @@ -901,6 +904,40 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,

[ ... ]

> +static s32 ixgbevf_hv_read_links_e610(struct ixgbe_hw *hw, u32 *links_reg)
> +{
> +	struct ixgbevf_adapter *adapter = hw->back;
> +	u8 data[IXGBE_HV_LINK_STATUS_SIZE];
> +
> +	if (!IS_ENABLED(CONFIG_PCI_MMCONFIG)) {
> +		dev_err_once(&adapter->pdev->dev,
> +			     "cannot read link status, PCI_MMCONFIG is required for Hyper-V\n");
> +		return -EOPNOTSUPP;
> +	}

[Severity: Medium]
Is CONFIG_PCI_MMCONFIG actually needed for this read? The commit message
says:

  Guard the PCI config space read with IS_ENABLED(CONFIG_PCI_MMCONFIG),
  since accessing offsets above 256 requires MMCONFIG support.

A Hyper-V VF sits on the pci-hyperv bus. Its config accessor,
_hv_pcifront_read_config(), serves the whole 4K config page through the
vPCI window or through hypercalls:

	} else if (where + size <= CFG_PAGE_SIZE) {

		spin_lock_irqsave(&hbus->config_lock, flags);
		if (hbus->use_calls) {
		...

PCI_MMCONFIG is x86-only and optional on X86_64. PCI_HYPERV also
supports ARM64.

On arm64 Hyper-V guests, and on x86_64 guests built with
PCI_MMCONFIG=n, this function always returns -EOPNOTSUPP. As a result,
ixgbevf_hv_check_mac_link_vf() reports *link_up = false on every
watchdog cycle.

Before this patch the link-up bit came from VFLINKS, so the carrier came
up in those configurations. Does this leave the VF link down permanently
there? netvsc only sends through the VF when netif_carrier_ok(vf_netdev)
is true, so TX through the VF would be lost.

The same guard already exists in ixgbevf_hv_reset_hw_vf(), so those
builds already lack the host-provided MAC address. Before this patch,
though, the link still came up.

[ ... ]

> @@ -926,8 +964,16 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
>  	if (!mac->get_link_status)
>  		goto out;
>  
> -	/* if link status is down no point in checking to see if pf is up */
> -	links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
> +	if (mac->type == ixgbe_mac_e610_vf) {
> +		if (ixgbevf_hv_read_links_e610(hw, &links_reg)) {
> +			*link_up = false;
> +			*speed = IXGBE_LINK_SPEED_UNKNOWN;
> +			return 0;
> +		}
> +	} else {
> +		links_reg = IXGBE_READ_REG(hw, IXGBE_VFLINKS);
> +	}
> +
>  	if (!(links_reg & IXGBE_LINKS_UP))
>  		goto out;

[Severity: Medium]
The commit message says VFLINKS "does not carry valid link speed". That
suggests the VFLINKS link-up bit is still valid. Is it intended that
link-up detection for E610 also moves to offset 0x209, with no fallback
to VFLINKS?

Suppose a Hyper-V host doesn't provide link status at 0x209, for
example because reads there return 0. IXGBE_LINKS_UP is then never set,
get_link_status stays true, and the VF never gets carrier.

The patch has a Fixes: tag. Could it be backported to guests running on
hosts that don't provide this interface?

[Severity: Low]
The commit message says:

  To avoid generating unnecessary VMBus transactions on every watchdog
  cycle, read the PCI config register on demand when ethtool or sysfs
  queries link speed, rather than polling it periodically.

Does this match the code? ixgbevf_watchdog_update_link() calls
check_link() on every service cycle. Whenever get_link_status is true,
this path does four pci_read_config_byte() calls per cycle. That covers
link down, after ixgbevf_up(), after the mailbox interrupt, after a
detected reset, and after a failed config read.

Only the steady link-up state avoids the periodic reads. Could the
commit message describe this more precisely?

[ ... ]

> @@ -956,6 +1005,9 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
>  	case IXGBE_LINKS_SPEED_100_82599:
>  		*speed = IXGBE_LINK_SPEED_100_FULL;
>  		break;

[Severity: High]
The commit message says offset 0x209 uses the VFLINKS register format.
If so, should this switch also check IXGBE_LINKS_SPEED_NON_STD for E610?
The PF driver decodes the same layout in ixgbe_check_mac_link_generic():

	case IXGBE_LINKS_SPEED_10G_82599:
		if ((hw->mac.type >= ixgbe_mac_X550) &&
		    (links_reg & IXGBE_LINKS_SPEED_NON_STD))
			*speed = IXGBE_LINK_SPEED_2_5GB_FULL;
		else
			*speed = IXGBE_LINK_SPEED_10GB_FULL;
		break;
	...
	case IXGBE_LINKS_SPEED_100_82599:
		if ((hw->mac.type >= ixgbe_mac_X550 ||
		     hw->mac.type == ixgbe_mac_e610) &&
		    (links_reg & IXGBE_LINKS_SPEED_NON_STD))
			*speed = IXGBE_LINK_SPEED_5GB_FULL;
		else
			*speed = IXGBE_LINK_SPEED_100_FULL;
		break;

The ixgbevf defines.h has no NON_STD mask and no 2.5G or 5G link speed
constants. ixgbevf_get_link_ksettings() only maps 10G, 1G and 100M.

E610 supports 2.5G and 5G. Would a Hyper-V E610 VF linked at 2.5G show
10000 Mb/s, and one linked at 5G show 100 Mb/s?

That looks like the same "stale or incorrect link speed" the commit
message says this patch fixes.

> +	default:
> +		*speed = IXGBE_LINK_SPEED_UNKNOWN;
> +		break;
>  	}

[Severity: Medium]
After this default case, the code below still sets
mac->get_link_status = false. The caller therefore sees link up with
*speed == IXGBE_LINK_SPEED_UNKNOWN.

ixgbevf_get_link_ksettings() has no case for that value:

	if (adapter->link_up) {
		__u32 speed = SPEED_10000;

		switch (adapter->link_speed) {
		...

Wouldn't ethtool and sysfs then report 10000 Mb/s full duplex?
ixgbevf_watchdog_link_is_up() prints "unknown speed" for the same value.

Speed bits 00 are the LINKS encoding for 10M on newer parts
(IXGBE_LINKS_SPEED_10_X550EM_A in the PF driver). E610 supports 10M, so
an E610 HV VF on a 10M link could hit this.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120220022.3133664-1-anthony.l.nguyen%40intel.com

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

* Re: [PATCH net 4/4] net: fm10k: shut down the service timer during removal
  2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
@ 2026-11-24 22:01   ` netdev-bot+sashiko
  0 siblings, 0 replies; 10+ messages in thread
From: netdev-bot+sashiko @ 2026-11-24 22:01 UTC (permalink / raw)
  To: anthony.l.nguyen
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev,
	tomasz.lichwala, ripatel, xiaolinkui, xiaolinkui, runyu.xiao,
	horms, marcin.szycik, przemyslaw.kitszel, rafal.romanowski

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message gives the wrong reason why timer_delete_sync()
  is not enough.

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the service
  work item has the same lifetime bug as the timer this patch fixes, and…

--

net: fm10k: shut down the service timer during removal

This commit changes fm10k_remove() to stop the service timer with
timer_shutdown_sync() instead of timer_delete_sync(). After the change, the
timer cannot be rearmed once teardown starts, so it is not left pending
after free_netdev().

> The fm10k service timer rearms itself from its callback. During PCI
> removal, timer_delete_sync() waits for a running callback but does not
> prevent a callback or another service path from rearming the timer. This
> can leave the timer referencing the fm10k_intfc after free_netdev().

[Severity: Low]
Is the callback self-rearm really why timer_delete_sync() falls short here?

timer_delete_sync() already handles a timer that rearms itself from its own
callback. __timer_delete_sync() keeps retrying while the callback runs:

kernel/time/timer.c:__timer_delete_sync() {
    ...
	do {
		ret = __try_to_del_timer_sync(timer, shutdown);
		if (unlikely(ret < 0)) {
			del_timer_wait_running(timer);
			cpu_relax();
		}
	} while (ret < 0);
    ...
}

fm10k_service_timer() calls mod_timer(&interface->service_timer,
(HZ * 2) + jiffies). After the callback returns, the next pass of this loop
detaches the timer that call just armed.

The rearm that timer_delete_sync() cannot stop looks like it comes from
fm10k_up():

drivers/net/ethernet/intel/fm10k/fm10k_pci.c:fm10k_up() {
    ...
	/* kick off the service timer now */
	hw->mac.get_host_state = true;
	mod_timer(&interface->service_timer, jiffies);
}

fm10k_up() is reached through fm10k_open(), both from ndo_open and from
the service task reset path:

fm10k_reset_subtask()->fm10k_handle_reset()->fm10k_open()->fm10k_up()

Both can run between the timer delete and
fm10k_stop_service_event()/unregister_netdev() in fm10k_remove().
fm10k_down() does not delete the timer, so a timer rearmed this way is
still pending after free_netdev().

The code change itself looks correct, since timer_shutdown_sync() turns
those later mod_timer() calls into no-ops.

Could the commit message name fm10k_up() and the fm10k_open() paths
instead of the callback self-rearm? That way stable backporters see the
mechanism that actually needs the fix.

> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> index afe939f8f4efe..c830417b112ce 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> @@ -2243,7 +2243,7 @@ static void fm10k_remove(struct pci_dev *pdev)
>  	struct fm10k_intfc *interface = pci_get_drvdata(pdev);
>  	struct net_device *netdev = interface->netdev;
>  
> -	timer_delete_sync(&interface->service_timer);
> +	timer_shutdown_sync(&interface->service_timer);
>  
>  	fm10k_stop_service_event(interface);

[Severity: High]
This is a pre-existing issue, not one introduced by this patch, but does
service_task have the same lifetime problem the timer had?

Only bit flags guard the work item. fm10k_service_event_schedule() tests
DISABLE, and then, as a separate step, does test_and_set_bit(SCHED) and
queue_work():

void fm10k_service_event_schedule(struct fm10k_intfc *interface)
{
	if (!test_bit(__FM10K_SERVICE_DISABLE, interface->state) &&
	    !test_and_set_bit(__FM10K_SERVICE_SCHED, interface->state)) {
		clear_bit(__FM10K_SERVICE_REQUEST, interface->state);
		queue_work(fm10k_workqueue, &interface->service_task);
	...
}

fm10k_msix_mbx_pf() calls this from the mailbox IRQ. That IRQ stays
registered until fm10k_mbx_free_irq(), which fm10k_remove() calls well
after fm10k_stop_service_event(). cancel_work_sync() leaves the work
enabled when it returns, so it can be queued again:

CPU1 (mbx IRQ)                      CPU0 (fm10k_remove)
fm10k_service_event_schedule()
  test_bit(DISABLE) == 0
                                    fm10k_stop_service_event()
                                      set_bit(DISABLE)
                                      cancel_work_sync()  /* idle */
                                      clear_bit(SCHED)
  test_and_set_bit(SCHED) == 0
  queue_work(service_task)

fm10k_service_task() never checks __FM10K_SERVICE_DISABLE, and
fm10k_remove() never cancels or flushes service_task again.

Can the work then run at the same time as unregister_netdev(),
fm10k_iov_disable(), fm10k_clear_queueing_scheme() and the iounmap()
calls? If the worker is delayed, can it even run after free_netdev() has
freed the fm10k_intfc that holds the work_struct?

fm10k_tx_timeout_reset() and fm10k_msix_mbx_vf() appear to have the same
window between the check and the queue_work().

Would calling disable_work_sync(&interface->service_task) in
fm10k_remove() close this? Cancelling the work again after
fm10k_mbx_free_irq() might also work.

>  	fm10k_stop_macvlan_task(interface);

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120220022.3133664-1-anthony.l.nguyen%40intel.com

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

end of thread, other threads:[~2026-11-24 22:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 22:00 [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) Tony Nguyen
2026-11-20 22:00 ` [PATCH net 1/4] ixgbe: fix MDIO bus lifetime Tony Nguyen
2026-11-24 22:00   ` netdev-bot+sashiko
2026-11-20 22:00 ` [PATCH net 2/4] ixgbe: fix incomplete ACI command buffer backup on retry Tony Nguyen
2026-11-24 22:00   ` netdev-bot+sashiko
2026-11-20 22:00 ` [PATCH net 3/4] ixgbevf: fix link speed reporting for Hyper-V E610 VFs Tony Nguyen
2026-11-24 22:00   ` netdev-bot+sashiko
2026-11-20 22:00 ` [PATCH net 4/4] net: fm10k: shut down the service timer during removal Tony Nguyen
2026-11-24 22:01   ` netdev-bot+sashiko
2026-11-20 22:03 ` [PATCH net 0/4][pull request] Intel Wired LAN Driver Updates 2026-11-20 (ixgbe, ixgbevf, fm10k) netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox