The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net] net: fix spurious TX timeout after dev_activate()
@ 2026-08-24 11:45 Breno Leitao
  2026-08-24 15:13 ` Nicolai Buchwitz
  0 siblings, 1 reply; 5+ messages in thread
From: Breno Leitao @ 2026-08-24 11:45 UTC (permalink / raw)
  To: Jamal Hadi Salim, Jiri Pirko, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal
  Cc: netdev, linux-kernel, kernel-team, stable, Breno Leitao

While debugging another issue today, I found out that my TX queue is
stopped for 136.07 years (4294907392 ms).

    bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 28: transmit queue 23 timed out 4294907392 ms

4294907392 is not an elapsed time. It is the value of jiffies at that
moment: INITIAL_JIFFIES is 4294667296.

dev_activate() runs transition_one_qdisc() over every TX queue, which
resets trans_start to 0, and then stamps only queue 0 through
netif_trans_update().

Stamp jiffies instead. A queue stopped across dev_activate() now gets a
full watchdog_timeo of grace, and is still reported if it is stopped
that long.

Fixes: 9b36627acecd ("net: remove dev->trans_start")
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index ef2b4bf515641..4539dc2c6d380 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct net_device *dev,
 
 	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
 	if (need_watchdog_p) {
-		WRITE_ONCE(dev_queue->trans_start, 0);
+		WRITE_ONCE(dev_queue->trans_start, jiffies);
 		*need_watchdog_p = 1;
 	}
 }

---
base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
change-id: 20260824-trans_start-557ecd4c8866

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


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

* Re: [PATCH net] net: fix spurious TX timeout after dev_activate()
  2026-08-24 11:45 [PATCH net] net: fix spurious TX timeout after dev_activate() Breno Leitao
@ 2026-08-24 15:13 ` Nicolai Buchwitz
  2026-08-25  8:47   ` Paolo Abeni
  2026-08-25 10:36   ` Breno Leitao
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolai Buchwitz @ 2026-08-24 15:13 UTC (permalink / raw)
  To: Breno Leitao
  Cc: Jamal Hadi Salim, Jiri Pirko, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	netdev, linux-kernel, kernel-team, stable

Hi Breno

On 24.8.2026 13:45, Breno Leitao wrote:
> While debugging another issue today, I found out that my TX queue is
> stopped for 136.07 years (4294907392 ms).

nit: 4294907392 ms is ~49.7 days

> 
>     bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 28: transmit queue 
> 23 timed out 4294907392 ms
> 
> 4294907392 is not an elapsed time. It is the value of jiffies at that
> moment: INITIAL_JIFFIES is 4294667296.
> 
> dev_activate() runs transition_one_qdisc() over every TX queue, which
> resets trans_start to 0, and then stamps only queue 0 through
> netif_trans_update().
> 
> Stamp jiffies instead. A queue stopped across dev_activate() now gets a
> full watchdog_timeo of grace, and is still reported if it is stopped
> that long.
> 
> Fixes: 9b36627acecd ("net: remove dev->trans_start")
> Cc: stable@vger.kernel.org
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  net/sched/sch_generic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> index ef2b4bf515641..4539dc2c6d380 100644
> --- a/net/sched/sch_generic.c
> +++ b/net/sched/sch_generic.c
> @@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct 
> net_device *dev,
> 
>  	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
>  	if (need_watchdog_p) {
> -		WRITE_ONCE(dev_queue->trans_start, 0);
> +		WRITE_ONCE(dev_queue->trans_start, jiffies);
>  		*need_watchdog_p = 1;
>  	}
>  }

Follow up or v2: netif_trans_update() in dev_activate() now seems 
redundant?

> 
> ---
> base-commit: 0a0d1d55dad570724bf8c7ea83409639cfb4be9b
> change-id: 20260824-trans_start-557ecd4c8866
> 
> Best regards,
> --
> Breno Leitao <leitao@debian.org>

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai

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

* Re: [PATCH net] net: fix spurious TX timeout after dev_activate()
  2026-08-24 15:13 ` Nicolai Buchwitz
@ 2026-08-25  8:47   ` Paolo Abeni
  2026-08-25 10:43     ` Breno Leitao
  2026-08-25 10:36   ` Breno Leitao
  1 sibling, 1 reply; 5+ messages in thread
From: Paolo Abeni @ 2026-08-25  8:47 UTC (permalink / raw)
  To: Nicolai Buchwitz, Breno Leitao
  Cc: Jamal Hadi Salim, Jiri Pirko, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Simon Horman, Florian Westphal, netdev,
	linux-kernel, kernel-team, stable

On 8/24/26 5:13 PM, Nicolai Buchwitz wrote:
>> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
>> index ef2b4bf515641..4539dc2c6d380 100644
>> --- a/net/sched/sch_generic.c
>> +++ b/net/sched/sch_generic.c
>> @@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct 
>> net_device *dev,
>>
>>  	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
>>  	if (need_watchdog_p) {
>> -		WRITE_ONCE(dev_queue->trans_start, 0);
>> +		WRITE_ONCE(dev_queue->trans_start, jiffies);
>>  		*need_watchdog_p = 1;
>>  	}
>>  }
> 
> Follow up or v2: netif_trans_update() in dev_activate() now seems 
> redundant?

