Article View: linux.kernel.netdev
Article #18929Re: [PATCH net-next 1/6] eth: bnxt_en: order event data before setting the sp_event bit
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 03:21
Date: Thu, 19 Nov 2026 03:21
119 lines
12237 bytes
12237 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 fixes only some of the producers that publish data
and then raise an sp_event bit.
--
eth: bnxt_en: order event data before setting the sp_event bit
This commit adds smp_mb__before_atomic() in bnxt_queue_sp_work() before
the set_bit() on bp->sp_event. Data that callers store for bnxt_sp_task()
then becomes visible before the event bit. The barrier pairs with the
fully ordered test_and_clear_bit() in bnxt_sp_task().
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 6846a27bfef4c..5ad2a3033505d 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -394,6 +394,10 @@ static void __bnxt_queue_sp_work(struct bnxt *bp)
>
> static void bnxt_queue_sp_work(struct bnxt *bp, unsigned int event)
> {
> + /* Make the data the event carries visible before the event bit,
> + * pairs with test_and_clear_bit() in bnxt_sp_task().
> + */
> + smp_mb__before_atomic();
> set_bit(event, &bp->sp_event);
> __bnxt_queue_sp_work(bp);
> }
[Severity: Medium]
Should the same ordering also cover the producers that set sp_event bits
directly and then call __bnxt_queue_sp_work()?
The new comment reads like an ordering contract for sp_event in general.
Several paths in bnxt.c do not go through bnxt_queue_sp_work(), so they
never reach the new barrier. Each of them stores the event data, does a
plain set_bit() on bp->sp_event, and then calls __bnxt_queue_sp_work(),
which has no barrier.
In bnxt_async_event_process(), the echo request case does this:
if (fw_health) {
fw_health->echo_req_data1 = data1;
fw_health->echo_req_data2 = data2;
set_bit(BNXT_FW_ECHO_REQUEST_SP_EVENT, &bp->sp_event);
break;
}
...
__bnxt_queue_sp_work(bp);
Could bnxt_fw_echo_reply() then copy stale echo_req_data1/2 into
HWRM_FUNC_ECHO_RESPONSE?
In the RESET_NOTIFY case, the code writes fw_reset_timestamp,
fw_reset_min_dsecs, fw_reset_max_dsecs and the BNXT_STATE_FW_FATAL_COND or
BNXT_STATE_FW_NON_FATAL_COND bit in bp->state, and then does:
set_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event);
The state bits are also set with a relaxed set_bit(), on a different
word, so nothing orders them against the sp_event bit. bnxt_sp_task()
then checks them:
if (test_and_clear_bit(BNXT_FW_RESET_NOTIFY_SP_EVENT, &bp->sp_event)) {
if (test_bit(BNXT_STATE_FW_FATAL_COND, &bp->state) ||
test_bit(BNXT_STATE_FW_NON_FATAL_COND, &bp->state))
bnxt_devlink_health_fw_report(bp);
else
bnxt_fw_reset(bp);
}
Can this take bnxt_fw_reset() instead of bnxt_devlink_health_fw_report(),
or start the reset with stale wait limits?
bnxt_event_error_report() does the same with bp->thermal_threshold_type:
bp->thermal_threshold_type = type;
set_bit(BNXT_THERMAL_THRESHOLD_SP_EVENT, &bp->sp_event);
and bnxt_hwmon_notify_event() switches on that value.
bnxt_sched_reset_rxr() follows the same pattern:
rxr->bnapi->in_reset = true;
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
set_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event);
else
set_bit(BNXT_RST_RING_SP_EVENT, &bp->sp_event);
__bnxt_queue_sp_work(bp);
If bnxt_rx_ring_reset() sees a stale in_reset == false, it skips the ring:
if (!rxr->bnapi->in_reset)
continue;
in_reset then stays true, so bnxt_sched_reset_rxr() never schedules that
ring reset again. Would that ring stay stuck until a full reset?
These paths are still unchanged at the end of the series, as of the
"restart Rx queues when their IRQ moves to another NUMA node" patch.
Moving the barrier into __bnxt_queue_sp_work() would not cover these
paths, because the open-coded set_bit() calls run before it. Could
smp_mb__before_atomic() go before each open-coded set_bit() instead, or
could these producers use an ordered helper?
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118023905.3050661-1-kuba%40kernel.org
Technical Details
Message-ID:
<179505851041.3136.8792625449105507971@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366701-linux-kernel-netdev=dewy.ruReferences:
<20261118023905.3050661-2-kuba@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366701-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 1/6] eth: bnxt_en: order event data before setting the sp_event bit Date: Thu, 19 Nov 2026 03:21:50 +0000 Organization: Usenet Network Message-ID: <179505851041.3136.8792625449105507971@kernel.org> References: <20261118023905.3050661-2-kuba@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2775764"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:jDM7XDLmDpYphCtu2Z8rIps9geQ= sha256:MRcrarwGbTzy3sQ+3gVSD2ztyGpnZljc0aJMFef6oZk= sha1:k2fLWkEuFAiHdH41Oow4i5+4UKg= sha256:Y8brK20fFQlA/rljTAoQInvRjOLRv86y+uXdE9yatF0= 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 8A0F81154CB; Thu, 19 Nov 2026 06:22:08 +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 6QhknDzgkwug; Thu, 19 Nov 2026 06:22:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366701-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 3550D1154C3; Thu, 19 Nov 2026 06:21:55 +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 AAC4348E4B; Thu, 19 Nov 2026 03:21:52 +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=1795058512; b=mjf3ODXPo5B059GT/zW/GREbfpIO5pH0PyZZh7zYfu1mY9D6/Y/WLKOxpBMBZFMw7+xC h1RCJ5Ar/FAy33OeTJGP2PQntm/tY/AVGC81TV+uWDt8/kK9md1WqAWyATi8hSNZ8VPhF bU7dAyjT+OaDIak9NMhERpbOAnJ7CHalTeVuvesIKTphppvociMGwUXLTxv3zCZAVKjtz MeLLpcywwXWJIsy6Nwf3xrksaCcjXNARZA23RTu+H9HmWJ6UVtc0PQA4P5P9Qu3iVxdNh tLEpTLshKbilBW0VAP85bfP9ZLD/9aG1418AH88eEScObNZ8JDKxIwuiZBZQZfYQY3g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795058512; 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=iDmQOr43QTF7igvrWWY0fOtv86OpvPLY2q1VhBvbwSM=; b=ien/hooiBV96oFlDAzaSf5f/jErlASC2N2/aWVMPdOCX67eV9gpvFPnC276xB6Ub53Sf 2Z+SUDi5sg8FeNVVAADUnQV7/wGSZQXU+j/8SNrXCZ2BYhrZZ2A5abDcKMCc6uWNg2Fak Ke4EujvKW1ygqVbUDeZ/WyTv5qTmpt7b6i9XH92EDA68oGQ0xy7HWKWJAbbq+Pv+0VFEw y7t5EuMpqcJb9qpSBW8gTyOwYZNA6754XAo850UP3G5P4NRDvg6YKznLLM7JxccI9z019 YnrSZq4GZEs5U//g/Ii+dY5D7pdcp+ajn1rZgS2Uq8e4OjKx/MdlmcS7m1oxXwJ3V+A== 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="hJ/5ptYx"; 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 799DB606A330; Thu, 19 Nov 2026 03:21:52 +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=hJ/5ptYx 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=1795058511; b=WVyjzfKrtjsY/YvmOvIWyM6AcHC+pXopEhVkqYWFjLiI9Z2IbpoP7x7VycNvFKWiNzco nUIiyOwDT//ptmPnKos0mj2OparEOo+LkQbqfWHwFRxAm8U/YXNKvElcfWxwBvRamGhiY OmF+joCJ2Lf9sGcMnUha1TwTVlDmiE47IyskMU2mv190M4cGe2XUYUZN0QGz7xlJY8b2m oRnudxksUlLNzcqZklO1pA37oQtncs0N0GaN9mTJHzcACBJvAkCyD5bznjuoPAVcYs9tm p6+gXyM4uC+HCLqxADQM03d3MTiBKmiEnzI6PAAWsyGJLvSRTDf/AaBtcijffnxjYWQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795058511; 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=iDmQOr43QTF7igvrWWY0fOtv86OpvPLY2q1VhBvbwSM=; b=0UILzzJUuluJs0zR6NDSwqpTRX9j5O20mf4VjhWLAz6SKwgQzi6pwK6z7hDRK9ZOm4SP 9eOw9FE8XdWJ2IbmMhklKu9o27gQlGfKhW6xeaFfpW1adT2qIO53s9PrkaIs2/HkWhw5/ 0c0jxUoFV2wrSqYbCKS2mUaQzBs3HPGMJvz4rtgat+XgyBYnv8vop29iQ75doQ9LAw9lK UasH97Q4FQcqavOUql8pmqemRPdILVqPHkB5WitZT9M+a62jPOXgAHFoKiTGQLSfgvUeR MA86VR2hHm/t6Ww3h3PbHbaDUz2169P/VnXIqEc2+F552bnF8oj+jRpymzdNitPMl3Q== 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="hJ/5ptYx"; 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 9710A606A326 for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 03:21:51 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCF411F000C4; Thu, 19 Nov 2026 03:21:50 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795058511; bh=iDmQOr43QTF7igvrWWY0fOtv86OpvPLY2q1VhBvbwSM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hJ/5ptYxGDUQxEW1FPtDFYsdmo7UOtOGQzylBH39HHfG4FZh9hv1xOKwGv4VuNcPN m+2Lrlby1IDjCCXCREr/IiBS2VAl/hupBVZJujz1KtFU8J7s4+I2KP1lPLXR5adtBE wDQIPIMRRcml/IQREpvxYeDIxmI/GR5obi3K0iBtEpq0fxbs1Pyb4urSTuE6Q3GIeU FjqU0EnhUFIaaJPUUyIKa7Cgji18T9OPx5hhIdCDngysXeiHj8TmphFdkzUxC8amwg qgzIqAV5QxH+sLyyAbFpORSoCj1bubr/Tn90cYZ/Z3IEfJ7pvQfQPEncSE1g0YkpS3 P74MP50OJRo2g== X-Cc: davem@davemloft.net, michael.chan@broadcom.com, netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org, pavan.chebbi@broadcom.com X-In-Reply-To: <20261118023905.3050661-2-kuba@kernel.org> 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