RE: [Intel-wired-lan] [PATCH RFC iwl-next 2/4] iavf: stop removing VLAN filters from PF on interface down

From: Loktionov, Aleksandr

Date: Mon Mar 16 2026 - 07:42:11 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Petr Oros
> Sent: Monday, March 2, 2026 12:40 PM
> To: netdev@xxxxxxxxxxxxxxx
> Cc: Kitszel, Przemyslaw <przemyslaw.kitszel@xxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Andrew Lunn
> <andrew+netdev@xxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx;
> Keller, Jacob E <jacob.e.keller@xxxxxxxxx>; Jakub Kicinski
> <kuba@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH RFC iwl-next 2/4] iavf: stop
> removing VLAN filters from PF on interface down
>
> When a VF goes down, the driver currently sends DEL_VLAN to the PF for
> every VLAN filter (ACTIVE -> DISABLE -> send DEL -> INACTIVE), then
> re-adds them all on UP (INACTIVE -> ADD -> send ADD -> ADDING ->
> ACTIVE). This round-trip is unnecessary because:
>
> 1. The PF disables the VF's queues via VIRTCHNL_OP_DISABLE_QUEUES,
> which already prevents all RX/TX traffic regardless of VLAN filter
> state.
>
> 2. The VLAN filters remaining in PF HW while the VF is down is
> harmless - packets matching those filters have nowhere to go with
> queues disabled.
>
> 3. The DEL+ADD cycle during down/up creates race windows where the
> VLAN filter list is incomplete. With spoofcheck enabled, the PF
> enables TX VLAN filtering on the first non-zero VLAN add, blocking
> traffic for any VLANs not yet re-added.
>
> Remove the entire DISABLE/INACTIVE state machinery:
> - Remove IAVF_VLAN_DISABLE and IAVF_VLAN_INACTIVE enum values
> - Remove iavf_restore_filters() and its call from iavf_open()
> - Remove VLAN filter handling from iavf_clear_mac_vlan_filters(),
> rename it to iavf_clear_mac_filters()
> - Remove DEL_VLAN_FILTER scheduling from iavf_down()
> - Remove all DISABLE/INACTIVE handling from iavf_del_vlans()
>
> VLAN filters now stay ACTIVE across down/up cycles. Only explicit user
> removal (ndo_vlan_rx_kill_vid) or PF/VF reset triggers VLAN filter
> deletion/re-addition.
>
> Signed-off-by: Petr Oros <poros@xxxxxxxxxx>
> ---
> drivers/net/ethernet/intel/iavf/iavf.h | 6 +--
> drivers/net/ethernet/intel/iavf/iavf_main.c | 39 ++----------------
> -
> .../net/ethernet/intel/iavf/iavf_virtchnl.c | 33 +++-------------
> 3 files changed, 12 insertions(+), 66 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h
> b/drivers/net/ethernet/intel/iavf/iavf.h
> index 8e6db72828ae14..1ad00690622c8e 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h
> @@ -159,10 +159,8 @@ enum iavf_vlan_state_t {
> IAVF_VLAN_INVALID,
> IAVF_VLAN_ADD, /* filter needs to be added */
> IAVF_VLAN_ADDING, /* ADD sent to PF, waiting for response */

...

> if (i == count)
> break;
> --
> 2.52.0

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>