RE: [PATCH net] idpf: reset mb_wait_count once the mailbox is up

From: Loktionov, Aleksandr

Date: Fri Nov 13 2026 - 15:53:36 EST




> -----Original Message-----
> From: Breno Leitao <leitao@xxxxxxxxxx>
> Sent: Monday, November 9, 2026 3:43 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@xxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Chittim, Madhu <madhu.chittim@xxxxxxxxx>; Tantilov,
> Emil S <emil.s.tantilov@xxxxxxxxx>; Hay, Joshua A
> <joshua.a.hay@xxxxxxxxx>; Alan Brady <alan.brady@xxxxxxxxx>; Samudrala,
> Sridhar <sridhar.samudrala@xxxxxxxxx>; Willem de Bruijn
> <willemb@xxxxxxxxxx>; Shailendra Bhatnagar
> <shailendra.bhatnagar@xxxxxxxxx>; Pavan Kumar Linga
> <pavan.kumar.linga@xxxxxxxxx>
> Cc: Burra, Phani R <phani.r.burra@xxxxxxxxx>; intel-wired-
> lan@xxxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; kernel-team@xxxxxxxx; Breno Leitao
> <leitao@xxxxxxxxxx>
> Subject: [PATCH net] idpf: reset mb_wait_count once the mailbox is up
>
> 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@xxxxxxxxxx>
> ---
> 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@xxxxxxxxxx>

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>