All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: mheib@redhat.com
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH iwl-next v6 1/2] i40e: move ATR sample rate from ring to PF level
Date: Mon, 12 Oct 2026 13:50:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-168217@kernel.org> (raw)
In-Reply-To: <20261011134952.54887-2-mheib@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] i40e: combined reset flags downgrade reset level to weaker PF_RESET
--

commit 6e65935fd380dc5da870cee78bd93449fc30b74c
Author: Mohammad Heib <mheib@redhat.com>

i40e: move ATR sample rate from ring to PF level

This commit moves the ATR sample rate from the per-ring struct to the
PF struct, initializing it once during software initialization. It also
triggers a PF reset when re-enabling ATR so that the TX queue HW context
is appropriately reprogrammed.

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> index 0ae50d7f34651..bc9b4a2bc23b2 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
[ ... ]
>  	if (test_bit(I40E_FLAG_FW_LLDP_DIS, changed_flags))
>  		reset_needed = I40E_PF_RESET_AND_REBUILD_FLAG;
>  
>  	if (test_bit(I40E_FLAG_VEB_STATS_ENA, changed_flags) ||
>  	    test_bit(I40E_FLAG_LEGACY_RX_ENA, changed_flags) ||
>  	    test_bit(I40E_FLAG_SOURCE_PRUNING_DIS, changed_flags))
>  		reset_needed = BIT(__I40E_PF_RESET_REQUESTED);

[Severity: Medium]
This problem wasn't introduced by this patch, but does this unconditionally
overwrite reset_needed? If I40E_FLAG_FW_LLDP_DIS is also in changed_flags,
it looks like the I40E_PF_RESET_AND_REBUILD_FLAG will be silently dropped.

>  
> +	/* Re-enabling ATR requires a reset to reprogram fd_ena in the
> +	 * TX queue HW context. Skip when FD_SB (ntuple) is already
> +	 * enabled, since i40e_configure_tx_ring() sets fd_ena when
> +	 * either FD flag is active.
> +	 */
> +	if (test_bit(I40E_FLAG_FD_ATR_ENA, changed_flags) &&
> +	    test_bit(I40E_FLAG_FD_ATR_ENA, new_flags) &&
> +	    !test_bit(I40E_FLAG_FD_SB_ENA, new_flags))
> +		reset_needed |= BIT(__I40E_PF_RESET_REQUESTED);

[Severity: Medium]
If changed_flags contains multiple flags (for instance FW_LLDP_DIS and
FD_ATR_ENA simultaneously via ethtool), this bitwise OR operation can cause
reset_needed to contain both I40E_PF_RESET_AND_REBUILD_FLAG and
BIT(__I40E_PF_RESET_REQUESTED).

When both flags are set, does this cause the weaker reset to be executed?
Looking at i40e_do_reset() in i40e_main.c, there is a cascade that checks
the weaker flag before I40E_PF_RESET_AND_REBUILD_FLAG:

    } else if (reset_flags & I40E_PF_RESET_FLAG) {
        ...
        dev_dbg(&pf->pdev->dev, "PFR requested\n");
        i40e_handle_reset_warning(pf, lock_acquired);

    } else if (reset_flags & I40E_PF_RESET_AND_REBUILD_FLAG) {

This means the requested rebuild from I40E_PF_RESET_AND_REBUILD_FLAG would
be skipped.

Also, looking at i40e_handle_reset_warning(), it appears to synchronously call
i40e_reset_and_rebuild() with reinit set to false, instead of deferring it via
__I40E_RESET_INTR_RECEIVED:

static void i40e_handle_reset_warning(struct i40e_pf *pf, bool lock_acquired)
{
        i40e_prep_for_reset(pf);
        i40e_reset_and_rebuild(pf, false, lock_acquired);
}

Can this lead to the VSI reinitialization being incorrectly skipped when
both flags are present?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261011134952.54887-1-mheib@redhat.com?part=1

  reply	other threads:[~2026-10-12 13:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 13:49 [PATCH iwl-next v6 0/2] i40e: add runtime-tunable ATR sample rate mheib
2026-10-11 13:49 ` [PATCH iwl-next v6 1/2] i40e: move ATR sample rate from ring to PF level mheib
2026-10-12 13:50   ` sashiko-bot [this message]
2026-10-12 14:34     ` Mohammad Heib
2026-10-11 13:49 ` [PATCH iwl-next v6 2/2] i40e: add devlink parameter for Flow Director ATR sample rate mheib
2026-10-12 13:50   ` 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-168217@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=mheib@redhat.com \
    --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 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.