IMHO should be a follow-up.

/P


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

* Re: [PATCH net] net: fix spurious TX timeout after dev_activate()
  2026-08-24 15:13 ` Nicolai Buchwitz
  2026-08-25  8:47   ` Paolo Abeni
@ 2026-08-25 10:36   ` Breno Leitao
  1 sibling, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-08-25 10:36 UTC (permalink / raw)
  To: Nicolai Buchwitz
  Cc: Jamal Hadi Salim, Jiri Pirko, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Florian Westphal,
	netdev, linux-kernel, kernel-team, stable

Hello Nicolai,

On Mon, Aug 24, 2026 at 05:13:13PM +0200, Nicolai Buchwitz wrote:
> On 24.8.2026 13:45, Breno Leitao wrote:
> > While debugging another issue today, I found out that my TX queue is
> > stopped for 136.07 years (4294907392 ms).
> 
> nit: 4294907392 ms is ~49.7 days

Lol, let me fix update it.

> >     bnxt_en 0002:01:00.0 eth0: NETDEV WATCHDOG: CPU: 28: transmit queue
> > 23 timed out 4294907392 ms
> > 
> > 4294907392 is not an elapsed time. It is the value of jiffies at that
> > moment: INITIAL_JIFFIES is 4294667296.
> > 
> > dev_activate() runs transition_one_qdisc() over every TX queue, which
> > resets trans_start to 0, and then stamps only queue 0 through
> > netif_trans_update().
> > 
> > Stamp jiffies instead. A queue stopped across dev_activate() now gets a
> > full watchdog_timeo of grace, and is still reported if it is stopped
> > that long.
> > 
> > Fixes: 9b36627acecd ("net: remove dev->trans_start")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> > ---
> >  net/sched/sch_generic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> > index ef2b4bf515641..4539dc2c6d380 100644
> > --- a/net/sched/sch_generic.c
> > +++ b/net/sched/sch_generic.c
> > @@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct net_device
> > *dev,
> > 
> >  	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
> >  	if (need_watchdog_p) {
> > -		WRITE_ONCE(dev_queue->trans_start, 0);
> > +		WRITE_ONCE(dev_queue->trans_start, jiffies);
> >  		*need_watchdog_p = 1;
> >  	}
> >  }
> 
> Follow up or v2: netif_trans_update() in dev_activate() now seems redundant?

Yea, good point, we can get rid of netif_trans_update(), given we have
updated all the trans_start in here.

I will respin this one.

Thanks for the review,
--breno

--
pw-bot: cr

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

* Re: [PATCH net] net: fix spurious TX timeout after dev_activate()
  2026-08-25  8:47   ` Paolo Abeni
@ 2026-08-25 10:43     ` Breno Leitao
  0 siblings, 0 replies; 5+ messages in thread
From: Breno Leitao @ 2026-08-25 10:43 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: Nicolai Buchwitz, Jamal Hadi Salim, Jiri Pirko, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Simon Horman, Florian Westphal,
	netdev, linux-kernel, kernel-team, stable

On Tue, Aug 25, 2026 at 10:47:13AM +0200, Paolo Abeni wrote:
> On 8/24/26 5:13 PM, Nicolai Buchwitz wrote:
> >> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> >> index ef2b4bf515641..4539dc2c6d380 100644
> >> --- a/net/sched/sch_generic.c
> >> +++ b/net/sched/sch_generic.c
> >> @@ -1278,7 +1278,7 @@ static void transition_one_qdisc(struct 
> >> net_device *dev,
> >>
> >>  	rcu_assign_pointer(dev_queue->qdisc, new_qdisc);
> >>  	if (need_watchdog_p) {
> >> -		WRITE_ONCE(dev_queue->trans_start, 0);
> >> +		WRITE_ONCE(dev_queue->trans_start, jiffies);
> >>  		*need_watchdog_p = 1;
> >>  	}
> >>  }
> > 
> > Follow up or v2: netif_trans_update() in dev_activate() now seems 
> > redundant?
> 
> IMHO should be a follow-up.

Oops, I replied to the other email too early. I'll respin this one and
send a separate follow-up covering netif_trans_update.

In that follow-up (net-next material0, I can probably simplify
need_watchdog as well.

Thanks for the guidance,
--breno

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

end of thread, other threads:[~2026-08-25 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 11:45 [PATCH net] net: fix spurious TX timeout after dev_activate() Breno Leitao
2026-08-24 15:13 ` Nicolai Buchwitz
2026-08-25  8:47   ` Paolo Abeni
2026-08-25 10:43     ` Breno Leitao
2026-08-25 10:36   ` Breno Leitao

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