Netdev List
 help / color / mirror / Atom feed
From: Shahar Shitrit <shshitrit@nvidia.com>
To: netdev-bot+sashiko@kernel.org, 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,
	horms@kernel.org
Subject: Re: [PATCH net-next V3 5/5] net/mlx5: nodnic: Add health monitoring
Date: Sun, 29 Nov 2026 16:47:12 +0200	[thread overview]
Message-ID: <de24ca2c-d503-4031-8e2b-529e3fc7a68c@nvidia.com> (raw)
In-Reply-To: <179580622522.3135.9739046341225289422@kernel.org>



On 27/11/2026 21:03, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 3 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 2
> 
> 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] When mlx5_nodnic_poll_health()
>   (drivers/net/ethernet/mellanox/mlx5/nodnic/health.c) detects a fatal…
> - [Low] The commit message does not spell out several behaviours.
> - [Low] mlx5_nodnic_printk() in
>   drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h is a variadic…
> 
> --
> 
> net/mlx5: nodnic: Add health monitoring
> 
> This commit adds a timer-based health poller to the mlx5 nodnic driver.
> The poller reads the health buffer in the initialization segment and
> detects fatal PCI/FW conditions, health counter stalls and syndrome
> changes. It logs them with a severity and moves the device to
> INTERNAL_ERROR on fatal conditions. Polling starts in probe and stops in
> remove.
> 
>> Detect fatal device conditions, firmware health counter stalls, and
>> syndrome changes. Report health errors together with their severity
>> and mark the device as unhealthy on fatal conditions.
> 
> [Severity: Low]
> Could the commit message say more about what "mark the device as
> unhealthy" means in practice?
> 
> After the first fatal event, mlx5_nodnic_poll_health() returns without
> calling mod_timer(), so health polling stops for good.
> 
> The INTERNAL_ERROR state is never cleared. From then on,
> mlx5_nodnic_open_locked() returns -EIO for the rest of the driver's
> lifetime.
> 
> The patch also adds a new severity-aware logging helper,
> mlx5_nodnic_printk() / mlx5_nodnic_log(), to nodnic.h, and the message
> doesn't mention it.
> 
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/health.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/health.c
>> new file mode 100644
>> index 0000000000000..a2038eea9717f
>> --- /dev/null
>> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/health.c
>> @@ -0,0 +1,303 @@
> 
> [ ... ]
> 
>> +static void mlx5_nodnic_poll_health(struct timer_list *t)
>> +{
>> +	struct mlx5_nodnic_priv *priv = timer_container_of(priv, t,
>> +							   health.timer);
>> +	struct mlx5_nodnic_core_dev *dev = priv->core_dev;
>> +	struct mlx5_nodnic_health *health = &priv->health;
>> +	struct health_buffer __iomem *h = health->health;
>> +	u32 fatal_error, count;
>> +	u8 prev_synd;
>> +
>> +	if (READ_ONCE(dev->state) == NODNIC_DEVICE_STATE_INTERNAL_ERROR)
>> +		return;
>> +
>> +	fatal_error = mlx5_nodnic_health_check_fatal_sensors(dev);
>> +
>> +	if (fatal_error && !health->fatal_error) {
>> +		mlx5_nodnic_core_err(dev, "fatal error detected: %s (%u)\n",
>> +				     mlx5_nodnic_fatal_error_str(fatal_error),
>> +				     fatal_error);
>> +		priv->health.fatal_error = fatal_error;
>> +		WRITE_ONCE(dev->state, NODNIC_DEVICE_STATE_INTERNAL_ERROR);
>> +		if (fatal_error != MLX5_NODNIC_SENSOR_PCI_COMM_ERR &&
>> +		    fatal_error != MLX5_NODNIC_SENSOR_PCI_ERR)
>> +			mlx5_nodnic_print_health_info(dev);
>> +		return;
>> +	}
> 
> [Severity: Medium]
> When a fatal sensor fires, this branch sets dev->state to INTERNAL_ERROR
> and returns. Is anything else supposed to happen to an interface that is
> already open?
> 
> As far as I can see, the only reader of the new state is the check added
> to mlx5_nodnic_open_locked(). Carrier stays on, the TX queue is not
> stopped and the netdev is not detached.
> 
> mlx5_nodnic_xmit() never looks at dev->state, so it keeps building WQEs,
> updating the DBR and ringing the UAR doorbell of a device that has just
> been declared dead:
> 
> drivers/net/ethernet/mellanox/mlx5/nodnic/tx.c:mlx5_nodnic_xmit() {
>     ...
>     mlx5_write64((__be32 *)ctrl, uar_base + MLX5_BF_OFFSET);
>     ...
> }
> 
> The close and remove paths also ignore the state:
> 
>   mlx5_nodnic_close_locked()
>     -> deactivate/close queue VSC commands
> 
>   mlx5_nodnic_remove_one()->mlx5_nodnic_dev_cleanup()
>     -> mlx5_nodnic_write_nic_interface(dev, DISABLED)
>     -> mlx5_nodnic_wait_fw_init(dev, "teardown")
> 
> With all-ones reads, the VSC gateway lock gives up with -EBUSY after
> VSC_MAX_RETRIES sleeps, so each access is bounded to a few seconds.
> 
> What if config space still works but FW keeps the initializing bit set,
> for example during SW_RESET or RFR? Could the teardown wait then run up to
> MLX5_NODNIC_FW_INIT_TIMEOUT_MS?
> 
> Because the state is never cleared, a down/up cycle then fails in
> mlx5_nodnic_open_locked() with -EIO, and only unbind/rebind recovers the
> interface.
> 
> Should the fatal path drop carrier and stop or detach the netdev? Should
> xmit, close and remove also skip device access once the state is
> INTERNAL_ERROR?
> 
> [ ... ]
>
FW fatal errors are currently logged only; recovery will be added in a
follow-up.

>> diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h
>> index c44b0fdbe601b..6f8677bf1aaef 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h
>> +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/nodnic.h
>> @@ -78,6 +78,31 @@ struct mlx5_nodnic_core_dev {
>>  	enum mlx5_nodnic_device_state	state;
>>  };
>>  
>> +static inline void mlx5_nodnic_printk(struct mlx5_nodnic_core_dev *dev,
>> +				      int level, const char *format, ...)
> 
> [Severity: Low]
> This isn't a bug, but could mlx5_nodnic_printk() be annotated with
> __printf(3, 4)? Without it, -Wformat can't check the format strings
> passed through mlx5_nodnic_log().
> 
> All current callers in mlx5_nodnic_print_health_info() use matching
> formats and arguments. mlx5_printk() in mlx5/core/mlx5_core.h is declared
> the same way without __printf, so this follows the existing pattern.
> 
>> +{
>> +	struct device *device = dev->device;
>> +	struct va_format vaf;
>> +	va_list args;
> 
> [ ... ]
> 


      reply	other threads:[~2026-11-29 14:47 UTC|newest]

Thread overview: 16+ 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-29 14:40     ` Shahar Shitrit
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
2026-11-29 14:44     ` Shahar Shitrit
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-29 14:46     ` Shahar Shitrit
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
2026-11-29 14:47     ` Shahar Shitrit [this message]

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=de24ca2c-d503-4031-8e2b-529e3fc7a68c@nvidia.com \
    --to=shshitrit@nvidia.com \
    --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-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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