Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: tariqt@nvidia.com
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
Subject: Re: [PATCH net-next V3 2/5] net/mlx5: nodnic: Implement data path
Date: Fri, 27 Nov 2026 19:03:41 +0000	[thread overview]
Message-ID: <179580622112.3135.1797108162011344544@kernel.org> (raw)
In-Reply-To: <20261126182448.707782-3-tariqt@nvidia.com>

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

  reply	other threads:[~2026-11-27 19:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 18:24 [PATCH net-next V3 0/5] net/mlx5: Introduce mlx5_nodnic, a driver for DRAM-less NVIDIA Mellanox NIC functions Tariq Toukan
2026-11-26 18:24 ` [PATCH net-next V3 1/5] net/mlx5: nodnic: Introduce the mlx5_nodnic driver Tariq Toukan
2026-11-27  8:58   ` Paolo Abeni
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 2/5] net/mlx5: nodnic: Implement data path Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko [this message]
2026-11-26 18:24 ` [PATCH net-next V3 3/5] net/mlx5: nodnic: Add TX/RX statistics Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 4/5] net/mlx5: nodnic: Add ethtool driver info Tariq Toukan
2026-11-27 19:03   ` netdev-bot+sashiko
2026-11-26 18:24 ` [PATCH net-next V3 5/5] net/mlx5: nodnic: Add health monitoring Tariq Toukan
2026-11-27 19:03   ` 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=179580622112.3135.1797108162011344544@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=cjubran@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shshitrit@nvidia.com \
    --cc=tariqt@nvidia.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