mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Federico Musto <federico@rimpianto.com>
To: netdev-bot+sashiko@kernel.org
Cc: Federico Musto <federico@rimpianto.com>,
	Chris Snook <chris.snook@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH net v4 1/2] net: atl1c: wait for in-flight RX polls before the link-down ring reset
Date: Wed, 25 Nov 2026 12:34:48 +0100	[thread overview]
Message-ID: <20261125113448.99952-1-federico@rimpianto.com> (raw)
In-Reply-To: <179530311729.3135.17859147482038356358@kernel.org>

Thank you for the review. A two-patch v5 addressing the findings is
posted here:

https://lore.kernel.org/netdev/20261125113120.99743-1-federico@rimpianto.com/

[High] "This patch does not close the RX race it claims to fix."

Correct. In v5, atl1c_rx_poll_sync() returns bool and, when __AT_DOWN
appears while waiting, the link-down handler skips the reset entirely
instead of proceeding without having waited. Skipping is safe: every
setter of __AT_DOWN is a teardown path that napi_disable()s all queues
and then runs atl1c_reset_dma_ring() itself, so the rings are reset
with NAPI quiesced by the teardown that owns them. The handler runs
again on the next link-change event.

On the remark that the loop "polls another context's state bit and its
exit condition does not synchronise with the poll": the wait now pairs
with the polling side. The handshake is a store-buffer pattern - the
work item stores the carrier-off state and then loads
NAPI_STATE_SCHED, while the scheduling side stores NAPI_STATE_SCHED
(the cmpxchg in napi_schedule_prep()) and the poll then loads the
carrier. A full barrier between store and load on each side (an
explicit smp_mb() after netif_carrier_off() here) guarantees that
either the work item sees the in-flight poll and waits for it, or the
poll sees the carrier off and returns at entry without touching the
rings.

[Medium] Unbounded wait with threaded busy-poll.

Correct. The wait is now bounded: 500 iterations of
usleep_range(1000, 2000), about 0.5-1 s. On timeout the work item logs
a ratelimited warning and skips the reset - it never resets under a
possibly live poll - and re-enables interrupts, so later link-change
events are handled. The reset is likewise skipped when __AT_DOWN
appears (above). In both cases the rings are left to their owner and
the link-down event falls back to the pre-5e5c0964d9b9 behaviour (no
MAC reset), which is degraded but safe.

[High, pre-existing] TX side of the same reset.

Acknowledged and still out of scope for this series: it belongs to the
serialisation of the work item against the atl1c_down() callers, which
the changelog defers. Unchanged in v5, restated under the ---.

One runtime observation from the v5 hardware validation (emulated
AR8151 on a MikroTik CCR2004-1G-2XS-PCIe): twice, about 1.3 s after an
MTU change and immediately before the device signalled link down, the
IOMMU blocked a DMA read from the device to an unmapped address. Both
faults precede the link-down interrupt, so they happened before any
code touched by this series ran for that event. I have not established
the cause; reported here and in the cover letter as an observation
only.

pw-bot: cr

  reply	other threads:[~2026-11-25 11:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 22:55 [PATCH net v4 0/2] net: atl1c: fix the RX buffer leak on errored frames Federico Musto
2026-11-17 22:55 ` [PATCH net v4 1/2] net: atl1c: wait for in-flight RX polls before the link-down ring reset Federico Musto
2026-11-21 23:18   ` netdev-bot+sashiko
2026-11-25 11:34     ` Federico Musto [this message]
2026-11-17 22:55 ` [PATCH net v4 2/2] net: atl1c: free the RX buffer when the descriptor reports an error Federico Musto
2026-11-21 23:18   ` netdev-bot+sashiko
2026-11-25 11:34     ` Federico Musto

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=20261125113448.99952-1-federico@rimpianto.com \
    --to=federico@rimpianto.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®