Article View: linux.kernel.netdev
Article #21753Re: [PATCH net 1/4] eth: fbnic: restart queues in place when fbnic_queue_stop() fails
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 12:33
Date: Tue, 24 Nov 2026 12:33
134 lines
13085 bytes
13085 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] fbnic_queue_stop()'s new error path relies on a hardware
guarantee that is never written down or checked.
--
eth: fbnic: restart queues in place when fbnic_queue_stop() fails
When the idle wait in fbnic_queue_stop() times out, this patch no longer
runs fbnic_nv_enable() and fbnic_nv_fill() on the error path. A new
helper, fbnic_nv_reenable(), sets the ring enable bits back without
resetting anything, so the hardware and the driver's ring state resume
in place. The fbnic_nv_enable()/fbnic_nv_fill() calls move from
__fbnic_nv_restart() into fbnic_queue_start().
> diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
> index 381831b7e1080..c0fe89425430d 100644
> --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
> +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
> @@ -2326,6 +2326,50 @@ fbnic_nv_disable(struct fbnic_net *fbn, struct fbnic_napi_vector *nv)
[ ... ]
> +static void
> +fbnic_nv_reenable(struct fbnic_net *fbn, struct fbnic_napi_vector *nv)
> +{
> + int j, t;
> +
> + for (t = 0; t < nv->txt_count; t++) {
> + struct fbnic_q_triad *qt = &nv->qt[t];
> +
> + if (qt->cmpl.size_mask) {
> + fbnic_ring_wr32(&qt->cmpl, FBNIC_QUEUE_TIM_MASK, 0);
> + fbnic_ring_wr32(&qt->cmpl, FBNIC_QUEUE_TCQ_CTL,
> + FBNIC_QUEUE_TCQ_CTL_ENABLE);
> + }
> + fbnic_reenable_twq(&qt->sub1, FBNIC_QUEUE_TWQ1_CTL);
> + fbnic_reenable_twq(&qt->sub0, FBNIC_QUEUE_TWQ0_CTL);
> + }
> +
> + for (j = 0; j < nv->rxt_count; j++, t++) {
> + struct fbnic_q_triad *qt = &nv->qt[t];
> + u32 bdq_ctl;
> +
> + fbnic_ring_wr32(&qt->cmpl, FBNIC_QUEUE_RIM_MASK, 0);
> + fbnic_ring_wr32(&qt->cmpl, FBNIC_QUEUE_RCQ_CTL,
> + FBNIC_QUEUE_RCQ_CTL_ENABLE);
[Severity: Medium]
Does this in-place resume rely on hardware behavior that is not
documented or checked anywhere?
The driver keeps all of its ring state across the disable/enable toggle.
That includes head/tail, the TCQ deferred_head, the TWQ0 deferred_meta,
and the partly built Rx frame in qt->cmpl.pkt.
For that state to stay correct, two things have to be true:
- The device keeps its internal ring pointers and frame-assembly state
when ENABLE goes 1->0->1 with no RESET.
- Completion writes that were in flight when the CQ was disabled are
held back or finished, not dropped.
Nothing on the disable side seems to ensure the second point.
__fbnic_nv_disable() turns off the CQs in the same burst as the
WQs/BDQs, without waiting for the upstream queue to drain:
fbnic_disable_tcq():
fbnic_ring_wr32(txr, FBNIC_QUEUE_TCQ_CTL, 0);
fbnic_disable_rcq():
fbnic_ring_wr32(rxr, FBNIC_QUEUE_RCQ_CTL, 0);
Also, err_restart in fbnic_queue_stop() is only reached when an idle bit
did not assert before fbnic_wait_queue_idle() timed out. That is when
the device is most likely in the middle of a descriptor or a frame.
On Rx, fbnic_clean_rcq() picks up from pkt = rcq->pkt. Suppose the RDE
had written the HDR_AL/PAY_AL completions for a frame, but its META
completion was lost while the RCQ was disabled. Would the next frame's
PAY_AL frags then be appended to the stale pkt?
The next frame's HDR_AL would also hit this check in fbnic_pkt_prepare():
WARN_ON_ONCE(pkt->buff.data_hard_start);
pkt would then be overwritten, leaking the old page references.
On Tx, the cumulative head in the TCDs makes this partly self-healing.
Even so, could the Tx buffers, DMA mappings and BQL bytes stay stuck
until another completion arrives?
The commit message says the HW "resumes from where it stopped". However,
fbnic_csr.h only defines RESET and ENABLE for these CTL registers.
The injected tests cover "HW is idled, but waiting for queues to idle
fails" and "HW never stops (rings left enabled, and wait skipped)".
Neither covers a CQ that was disabled while a completion was actually in
flight.
Could this behavior be confirmed against the hardware documentation and
described in a comment? If that is not possible, other options would be
to disable the CQs only after the WQs/BDQs have gone idle, or to drop
the partial qt->cmpl.pkt state before resuming.
The later patches in this series ("net: add netif_disable_subqueue()",
"eth: fbnic: wait for in-flight xmit in fbnic_queue_stop()" and "eth:
fbnic: wait for both TWQs of a Tx queue to go idle") do not seem to
change fbnic_nv_reenable() or the disable ordering.
> +
> + bdq_ctl = fbnic_ring_rd32(&qt->sub0, FBNIC_QUEUE_BDQ_CTL);
> + fbnic_ring_wr32(&qt->sub0, FBNIC_QUEUE_BDQ_CTL,
> + bdq_ctl | FBNIC_QUEUE_BDQ_CTL_ENABLE);
> + }
> +
> + fbnic_wrfl(fbn->fbd);
> +}
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121033215.1020506-1-dimitri.daskalakis1%40gmail.com
Technical Details
Message-ID:
<179552362260.3135.14543564146944003534@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370329-linux-kernel-netdev=dewy.ruReferences:
<20261121033215.1020506-2-dimitri.daskalakis1@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370329-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/4] eth: fbnic: restart queues in place when fbnic_queue_stop() fails Date: Tue, 24 Nov 2026 12:33:42 +0000 Organization: Usenet Network Message-ID: <179552362260.3135.14543564146944003534@kernel.org> References: <20261121033215.1020506-2-dimitri.daskalakis1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4133488"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ANviCY0OAzsgpH1altVy2s6vggU= sha256:8x7l/phrpkm3f478rCImgCwKaez5c6ZZc92BRfdaHeE= sha1:DLy22Nwim58Q1VQ37Fhd9rdYpyE= sha256:4KQRHcWsTPEH+Od8BCZEYiW2KC7RlR1hGNkMC9Nx3G8= 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 14239125E14; Tue, 24 Nov 2026 15:33:59 +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 LoI9QxKhrZ3X; Tue, 24 Nov 2026 15:33:55 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370329-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 AC100125E12; Tue, 24 Nov 2026 15:33:46 +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 27CD534102; Tue, 24 Nov 2026 12:33:45 +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=1795523624; b=NQ4CQUK6ghiNWz3qKNrKqJvklIlu9sVUXXaSfUAwaHNL0UgpeocUAUuWYxvvU0/e8+yi D13UUdteGSlQ4CDZvgnZDoY1Q/axixGuS9xJjnTwfY8jewbQr7XDoz1jcPbKh4qVKwrfS sr/NVm5fq1H51Ou/s1zcj1megGL3onGRgT7fLPYOsKoSxt/pcg0866XqP57POYPteOLkO YoS5rxxu6uEt508be+36O73mtCO4p9izyIPP+EirpPK2q019qMU3GvUrxtnMl41UVPUTh 1UceVL+PApgG7hga4y+tfMp1L67aIUDw6cpZ/OSFNSwEOFlaa04zovPJQalwil+/9Ag== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795523624; 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=mj4WIF0r5bDm7Ig3365eQeIDAcnQr8DdtDdiyJY6wmI=; b=Iy+l02eyahc14sP+tXJuLiMS0wF+L+VtKkZwlvfbj366kd/nKu67CVIjYw60HmBMCqU0 PO129XLpBrVYlX6kQBcZaRD0v45goOkTOuh+l32FCQFyZVTEBAcfqSG11+YZSRP/jEobr r2aBhQT9aefkbS5WYqRs3336T7cemC73F/DRuZKyyN5HG+/Plf2JRxUynhQWGlBaZLvBI Wx1Ob7dbGABuDl+0q7BVz+HtL5wTXD19E7RL2olvWI8ivtJyTyc0vqFHuQK+lS9JtIPou UzjrgwmwESBBNUjDZPmubsCXIS+Vxc3mqnkaxPjA9MHQhjlZAWC1YWlC9p/MnJKgQEQ== 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=iMlkKn5R; 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 CC539606A32C; Tue, 24 Nov 2026 12:33:44 +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=iMlkKn5R 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=1795523624; b=g19C2+cAs6tcM2PgLIl75vEewZJ2lsPjt8StZfYRQcW7FFQIj4/CszvcTmc0bRjTjrAK T4IvgmTd5RsYlb/gtwZ5987R3ly3L1n/zoN6dU72qeN3wx0oT74LSEmdhbxLMCQVM9QRB UQ+C+NbJvrUIUvb8Lscp4gGNiOYgjP3dwM6VYQPCw3KU0Mt4+dNVCKkeE88K6PtzQjwrT FJGUo0VZdTCBwGtZX93w6Lks5VnGHTsHuYlMVKVzRMrR5TdbFX3+SI57qzyYpV5iolAMX IDA+Uod1SsiFvKcU4jvlWobwusn5ekdmoPM3LiytmqYBQPTZfa8NQHi1T+YHEplm2KQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795523624; 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=mj4WIF0r5bDm7Ig3365eQeIDAcnQr8DdtDdiyJY6wmI=; b=i6juX1XBD9Z1lOKjPjXrvHZ5GaMI+f2ajNuhzzKyzWdAltW34gcrJC3LmhpoqUeszafY +EcB7o4MvaI16+LGpKn6XWY19Zi2SFi7nC61TjrhYehdEPCOYfhgZVeN+aLMEnSLA26pH K1tkxbzM5o+l4T5gnZKeK/1ZKihXbh/2Q1d5XqAFaA2Zv8xQkXtKHQg0WT/xIF1/o+uYS 34gILJ7JuLbKXBXmyei2quqKM8UwmtUbyoXv6XDCGrDF7g2OHwrM3OKtahWU9E46+Hkwm V5K79RcriByYQ/5DI/U26qeWkWEFf99AVfPTTNWkHbYJLLVvHvdGSrcxkA4drY8ZsEQ== 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=iMlkKn5R; 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 E9BF7606A31E for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 12:33:43 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C83F1F000CA; Tue, 24 Nov 2026 12:33:43 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795523623; bh=mj4WIF0r5bDm7Ig3365eQeIDAcnQr8DdtDdiyJY6wmI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=iMlkKn5R54MXD0fpQiZmYkyJqVk7/GieIbXtGvPPrlmH/n//mi+gM++J2+muX3BEh 7j1PKJSBATDvSAgBxNhqv53xvFPDVWKdQCpkHODySFdqRle25dnTl1OXaZZbaPUgYL +whKVer9U4m1C28UyR40H9hc3z14XDMtWi4sj4QZ6xSPbw6WIwkCDlB91Tu8DuoLpb iArQwahDYPy+uJRzLAc3oT4GgRki1Nlmqj/zRtkeKeaDFFE+Qgj1gXYOroJUG72Wir t1h+MLdR05PgCWo+LTvbYaW1oqBM44r+pG/TxJKnRQrF2A2+iLMeO+ga3LpmqgkUAJ 02yZXqnbpXwvw== X-Cc: davem@davemloft.net, alexanderduyck@fb.com, kuba@kernel.org, kernel-team@meta.com, andrew+netdev@lunn.ch, edumazet@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, bjorn@kernel.org, bobbyeshleman@meta.com, almasrymina@google.com, daskald@meta.com, netdev@vger.kernel.org X-In-Reply-To: <20261121033215.1020506-2-dimitri.daskalakis1@gmail.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