Article View: linux.kernel.netdev
Article #23717Re: [PATCH net-next V3 5/5] net/mlx5: nodnic: Add health monitoring
From: netdev-bot+sashiko
Date: Fri, 27 Nov 2026 19:03
Date: Fri, 27 Nov 2026 19:03
158 lines
13717 bytes
13717 bytes
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?
[ ... ]
> 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;
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126182448.707782-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179580622522.3135.9739046341225289422@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372922-linux-kernel-netdev=dewy.ruReferences:
<20261126182448.707782-6-tariqt@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372922-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next V3 5/5] net/mlx5: nodnic: Add health monitoring Date: Fri, 27 Nov 2026 19:03:45 +0000 Organization: Usenet Network Message-ID: <179580622522.3135.9739046341225289422@kernel.org> References: <20261126182448.707782-6-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="796494"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ffTtD8wy2DCmYrJeXKpFUhKiPLo= sha256:NgP/JZZkBWrcMMYs1FaHjeVwh5mSQ9dSp/h+0oBLF8M= sha1:aqTsrLxLrTBjuPj9aod5yCbAKOg= sha256:jCYJ5mcLrlYB5IzC8wdMrJxEr/85t0WFEY2yD7e8OPs= 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 A4063125F5E; Fri, 27 Nov 2026 22:04:22 +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 JUzv210MAldU; Fri, 27 Nov 2026 22:04:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372922-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 D674C125F60; Fri, 27 Nov 2026 22:04:10 +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 36A8F30142; Fri, 27 Nov 2026 19:03:54 +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=1795806232; b=ybrNowI/OuTdeTgLt8e2OKbq6oO+duhPINvWh8SLG6Im+oK6WdrWXK7q2C/GwPNJ8qpz XrcNd61AFltPq5hWHvQAXXRjCOJHt07iznkgZQ8bCB7IZ75CB0o0fTRpovjM1XeUbn5D/ vdBfIIVL/IO9ZxJS7WpiTSBHtMbcHfz7RZ1IjrTeCnilIIg34o9Ymn7ut2mdjmdI91dYn FAQ2p1XZVGItVYyHscFWznKxouES7DlQombnZ7tCIVgc+PcuAvVMcw8cwYZ/0sSkHHHQV fy5DgDgI6/w09u+1drg8SXxCfZOf5d6nLoQuAsVnpyI48dfYrRmaMZEYWy5SICvIsxw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795806232; 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=sh53ElcPrxXMqpfaM+scQ0n1Yr1piuqY/R2KAkhxLOE=; b=fMr7VLtBCunvWFo4B9LhKifcJl7Wz3bxMgDsnL1PYy3TMeVALf860nCbI/SF0ka4fR03 u9jp4knaig+c+27VQU9oQSWrgFnPoRSq7mqenMSsipd58L0HX8TiddZIbyQ3s2tYoXnqn c4FadzYI/yUF71QbvLLtBiN33sVLOOZes7ZENSA3cUR9uV/rf4UD236hcXodjP50TxtED GSNGkDMTIf5iZUYx+8KLeby59M6Uo/U/P+/FNB2CCIchXgwoYJQeIz/ONPln/4AigGpnM ObAK3w+dfqqvwKSwtiOptakhNLXeI4LGEi/X707b7b7C4YXK7Z9xFo3oKb1cIt1U+7w== 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=oBkxANxi; 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 6B8AA606A686; Fri, 27 Nov 2026 19:03:52 +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=oBkxANxi 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=1795806226; b=vfeoFf6EiaWHGdF2WHzer9B95lEW8+3L95GQDg0IQVy0Dr55Jb4ZIu4zioQtXwdE15s1 XCdIamUstcieTqBdQPqezQXj4kZX6NqV5YxZNUEMZJmwLLdAHshLiQXJKFhpJzjTf0xmI cwz+iuFtQZz0tuDsUrri9sV/rrEgQ4py1c4L9fUccOsXDixegfsfiakC5apnjrfyvxlhe eFvTVQbOW3+soVyl1sWIG5BuSF+67w8qa4uVIz+mc9Pl9LJLJ6Hwki1EO3t7mtuAQWcbR ODBZ48aNMUEsrQ6sTj3TzdRClb/LNT1jIW+aGaxw38r57i8VNgxDQE1YEnyQa2Cs/JQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795806226; 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=sh53ElcPrxXMqpfaM+scQ0n1Yr1piuqY/R2KAkhxLOE=; b=ngWq2hxuyXqP9CVk0NBCvLAkzXXQN83Y2vNi7KvEZ/Zm4E/FM4WsgdsKfYtSj4Ak+GoZ iIETJ+048aLaV4l7/DrHttC4YmJDv4chadxLbHExGJKu5l3P0Oc3FOpFfs6Crf7v/c/im JRs7b3hScAq9+mIeYcMFrdCt3jSnsxYT8d9LR2hhAoQap6oY+lNpVxsissvXBQ5qi4F8x s6t3zIcXB6lJHwVe/Tv62ouGnkl/rIhUCH+kmdgri/AQ+GV9hH2WM5mlrXcmr/F7A+uSG XpAA3uMUk49jwSXm1rfKLbKHsEJ5IdD6UUiJMugu1lAwzaZIOsYbNftwqU9FdivC72Q== 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=oBkxANxi; 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 8BF8D606A684; Fri, 27 Nov 2026 19:03:46 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BD971F000C1; Fri, 27 Nov 2026 19:03:45 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795806226; bh=sh53ElcPrxXMqpfaM+scQ0n1Yr1piuqY/R2KAkhxLOE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=oBkxANxip2zbCnd3ReEepEdxBNPQRWrgSjgJRBKj+EePob/yJZWlE4ZPRrp+apRUf 76z6r3D6WhLW8mwcFlreLEgNFqSTw9tFA2RQiLl5i9+z8F3A2ZbQfOJGGgUK4A9RrO EJzgfsztt15lAIWPgF26esgTMqG2uJVLEneGA2uDDz8KDxuT3ev/cyq9ONsUenaS4n J55/QXb6D+khYxjxwCsSDwFOc86HQ/T+ohY/+iwuGTXiqag+zdxYVIOMFemSya+McB 8MoWKs8JT7zFMe2d0IpTLnCHQGY1E8ibP8LEuE6L1JVGYzUT75B7tZ8XLpuyL7JFME wi2Um6vddHWbA== 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-6-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