* [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue()
@ 2026-11-16 14:37 Curtis McBurney
2026-11-16 14:37 ` [PATCH net 1/2] " Curtis McBurney
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Curtis McBurney @ 2026-11-16 14:37 UTC (permalink / raw)
To: netdev
Cc: davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb,
toke, linux-kernel, Curtis McBurney
Since commit 95ecba62e2fd ("net: fix races in
netdev_tx_sent_queue()/dev_watchdog()"), every netif_tx_stop_queue()
call writes txq->trans_start, also on a queue that is already stopped.
Drivers whose Tx hang check stops the queue again on each run (e1000,
e1000e, igb, igc) keep moving trans_start forward, dev_watchdog() never
times out, and the hung adapter is never reset.
Patch 1 writes trans_start only when the driver stops a running queue,
before set_bit() as in 95ecba62e2fd. Patch 2 adds KUnit tests for the
four cases; one of them fails without patch 1.
The issue was observed on a system in real use. I reproduced it and
tested the fix on an AlmaLinux 10 kernel (6.12.0-211.68.1.el10_2) with
e1000 on a VMware-emulated 82545EM, using a test-only module parameter
that forces the e1000 hang check to fire. Patch 1 has the details. The
KUnit tests ran on UML on the net tree.
I wrote the fix. Claude Code (Anthropic) reviewed it, wrote the KUnit
tests, the e1000 reproducer and the changelogs.
Curtis McBurney (2):
net: keep txq->trans_start on repeated netif_tx_stop_queue()
net: net_test: add tests for netif_tx_stop_queue() trans_start
include/linux/netdevice.h | 11 +++-
net/core/net_test.c | 112 ++++++++++++++++++++++++++++++++++++++
2 files changed, 121 insertions(+), 2 deletions(-)
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
--
2.52.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH net 1/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() 2026-11-16 14:37 [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Curtis McBurney @ 2026-11-16 14:37 ` Curtis McBurney 2026-11-19 5:38 ` netdev-bot+sashiko 2026-11-16 14:37 ` [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start Curtis McBurney 2026-11-17 3:11 ` [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Xia Yan 2 siblings, 1 reply; 6+ messages in thread From: Curtis McBurney @ 2026-11-16 14:37 UTC (permalink / raw) To: netdev Cc: davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb, toke, linux-kernel, Curtis McBurney, stable Since commit 95ecba62e2fd ("net: fix races in netdev_tx_sent_queue()/dev_watchdog()"), netif_tx_stop_queue() writes txq->trans_start on every call, also when the queue is already stopped. Several drivers stop the queue from their periodic Tx hang check and leave the recovery to dev_watchdog(). e1000, e1000e, igb and igc call netif_stop_queue() or netif_stop_subqueue() each time the hang check, requested every 2 seconds by the driver watchdog, finds the hang again, and do not wake the queue. Each call now moves trans_start forward, so dev_watchdog() never sees the queue stopped for longer than watchdog_timeo (5 seconds for these drivers). ndo_tx_timeout() is never called and the adapter is never reset: the driver logs "Detected Tx Unit Hang" every 2 seconds while the NIC stays hung. Write trans_start only when the driver stops a queue that it had not stopped yet, i.e. when __QUEUE_STATE_DRV_XOFF is clear. The write still happens before set_bit(), which keeps the ordering against dev_watchdog() added by 95ecba62e2fd. A queue stopped only by BQL (__QUEUE_STATE_STACK_XOFF) still gets a new trans_start when the driver stops it. The test_bit() and set_bit() pair is not atomic. If netif_tx_wake_queue() runs between the two, trans_start keeps the time of the previous stop and dev_watchdog() measures from that earlier stop. A timeout is then reported only if both stops together last longer than watchdog_timeo. The issue was observed on a system in real use: a hung NIC kept reporting a Tx unit hang and was never reset. Code inspection then pointed to 95ecba62e2fd. I reproduced the issue and tested the fix on an AlmaLinux 10 kernel (6.12.0-211.68.1.el10_2, which contains 95ecba62e2fd) with the e1000 driver on a VMware-emulated Intel 82545EM. Reproducing required modifying the driver: a test-only module parameter makes e1000_clean_tx_irq() report a Tx unit hang on every hang check of one interface. netif_tx_stop_queue() is inlined into the driver, so the patched variant was e1000 built out of tree against the 6.12 headers with this change applied. With the fake hang held for 30 seconds: unpatched: 15 "Detected Tx Unit Hang", no NETDEV WATCHDOG, tx_timeout 0 -> 0 patched: first "NETDEV WATCHDOG ... timed out 5054 ms" 5 seconds after the first stop, followed by an adapter reset; tx_timeout 0 -> 5 This patch was not booted on the net tree. The KUnit tests added in the next patch pass with this change and fail without it. I wrote the fix. Claude Code (Anthropic) reviewed it, built the e1000 reproducer and wrote this changelog. Fixes: 95ecba62e2fd ("net: fix races in netdev_tx_sent_queue()/dev_watchdog()") Cc: stable@vger.kernel.org Signed-off-by: Curtis McBurney <cmcburney@telcobridges.com> --- include/linux/netdevice.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 435be7880d7e..6a488245db1e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3805,8 +3805,15 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) static __always_inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) { - /* Paired with READ_ONCE() from dev_watchdog() */ - WRITE_ONCE(dev_queue->trans_start, jiffies); + /* Only write trans_start on the initial state transition + * (when the DRV_XOFF bit changes from 0 to 1). + * This prevents recursive driver watchdog polls from continuously + * resetting the timeout timeline and blinding dev_watchdog(). + * + * Paired with READ_ONCE() from dev_watchdog() + */ + if (!test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state)) + WRITE_ONCE(dev_queue->trans_start, jiffies); /* This barrier is paired with smp_mb() from dev_watchdog() */ smp_mb__before_atomic(); base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4 -- 2.52.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() 2026-11-16 14:37 ` [PATCH net 1/2] " Curtis McBurney @ 2026-11-19 5:38 ` netdev-bot+sashiko 0 siblings, 0 replies; 6+ messages in thread From: netdev-bot+sashiko @ 2026-11-19 5:38 UTC (permalink / raw) To: cmcburney Cc: netdev, davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb, toke, linux-kernel, stable Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · 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). - [Medium] The patch makes netif_tx_stop_queue() skip the trans_start write when `test_bit(__QUEUE_STATE_DRV_XOFF)` reads the bit as set,… - [Low] The new comment in netif_tx_stop_queue() (include/linux/netdevice.h) says trans_start is written "only ... on… -- net: keep txq->trans_start on repeated netif_tx_stop_queue() With this patch, netif_tx_stop_queue() writes txq->trans_start only when __QUEUE_STATE_DRV_XOFF is not already set. e1000, e1000e, igb and igc stop the queue again on every periodic hang check. Since commit 95ecba62e2fd, each of those calls moved trans_start forward, so dev_watchdog() never fired. > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index 435be7880d7e5..6a488245db1ea 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -3805,8 +3805,15 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev) > > static __always_inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) > { > - /* Paired with READ_ONCE() from dev_watchdog() */ > - WRITE_ONCE(dev_queue->trans_start, jiffies); > + /* Only write trans_start on the initial state transition > + * (when the DRV_XOFF bit changes from 0 to 1). > + * This prevents recursive driver watchdog polls from continuously > + * resetting the timeout timeline and blinding dev_watchdog(). [Severity: Low] Is this comment accurate? The code below it calls test_bit() and then a separate set_bit() after smp_mb__before_atomic(). Because of that, DRV_XOFF can really go from 0 to 1 at set_bit() without any trans_start write. That happens if netif_tx_wake_queue() clears the bit between the two: net/core/dev.c:netif_tx_wake_queue() { if (test_and_clear_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state)) { ... } In that case set_bit() in netif_tx_stop_queue() makes the 0 to 1 transition, but the WRITE_ONCE() was already skipped. The changelog describes this race. The comment, though, says the timestamp follows every 0 to 1 transition. Readers of dev_watchdog() and netif_xmit_timeout_ms() could take that at face value. Could the comment mention the race? Also, the repeated hang check stops are periodic, not recursive. Would "repeated" be a better word than "recursive" here? > + * > + * Paired with READ_ONCE() from dev_watchdog() > + */ > + if (!test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state)) > + WRITE_ONCE(dev_queue->trans_start, jiffies); [Severity: Medium] Can this leave a newly stopped queue with a stale trans_start, and lead to a spurious "NETDEV WATCHDOG" timeout? Take a queue that has been DRV_XOFF since T0: CPU A CPU B netif_tx_stop_queue() test_bit(DRV_XOFF) == true (trans_start write skipped) netif_tx_wake_queue() test_and_clear_bit(DRV_XOFF) smp_mb__before_atomic() set_bit(DRV_XOFF) The queue is now held by a new stop, but trans_start is still T0. If nothing is transmitted between the wake and the re-stop, txq_trans_cond_update() does not run. dev_watchdog() then sees netif_xmit_stopped() and checks: net/sched/sch_generic.c:dev_watchdog() { ... trans_start = READ_ONCE(txq->trans_start); ... if (time_after(jiffies, trans_start + dev->watchdog_timeo)) { ... } This can call ndo_tx_timeout() and reset the adapter, even though the current stop is much shorter than watchdog_timeo. T0 can be quite old. netif_device_detach() stops all queues at suspend time, and netif_device_attach() wakes them without refreshing trans_start: net/core/dev.c:netif_device_attach() { if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && netif_running(dev)) { netif_tx_wake_all_queues(dev); netdev_watchdog_up(dev); } } Suppose a stop of an already stopped queue races with this wake, for example from a driver hang check. The queue stays stopped with a timestamp from before the suspend, just as the watchdog is armed. The window has no fixed limit either. Drivers call netif_tx_stop_all_queues() from preemptible process context (ndo_stop, reset, ring reconfiguration) without the tx lock. Preemption or an interrupt between test_bit() and set_bit() can make the window longer. dev_activate() does not have this problem, because transition_one_qdisc() writes trans_start for each tx queue. The changelog says: A timeout is then reported only if both stops together last longer than watchdog_timeo. Does that hold only when the wake and the re-stop come back to back? Otherwise, the interval that dev_watchdog() measures also includes the time the queue was running. Before this patch, every stop wrote jiffies before set_bit(), so a queue seen as stopped always had a current timestamp. The KUnit test patch later in the series does not change netif_tx_stop_queue(), so the window is still there at the end of the series. Would any of these work instead: rewriting trans_start when an atomic RMW on DRV_XOFF shows the bit was actually clear, keeping a separate "stopped since" timestamp, or refreshing trans_start in the wake path? > > /* This barrier is paired with smp_mb() from dev_watchdog() */ > smp_mb__before_atomic(); -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116143716.367451-1-cmcburney%40telcobridges.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start 2026-11-16 14:37 [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Curtis McBurney 2026-11-16 14:37 ` [PATCH net 1/2] " Curtis McBurney @ 2026-11-16 14:37 ` Curtis McBurney 2026-11-19 5:38 ` netdev-bot+sashiko 2026-11-17 3:11 ` [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Xia Yan 2 siblings, 1 reply; 6+ messages in thread From: Curtis McBurney @ 2026-11-16 14:37 UTC (permalink / raw) To: netdev Cc: davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb, toke, linux-kernel, Curtis McBurney Add KUnit tests for the txq->trans_start handling of netif_tx_stop_queue(), which dev_watchdog() uses to detect a stuck queue: - a stop on a running queue writes trans_start - a stop on a queue already stopped by the driver keeps trans_start - a stop after netif_tx_start_queue() writes trans_start again - a stop on a queue stopped only by BQL (__QUEUE_STATE_STACK_XOFF) writes trans_start txq_stop_keeps_stamp_stopped_queue fails without the previous patch. Tested on UML with CONFIG_KUNIT, CONFIG_NET and CONFIG_NET_TEST: tools/testing/kunit/kunit.py run --kunitconfig=<cfg> 'net_core.txq_*' Claude Code (Anthropic) wrote these tests and this changelog. Signed-off-by: Curtis McBurney <cmcburney@telcobridges.com> --- net/core/net_test.c | 112 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/net/core/net_test.c b/net/core/net_test.c index 2b5080c22663..c69d34d0e230 100644 --- a/net/core/net_test.c +++ b/net/core/net_test.c @@ -1721,6 +1721,114 @@ static void netmem_ref_test_tcp_devmem_recv(struct kunit *test) #endif #endif +/* netif_tx_stop_queue() and txq->trans_start */ + +#include <linux/etherdevice.h> +#include <linux/jiffies.h> +#include <linux/netdevice.h> + +/* dev_watchdog() reports a timeout when a queue stays stopped for longer + * than watchdog_timeo after txq->trans_start. A trans_start value this far + * in the past is distinguishable from a fresh one. + */ +#define TXQ_TEST_OLD_DELTA (10 * HZ) + +KUNIT_DEFINE_ACTION_WRAPPER(txq_test_free_netdev, free_netdev, + struct net_device *); + +static struct netdev_queue *txq_test_alloc(struct kunit *test) +{ + struct net_device *dev; + + dev = alloc_etherdev(0); + KUNIT_ASSERT_NOT_NULL(test, dev); + KUNIT_ASSERT_EQ(test, 0, + kunit_add_action_or_reset(test, txq_test_free_netdev, + dev)); + + return netdev_get_tx_queue(dev, 0); +} + +static void txq_test_expect_fresh(struct kunit *test, + struct netdev_queue *txq, + unsigned long before) +{ + unsigned long stamp = READ_ONCE(txq->trans_start); + + KUNIT_EXPECT_TRUE_MSG(test, time_in_range(stamp, before, jiffies), + "trans_start=%lu not in [%lu, %lu]", + stamp, before, jiffies); +} + +/* A stop on a running queue records the stop time in trans_start */ +static void txq_stop_stamps_running_queue(struct kunit *test) +{ + struct netdev_queue *txq = txq_test_alloc(test); + unsigned long before; + + WRITE_ONCE(txq->trans_start, jiffies - TXQ_TEST_OLD_DELTA); + before = jiffies; + netif_tx_stop_queue(txq); + + KUNIT_EXPECT_TRUE(test, netif_tx_queue_stopped(txq)); + txq_test_expect_fresh(test, txq, before); +} + +/* A stop on a queue that is already stopped keeps the first stop time, so + * repeated stops from a driver hang check do not postpone dev_watchdog() + */ +static void txq_stop_keeps_stamp_stopped_queue(struct kunit *test) +{ + struct netdev_queue *txq = txq_test_alloc(test); + unsigned long old, stamp; + + netif_tx_stop_queue(txq); + old = jiffies - TXQ_TEST_OLD_DELTA; + WRITE_ONCE(txq->trans_start, old); + netif_tx_stop_queue(txq); + stamp = READ_ONCE(txq->trans_start); + + KUNIT_EXPECT_TRUE(test, netif_tx_queue_stopped(txq)); + KUNIT_EXPECT_EQ_MSG(test, stamp, old, + "second stop moved trans_start forward by %lu jiffies", + stamp - old); +} + +/* A stop after a restart records a new stop time */ +static void txq_stop_stamps_restarted_queue(struct kunit *test) +{ + struct netdev_queue *txq = txq_test_alloc(test); + unsigned long before; + + netif_tx_stop_queue(txq); + netif_tx_start_queue(txq); + KUNIT_EXPECT_FALSE(test, netif_tx_queue_stopped(txq)); + + WRITE_ONCE(txq->trans_start, jiffies - TXQ_TEST_OLD_DELTA); + before = jiffies; + netif_tx_stop_queue(txq); + + KUNIT_EXPECT_TRUE(test, netif_tx_queue_stopped(txq)); + txq_test_expect_fresh(test, txq, before); +} + +/* Only the driver XOFF bit decides whether the stop is a transition. A queue + * stopped by BQL (stack XOFF) gets a new stop time when the driver stops it. + */ +static void txq_stop_stamps_stack_stopped_queue(struct kunit *test) +{ + struct netdev_queue *txq = txq_test_alloc(test); + unsigned long before; + + set_bit(__QUEUE_STATE_STACK_XOFF, &txq->state); + WRITE_ONCE(txq->trans_start, jiffies - TXQ_TEST_OLD_DELTA); + before = jiffies; + netif_tx_stop_queue(txq); + + KUNIT_EXPECT_TRUE(test, netif_tx_queue_stopped(txq)); + txq_test_expect_fresh(test, txq, before); +} + static struct kunit_case net_test_cases[] = { KUNIT_CASE_PARAM(gso_test_func, gso_test_gen_params), KUNIT_CASE_PARAM(ip_tunnel_flags_test_run, @@ -1738,6 +1846,10 @@ static struct kunit_case net_test_cases[] = { KUNIT_CASE(netmem_ref_test_tcp_devmem_recv), #endif #endif + KUNIT_CASE(txq_stop_stamps_running_queue), + KUNIT_CASE(txq_stop_keeps_stamp_stopped_queue), + KUNIT_CASE(txq_stop_stamps_restarted_queue), + KUNIT_CASE(txq_stop_stamps_stack_stopped_queue), { }, }; -- 2.52.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start 2026-11-16 14:37 ` [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start Curtis McBurney @ 2026-11-19 5:38 ` netdev-bot+sashiko 0 siblings, 0 replies; 6+ messages in thread From: netdev-bot+sashiko @ 2026-11-19 5:38 UTC (permalink / raw) To: cmcburney Cc: netdev, davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb, toke, linux-kernel, stable 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 patchset changes netif_tx_stop_queue() (include/linux/netdevice.h:3814-3821) so that it decides whether to… -- net: net_test: add tests for netif_tx_stop_queue() trans_start This adds four KUnit cases to net/core/net_test.c. They check how netif_tx_stop_queue() updates txq->trans_start on a running queue, a queue already stopped by the driver, a restarted queue and a queue stopped only by BQL. They cover the previous patch, which skips the trans_start write when __QUEUE_STATE_DRV_XOFF is already set. > diff --git a/net/core/net_test.c b/net/core/net_test.c > index 2b5080c226636..c69d34d0e2306 100644 > --- a/net/core/net_test.c > +++ b/net/core/net_test.c [ ... ] > +/* A stop on a queue that is already stopped keeps the first stop time, so > + * repeated stops from a driver hang check do not postpone dev_watchdog() > + */ > +static void txq_stop_keeps_stamp_stopped_queue(struct kunit *test) > +{ > + struct netdev_queue *txq = txq_test_alloc(test); > + unsigned long old, stamp; > + > + netif_tx_stop_queue(txq); > + old = jiffies - TXQ_TEST_OLD_DELTA; > + WRITE_ONCE(txq->trans_start, old); > + netif_tx_stop_queue(txq); > + stamp = READ_ONCE(txq->trans_start); [Severity: Medium] This test treats the check-then-set behaviour added to netif_tx_stop_queue() by the previous patch as the intended contract. Is that behaviour safe when netif_tx_wake_queue() runs at the same time? include/linux/netdevice.h:netif_tx_stop_queue() { if (!test_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state)) WRITE_ONCE(dev_queue->trans_start, jiffies); /* This barrier is paired with smp_mb() from dev_watchdog() */ smp_mb__before_atomic(); /* Must be an atomic op see netif_txq_try_stop() */ set_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state); } The test_bit() and the set_bit() do not happen as one atomic step. Suppose TX completion clears the bit locklessly between them. The set_bit() is then a real 0->1 transition, but trans_start still holds the stamp from the earlier stop: CPU1 (queue stopped, trans_start == T0) CPU2 netif_tx_stop_queue() test_bit(DRV_XOFF) == 1 (trans_start not written) netif_tx_wake_queue() test_and_clear_bit(DRV_XOFF) (queue idle, no txq_trans_update()) set_bit(DRV_XOFF) After that, dev_watchdog() sees a stopped queue with trans_start == T0: trans_start = READ_ONCE(txq->trans_start); if (time_after(jiffies, trans_start + dev->watchdog_timeo)) { Can this report a NETDEV WATCHDOG timeout and call ndo_tx_timeout() right after the queue was stopped again? Before the previous patch, the stamp was always written before set_bit(). So a stop could never leave the queue stopped with an old stamp. The previous commit says "A timeout is then reported only if both stops together last longer than watchdog_timeo". Does that still hold when the caller can be preempted? For example, e1000_print_hw_hang() runs from the print_hang_task work item. It can call netif_stop_queue() on a queue that is already stopped: drivers/net/ethernet/intel/e1000e/netdev.c:e1000_print_hw_hang() { ... /* Real hang detected */ netif_stop_queue(netdev); ... } If it is preempted after test_bit(), the queue can be woken and then sit idle for any length of time. That running time also counts against watchdog_timeo. These tests all run on a single thread, so they can't catch this window. > + > + KUNIT_EXPECT_TRUE(test, netif_tx_queue_stopped(txq)); > + KUNIT_EXPECT_EQ_MSG(test, stamp, old, > + "second stop moved trans_start forward by %lu jiffies", > + stamp - old); > +} [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116143716.367451-1-cmcburney%40telcobridges.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() 2026-11-16 14:37 [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Curtis McBurney 2026-11-16 14:37 ` [PATCH net 1/2] " Curtis McBurney 2026-11-16 14:37 ` [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start Curtis McBurney @ 2026-11-17 3:11 ` Xia Yan 2 siblings, 0 replies; 6+ messages in thread From: Xia Yan @ 2026-11-17 3:11 UTC (permalink / raw) To: Curtis McBurney, netdev Cc: davem, edumazet, kuba, pabeni, horms, andrew+netdev, willemb, toke, linux-kernel, yana06070 On 11/16/26 09:37, Curtis McBurney wrote: > Since commit 95ecba62e2fd ("net: fix races in > netdev_tx_sent_queue()/dev_watchdog()"), every netif_tx_stop_queue() > call writes txq->trans_start, also on a queue that is already stopped. Each of the four drivers re-arms its hang check from a two-second watchdog task and stops the queue again while the hang persists, without waking it: e1000 and e1000e via netif_stop_queue() from e1000_clean_tx_irq() and e1000_print_hw_hang(), igb and igc via netif_stop_subqueue(). All four set watchdog_timeo to 5 seconds, so with the unconditional write each repeat stop moves trans_start another two seconds forward and dev_watchdog() never reaches trans_start + watchdog_timeo. The ordering of 95ecba62e2fd survives the gate: the WRITE_ONCE still precedes the barrier and the set_bit(), and both of those remain unconditional. A queue stopped only by BQL still gets a stamp, since the gate tests DRV_XOFF alone. That case is the last of the KUnit tests. Reviewed-by: Xia Yan <yanxia@cmss.chinamobile.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-19 5:38 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-11-16 14:37 [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Curtis McBurney 2026-11-16 14:37 ` [PATCH net 1/2] " Curtis McBurney 2026-11-19 5:38 ` netdev-bot+sashiko 2026-11-16 14:37 ` [PATCH net 2/2] net: net_test: add tests for netif_tx_stop_queue() trans_start Curtis McBurney 2026-11-19 5:38 ` netdev-bot+sashiko 2026-11-17 3:11 ` [PATCH net 0/2] net: keep txq->trans_start on repeated netif_tx_stop_queue() Xia Yan
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®