From: netdev-bot+sashiko@kernel.org
To: anthony.l.nguyen@intel.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com, andrew+netdev@lunn.ch,
netdev@vger.kernel.org, chris.packham@alliedtelesis.co.nz,
kohei.enju@gmail.com, enjuk@amazon.com,
przemyslaw.kitszel@intel.com, blair.steven@alliedtelesis.co.nz,
carl.smith@alliedtelesis.co.nz, horms@kernel.org,
maciej.fijalkowski@intel.com, magnus.karlsson@intel.com,
ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org,
john.fastabend@gmail.com, sdf@fomichev.me, bpf@vger.kernel.org,
aleksandr.loktionov@intel.com, sx.rinitha@intel.com
Subject: Re: [PATCH net-next 4/4] i40e: Avoid repeating RX filter warning
Date: Fri, 04 Sep 2026 09:19:57 +0000 [thread overview]
Message-ID: <178851359799.4131868.11248615575150226456@kernel.org> (raw)
In-Reply-To: <20260901211752.1922993-5-anthony.l.nguyen@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:
Critical: 0 · High: 0 · Medium: 0 (1) · Low: 1
- [Low] Two diagnostics that report different failure classes are now
gated on one shared single-shot bit.
Pre-existing issues:
- [Medium] The overflow-promiscuous bit that the patch now also uses as a
log-once latch lives in `vsi->state`, which is protected only by an…
--
i40e: Avoid repeating RX filter warning
The patch converts the two set_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state)
call sites in i40e_aqc_add_filters() and i40e_aqc_broadcast_filter() to
test_and_set_bit(), so the "forcing overflow promiscuous" warning is only
emitted on the transition into overflow promiscuous mode.
> 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);
> + }
[Severity: Medium]
This isn't a bug introduced by this patch, but the warning is now latched on
a bit whose lifetime is managed by an ad-hoc flag-as-lock scheme, so is the
latch reliable?
i40e_sync_vsi_filters() serializes its whole sleeping section with an
open-coded acquire loop:
while (test_and_set_bit(__I40E_VSI_SYNCING_FILTERS, vsi->state))
usleep_range(1000, 2000);
pf = vsi->back;
old_overflow = test_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
and releases it with a plain clear_bit(__I40E_VSI_SYNCING_FILTERS,
vsi->state) on both the out: and err_no_memory: paths.
i40e_add_vsi(), reached from i40e_rebuild() and i40e_vsi_setup(), clears the
bit without participating in that gate at all:
spin_unlock_bh(&vsi->mac_filter_hash_lock);
clear_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
If that clear lands while i40e_sync_vsi_filters() is between its
old_overflow snapshot and the new_overflow / promisc_threshold decision, can
the warning re-fire, or the opposite, can the state read as non-overflowing
while filter programming keeps failing?
> } else if (vsi->type == I40E_VSI_SRIOV ||
> vsi->type == I40E_VSI_VMDQ1 ||
> vsi->type == I40E_VSI_VMDQ2) {
> @@ -2465,10 +2467,11 @@ i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name,
> }
>
> if (aq_ret) {
> - set_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state);
> - dev_warn(&vsi->back->pdev->dev,
> - "Error %s, forcing overflow promiscuous on %s\n",
> - libie_aq_str(hw->aq.asq_last_status), vsi_name);
> + if (!test_and_set_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state)) {
> + dev_warn(&vsi->back->pdev->dev,
> + "Error %s, forcing overflow promiscuous on %s\n",
> + libie_aq_str(hw->aq.asq_last_status), vsi_name);
> + }
> }
[Severity: Low]
Two different failure classes now share one single-shot bit. Is that
intended?
i40e_aqc_add_filters() warns when MAC/VLAN filter space is exhausted
(fcnt != num_add, typically LIBIE_AQ_RC_ENOSPC), while
i40e_aqc_broadcast_filter() warns on any AdminQ error returned by
i40e_aq_set_vsi_broadcast() or i40e_aq_set_vsi_bc_promisc_on_vlan(),
including errors that are not ENOSPC, and prints its own
libie_aq_str(hw->aq.asq_last_status) text.
In the scenario from the commit message (bridge vlan add vid 2-4094) the add
path sets __I40E_VSI_OVERFLOW_PROMISC first, so a later
i40e_aqc_broadcast_filter() failure of an unrelated class prints nothing
until the bit is cleared again.
For the delete path in i40e_sync_vsi_filters() the return value is
discarded:
if (is_broadcast_ether_addr(f->macaddr)) {
i40e_aqc_broadcast_filter(vsi, vsi_name, f);
hlist_del(&f->hlist);
kfree(f);
continue;
}
so with the warning suppressed, is that failure reported anywhere at all?
Would a per-site dev_warn_once() style latch, or a separate condition flag
per message, keep both diagnostics?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260901211752.1922993-1-anthony.l.nguyen%40intel.com
prev parent reply other threads:[~2026-09-04 9:19 UTC|newest]
Thread overview: 8+ 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-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
2026-09-04 9:19 ` netdev-bot+sashiko [this message]
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=178851359799.4131868.11248615575150226456@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=blair.steven@alliedtelesis.co.nz \
--cc=bpf@vger.kernel.org \
--cc=carl.smith@alliedtelesis.co.nz \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enjuk@amazon.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kohei.enju@gmail.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=sdf@fomichev.me \
--cc=sx.rinitha@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