From: Jacob Keller <jacob.e.keller@intel.com>
To: <netdev-bot+sashiko@kernel.org>
Cc: <przemyslaw.kitszel@intel.com>, <andrew+netdev@lunn.ch>,
<davem@davemloft.net>, <edumazet@kernel.org>, <kuba@kernel.org>,
<pabeni@redhat.com>, <poros@redhat.com>, <netdev@vger.kernel.org>,
<grzegorz.nitka@intel.com>, <aleksandr.loktionov@intel.com>,
<alexander.nowlin@intel.com>, <anthony.l.nguyen@intel.com>,
<maciej.machnikowski@intel.com>, <przemyslaw.korba@intel.com>,
<sergey.temerkhanov@intel.com>, <arkadiusz.kubalewski@intel.com>,
<richardcochran@gmail.com>, <horms@kernel.org>
Subject: Re: [PATCH net v5 11/13] ice: keep Tx timestamp slots tracked until completion or timeout
Date: Mon, 26 Oct 2026 14:58:53 -0700 [thread overview]
Message-ID: <ba2163b7-2b65-48cc-b637-3aee46d2bf19@intel.com> (raw)
In-Reply-To: <179297184533.3134.5564062752798799751@kernel.org>
On 10/25/2026 4:44 PM, netdev-bot+sashiko@kernel.org wrote:
> 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 commit message says link-down requests are marked stale,
> but the patch never marks them stale on E810, E830 or E82x.
>
> --
>
> ice: keep Tx timestamp slots tracked until completion or timeout
>
> This patch stops dropping outstanding Tx timestamp requests on link down
> and rejects new requests while the link is down. Slots that are not ready
> yet are now released by the existing 2 second timeout. It also makes the
> interrupt re-arm checks ignore stale slots, and lets
> ice_ptp_maybe_trigger_tx_interrupt() run for PFs that handle their own Tx
> timestamp interrupt.
>
>> diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
>> index b7c539f98276..309fa2877cc3 100644
>> --- a/drivers/net/ethernet/intel/ice/ice_ptp.c
>> +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
>
> [ ... ]
>
>> @@ -582,14 +584,11 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx)
>> return;
>> }
>>
>> - /* Drop packets if the link went down */
>> - link_up = READ_ONCE(ptp_port->link_up);
>> -
>> for_each_set_bit(idx, tx->in_use, tx->len) {
>> struct skb_shared_hwtstamps shhwtstamps = {};
>> u8 phy_idx = idx + tx->offset;
>> u64 raw_tstamp = 0, tstamp;
>> - bool drop_ts = !link_up;
>> + bool drop_ts = false;
>> struct sk_buff *skb;
>
> [Severity: Medium]
> The commit message says:
>
> Mark the outstanding requests stale so their completions are read
> and discarded
>
> Where does this stale marking happen for E810, E830 and E82x? The patch
> removes the link-down drop here, but it doesn't add any new calls to
> ice_ptp_mark_tx_tracker_stale().
>
At present it doesn't. I think this was needed for E825 because of the
complexity of what the reset flow required. I am not sure its actually
necessary on the other devices. We can improve the commit message for
clarity.
> On link down, the only caller that can be reached is the
> ICE_MAC_GENERIC_3K_E825 branch of ice_ptp_port_phy_stop() (and the same
> branch of ice_ptp_port_phy_restart()):
>
> ice_ptp_port_phy_stop() {
> ...
> case ICE_MAC_E810:
> case ICE_MAC_E830:
> err = 0;
> break;
> case ICE_MAC_GENERIC:
> kthread_cancel_delayed_work_sync(&ptp_port->ov_work);
>
> err = ice_stop_phy_timer_e82x(hw, port, true);
> break;
> case ICE_MAC_GENERIC_3K_E825:
> ...
> ice_ptp_mark_tx_tracker_stale(&ptp_port->tx);
> ...
> }
>
> Also, ice_ptp_link_change() skips E810 and E830 entirely:
>
> case ICE_MAC_E810:
> case ICE_MAC_E830:
> /* Do not reconfigure E810 or E830 PHY */
> break;
>
> The new in_irq check in ice_port_has_timestamps() only excludes stale
> slots:
>
> if (in_irq)
> return bitmap_andnot(tstamps, tx->in_use, tx->stale, tx->len);
>
> Given that, can a link down with a request still outstanding on E810
> (non-LL), E830 or E82x cause a back-to-back interrupt loop? The sequence
> would be:
>
> link goes down while a not-ready slot is set in in_use
> ice_ptp_maybe_trigger_tx_interrupt()
> ice_ptp_tx_tstamps_pending(pf, false) -> true
> wr32(hw, PFINT_OICR, PFINT_OICR_TSYN_TX_M)
> ice_ptp_process_tx_tstamp()
> slot not ready and not timed out -> continue
> ice_misc_intr_thread_fn() (E810/E82x) or ice_ptp_ts_irq() (E830)
> ice_ptp_tx_tstamps_pending(pf, true) -> true, slot is not stale
> wr32(hw, PFINT_OICR, PFINT_OICR_TSYN_TX_M)
> ... repeats until the 2 second timeout frees the slot
>
This ultimately depends on whether a given index actually gets stuck or
completes, which may depend on each device type. We don't really have a
good mechanism to rate limit how often the IRQ re-tries, (and at this
point I am heavily considering just trying to switch to a polling
implementation given how much trouble we've had with the IRQ to begin
with...)
> On E830 the re-arm happens in hardirq context in ice_ptp_ts_irq(). On E82x
> every pass does sideband PHY reads. Before this patch, the first pass after
> link down dropped every slot, so this loop could not happen.
>
> A later patch in this series, "ice: don't clear in_use until HW clears
> ready bitmap", adds an ice_ptp_is_tx_tracker_up() check to the in_irq
> branch. Combined with the link_up check added here, that seems to close
> the loop.
>
> Even after that patch, though, E810, E830 and E82x still don't get any
> stale marking on link down. So this commit isn't bisect-safe on its own,
> and the commit message describes a mechanism the code doesn't implement.
>
> Should the commit message be corrected, or should the stale marking be
> added for the other MAC types?
>
I can certainly try to reword the commit message...
next prev parent reply other threads:[~2026-10-26 21:59 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 22:12 [PATCH net v5 00/13] ice: E82x: timestamp processing logic fixes Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 01/13] ice: fix removal of PTP timestamp tracker during reset Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:23 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 02/13] ice: use reference counting and SRCU for PTP port access Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 03/13] ice: fix PHY port restart serialization Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:30 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 04/13] ice: set in_use only after preparing Tx timestamp index Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 05/13] ice: call PTP link change only from link events Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:40 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 06/13] ice: E822: keep Tx timestamps disabled during offset calibration Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 07/13] ice: E822: cancel offset verification work during reset preparation Jacob Keller
2026-10-25 23:43 ` netdev-bot+sashiko
2026-10-26 21:41 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 08/13] ice: E825: stop clearing PHY_REG_TX_OFFSET_READY Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:41 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 09/13] ice: E825: clear PHY_TSTAMP memory prior to soft reset Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:43 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 10/13] ice: E825: perform a soft reset when starting the PHY timer Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:52 ` Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 11/13] ice: keep Tx timestamp slots tracked until completion or timeout Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 21:58 ` Jacob Keller [this message]
2026-10-21 22:12 ` [PATCH net v5 12/13] ice: skip reading Tx ready bitmap on ports with no timestamps Jacob Keller
2026-10-21 22:12 ` [PATCH net v5 13/13] ice: don't clear in_use until HW clears ready bitmap Jacob Keller
2026-10-25 23:44 ` netdev-bot+sashiko
2026-10-26 22:07 ` Jacob Keller
2026-10-27 14:40 ` [PATCH net v5 00/13] ice: E82x: timestamp processing logic fixes Paolo Abeni
2026-10-27 19:32 ` Jacob Keller
2026-10-27 22:15 ` Jakub Kicinski
2026-10-27 22:57 ` Jacob Keller
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=ba2163b7-2b65-48cc-b637-3aee46d2bf19@intel.com \
--to=jacob.e.keller@intel.com \
--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=kuba@kernel.org \
--cc=maciej.machnikowski@intel.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@intel.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