Article View: linux.kernel.netdev
Article #20511Re: [PATCH net-next v2 1/7] eth: bnxt_en: order event data before setting the sp_event bit
From: Björn Töpel
Date: Sun, 22 Nov 2026 20:20
Date: Sun, 22 Nov 2026 20:20
26 lines
8868 bytes
8868 bytes
Jakub Kicinski <kuba@kernel.org> writes: > Producers of sp_events may store data for bnxt_sp_task() right before > raising the event, e.g. the IRQ affinity notifier publishes the new > TPH Steering Tag, the async event handler records the FW echo request > data or the FW reset wait limits. set_bit() is not ordered, so on > weakly ordered architectures the event bit may become visible first. > If bnxt_sp_task() is already running it can consume the event and > read the stale data. The queue_work() which follows only re-runs > the task with the event bit already cleared, so the update is lost. > > Add a helper which issues smp_mb__before_atomic() before setting > the bit, it pairs with the fully ordered test_and_clear_bit() in > bnxt_sp_task(). Use it for all events, including those which carry > no data, so that new producers don't have to think about it. > > Reported by an LLM reviewer while working on subsequent patches. > Very unlikely to matter in practice. > > Signed-off-by: Jakub Kicinski <kuba@kernel.org> > --- > v2: > - convert the producers which set the bit directly (Björn) Reviewed-by: Björn Töpel <bjorn@kernel.org>
Technical Details
Message-ID:
<87h5h81uvi.fsf@all.your.base.are.belong.to.us>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-368809-linux-kernel-netdev=dewy.ruReferences:
<20261120035214.369158-1-kuba@kernel.org> <20261120035214.369158-2-kuba@kernel.org>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-368809-linux-kernel-netdev=dewy.ru From: bjorn@kernel.org (Björn Töpel) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 1/7] eth: bnxt_en: order event data before setting the sp_event bit Date: Sun, 22 Nov 2026 21:20:01 +0100 Organization: Usenet Network Message-ID: <87h5h81uvi.fsf@all.your.base.are.belong.to.us> References: <20261120035214.369158-1-kuba@kernel.org> <20261120035214.369158-2-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="3716699"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:kqT3wHfTBstPQIkCEkpWvI3sZMA= sha256:UH+BWsCGG6JDExIxp8GwDJjeU+OH1u3HFTaAqEw5t5k= sha1:/0arYNUQtd4HKjVuu2SFtdZ0xoo= sha256:RzcAnCf97/Sodqkl2ivmGPQ2v83wBj5eqc5zYCpcgJI= 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 55D1A125D83; Sun, 22 Nov 2026 23:20:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 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] 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 BAA5K3yg1JHd; Sun, 22 Nov 2026 23:20:16 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368809-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 17F95125D82; Sun, 22 Nov 2026 23:20:07 +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 E6DC227D85; Sun, 22 Nov 2026 20:20:05 +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=1795378805; b=JfEEjxXnQ1gF5XczQ5pfyOU3JK8LJwETlRN1ZhV2T8DuHC2lyEK5EFzhBdQiy/0+bfLo Qy+pjBPtHm6sMn0NLOtE4B18MFh0vRlgeaye4W5BQN0fEFfu5OPJqO+Ra9kjs3Fp5A9hJ 6V3zsX5UuuxjiUCAMa1XDqJ7OGulxaEwjfipKOQSXHGnZBcoH9ONZdo3F0aB5LEjxWtJD oxoj6KwfPFS93bFUzyGrMDPwnSh3besYxhN6IUi7z/5hiPj2LxBHuFfm5H+HqZ3+nMBkg n25ygi3u0pzYQ1D9951Kk/PScNgTwKDwgUxMxYc7xSbkc9IWjhSg+xZ1m8Q/949nCWg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795378805; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: In-Reply-To:References:Date:Message-ID:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=9FEIzTQEqkB/eIgyK+vZVtxbsx1bwiwbLuTEueuQG8w=; b=SeSfkT7Wkcxo0iTj63ApxWGVmwOUYZCliKaMteFfbWoiJoF3lVPuK5H8BIbJc2HI1rzn 8p18mY+hg+YuYi3Uwk4vfhHgDfbQKAWfC+7FxVh0aKASf3E6ThXw2LBbOCuRaH3SmabCT U9ghVS7I893LFamqwiqnMT/MekWZw7Px+vOYdqlz/polPhJsgK5puO6khuZOTxl9liTih qEM2dJWOpGqptxOzd9kUrr/UHJ4HB/UwyEyuXeKW8ikE+i5wFwJLAecCU6/RvyRaxWJF3 y1YVGyugaRJNHQO2pAyY0bQe6qQzjymEuGXkdYXa46R29Uum1AV9YvFN2slulM1sdoA== 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=NyJ41vBG; 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 BF40A606A32C; Sun, 22 Nov 2026 20:20:05 +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=NyJ41vBG 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=1795378804; b=ivMoEHeWDznPnr9RHLl1a/82LK6YTFa46S312bTs+ETnkcs5N0yfQz17p0c76riHtkU0 my2qx3eoz4gO2gI6ECxkrgM2nK3YTqFJ5UPFZmnyywpPQo+bFvdjld1skxrraqwe6NcK5 aln2uQFVMm8lAIPNYTTkqy3uQMJh2VHYbB+6zKdYw/f4Pq4W3TkYom+iVMQgH4yhp4MJi oG3u4yjuK9ESwgFJuaX8bbIRaDn1pVgj94o1lPycDiytwSAaP7bywT6fXDU1aQsKTI5dL BdM+7WgiJrLaLmyWKEgiLD4m567fW6R1PJp7WIKJwM5I6potuG1fO4yVEEfLHHtUW4w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795378804; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=9FEIzTQEqkB/eIgyK+vZVtxbsx1bwiwbLuTEueuQG8w=; b=llKLzifpmbsHCrfL9bgeW/HFaRmZEaRA1hHndjd7nwL+tCKKBVYHj/FCVt3fdS54NFBe 7suXDpckQ1LholoKpqayHMzfKQjyawzAqOOM8V9pKUTORjAh66emtOLnwiGfaRrm610wL cSCCZ5NOeNMP1DRzGE58nJXFUjLwQ1Wtf/w986sh3knbx6eqNekh8aoPKqqVsJFXuF8v8 0bAYoHNHqjLUdTla4TZxNolf9xrFqYGoKtBE5UA0D3DEgLyOPqS+QoFt1gDTW6Q3srhSJ k9FUZYdDqJayoQpfJSNv05ARVjCUlPmNjkfKgq5NB80r1FTJWNJn03pn3/1my0qlQZQ== 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=NyJ41vBG; 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 DB223606A31A for <netdev@vger.kernel.org>; Sun, 22 Nov 2026 20:20:04 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8C2A1F000C0; Sun, 22 Nov 2026 20:20:03 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795378804; bh=9FEIzTQEqkB/eIgyK+vZVtxbsx1bwiwbLuTEueuQG8w=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=NyJ41vBGeeG3X4NtEKJIhj++ci+qILm3NVR95FgyVfaoepAXuwMIbGlZnfzEzSSTs h1wXsw+xJer3joGS+R6ckqf1d+QbG6tx6XcFWa/zfbmmZyQX+NAjtX6P+19cC5WUJ4 gLFdO3QeGDM+sLd/52xbupdiIUIrc048CxCn8R8Z9qQx+tHy13/xJS8rNHODB/R6lQ tQwLtb6Wt2mamrJ8Qo2k9+ATyjPatSU/4/obIDOD+V79IVNMWHbyLAdLcYMOOgEMm1 o0PIUIfp9TLUzhcOLK0y7SxfE3wGSKRVfzec2nUpUP7hIHTI+K5+O0gXvbJuKfuJ9y ZtwUBBhZxG3Dg== X-Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, pavan.chebbi@broadcom.com, joe@dama.to, Jakub Kicinski <kuba@kernel.org> X-In-Reply-To: <20261120035214.369158-2-kuba@kernel.org> 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