Article View: linux.kernel.netdev
Article #26202Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 08:01
Date: Thu, 03 Dec 2026 08:01
112 lines
12668 bytes
12668 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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 critical sections in
drivers/net/ethernet/intel/ice/ice_eswitch.c that use the ICE_CFG_BUSY…
--
ice: resync uplink filters after a switchdev session
This patch adds an ICE_VSI_ESWITCH_UPLINK bit so the eswitch owns the
uplink promisc configuration during a switchdev session. When the session
ends, it queues a full filter sync so the uplink is programmed again from
the netdev flags. It also adds a barrier in ice_set_rx_mode() and changes
how ice_vsi_sync_fltr() handles multicast promisc and VLAN pruning.
> diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
> index 44ef1fcfc6e4a..e91f126bc8a67 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);
> +
[ ... ]
> + 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);
> +
> + set_bit(ICE_FLAG_FLTR_SYNC, pf->flags);
> + ice_service_task_schedule(pf);
> +}
> +
> /**
> * ice_eswitch_setup_env - configure eswitch HW filters
> * @pf: pointer to PF struct
> @@ -28,6 +56,15 @@ 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);
> + /* drop a pending sync, the address lists are unsynced below */
> + clear_bit(ICE_VSI_UMAC_FLTR_CHANGED, uplink_vsi->state);
> + clear_bit(ICE_VSI_MMAC_FLTR_CHANGED, uplink_vsi->state);
> + clear_bit_unlock(ICE_CFG_BUSY, uplink_vsi->state);
> +
[Severity: Medium]
Both new sections, in ice_eswitch_resync_uplink() and
ice_eswitch_setup_env(), use ICE_CFG_BUSY in uplink_vsi->state as a
sleeping lock. They take it with a test_and_set_bit()/usleep_range() poll
loop and drop it with clear_bit_unlock().
Could a real lock be used here instead of a hand-built bit lock?
The new ownership handoff depends entirely on this bit for mutual
exclusion. That covers publishing ICE_VSI_ESWITCH_UPLINK, dropping the
pending UMAC/MMAC syncs and the resync when the session ends. Lockdep
can't see the bit, it has no owner tracking or fairness, and the
acquire/release ordering has to be built by hand.
The ordering is already hard to keep consistent. This version had to
switch ice_vsi_sync_fltr() to clear_bit_unlock(), but other holders of the
same bit still release it with a plain clear_bit():
drivers/net/ethernet/intel/ice/ice_main.c:ice_vlan_rx_add_vid() {
...
finish:
clear_bit(ICE_CFG_BUSY, vsi->state);
...
}
ice_vlan_rx_kill_vid() does the same.
There doesn't appear to be a concrete deadlock among the current holders:
ice_vsi_sync_fltr() from the service task, the VLAN ndos under rtnl, and
the devlink path here. But lockdep would not catch a future lock ordering
problem in these sections.
Would a per-VSI mutex around the filter and promisc state give the same
exclusion, with proper acquire/release semantics? These sections are still
there in the last patch of the series.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202071642.2527605-1-poros%40redhat.com
Technical Details
Message-ID:
<179628491749.3146.14362879400914207891@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376387-linux-kernel-netdev=dewy.ruReferences:
<20261202071642.2527605-4-poros@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376387-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session Date: Thu, 03 Dec 2026 08:01:57 +0000 Organization: Usenet Network Message-ID: <179628491749.3146.14362879400914207891@kernel.org> References: <20261202071642.2527605-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="2431006"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7+aiJ0DlrRBT0Qd+oTI7Ofb+ro0= sha256:admH8pPDEZ2vz7iDCuNOWNKzTQKqY5C6OFVdi0FnqnU= sha1:0TNLaaQr3A8DjdNrTeKeqI/RqbA= sha256:7Zg4fNRChHI+iJ7E5BTBBYrVg9dMzrio0X5b5tgwCU8= 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 80639117870; Thu, 3 Dec 2026 11:02:18 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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] 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 eI6VcpseVCS7; Thu, 3 Dec 2026 11:02:14 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376387-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id CDD0B117842; Thu, 3 Dec 2026 11:02:01 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id E12D9602B4A; Thu, 3 Dec 2026 08:02:00 +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=1796284920; b=FoO47IDO2AYcGI5tP8qQB5tZ81IKf0v2V/wTaN9chd38gOAeAO3tuWc0QMhqYXjx8tY3 peRQ3i3zVD+WW1kjqPHXNV/mxVlbwrJmn4mlRZOqwyouKNjlasxdU1Aw7HR1M+23o2vM8 CPheVtR/vuF5c7KXZxrOQw+d16aGjxqmFFIzBTqG2fJQFSZaIflpJYbkA84VIEjhYK3BD aZSZMoUT78DPM0wJ/Vz/vEXC3zc0B69HP4DQkv6ug5TRSaGZ6zcgW5iXVRCxfvfF4oxJF hPOsSxhvVhQ7LGCEVsaxC6hGlwTdsx1zHID/G5XVDu++VSTZYE7BBXO4u8wlCBcxRwQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284920; 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=KwpkX2EDctBhuVAJN8HVSKtiel3MPAYg9ISpj/RLjkw=; b=dk2xyxUTIIowJkBCiIzyWviyMQQwmRnbiIjcpUcudWTDNWeAB70F02+hbAaNI0ekXj3E U0vgX8i9cyH4pPwho1ZUyO1GmMQa/24jHuL9VUwYRRZsEMG+MVj6Z3yGpylrxnI7FblTs b6jJoH6M5vPNlV1kOdi4gneh/Up9jP02vc9ozN2o6qmPaWwSknK870Q8fJlAbIIf3x1U9 O/GcuinLBq93M6jiiOaQwyvyhycKhNLR5WScEmYzzLhLSnpE1uhY4XpNazwf+HSPy3WC8 ZpUgE6ccXmP5xcpFSSM3RQelU2nGOyOdq6D0rBd3ZEtLswWcn+bRgpLn0rWqmfWEpBg== 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="ZR/mYWda"; 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 321E6606A683; Thu, 3 Dec 2026 08:02:00 +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=ZR/mYWda 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=1796284919; b=R1IWWU/b7Z6c7JS+7p2s4Y+opdqjUTLEnpoVsQEt/qG3fCQiU2AVnBxDvPF0NysDSKAT e3RGgTtMpoJ9cAFdMSHpaydJsT2zGDvVhrDyN8uO2rUVb0Ojwl3FGQzuPsRwePTaHusE6 /paKgx/iWhwxlFcvopmUib3W1KTVY3xyEbvavkzYI+/4XqBEmPwQ0PkKSIAP4LCMlbG3Z CzpN2yzuUY8dqqz++pu58Ge1YmoLRIG67PZAMSYPie1wjBXtPiqjcxR6QY38xTnxiQjsJ TyHXxGdqQA0IBR9h2ZXwBxJITo54J2pQeq8pWB2dnq9h/us6TWTlnBHuzStQpb8RO5w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796284919; 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=KwpkX2EDctBhuVAJN8HVSKtiel3MPAYg9ISpj/RLjkw=; b=FydKeyPPz2rqkBQnil+GLv3oQsTIYrbGUUijx/Ozc1EFNT8vOJK0cJUgTEWYqFBPPWPj QDQKX2VaIlHCJB6yrKmezsnN53O6xHqpamOamsqqVOdpLPO32ziNUt6Vg0Gzck0ocnmke vnkdYF+J7Dy/mfXpQUM+b41XMfQO2ZR5VuiffdJ+/7l3GuU+f9e/Gn6PsGFuuoRvEWfCU 9R7VobZImGfJ40fhsRBRxvbt09LrT5n2iHWNoAmUy3VJJdRWHTAyRMdal42DDgIt+muAA R/Dja4BrlnHjRY4lCDFs021/wnZyQeBnuQGvouLk4BgHKbVP5kH7RWor1jhtegcQezQ== 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="ZR/mYWda"; 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 4F823606A332; Thu, 3 Dec 2026 08:01:59 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E15791F00899; Thu, 3 Dec 2026 08:01:57 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796284919; bh=KwpkX2EDctBhuVAJN8HVSKtiel3MPAYg9ISpj/RLjkw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ZR/mYWda3/G+pr/SjVNTGuD0gQHGLVPW6x7C+zov9xgNjqpXQ3DUj3VF2ufdVgdjq D50SCB/KFHbt2bVAIKAG34gu8KEG3i55YMfDYVjcZ1+UKooGDXXVDosP14y4YtPMIV UzU1jTab6bKASlLOaCNq42d8w9yYIa5z0SSph7upNq8rJ4cL7ijuQ5SBeVTaQtWM1S 6KKP1xlYzF1dCpchtQsUS7dA4Vj2qLPli0COqWLeRrTsZH/INfrZKcKRc2rJxR4AHw gdwI9XQYAF1uvSRuK4PQz5DXvktj8dGf7ZbLk87H7jC+JhX7YBbawSU0X0NraKgjhD 5wn9jG1H+sN4w== 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: <20261202071642.2527605-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