Article View: linux.kernel.netdev
Article #23715Re: [PATCH net-next V3 2/5] net/mlx5: nodnic: Implement data path
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 19:03
Date: Fri, 27 Nov 2026 19:03
224 lines
15962 bytes
15962 bytes
Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 3
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] With budget == 0 (netpoll), mlx5_nodnic_napi_poll()
(drivers/net/ethernet/mellanox/mlx5/nodnic/en.c) runs `if…
- [Medium] Error CQEs (OPCODE_CQ_SEND_ERR 0xD / OPCODE_CQ_RECV_ERR 0xE)
are treated as single-WQE failures.
- [Low] The commit message describes only the TX/RX descriptor paths,
NAPI and checksum offload.
- [Low] In mlx5_nodnic_check_features()
(drivers/net/ethernet/mellanox/mlx5/nodnic/en.c), the comment…
- [Low] mlx5_nodnic_activate_queues() (en_cfg.c) calls
napi_enable_locked(&cq->napi), then mlx5_nodnic_arm_cq(cq) from…
--
net/mlx5: nodnic: Implement data path
This commit implements the TX and RX data paths for mlx5_nodnic. It adds
WQE posting with a BlueFlame doorbell, page pool backed RX, and a NAPI
poll on a shared CQ that dispatches both TX and RX completions. It also
wires up ndo_start_xmit and ndo_features_check and enables checksum
offload.
> Implement NAPI polling and CQE dispatch for TX and RX completions,
> including RX WQE reposting and CQ re-arming.
> Wire up ndo_start_xmit and ndo_features_check, and enable TX/RX
> checksum offload support.
[Severity: Low]
This isn't a bug, but the commit message leaves out some port lifecycle
changes. This is the first patch that calls mlx5_nodnic_enable_port() and
mlx5_nodnic_disable_port(), from ndo_open/ndo_stop. In the parent commit
they were defined but never called.
The patch also makes three related changes:
- mlx5_nodnic_disable_port() now returns int instead of void.
- A new mlx5_nodnic_quiesce_port() calls pci_clear_master() on the whole
function when the VSC port disable fails.
- mlx5_nodnic_enable_port() is relied on to restore bus mastering on the
next open.
Could the commit message describe these port enable/disable and bus
mastering changes?
> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/en.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/en.c
> new file mode 100644
> index 0000000000000..6400e100bcb10
> --- /dev/null
> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/en.c
[ ... ]
> +static void mlx5_nodnic_handle_err_cqe(struct mlx5_nodnic_cq *cq,
> + struct mlx5_cqe64 *cqe64,
> + int napi_budget)
> +{
[ ... ]
> + if (opcode == OPCODE_CQ_SEND_ERR) {
> + struct mlx5_nodnic_sq *sq = &priv->sq;
> + u16 sq_pi = mlx5_nodnic_sq_get_pi(sq, wqe_counter);
> +
> + mlx5_nodnic_complete_send_wqe(sq, &sq->wqe_info[sq_pi],
> + napi_budget);
> + } else {
> + struct mlx5_nodnic_rq *rq = &priv->rq;
> + u16 ci = wqe_counter & (rq->ring.num_entries - 1);
> +
> + mlx5_nodnic_release_rx_wqe(rq, ci);
> + }
> +}
[Severity: Medium]
If the device moves the SQ or RQ into an error state after a completion
error, does anything recover it?
mlx5_nodnic_handle_err_cqe() prints the CQE and then completes or
releases only the one slot. It records no queue error state and
schedules no recovery. The syndrome table includes WR_FLUSH_ERR. Under
mlx5 semantics that syndrome only appears once a queue is already in
the error state and flushing.
On the TX side, mlx5_nodnic_complete_send_wqe() credits flush
completions as if they were successful sends. The txq keeps waking and
xmit keeps posting into the errored SQ while the carrier stays up.
If the SQ stops completing instead, the txq stays stopped forever.
mlx5_nodnic_netdev_ops has no ndo_tx_timeout, so the watchdog never
fires.
On the RX side, mlx5_nodnic_napi_poll() refills every freed slot on
each poll, with no queue health check:
if (!mlx5_nodnic_rq_post_wqes(priv))
return budget;
Wouldn't each reposted WQE come straight back as a RECV_ERR CQE that
counts toward rx_work_done? That would keep NAPI and the IRQ busy
without ever receiving a packet, until a manual ifdown/ifup.
mlx5e recovers from MLX5_CQE_REQ_ERR by moving the SQ through
ERR->RST->RDY. The health monitoring patch later in this series only
polls firmware health.
Is the nodnic firmware guaranteed not to put the queue into an error
state here, or does this need a recovery path?
[ ... ]
> +int mlx5_nodnic_napi_poll(struct napi_struct *napi, int budget)
> +{
[ ... ]
> + while (true) {
> + cqe = mlx5_nodnic_cq_get_cqe(cq);
> + if (!cqe)
> + break;
> +
> + /* RX and TX share the CQ. With budget == 0 (netpoll) only TX
> + * completions may be processed, leave RX CQEs in place.
> + */
> + if (unlikely(!budget) && mlx5_nodnic_cqe_is_rx(cqe))
> + break;
[Severity: Medium]
With budget == 0, can an RX CQE at the head of the shared CQ block every
TX completion behind it?
The CQ is consumed strictly in order, so this break leaves cq->cc on the
RX CQE. The send CQEs after it are never reached,
mlx5_nodnic_sq_publish_cc() has nothing to publish, and sq->cc does not
advance.
During a panic with netconsole, NAPI and softirq can't run. Any inbound
frame that lands at the head, such as a broadcast ARP, stops TX reclaim
permanently. The failure would go like this:
- BQL or the SQ ring fills.
- mlx5_nodnic_xmit() sees no room.
- __netpoll_send_skb() retries netpoll_poll_dev() until it gives up.
- The skb is queued on npinfo->txq for a workqueue that won't run.
Wouldn't the rest of the panic output be lost?
bnxt handles budget 0 on its shared completion ring by discarding RX
completions with bnxt_force_rx_discard(), so it can reach the TX
completions behind them. Would something similar work here?
[ ... ]
> +netdev_features_t
> +mlx5_nodnic_check_features(struct sk_buff *skb, struct net_device *netdev,
> + netdev_features_t features)
> +{
> + features = vlan_features_check(skb, features);
> +
> + /* Validate if the tunneled packet is being offloaded by HW */
> + if (skb->encapsulation && (features & NETIF_F_CSUM_MASK))
> + return features & ~NETIF_F_CSUM_MASK;
[Severity: Low]
This isn't a bug, but this comment appears to be copied from
mlx5e_features_check(). There it is followed by a call to
mlx5e_tunnel_features_check().
Here nothing is validated. Checksum offload is cleared for every
encapsulated skb. That behaviour is correct, since
mlx5_nodnic_tx_build_wqe_eseg() only sets outer L3/L4 checksum flags.
Could the comment say that tunnel checksum offload isn't supported?
> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
> index 79cd2527966c4..243c720b73b63 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c
[ ... ]
> +static int mlx5_nodnic_activate_queues(struct mlx5_nodnic_core_dev *dev)
> +{
[ ... ]
> + mlx5_nodnic_activate_sq(dev);
> +
> + napi_enable_locked(&cq->napi);
> + mlx5_nodnic_arm_cq(cq);
> + napi_schedule(&cq->napi);
[Severity: Low]
Is the mlx5_nodnic_arm_cq() call here needed?
Once napi_enable_locked() has run, a busy-poll socket still holding the
napi_id from a previous session can run mlx5_nodnic_napi_poll() on
another CPU. That poll updates cq->cc and may call mlx5_nodnic_arm_cq()
itself after napi_complete_done().
Meanwhile this process-context arm reads cq->cc and cq->arm_sn. It then
writes cq->dbr.db[1] and the CQ doorbell, and nothing serializes the
two arms. mlx5_nodnic_cq_irq_handler() also increments cq->arm_sn.
include/linux/mlx5/doorbell.h notes that mlx5_write64() is not atomic on
32-bit and needs external locking.
The practical effect looks limited to a stale arm or a spurious
interrupt. napi_schedule() follows right away, and the poll re-arms when
it completes. Could this arm be dropped, or moved before
napi_enable_locked()?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126182448.707782-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179580622112.3135.1797108162011344544@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.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-372919-linux-kernel-netdev=dewy.ruReferences:
<20261126182448.707782-3-tariqt@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.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-372919-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next V3 2/5] net/mlx5: nodnic: Implement data path Date: Fri, 27 Nov 2026 19:03:41 +0000 Organization: Usenet Network Message-ID: <179580622112.3135.1797108162011344544@kernel.org> References: <20261126182448.707782-3-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="796392"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:W8PESl4q3yAm2xR5BhSjBYnJ8RY= sha256:1I+aPhHGD73+we36N/RDsHYtJT2p8ZAlIsH8bu88QA0= sha1:G1c586V3XJSf3rRyx+HLbZNL+iQ= sha256:cDcZOvCyxxiiMgvJXds/RRFn4ekD/RVYQvqOh8uWDBM= 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 AD608125F63; Fri, 27 Nov 2026 22:04:12 +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 mct7CF7zqwts; Fri, 27 Nov 2026 22:04:09 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372919-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 A2ECB125F60; Fri, 27 Nov 2026 22:04:00 +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 E34D42BDA6; Fri, 27 Nov 2026 19:03:50 +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=1795806228; b=B+qfiW7IydwHuuINJufPm0S3vdTVHIzUo+Ltk434Z+FkypqgrlblNWfjPp6JIsd0Tnal YWYjU7pyKcozHxQjgLueP+B27KQO33QvQzUeDZxhDlgYanZ6z3/WUUVaz8QHlGDbViWp8 BeN777dRMoomnrChnQq3xmxFLwJqdctn4q/zrWzVK6jhO7aR+iYTPA+sY9NXcDPw2HRUG 3zTcTZoMYvqsT8NZ2R/NJj5QNeAye/jXS+nTVPuH+ARHnd50NguuWYDrPlZ1pTP2LOEz+ 0EJW2kq+yzLvQFVZ6H3e00A+EYV8PC9T8W2MMpbWXcoFXciBI79r73XqtVLnIj7DSYQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795806228; 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=TjzzOyavUsmK8+nA5C4pPZ8/ksR+I/TmM7vvBy5YUk0=; b=3SAtAGmwV2lkJw3WSPj2A7ORFyDW7Ac6gqtdjI/zPiQMe7vSEyobvq4vuXWRwx7c+9QY YMZCcbdp5PfxwraR3vALCFYCGMX2oFz4Ee32CB9MMT7iU35XFft4Ny0EQVhaVXIXFEJeu b1n7OQ++wGbzNa9zWU7vvIZxuzJkzC7oDKcF/pSseablADP378yeRmahNgg2hbiIXdkfw HkU7WdeaVISsYzol054PA3frU79ftF3jbMvVdus3QTmEIiV1a0bfzSy92XZz3R5FNYopR J2S1pT2mdnBeV/8LCZpVfk8+cwif7IDnyrkYncyPdvfdhjzIyrg41UdwltHt6MuJtoQ== 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=AAowffRb; 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 4AD0A606A338; Fri, 27 Nov 2026 19:03:48 +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=AAowffRb 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=1795806222; b=Vr093dbC4CaCnxOor1BwRRq7u8bDq62A0LsED/aC6UsHdyGQWshN2vlmSHw4fmR16ROl L4/aQC7QGhzoV+LF0Rk4I117PDFhQRms+mcjnsLEjuGS2/L6mQy4XWH940kaaTLb33iyC HZMWp8oHMBbOKRSsxLmA5SVRDoc4w49H+J/ngJZAeCJRrZ/0soxi+kmEPmsP+kz/wEg6t oL6uT8MzQ+LtYwb0FoHUUOdz7bkUX/FnYn1G9bG8hYbHYDZa8zeZUv3iDu3kMtnU5V1mX v401RTnbUdYyAoNl7N+AAqFmX7aq/okEjv0vPxbEjktPDGhb7uZY6Qb83I9BQWoOtDw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795806222; 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=TjzzOyavUsmK8+nA5C4pPZ8/ksR+I/TmM7vvBy5YUk0=; b=OWgNWa+GqQylR37i1u4fB8YuO945mR39m9SwdOMnHM1ASf6LlDUsgayMLUAine7nDPgA iREkqnwjo0yx1C/bsZLk3DPWFgJKxZNP+VFwA6f0GFdfxgak0F14lIzHKTuUOQMBKjbTq 1i9F8xL/dLVH92GrDcTL9LMMp2j5SQfJXnqESXzylzrDL/w1Pob0rsbg9dPbVrshpIc+K S8XiDhlGlH84IYwKsWZMY+wDrQUEKmcjUkHvv3tQxiawDW0qmvl/mfhSmXsnC5ZozNylb AVdZIfN6cwQ9KtUN4wc0dvTTmHwMJe41PGTI+1LAUwbOgZG7gdy7blaRDP3EVCInauQ== 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=AAowffRb; 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 69386606A333; Fri, 27 Nov 2026 19:03:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DA201F000C1; Fri, 27 Nov 2026 19:03:41 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795806222; bh=TjzzOyavUsmK8+nA5C4pPZ8/ksR+I/TmM7vvBy5YUk0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=AAowffRbCJ4ZdIHylf0XbQ9tZRC3N/lRW0PF2aVQUJd3kk2h2VRCeRi4fUoJ0oBpm SVb2KdSKU35zVVIa5rbSsJ0nz+i7+tWGxHgJdi3U6568T/wsu8vk5DGJddFpis5iBr XsAf8nhOD33SYK2gEpWyqHAc13SmcoeRfb1aBr60elek5n9G7F6RQNxiPLe7r74dET qAV8C+nLbDxR0zD0CKf6nvgYes0U5krIeCHWHZL5t/pncRX5f7Ch69XJY7e2GbHl51 IKaWnOqjxM7YqFO+0jjNH0UQsOVwg9k0YwNdNCSptcLSzkuCFqocrqT0+3T7lGdyW1 K/aVSswsH/qnw== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, cjubran@nvidia.com, gal@nvidia.com, linux-kernel@vger.kernel.org, shshitrit@nvidia.com, horms@kernel.org X-In-Reply-To: <20261126182448.707782-3-tariqt@nvidia.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