mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] idpf: reset mb_wait_count once the mailbox is up
@ 2026-11-09 14:43 Breno Leitao
  2026-11-13 17:42 ` Simon Horman
  2026-11-13 18:04 ` Loktionov, Aleksandr
  0 siblings, 2 replies; 4+ messages in thread
From: Breno Leitao @ 2026-11-09 14:43 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Madhu Chittim,
	Emil Tantilov, Joshua Hay, Alan Brady, Sridhar Samudrala,
	Willem de Bruijn, Shailendra Bhatnagar, Pavan Kumar Linga
  Cc: Phani Burra, intel-wired-lan, netdev, linux-kernel, kernel-team,
	Breno Leitao

idpf_vc_core_init() retries a failed virtchnl version and capabilities
handshake up to IDPF_MB_MAX_ERR times before it gives up on the device.
Each failure increments adapter->mb_wait_count, but nothing ever clears
it, so the limit is shared by every initialization in the lifetime of
the adapter, including the one done by each reset.

A device that fails the first handshake after a reset, and then
recovers on the retry, leaves one count behind per reset. Once 20 have
accumulated, the next failure is final, and the device stays down until
the driver is reloaded. This is seen in Meta's fleet on hosts with
recurring Tx timeouts:

  [ 2176.496801] idpf 0016:01:00.0 eth1: Detected Tx timeout: Count 21, Queue 11
  [ 2176.508763] idpf 0016:01:00.0: Device HW Reset initiated
  [ 2237.412541] idpf 0016:01:00.0: Transaction timed-out (op:1 cookie:9800 vc_op:1 salt:98 timeout:60000ms)
  [ 2237.412578] idpf 0016:01:00.0: Failed to establish mailbox communications with hardware

Clear mb_wait_count once the handshake succeeds, so the limit applies
to consecutive failures only.

Fixes: 4930fbf419a7 ("idpf: add core init and interrupt request")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 928de868fa624e..7c11c877acd0ba 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -3118,6 +3118,9 @@ int idpf_vc_core_init(struct idpf_adapter *adapter)
 		msleep(task_delay);
 	}
 
+	/* The mailbox is up, give the next reset a fresh retry budget */
+	adapter->mb_wait_count = 0;
+
 	if (idpf_is_cap_ena(adapter, IDPF_OTHER_CAPS, VIRTCHNL2_CAP_LAN_MEMORY_REGIONS)) {
 		err = idpf_cfg_lan_memory_regions(adapter);
 		if (err) {

---
base-commit: 1d5e2c57e9ffc134e14b3f837c8d7c53b508bd22
change-id: 20261109-idpf-mb-wait-count-184efb41b525

Best regards,
--  
Breno Leitao <leitao@debian.org>


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

end of thread, other threads:[~2026-11-13 18:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:43 [PATCH net] idpf: reset mb_wait_count once the mailbox is up Breno Leitao
2026-11-13 17:42 ` Simon Horman
2026-11-13 18:29   ` Tony Nguyen
2026-11-13 18:04 ` Loktionov, Aleksandr

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

all inboxes | Powered by JetHome®