From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 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== 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== 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 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) 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 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E15791F00899; Thu, 3 Dec 2026 08:01:57 +0000 (UTC) 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== Subject: Re: [PATCH net v7 3/4] ice: resync uplink filters after a switchdev session From: netdev-bot+sashiko@kernel.org To: poros@redhat.com 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 Date: Thu, 03 Dec 2026 08:01:57 +0000 Message-ID: <179628491749.3146.14362879400914207891@kernel.org> In-Reply-To: <20261202071642.2527605-4-poros@redhat.com> References: <20261202071642.2527605-4-poros@redhat.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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