From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: "Jakub Kicinski" <kuba@kernel.org>,
"Jonas Köppeler" <j.koeppeler@tu-berlin.de>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Simon Horman" <horms@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v6 4/5] net: sched: add timeout count to NETDEV WATCHDOG message
Date: Fri, 12 Jun 2026 11:39:58 +0200 [thread overview]
Message-ID: <7be62ade-2598-4c63-8b42-393323a1cc0e@kernel.org> (raw)
In-Reply-To: <3f73e314-756e-494e-a1aa-0bc39c14f41b@redhat.com>
On 04/06/2026 10.30, Paolo Abeni wrote:
> On 5/27/26 3:54 PM, hawk@kernel.org wrote:
>> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
>> index 237ee1cd0136..2aebab985c00 100644
>> --- a/net/sched/sch_generic.c
>> +++ b/net/sched/sch_generic.c
>> @@ -533,13 +533,12 @@ static void dev_watchdog(struct timer_list *t)
>> netif_running(dev) &&
>> netif_carrier_ok(dev)) {
>> unsigned int timedout_ms = 0;
>> + struct netdev_queue *txq;
>> unsigned int i;
>> unsigned long trans_start;
>> unsigned long oldest_start = jiffies;
>>
>> for (i = 0; i < dev->num_tx_queues; i++) {
>> - struct netdev_queue *txq;
>> -
>> txq = netdev_get_tx_queue(dev, i);
>> if (!netif_xmit_stopped(txq))
>> continue;
>> @@ -561,9 +560,10 @@ static void dev_watchdog(struct timer_list *t)
>>
>> if (unlikely(timedout_ms)) {
>> trace_net_dev_xmit_timeout(dev, i);
>> - netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms\n",
>> + netdev_crit(dev, "NETDEV WATCHDOG: CPU: %d: transmit queue %u timed out %u ms (n:%ld)\n",
>> raw_smp_processor_id(),
>> - i, timedout_ms);
>> + i, timedout_ms,
>> + atomic_long_read(&txq->trans_timeout));
>
> It looks like txq could be uninitialized here if num_tx_queues is 0. I'm
> unsure if some weird/buggy device driver could actually hit that case,
> but grep '->num_tx_queues = 0;' has more than 0 hits in the current tree
> and I would err on the safe side.
Addressed in [V7], by reading out trans_timeout value when it is
accessed/incremented anyhow. Thus, avoiding the need to deref txq.
[V7] https://lore.kernel.org/all/20260612083530.1650245-5-hawk@kernel.org/
--Jesper
next prev parent reply other threads:[~2026-06-12 9:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260527135418.1166665-1-hawk@kernel.org>
2026-05-27 13:54 ` [PATCH net-next v6 1/5] net: add dev->bql flag to allow BQL sysfs for IFF_NO_QUEUE devices hawk
2026-05-27 13:54 ` [PATCH net-next v6 2/5] veth: implement Byte Queue Limits (BQL) for latency reduction hawk
2026-05-28 7:45 ` Jonas Köppeler
2026-06-04 8:19 ` Paolo Abeni
2026-06-10 12:21 ` Jesper Dangaard Brouer
2026-05-27 13:54 ` [PATCH net-next v6 3/5] veth: add tx_timeout watchdog as BQL safety net hawk
2026-06-04 8:24 ` Paolo Abeni
2026-06-10 12:37 ` Jesper Dangaard Brouer
2026-05-27 13:54 ` [PATCH net-next v6 4/5] net: sched: add timeout count to NETDEV WATCHDOG message hawk
2026-06-04 8:30 ` Paolo Abeni
2026-06-12 9:39 ` Jesper Dangaard Brouer [this message]
2026-05-27 13:54 ` [PATCH net-next v6 5/5] veth: time-based BQL completion coalescing via ethtool tx-usecs hawk
2026-05-28 7:46 ` Jonas Köppeler
2026-06-01 12:00 ` Simon Schippers
2026-06-01 14:03 ` Jonas Köppeler
2026-06-01 16:16 ` Simon Schippers
2026-06-02 7:24 ` Jonas Köppeler
2026-06-02 15:37 ` Simon Schippers
2026-06-03 8:28 ` Jonas Köppeler
2026-05-29 14:51 ` Simon Schippers
2026-06-04 8:21 ` Paolo Abeni
2026-06-08 10:38 ` Simon Schippers
2026-06-08 13:04 ` Jesper Dangaard Brouer
2026-06-08 13:13 ` Jonas Köppeler
2026-06-08 14:21 ` Simon Schippers
2026-06-09 13:59 ` Jesper Dangaard Brouer
2026-06-09 15:08 ` Simon Schippers
2026-06-10 7:04 ` Simon Schippers
2026-06-10 10:15 ` Jesper Dangaard Brouer
2026-06-10 12:00 ` Simon Schippers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7be62ade-2598-4c63-8b42-393323a1cc0e@kernel.org \
--to=hawk@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=j.koeppeler@tu-berlin.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome