From: Tian Xun Ng <luckilystar08@gmail.com>
To: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org, Emil Tantilov <emil.s.tantilov@intel.com>,
anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
aleksander.lobakin@intel.com, aleksandr.loktionov@intel.com,
decot@google.com, milena.olech@intel.com, joshua.a.hay@intel.com,
alan.brady@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
Tian Xun Ng <tianxun.ng@bytedance.com>
Subject: [PATCH iwl-net v5 0/3] idpf: destroy the vports on shutdown
Date: Tue, 13 Oct 2026 20:12:21 +0800 [thread overview]
Message-ID: <20261013121224.84482-1-luckilystar08@gmail.com> (raw)
From: Tian Xun Ng <tianxun.ng@bytedance.com>
On shutdown idpf shuts its virtchnl transaction manager down before the
vports are torn down, so the device is never told that they are gone.
Patch 3 keeps the mailbox up for that teardown, as remove already does,
with a short timeout so that an unresponsive control plane cannot hold
up a reboot for long. Patches 1 and 2 first close two existing races in
which the mailbox task uses state that the teardown has released: the
async PTP Tx timestamp reply, which patch 3 would otherwise make
reachable on shutdown, and link change events, which can already arrive
in that window on both remove and shutdown.
An LLM coding assistant helped analyse the problem and draft the changes
and their messages. Each patch carries an Assisted-by tag.
Changes in v5:
- New patch 2: idpf_handle_event_link() returns once IDPF_REMOVE_IN_PROG
is set, so that a link event cannot use a vport, or its netdev, that
idpf_deinit_task() has released (Sashiko on v4). The window predates
this series: mbx_task keeps running until idpf_vc_core_deinit()
cancels it after the vports are gone, with or without the requeue in
patch 1, whose drain makes the check race-free. The same window on a
hard reset is not changed.
- Patch 1 is retitled to the mailbox reply it guards. The Tx timestamp
state cached for the transmit and Tx completion paths is freed by
idpf_ptp_release() before NAPI is disabled; that older lifetime issue
is not touched here.
- Patch 3: a missing Tx queue marker no longer stops the mailbox
messages that follow. The remaining queues of that vport skip their
marker wait, and UNMAP_QUEUE_VECTOR, DESTROY_VPORT and DEALLOC_VECTORS
are still sent with the 500 ms cap. This departs from the helper
suggested on v3, which also failed the later messages: the device has
just answered DISABLE_QUEUES, so its mailbox works. With the first
marker treated as missing, all six transactions completed and 3 of 3
warm reboots were clean.
- Patch 3: the kdoc and the message now say that only a synchronous
transaction that times out fails the later ones at once, and that a
reset already running in the event task keeps its own timeouts.
IDPF_REMOVE_IN_PROG is documented as covering shutdown.
Testing of v5, besides what patch 3 describes: W=1 builds of idpf and
libie with allmodconfig and allyesconfig showed no new warnings after
each patch. On one server, modprobe -r idpf and a reload completed
without warnings or IOMMU faults. No link event arrived during a
teardown in these tests, so the path patch 2 changes was not exercised;
these devices do not support PTP, so neither was the one patch 1
changes.
Changes in v4 (patch numbers as in v4):
- New patch 1, closing the Tx timestamp callback race that Sashiko
pointed out on v3. It already affects remove; with patch 2 it would
also reach shutdown.
- Patch 2: the Tx queue SW marker wait follows the same bail-out as the
mailbox transactions, so a control plane that acks DISABLE_QUEUES but
posts no markers costs one marker timeout instead of one per queue
(Emil).
- Patch 2: the statistics task stops sending once IDPF_REMOVE_IN_PROG is
set (Emil).
- Patch 2: the shutdown comment now says that a transaction already in
flight keeps its own timeout; bounding that would need support in
libie.
- Not changed: if one teardown reply or Tx queue marker takes longer
than 500 ms, the rest of the teardown is skipped. On the tested PFs
the queue-related messages took at most 240 ms, and the slowest,
DEALLOC_VECTORS (about 300 ms), is sent last, after DESTROY_VPORT.
With the driver made to treat the first Tx queue marker as missing, so
that UNMAP_QUEUE_VECTOR, DESTROY_VPORT and DEALLOC_VECTORS were
skipped, 3 of 3 warm reboots were still clean on these devices. A
function reset as a fallback was patch 2 of v1; in our tests a
function reset on shutdown did not stop the faults, so it was dropped.
I can add one for when the timeout fires if that is preferred.
Changes in v3:
- No new flags: adapter->vc_xn_timeout_ms (60 s from probe) is lowered
to 500 ms on shutdown, and idpf_send_mb_msg() fails the rest at once
after a shortened transaction times out (Emil).
- IDPF_REMOVE_IN_PROG is set before the service and event tasks are
cancelled (Emil); the comment and message no longer state that a reset
does not clear the vports (Emil).
v4: https://lore.kernel.org/all/20261012063027.27750-1-luckilystar08@gmail.com/
v3: https://lore.kernel.org/all/20261009032706.94324-1-luckilystar08@gmail.com/
v2: https://lore.kernel.org/all/20261007055741.30629-1-luckilystar08@gmail.com/
v1: https://lore.kernel.org/all/20260917105205.37561-1-luckilystar08@gmail.com/
Tian Xun Ng (3):
idpf: ignore Tx timestamp replies once removal has started
idpf: ignore link events once removal has started
idpf: keep the mailbox up while tearing down vports on shutdown
drivers/net/ethernet/intel/idpf/idpf.h | 5 +-
drivers/net/ethernet/intel/idpf/idpf_lib.c | 3 ++
drivers/net/ethernet/intel/idpf/idpf_main.c | 11 +++++
.../net/ethernet/intel/idpf/idpf_virtchnl.c | 49 ++++++++++++++++---
.../net/ethernet/intel/idpf/idpf_virtchnl.h | 1 +
.../ethernet/intel/idpf/idpf_virtchnl_ptp.c | 3 +-
6 files changed, 64 insertions(+), 8 deletions(-)
--
2.50.1 (Apple Git-155)
next reply other threads:[~2026-10-13 12:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 12:12 Tian Xun Ng [this message]
2026-10-13 12:12 ` [PATCH iwl-net v5 1/3] idpf: ignore Tx timestamp replies once removal has started Tian Xun Ng
2026-10-13 16:26 ` Tantilov, Emil S
2026-10-13 12:12 ` [PATCH iwl-net v5 2/3] idpf: ignore link events " Tian Xun Ng
2026-10-13 16:27 ` Tantilov, Emil S
2026-10-13 12:12 ` [PATCH iwl-net v5 3/3] idpf: keep the mailbox up while tearing down vports on shutdown Tian Xun Ng
2026-10-13 16:31 ` Tantilov, Emil S
2026-10-14 12:13 ` sashiko-bot
2026-10-14 13:30 ` Tian Xun Ng
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=20261013121224.84482-1-luckilystar08@gmail.com \
--to=luckilystar08@gmail.com \
--cc=alan.brady@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=decot@google.com \
--cc=edumazet@google.com \
--cc=emil.s.tantilov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=joshua.a.hay@intel.com \
--cc=kuba@kernel.org \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=tianxun.ng@bytedance.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.