Netdev List
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: Petr Oros <poros@redhat.com>, netdev@vger.kernel.org
Cc: 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@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Simon Horman <horms@kernel.org>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Grzegorz Nitka <grzegorz.nitka@intel.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Wojciech Drewek <wojciech.drewek@intel.com>,
	Marcin Szycik <marcin.szycik@linux.intel.com>,
	Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@linux.intel.com>,
	Alice Michael <alice.michael@intel.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	Jesse Brandeburg <jbrandeb@kernel.org>,
	Patryk Holda <patryk.holda@intel.com>,
	Rinitha S <sx.rinitha@intel.com>,
	Aaron Ma <aaron.ma@canonical.com>,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session
Date: Thu, 3 Dec 2026 11:56:54 +0100	[thread overview]
Message-ID: <bcdefaf6-6ca3-41da-b30e-2dcd77b3e8a9@redhat.com> (raw)
In-Reply-To: <20261202071642.2527605-4-poros@redhat.com>

On 12/2/26 08:16, Petr Oros wrote:
> A switchdev session leaves the uplink filters out of sync with its
> netdev. ice_eswitch_setup_env() removes the multicast promisc rules, and
> ice_eswitch_release_env() removes the default VSI (DFLT) Rx rule that a
> promiscuous uplink needs. ice_set_rx_mode() ignores the uplink during
> the session and nothing syncs it when the session ends, so these rules
> are not installed again, and flag changes made meanwhile are lost.
> 
> Let the eswitch own the uplink promisc configuration during a session.
> While the new ICE_VSI_ESWITCH_UPLINK bit is set, ice_vsi_sync_fltr()
> leaves the promisc configuration of the uplink alone. Its address list
> filters are still installed again during a session that starts with
> the uplink up, an older behavior this patch does not change. When the
> session ends, after is_running is cleared, ice_eswitch_resync_uplink()
> clears the bit and queues a full filter sync, which programs the uplink
> from the netdev flags. As before this patch, nothing retries a failed
> promisc step on its own. A full barrier in ice_set_rx_mode() orders the
> flag change of its caller before the is_running test, so a change made
> while the session ends is not lost. The is_running accesses use
> READ_ONCE() and WRITE_ONCE(), they are read locklessly in the Tx path.
> ice_vsi_sync_fltr() releases ICE_CFG_BUSY with clear_bit_unlock() now,
> like the new sections, so the stores it makes in its section are
> ordered before the next one takes the bit.
> ice_eswitch_setup_env() drops a filter sync that is still pending, so a
> session that a reset creates again does not run the sync queued when
> the old one ended. Also subscribe a promiscuous VSI to multicast when it
> already holds the DFLT rule, and enable VLAN pruning on every promisc
> off, because it can be off without our DFLT rule after a session or
> with LAG.
> 
> When the driver is removed during a session, the session ends in
> ice_remove(), and the sync queued there needs "ice: stop the service
> task before the PF is unloaded".
> 
> This does not restore the uplink VLAN filters that
> ice_eswitch_setup_env() removes, a separate problem that now also shows
> when promisc is cleared after a promiscuous session. It does not change
> the unicast filter that ice_eswitch_release_env() adds back either,
> which is for the permanent MAC address even if the PF uses another one.
> 
> Found by AI code review, starting with the Sashiko review of v4, and
> reproduced on an E810-C (FW 8.1.1, ICE COMMS package 1.3.55.0) without
> kernel changes:
> 
>    ip link set $PF promisc on
>    devlink dev eswitch set pci/$BDF mode switchdev
>    echo 1 > /sys/class/net/$PF/device/sriov_numvfs
>    echo 0 > /sys/class/net/$PF/device/sriov_numvfs
> 
> after which unknown unicast no longer reaches the PF, and with this
> patch it does again. Also tested on that E810-C with promisc changed
> before, during and after sessions, allmulti across a session, and PF
> resets and driver removal during sessions. LAG and switchdev setup
> errors were not tested. No kernel selftests cover this.
> 
> Fixes: 1a1c40df2e80 ("ice: set and release switchdev environment")
> Fixes: 2571a3fa6251 ("ice: Prohibit rx mode change in switchdev mode")
> Fixes: 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in switchdev setup")
> Fixes: 776fe19953b0 ("ice: block default rule setting on LAG interface")
> Signed-off-by: Petr Oros <poros@redhat.com>
Reviewed-by: Ivan Vecera <ivecera@redhat.com>


  parent reply	other threads:[~2026-12-03 10:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  7:16 [PATCH net v7 0/4] ice: fix DFLT Rx rule handling for promisc and switchdev Petr Oros
2026-12-02  7:16 ` [PATCH net v7 1/4] ice: stop the service task before the PF is unloaded Petr Oros
2026-12-03  8:01   ` netdev-bot+sashiko
2026-12-03 10:55   ` Ivan Vecera
2026-12-02  7:16 ` [PATCH net v7 2/4] ice: do not leave switchdev mode while subfunction ports exist Petr Oros
2026-12-03  8:01   ` netdev-bot+sashiko
2026-12-03 10:56   ` Ivan Vecera
2026-12-02  7:16 ` [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session Petr Oros
2026-12-03  8:01   ` netdev-bot+sashiko
2026-12-03  9:51     ` Petr Oros
2026-12-03 10:56   ` Ivan Vecera [this message]
2026-12-02  7:16 ` [PATCH net v7 4/4] ice: use a VLAN agnostic multicast promisc rule pair for PF VSIs Petr Oros
2026-12-03 10:57   ` Ivan Vecera

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=bcdefaf6-6ca3-41da-b30e-2dcd77b3e8a9@redhat.com \
    --to=ivecera@redhat.com \
    --cc=aaron.ma@canonical.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=alice.michael@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=grzegorz.nitka@intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jbrandeb@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin.szycik@linux.intel.com \
    --cc=martyna.szapar-mudlaw@linux.intel.com \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patryk.holda@intel.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=poros@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sx.rinitha@intel.com \
    --cc=wojciech.drewek@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