From: netdev-bot+sashiko@kernel.org
To: kuba@kernel.org
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
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 [thread overview]
Message-ID: <179505851041.3136.8792625449105507971@kernel.org> (raw)
In-Reply-To: <20261118023905.3050661-2-kuba@kernel.org>
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
next prev parent reply other threads:[~2026-11-19 3:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 2:38 [PATCH net-next 0/6] eth: bnxt_en: allocate memory on the right NUMA node Jakub Kicinski
2026-11-18 2:39 ` [PATCH net-next 1/6] eth: bnxt_en: order event data before setting the sp_event bit Jakub Kicinski
2026-11-18 12:27 ` Björn Töpel
2026-11-19 3:21 ` netdev-bot+sashiko [this message]
2026-11-18 2:39 ` [PATCH net-next 2/6] eth: bnxt_en: follow explicitly set IRQ affinity when placing page pool Jakub Kicinski
2026-11-18 12:32 ` Björn Töpel
2026-11-18 14:42 ` Joe Damato
2026-11-19 3:21 ` netdev-bot+sashiko
2026-11-18 2:39 ` [PATCH net-next 3/6] eth: bnxt_en: allocate per-queue SW state on the queue's NUMA node Jakub Kicinski
2026-11-18 12:37 ` Björn Töpel
2026-11-18 14:49 ` Joe Damato
2026-11-18 2:39 ` [PATCH net-next 4/6] eth: bnxt_en: explicitly keep device-only memory on the device's node Jakub Kicinski
2026-11-18 12:38 ` Björn Töpel
2026-11-18 14:50 ` Joe Damato
2026-11-18 2:39 ` [PATCH net-next 5/6] eth: bnxt_en: allocate fast path DMA rings on the queue's NUMA node Jakub Kicinski
2026-11-18 12:39 ` Björn Töpel
2026-11-18 14:51 ` Joe Damato
2026-11-18 2:39 ` [PATCH net-next 6/6] eth: bnxt_en: restart Rx queues when their IRQ moves to another " Jakub Kicinski
2026-11-18 12:50 ` Björn Töpel
2026-11-18 15:01 ` Joe Damato
2026-11-19 1:24 ` Michael Chan
2026-11-19 3:21 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179505851041.3136.8792625449105507971@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox