Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Petr Oros" <poros@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH net v5 3/4] ice: resync uplink filters after a switchdev session
Date: Sat, 28 Nov 2026 08:58:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-238568@kernel.org> (raw)
In-Reply-To: <20261127085714.1207361-4-poros@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ice: ice_vsi_sync_fltr() re-adds uplink MAC filters during
  switchdev
--

commit edb8f55bf97ab7c6c15ad8258647b17f2ec38996
Author: Petr Oros <poros@redhat.com>

ice: resync uplink filters after a switchdev session

This commit adds ICE_VSI_ESWITCH_UPLINK to keep ice_vsi_sync_fltr() from
modifying the uplink promiscuous configuration during a switchdev session,
and schedules a filter resync when the session ends.

> diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> index c96b201901f48..d55c70edb7f7f 100644
> --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
[ ... ]
> @@ -28,6 +56,12 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
>  		if (ice_down(uplink_vsi))
>  			return -ENODEV;
>  
> +	/* the eswitch owns the uplink promisc config until the resync */
> +	while (test_and_set_bit(ICE_CFG_BUSY, uplink_vsi->state))
> +		usleep_range(1000, 2000);
> +	set_bit(ICE_VSI_ESWITCH_UPLINK, uplink_vsi->state);
> +	clear_bit_unlock(ICE_CFG_BUSY, uplink_vsi->state);
> +
>  	ice_remove_vsi_fltr(&pf->hw, uplink_vsi->idx);
>  	ice_vsi_cfg_sw_lldp(uplink_vsi, true, false);
[ ... ]
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index 6dede87b78944..2ce2b7138f668 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -394,6 +394,10 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
>  		}
>  	}
>  	err = 0;
> +	/* the eswitch owns the uplink promisc config during a session */
> +	if (test_bit(ICE_VSI_ESWITCH_UPLINK, vsi->state))
> +		goto exit;
> +
>  	/* check for changes in promiscuous modes */
>  	if (changed_flags & IFF_ALLMULTI) {
>  		if (vsi->current_netdev_flags & IFF_ALLMULTI) {

[Severity: High]
Does checking ICE_VSI_ESWITCH_UPLINK after the MAC filter sync block allow
ice_vsi_sync_fltr() to re-install the uplink's unicast and multicast MAC
filters during a switchdev session?

When ice_eswitch_enable_switchdev() calls ice_eswitch_setup_env() while the
uplink netdev is up, pf->eswitch.is_running is still false.  At the end of
ice_eswitch_setup_env(), ice_up(uplink_vsi) calls ice_vsi_cfg_lan() ->
ice_set_rx_mode(), which sees ice_is_switchdev_running() == false and
schedules a filter sync with ICE_VSI_UMAC_FLTR_CHANGED and
ICE_VSI_MMAC_FLTR_CHANGED set.

When ice_vsi_sync_fltr() runs for uplink_vsi, it executes __dev_uc_sync(),
__dev_mc_sync() and ice_fltr_add_mac_list() before reaching the
ICE_VSI_ESWITCH_UPLINK check, re-adding all the MAC filters that
ice_eswitch_setup_env() just removed and unsynced.  Because
pf->eswitch.is_running is then set to true, later address removals on the
uplink are ignored by ice_set_rx_mode(), leaving stale MAC rules in
hardware for the rest of the session (with multicast MAC rules also
overriding the lower-priority switchdev default Tx rule).  It also updates
vsi->current_netdev_flags = vsi->netdev->flags before the check, and in
ice_eswitch_setup_env() releasing ICE_CFG_BUSY before ice_remove_vsi_fltr()
and __dev_uc_unsync()/__dev_mc_unsync() lets an already-queued
ice_vsi_sync_fltr() race with filter removal.

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

  parent reply	other threads:[~2026-11-28  8:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  8:57 [PATCH net v5 0/4] ice: fix DFLT Rx rule handling for promisc and switchdev Petr Oros
2026-11-27  8:57 ` [PATCH net v5 1/4] ice: stop the service task before the PF is unloaded Petr Oros
2026-11-27 13:34   ` Ivan Vecera
2026-11-27 14:50   ` Przemek Kitszel
2026-11-28  9:30   ` netdev-bot+sashiko
2026-11-30 13:20     ` Petr Oros
2026-11-27  8:57 ` [PATCH net v5 2/4] ice: do not leave switchdev mode while representors exist Petr Oros
2026-11-27 13:34   ` Ivan Vecera
2026-11-28  9:30   ` netdev-bot+sashiko
2026-11-30 13:20     ` Petr Oros
2026-11-27  8:57 ` [PATCH net v5 3/4] ice: resync uplink filters after a switchdev session Petr Oros
2026-11-27 13:35   ` Ivan Vecera
2026-11-28  8:58   ` sashiko-bot [this message]
2026-11-28  9:30   ` netdev-bot+sashiko
2026-11-30 13:20     ` Petr Oros
2026-11-27  8:57 ` [PATCH net v5 4/4] ice: use a VLAN agnostic multicast promisc rule pair for PF VSIs Petr Oros
2026-11-27 13:36   ` Ivan Vecera
2026-11-28  9:30   ` netdev-bot+sashiko
2026-11-30 13:20     ` Petr Oros

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-238568@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=poros@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox