Article View: linux.kernel.netdev
Article #25291Re: [PATCH net v6 3/4] ice: resync uplink filters after a switchdev session
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 13:23
Date: Tue, 01 Dec 2026 13:23
137 lines
13345 bytes
13345 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The patch adds two new open-coded locks that poll a bit flag:
`while (test_and_set_bit(ICE_CFG_BUSY, uplink_vsi->state))…
- [Low] The patch adds a lockless store-buffering protocol on
pf->eswitch.is_running.
--
ice: resync uplink filters after a switchdev session
This patch hands the uplink promisc configuration to the eswitch for the
length of a switchdev session, using a new ICE_VSI_ESWITCH_UPLINK bit.
When the session ends, the new ice_eswitch_resync_uplink() hands it back
and queues a full filter sync. The patch also adds a full barrier before
the is_running test in ice_set_rx_mode(), subscribes a promiscuous DFLT
VSI to multicast, and enables VLAN pruning on every promisc off.
> diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> index 44ef1fcfc6e4a..e14fc60b6de3c 100644
> --- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
> +++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> @@ -10,6 +10,34 @@
> #include "devlink/devlink.h"
> #include "ice_tc_lib.h"
>
> +/**
> + * ice_eswitch_resync_uplink - hand the uplink filters back after switchdev
> + * @uplink_vsi: the uplink VSI
> + */
> +static void ice_eswitch_resync_uplink(struct ice_vsi *uplink_vsi)
> +{
> + struct ice_pf *pf = uplink_vsi->back;
> +
> + while (test_and_set_bit(ICE_CFG_BUSY, uplink_vsi->state))
> + usleep_range(1000, 2000);
> +
> + /* VLAN changes during the session may have added these */
> + ice_fltr_clear_vlan_vsi_promisc(&pf->hw, uplink_vsi,
> + ICE_MCAST_VLAN_PROMISC_BITS);
> + ice_fltr_clear_vsi_promisc(&pf->hw, uplink_vsi->idx,
> + ICE_MCAST_PROMISC_BITS, 0);
> + uplink_vsi->current_netdev_flags &= ~IFF_ALLMULTI;
> +
> + clear_bit(ICE_VSI_ESWITCH_UPLINK, uplink_vsi->state);
> + set_bit(ICE_VSI_PROMISC_CHANGED, uplink_vsi->state);
> + set_bit(ICE_VSI_UMAC_FLTR_CHANGED, uplink_vsi->state);
> + set_bit(ICE_VSI_MMAC_FLTR_CHANGED, uplink_vsi->state);
> + clear_bit_unlock(ICE_CFG_BUSY, uplink_vsi->state);
[Severity: Medium]
This builds a sleeping lock by polling ICE_CFG_BUSY, and
ice_eswitch_setup_env() gets the same loop. The new handoff of the
uplink promisc config relies on that flag behaving like a mutex for:
- setting and clearing ICE_VSI_ESWITCH_UPLINK
- dropping or re-arming the UMAC/MMAC/PROMISC_CHANGED bits
- keeping the eswitch out while ice_vsi_sync_fltr() is in its promisc
section
Could this be a real mutex in struct ice_vsi instead? Lockdep cannot see
the flag. Also, every CFG_BUSY user here runs in process context and
already sleeps in the loop.
The two sides also release the flag differently. The new code uses
clear_bit_unlock(), but ice_vsi_sync_fltr(), the other holder, uses a
relaxed clear_bit():
drivers/net/ethernet/intel/ice/ice_main.c:ice_vsi_sync_fltr() {
...
exit:
clear_bit(ICE_CFG_BUSY, vsi->state);
return err;
}
On weakly ordered architectures, is anything ordering the plain stores
that ice_vsi_sync_fltr() makes inside the section (vsi->current_netdev_flags,
for example) before that release?
The current_netdev_flags &= ~IFF_ALLMULTI read-modify-write above could
race with those stores. A later patch in the series, "ice: use a VLAN
agnostic multicast promisc rule pair for PF VSIs", removes it, so no
concrete lost update is left at the end of the series. This patch still
adds the pattern itself.
> +
> + set_bit(ICE_FLAG_FLTR_SYNC, pf->flags);
> + ice_service_task_schedule(pf);
> +}
[ ... ]
> @@ -331,6 +371,11 @@ static void ice_eswitch_disable_switchdev(struct ice_pf *pf)
> ice_eswitch_release_env(pf);
>
> pf->eswitch.is_running = false;
> +
> + /* after is_running is cleared, so no rx mode change is lost, its
> + * test_and_set_bit() pairs with smp_mb() in ice_set_rx_mode()
> + */
> + ice_eswitch_resync_uplink(pf->eswitch.uplink_vsi);
> }
[Severity: Low]
With this patch, the is_running store takes part in a lockless barrier
pairing with ice_set_rx_mode():
smp_mb();
if (ice_is_switchdev_running(vsi->back))
return;
ice_is_switchdev_running() is a plain load:
return pf->eswitch.is_running;
The store in ice_eswitch_enable_switchdev() is plain as well.
Should these accesses use READ_ONCE()/WRITE_ONCE()? ice_set_rx_mode()
and ice_eswitch_disable_switchdev() can run at the same time with no
common lock. As written, KCSAN would report a data race on is_running.
Nothing stops the compiler from re-reading or fusing the load at other
callers either, such as the xmit path in ice_txrx.c.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130132107.1177185-1-poros%40redhat.com
Technical Details
Message-ID:
<179613138433.3146.6653712043000778587@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375107-linux-kernel-netdev=dewy.ruReferences:
<20261130132107.1177185-4-poros@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375107-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v6 3/4] ice: resync uplink filters after a switchdev session Date: Tue, 01 Dec 2026 13:23:04 +0000 Organization: Usenet Network Message-ID: <179613138433.3146.6653712043000778587@kernel.org> References: <20261130132107.1177185-4-poros@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1721241"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:5UK3sIbUXjBcAqDcXWr1lBu31GI= sha256:gltgdHGZc22v7JQSCwuKik0K/qB+EExd6o7CXv97uv8= sha1:DxTpfeIoV/TItyGRDakzzDqZts8= sha256:zak3yDFIcZRkvZ9kTK14pYJ3po6NUj/oxELqYRg6iiU= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DC0AB1173B6; Tue, 1 Dec 2026 16:23:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tlGZSdQJS5rZ; Tue, 1 Dec 2026 16:23:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375107-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C3C5F1173B0; Tue, 1 Dec 2026 16:23:30 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id A86EF2FFC0; Tue, 1 Dec 2026 13:23:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796131392; b=wFmBggrQzE4SiTCTrQjQWOuRgt6Yl3/BZQ3yF98uzPnRYa7BSct9sP+/dbx/HRJRuuz3 A3hvl/Bn/HwfmH+e+CY2LJV4S804oAfXo9vIN56IUl6yuhKz8qKSw1yzWsmBPxWF54qp9 hSrhsxFOZ0wYOey+QoMLHD0wVoJ5cTmiWDxjjGzQbZQUFB4bZfU9Ncrs4W73jxgy8Re8g SAeYq5SqK8S5TdMEhjpSqopbE+Z3A24N0x5P8UQv+XAKXmHiIfdC9fDX5x0osEWfRWqFI E+jw/O92KKKu8soYP89QWMrtgigQ+CvSmmNm3gQN/eC/s6uH6+e9b4QqHND8X0gMkXg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131392; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=jhWOHZ8VD69mvMZBRt1wsYMx1PhOem8TlAbcV3/L9vg=; b=VY3A59gHNgNajd7GtHdEESMPr9Ns1kRCDLzJPZEJHsswH+zfjJwlo21J28Se83zqK9oU o+2jsd8N+rsbuaCo0VHZps3tyLy5pREO5L6cf6kfPCtO6fhvI7c39z7kMElOZGU7fdrMh BVGsGg39tEXj5d5yozYczvmXKx8kYYY8eKpsy0nRh/Y8lY6XOuAUlr7qGnCyl+ETcEVIF g+4FyP1PNk2/RU+efahq/42LSvRUNyyZj2QEHnaux5cRBY/37Ohacs+VqVWN/J45UCyK4 v3T4YB5eESl9Yw9RfZcoXDfmD15p6ravYeNtYgO16LCtDpGITIEWU3rG9F2CY0i3cgw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X63Kq9qa; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D493606A32E; Tue, 1 Dec 2026 13:23:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X63Kq9qa X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131386; b=gsiJslL4dgfd/nsaNzKagmJ2pvDAKl5lKS4vXCSz38p0r24tAsGwkDq7FYFXiMDcDbst 3SWElwOHaoen3xhBR6J7PKW3It1fbAYDJkyU0jmAeLFNSJGkbAxHeXHZWU99POGa7BcOE kOIBjs6VeM5GhRzVOk0YmfAmYPiN24UoLLFVrlHTk+d1NDlX+Nj4BfP6Phw3GrWYdhR22 JOH1xv/l2TlRWZMVhQHVurB3LX2y8icBEVvzeADFjVBmFel7J5LntmFxYgIr3H2iLpB5F FacDkemOBJN8IMcgpj0If2BE4QaOj7swskD4Z6sfmsAgNS/gXEqeYyJC6O5Y5LqiAMw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131386; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=jhWOHZ8VD69mvMZBRt1wsYMx1PhOem8TlAbcV3/L9vg=; b=QjtuOCyaGvX4y3g9cVXuR62Y0iaYscbx5haGsrvnYuw5e/QOcnLtHWLf+C43LXWyHnf/ sUSYYJDVPDqKwFyaRR3AM5/87LNNMnsDqx1UxZHsEzMJRzNPYt33tXHuyo3j/IDyGEUgE NjsFwGnuBQexTht7NTHXW7l6cbLZLoiaUiTkSVgihXRP7gSqYzRj0a2TRe4J0M0s2/PvR UneTIWaxmznp2zo08EYvqpkhuZh5OOkWSJbQnceKZH1pea8Yj/apIirz/z5kvrbHG+0GL oOmXo9jX5RleP30zgPgTn/1a1LdC2rKwhmgaIMA/F4BX7lvY7I7ZRHknDiuRNHAnvCg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=X63Kq9qa; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D43D606A32C; Tue, 1 Dec 2026 13:23:06 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C320F1F0089C; Tue, 1 Dec 2026 13:23:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796131386; bh=jhWOHZ8VD69mvMZBRt1wsYMx1PhOem8TlAbcV3/L9vg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=X63Kq9qabUeatqNG7XG0yLakOSATn959dTQVOaiHog9AekIrlTpTlWuYrWYAkn2IO djzfvO9JyNed5ZLGIVi2YMedX/2gv8lODSaNMRamoWc+D7gU07gZECpsJ6YzQbsCNM dM7VqeX+Uz5+3Qju+ucN9nJITU6bcOeih1zt64h57MW3iRSUjOptT7Qwjw7Kb5siSQ qC9n2fgWzFQMayCSNeJHaPa5ZiPPVdfvgl1HF0HsasJe4CIjkBMiYmYIWOLmwt3km7 HrCOUDoU15LavFFeHon7oeEmLg6kyjYJzEET7k9VR+PBdJLhuIomwgzdoLQbyqmhlI QZsAetqqhNB3w== X-Cc: netdev@vger.kernel.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, aleksandr.loktionov@intel.com, horms@kernel.org, michal.swiatkowski@linux.intel.com, grzegorz.nitka@intel.com, pmenzel@molgen.mpg.de, wojciech.drewek@intel.com, marcin.szycik@linux.intel.com, martyna.szapar-mudlaw@linux.intel.com, ivecera@redhat.com, alice.michael@intel.com, jacob.e.keller@intel.com, jbrandeb@kernel.org, patryk.holda@intel.com, sx.rinitha@intel.com, aaron.ma@canonical.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261130132107.1177185-4-poros@redhat.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list