All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tony Nguyen" <anthony.l.nguyen@intel.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 4/4] i40e: Avoid repeating RX filter warning
Date: Wed, 02 Sep 2026 21:18:16 +0000	[thread overview]
Message-ID: <20260902211817.0017C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901211752.1922993-5-anthony.l.nguyen@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] The fix for repeating RX filter warnings is incomplete and leaves SRIOV/VMDQ VSIs vulnerable to log spam, exacerbated by unconditional state clearing for untrusted VFs.

Pre-existing issues:
- [High] The function `i40e_sync_vsi_filters` implements an ad-hoc sleeping spinlock using a bit flag (`__I40E_VSI_SYNCING_FILTERS`), violating subsystem locking guidelines.
--

commit e12ee63ee282f8dda3570d0ba1ab6d4fc31ab63e
Author: Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: i40e: Avoid repeating RX filter warning

This patch introduces a test_and_set_bit check on the overflow promiscuous
state flag to suppress repetitive log messages when the driver forces
overflow promiscuous mode due to a lack of space for RX filters. It updates
the warning logic in both i40e_aqc_add_filters and i40e_aqc_broadcast_filter.

> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index 719f45b5cb409..abbc71e815ae3 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
[ ... ]
> @@ -2412,10 +2412,12 @@ void i40e_aqc_add_filters(struct i40e_vsi *vsi, const char *vsi_name,
>  
>  	if (fcnt != num_add) {
>  		if (vsi->type == I40E_VSI_MAIN) {
> -			set_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
> -			dev_warn(&vsi->back->pdev->dev,
> -				 "Error %s adding RX filters on %s, promiscuous mode forced on\n",
> -				 libie_aq_str(aq_status), vsi_name);
> +			if (!test_and_set_bit(__I40E_VSI_OVERFLOW_PROMISC,
> +					      vsi->state)) {
> +				dev_warn(&vsi->back->pdev->dev,
> +					 "Error %s adding RX filters on %s, promiscuous mode forced on\n",
> +					 libie_aq_str(aq_status), vsi_name);
> +			}
>  		} else if (vsi->type == I40E_VSI_SRIOV ||
>  			   vsi->type == I40E_VSI_VMDQ1 ||
>  			   vsi->type == I40E_VSI_VMDQ2) {

[Severity: High]
Does this logic leave virtual function and vmdq VSIs vulnerable to log spam?
The patch suppresses the warning for the main VSI by checking
test_and_set_bit, but the else if branch for the other VSI types immediately
below it does not use a state check.

Should the state-based warning suppression be enforced equally across all VSI
types?

This regression seems exacerbated by the unconditional state clearing for
untrusted virtual functions in i40e_sync_vsi_filters:

drivers/net/ethernet/intel/i40e/i40e_main.c:i40e_sync_vsi_filters() {
    ...
	/* if the VF is not trusted do not do promisc */
	if (vsi->type == I40E_VSI_SRIOV && pf->vf &&
	    !pf->vf[vsi->vf_id].trusted) {
		clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
		goto out;
	}
    ...
}

Does this unconditional state clearing destroy the warning suppression logic
for untrusted virtual functions, potentially leading to a denial of service
via log spam?

[Severity: High]
This is a pre-existing issue, but while reviewing the synchronization of
these filters I noticed the following pattern in i40e_sync_vsi_filters:

drivers/net/ethernet/intel/i40e/i40e_main.c:i40e_sync_vsi_filters() {
	...
	while (test_and_set_bit(__I40E_VSI_SYNCING_FILTERS, vsi->state))
		usleep_range(1000, 2000);
	...
out:
	...
	clear_bit(__I40E_VSI_SYNCING_FILTERS, vsi->state);
	return retval;
	...
}

Does this implement an ad-hoc sleeping spinlock using a bit flag, violating
the subsystem guidelines for synchronization?

Would it be better to directly replace this custom polling loop with a
standard mutex to ensure strict lockdep tracking and memory ordering?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901211752.1922993-1-anthony.l.nguyen@intel.com?part=4

  reply	other threads:[~2026-09-02 21:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 21:17 [PATCH net-next 0/4][pull request] Intel Wired LAN Driver Updates 2026-09-01 (i40e) Tony Nguyen
2026-09-01 21:17 ` [PATCH net-next 1/4] i40e: prepare for XDP metadata ops support Tony Nguyen
2026-09-01 21:17 ` [PATCH net-next 2/4] i40e: add support for bpf_xdp_metadata_rx_hash() Tony Nguyen
2026-09-04  9:19   ` netdev-bot+sashiko
2026-09-05  1:50     ` Jakub Kicinski
2026-09-01 21:17 ` [PATCH net-next 3/4] i40e: add support for bpf_xdp_metadata_rx_vlan_tag() Tony Nguyen
2026-09-01 21:17 ` [PATCH net-next 4/4] i40e: Avoid repeating RX filter warning Tony Nguyen
2026-09-02 21:18   ` sashiko-bot [this message]
2026-09-04  9:19   ` netdev-bot+sashiko
2026-09-05  1:50 ` [PATCH net-next 0/4][pull request] Intel Wired LAN Driver Updates 2026-09-01 (i40e) patchwork-bot+netdevbpf

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=20260902211817.0017C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bpf@vger.kernel.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 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.