From: sashiko-bot@kernel.org
To: "Aleksandr Loktionov" <aleksandr.loktionov@intel.com>,
intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH iwl-next 4/8] ixgbe: increase SECRX_RDY polling frequency in ixgbe_disable_rx_buff_generic
Date: Fri, 30 Oct 2026 04:53:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-190392@kernel.org> (raw)
In-Reply-To: <20260508031226.3601800-5-aleksandr.loktionov@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unbounded or excessively long hardware polling timeout due to using `usleep_range` with a fixed iteration count.
--
commit 8a91d1965e0f71698f5b5eb20f1c8e612eb2947a
Author: Maciej Rabeda <maciej.rabeda@intel.com>
ixgbe: increase SECRX_RDY polling frequency in ixgbe_disable_rx_buff_generic
This commit replaces a 40-iteration busy-wait loop with a 4000-iteration
sleeping loop in ixgbe_disable_rx_buff_generic() to reduce stalls when
the security block is quickly ready.
> The worst-case is now ~80 ms (4000 * 20
> us) plus scheduler latency, which is acceptable since SECRX_RDY
> failing to assert is a non-fatal informational condition (the function
> just logs a debug message).
Is this worst-case calculation accurate?
Because usleep_range() yields the CPU, scheduler latency and timer resolution
limits apply per iteration, rather than once for the entire loop. On a busy
system or one without high-resolution timers, usleep_range(10, 20) might
sleep for 1 to 10 ms per iteration.
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
> @@ -2683,7 +2683,7 @@ int prot_autoc_write_generic(struct ixgbe_hw *hw, u32 reg_val, bool locked)
> **/
> int ixgbe_disable_rx_buff_generic(struct ixgbe_hw *hw)
> {
> -#define IXGBE_MAX_SECRX_POLL 40
> +#define IXGBE_MAX_SECRX_POLL 4000
> int i;
> int secrxreg;
>
> @@ -2695,8 +2695,7 @@ int ixgbe_disable_rx_buff_generic(struct ixgbe_hw *hw)
> if (secrxreg & IXGBE_SECRXSTAT_SECRX_RDY)
> break;
> else
> - /* Use interrupt-safe sleep just in case */
> - udelay(1000);
> + usleep_range(10, 20);
> }
Could this loop stall for 4 to 40 seconds if the hardware is unresponsive
and the SECRX_RDY bit fails to assert?
With 4000 iterations, a 1 to 10 ms delay per iteration would result in a
multi-second stall. Since this function is used during device initialization
and reset paths, this could freeze network interface configuration and
potentially trigger khungtaskd panics if the RTNL lock is held.
Would it be safer to use an absolute time check, such as readx_poll_timeout()
or ktime_get(), to enforce a maximum timeout instead of multiplying the loop
count by the requested sleep duration?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260508031226.3601800-1-aleksandr.loktionov@intel.com?part=4
next prev parent reply other threads:[~2026-10-30 4:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 3:12 [Intel-wired-lan] [PATCH iwl-next 0/8] ixgbe: small cleanups and improvements Aleksandr Loktionov
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 1/8] ixgbe: rename numa_node to node in struct ixgbe_q_vector Aleksandr Loktionov
2026-05-11 15:27 ` Simon Horman
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 2/8] ixgbe: use int instead of u32 for error code variables Aleksandr Loktionov
2026-05-08 4:15 ` Przemek Kitszel
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 3/8] ixgbe: prevent adding duplicate FDIR perfect filter rules Aleksandr Loktionov
2026-05-08 4:44 ` Przemek Kitszel
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 4/8] ixgbe: increase SECRX_RDY polling frequency in ixgbe_disable_rx_buff_generic Aleksandr Loktionov
2026-05-11 15:30 ` Simon Horman
2026-10-30 4:53 ` sashiko-bot [this message]
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 5/8] ixgbe: use ktime_get_real_ns() in ixgbe_ptp_reset() Aleksandr Loktionov
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 6/8] ixgbe: extract ixgbe_restart_auto_neg() to avoid code duplication Aleksandr Loktionov
2026-05-11 15:40 ` Simon Horman
2026-05-12 13:42 ` Loktionov, Aleksandr
2026-05-13 12:13 ` Simon Horman
2026-10-30 4:54 ` sashiko-bot
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 7/8] ixgbe: limit ITR decrease in latency mode to prevent ACK overdrive Aleksandr Loktionov
2026-05-11 15:47 ` Simon Horman
2026-05-08 3:12 ` [Intel-wired-lan] [PATCH iwl-next 8/8] ixgbe: add IXGBE_ITR_ADAPTIVE_MASK_USECS constant Aleksandr Loktionov
2026-05-11 15:52 ` Simon Horman
2026-10-30 4:54 ` sashiko-bot
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=sashiko-outbox-190392@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
/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