From: Simon Horman <horms@kernel.org>
To: Petr Oros <poros@redhat.com>
Cc: netdev@vger.kernel.org, jacob.e.keller@intel.com,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH iwl-next 0/4] iavf: fix VLAN filter state machine races
Date: Thu, 19 Mar 2026 18:07:27 +0000 [thread overview]
Message-ID: <20260319180727.GR1753385@horms.kernel.org> (raw)
In-Reply-To: <20260316104209.1285962-1-poros@redhat.com>
On Mon, Mar 16, 2026 at 11:42:05AM +0100, Petr Oros wrote:
> The iavf VLAN filter state machine has several design issues that lead
> to race conditions between userspace add/del calls and the watchdog
> task's virtchnl processing. Filters can get lost or leak HW resources,
> especially during interface down/up cycles and namespace moves.
>
> The root problems:
>
> 1) On interface down, all VLAN filters are sent as DEL to PF and
> re-added on interface up. This is unnecessary and creates multiple
> race windows (details below).
>
> 2) The DELETE path immediately frees the filter struct after sending
> the DEL message, without waiting for PF confirmation. If the PF
> rejects the DEL, the filter remains in HW but the driver lost its
> tracking structure. Race conditions between a pending DEL and
> add/reset operations cannot be resolved because the struct is gone.
>
> 3) VIRTCHNL_OP_ADD_VLAN (V1) had no success completion handler, so
> filters stayed in IS_NEW state permanently.
...
> This series addresses all three issues:
>
> Patch 1 renames IS_NEW to ADDING for clarity.
>
> Patch 2 removes the DISABLE/INACTIVE state machinery so VLAN filters
> stay ACTIVE across down/up cycles. This is the core behavioral
> change -- VLAN filters are no longer sent as DEL to PF on interface
> down, and iavf_restore_filters() is removed since there is nothing
> to restore.
>
> Patch 3 adds a REMOVING state to make the DELETE path symmetric with
> ADD -- filters are only freed after PF confirms the deletion. If the
> PF rejects the DEL, the filter reverts to ACTIVE instead of being
> lost.
>
> Patch 4 hardens the remaining race windows: adds V1 ADD success
> handler and prevents redundant DEL on filters already in REMOVING
> state.
For the series:
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2026-03-19 18:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 10:42 [PATCH iwl-next 0/4] iavf: fix VLAN filter state machine races Petr Oros
2026-03-16 10:42 ` [PATCH iwl-next 1/4] iavf: rename IAVF_VLAN_IS_NEW to IAVF_VLAN_ADDING Petr Oros
2026-03-16 10:42 ` [PATCH iwl-next 2/4] iavf: stop removing VLAN filters from PF on interface down Petr Oros
2026-03-16 10:42 ` [PATCH iwl-next 3/4] iavf: wait for PF confirmation before removing VLAN filters Petr Oros
2026-03-16 10:42 ` [PATCH iwl-next 4/4] iavf: harden VLAN filter state machine race handling Petr Oros
2026-03-16 11:37 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-19 18:07 ` Simon Horman [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=20260319180727.GR1753385@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jacob.e.keller@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=poros@redhat.com \
--cc=przemyslaw.kitszel@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