From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, andrew+netdev@lunn.ch,
netdev@vger.kernel.org, maciej.machnikowski@intel.com,
jacob.e.keller@intel.com, przemyslaw.korba@intel.com,
grzegorz.nitka@intel.com, sergey.temerkhanov@intel.com,
arkadiusz.kubalewski@intel.com, poros@redhat.com,
richardcochran@gmail.com, horms@kernel.org,
pmenzel@molgen.mpg.de, aleksandr.loktionov@intel.com,
alexander.nowlin@intel.com
Subject: Re: [PATCH net v2 11/15] ice: wait for in-flight Tx timestamps before flushing the tracker
Date: Mon, 12 Oct 2026 23:15:30 +0000 [thread overview]
Message-ID: <179184693018.434549.11776352686949111433@kernel.org> (raw)
In-Reply-To: <20261008215614.1987250-12-anthony.l.nguyen@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1 (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] On E830 the flush still leaves hardware-ready entries
unacknowledged, so the drain does nothing for a device the commit…
- [Low] ice_ptp_rebuild_owner() calls ice_ptp_flush_all_tx_tracker(),
which now runs ice_ptp_wait_for_tracker_drain() on every port of the…
Pre-existing issues:
- [Low] At this commit, ice_ptp_process_tx_tstamp() sets drop_ts =
!link_up (line 592).
--
ice: wait for in-flight Tx timestamps before flushing the tracker
This patch adds a poll to ice_ptp_flush_tx_tracker(). For up to 10 ms per
port, it waits for the PHY to publish ready bits for all in-use Tx
timestamp slots, and only then flushes the tracker. E810 has no ready
bitmap, so it skips the wait.
> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
> index 818e2e265a7e5..5220de274819a 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
> @@ -744,6 +744,68 @@ ice_ptp_alloc_tx_tracker(struct ice_ptp_tx *tx)
[ ... ]
> +static void
> +ice_ptp_wait_for_tracker_drain(struct ice_pf *pf, struct ice_ptp_tx *tx)
> +{
> + bool drained;
> + int err;
> +
> + if (!tx->has_ready_bitmap)
> + return;
[Severity: Medium]
Does the drain actually help on E830? E830 has has_ready_bitmap set, so it
enters this wait. The commit message also lists it among the devices that
benefit:
"Only later devices (E822, E825, E830) have the bitmap ... Thus, skip
the wait for E810"
However, ice_clear_phy_tstamp() in ice_ptp_hw.c has no E830 case:
ice_clear_phy_tstamp() {
switch (hw->mac_type) {
case ICE_MAC_E810:
return ice_clear_phy_tstamp_e810(hw, block, idx);
case ICE_MAC_GENERIC:
return ice_clear_phy_tstamp_e82x(hw, block, idx);
case ICE_MAC_GENERIC_3K_E825:
return ice_clear_ptp_tstamp_eth56g(hw, block, idx);
default:
return -EOPNOTSUPP;
}
}
ice_ptp_flush_tx_tracker() ignores that return value, then clears in_use
and frees the skb anyway:
if (!hw->reset_ongoing && (tstamp_ready & BIT_ULL(phy_idx)))
ice_clear_phy_tstamp(hw, tx->block, phy_idx);
ice_ptp_reset_ts_memory(), ice_ptp_port_phy_stop() and
ice_ptp_port_phy_restart() also do nothing for E830.
So on E830, wouldn't an entry that becomes ready during the wait stay set
in E830_PRTMAC_TS_TX_MEM_VALID with no owner? That is the orphaned ready
bit state this patch is trying to prevent.
On the rebuild path the tracker stays initialized. For E830,
ice_ptp_ts_irq() re-arms PFINT_OICR whenever ice_ptp_tx_tstamps_pending()
sees a hardware ready bit.
Could such an orphan keep re-triggering the interrupt, or be picked up as
a stale timestamp by a later request that reuses the index?
The actual effect depends on two hardware details: whether E830 valid bits
clear only when the timestamp is read, and whether CORER resets the PRTMAC
timestamp memory. The E830 case is still missing from
ice_clear_phy_tstamp() at the end of the series.
> +
> + err = read_poll_timeout(ice_ptp_is_tracker_drained,
> + drained, drained, 500, 10 * USEC_PER_MSEC, false,
> + pf, tx);
[Severity: Low]
Will this poll always run until its full 10 ms timeout on the post-reset
rebuild path?
This call chain reaches the poll for every port on the adapter, one port
after another:
ice_rebuild()->ice_ptp_rebuild()->ice_ptp_rebuild_owner()->
ice_ptp_flush_all_tx_tracker()->ice_ptp_flush_tx_tracker()
ice_reset_subtask() clears reset_ongoing before the rebuild:
} else {
/* done with reset. start rebuild */
pf->hw.reset_ongoing = false;
ice_rebuild(pf, reset_type);
So the reset_ongoing early return in ice_ptp_is_tracker_drained() does not
skip the poll.
A CORER/GLOBR/EMPR reset drops the Tx rings. A request whose packet was
dropped that way will never get a ready bit, so
ice_ptp_is_tracker_drained() keeps returning false. That costs about 20
rounds of SBQ ready-bitmap reads per port. On an 8-port adapter it adds
roughly 80 ms to reset recovery.
A Tx hang is a common reason for the reset, and it is also the case most
likely to leave such entries behind.
The wait also seems unnecessary there. Right after the flush,
ice_ptp_rebuild_owner() does:
ice_ptp_flush_all_tx_tracker(pf);
/* Enable quad interrupts */
err = ice_ptp_cfg_phy_interrupt(pf, true, 1);
ice_ptp_cfg_phy_interrupt() calls ice_ptp_reset_ts_memory(), which resets
the E82x timestamp memory. On E825 ports with link up,
ice_ptp_restart_all_phy() then does a PHY soft reset.
Would it make sense to wait only on the release path? That is where new
requests are blocked and captures can still be in flight.
> + if (err) {
> + dev_dbg(ice_pf_to_dev(pf), "Timed out waiting for in-flight Tx timestamps on block %u\n",
> + tx->block);
> + }
> +}
> +
[ ... ]
> @@ -760,6 +822,8 @@ ice_ptp_flush_tx_tracker(struct ice_pf *pf, struct ice_ptp_tx *tx)
> int err;
> u8 idx;
>
> + ice_ptp_wait_for_tracker_drain(pf, tx);
> +
[Severity: Low]
This is a pre-existing issue and was not introduced by this patch. The new
drain only covers ice_ptp_flush_tx_tracker(). At this commit,
ice_ptp_process_tx_tstamp() can still create the same orphan when the link
goes down:
bool drop_ts = !link_up;
...
if (drop_ts)
goto skip_ts_read;
When a slot is not ready yet, this path clears in_use and frees the skb
without touching the PHY entry. If the capture finishes later, its ready
bit has no owner. That is the case the commit message describes.
The next patch in the series, "ice: keep Tx timestamp slots tracked until
completion or timeout", removes the link-down drop. After that patch, only
the 2 second timeout frees a slot that is not ready. That timeout is
intentional and is documented both in the ice_ptp_process_tx_tstamp()
kernel-doc and in that patch's commit message. So by the end of the series
this no longer applies.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261008215614.1987250-1-anthony.l.nguyen%40intel.com
next prev parent reply other threads:[~2026-10-12 23:15 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 21:55 [PATCH net v2 00/15][pull request] ice: E82x: timestamp processing logic fixes Tony Nguyen
2026-10-08 21:55 ` [PATCH net v2 01/15] ice: fix removal of PTP timestamp tracker during reset Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:55 ` [PATCH net v2 02/15] ice: use reference counting and SRCU for PTP port access Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 03/15] ice: fix PHY port restart serialization Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 04/15] ice: set in_use only after preparing Tx timestamp index Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 05/15] ice: call PTP link change only from link events Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 06/15] ice: E822: keep Tx timestamps disabled during offset calibration Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 07/15] ice: E822: cancel offset verification work during reset preparation Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 08/15] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 09/15] ice: E825: clear PHY_REG_TX_MEMORY_STATUS prior to soft reset Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 10/15] ice: E825: perform a soft reset when starting the PHY timer Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 11/15] ice: wait for in-flight Tx timestamps before flushing the tracker Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko [this message]
2026-10-08 21:56 ` [PATCH net v2 12/15] ice: keep Tx timestamp slots tracked until completion or timeout Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 13/15] ice: skip reading Tx ready bitmap on ports with no timestamps Tony Nguyen
2026-10-08 21:56 ` [PATCH net v2 14/15] ice: don't clear in_use until HW clears ready bitmap Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
2026-10-08 21:56 ` [PATCH net v2 15/15] ice: Recalibrate PHY after settime64 on E825-C Tony Nguyen
2026-10-12 23:15 ` netdev-bot+sashiko
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=179184693018.434549.11776352686949111433@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=alexander.nowlin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=grzegorz.nitka@intel.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=maciej.machnikowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pmenzel@molgen.mpg.de \
--cc=poros@redhat.com \
--cc=przemyslaw.korba@intel.com \
--cc=richardcochran@gmail.com \
--cc=sergey.temerkhanov@intel.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