From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420751; b=Jb3SsXtZp6TEdvN9Eu9yqCYb/EyeSYPStBkZr/B4mGDQyyQlJ3t6jvsS795To2F8h0br mmItO/TN463jjGrERTtzt1f0tSy6V9DxxOxIorlHKD12OwI0UaVbak+gSsbR/QCiM53UQ xWa7Lmr6XtzxrG/TmysuGQ5WgoNIDFIh2KK5gmztk8FTlh+f0EtWznqLDwwxGmqcTrrkf bQO7xMEm9R6gpW1covP8z3X4CsyQpz+KERFQiQWEpLBgcK9eqI22yDhY4lTXhICZfQv6T VN4593nlVmfKbVeQynEJn3x782mKurS7Om6Fe3e8HpO/hymNv7VVRjpoomMwVMLTv1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420751; 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=33xIygk9KQLetcvO2sjPVcAmenQjw6dQs8LpLDyez9o=; b=DQUTBZWK6BBr9ttlYl41jVpVMN17iwlq6SBSNT8COgkr+UgIQhfmSRnaTTPeH6nHcMgB /yho0aR23I7IkEEyuHo6mGLvMn3OXxFNw+QPLycGpXFtNGZ0Z+dOnrUvgAyydrY9CjL4/ RSRoLxg6rovoSqyCB9/PJp7xfC9pTmWiJ8Q/0i9cBNdyhYO60epnBnyqJLb/nHLePxU/j C5DNARvBL70/b7iV1MkavntOXqnDaVeqHtNnnCS5CmQYzKTPCF5lmplaw8mFQpOlt2BYD nuOeIrBsfIaaCxKXsASYmckcTn5b04vyFkAeTe8bBiDx5DGBF08aGS0UMoNQZWaLUjw== 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=YDqjGHwO; arc=none smtp.remote-ip=100.103.45.18 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 1999D606A6A3; Fri, 4 Dec 2026 21:45:50 +0000 (UTC) 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=YDqjGHwO Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19C0D1F00A17; Fri, 4 Dec 2026 21:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796420750; bh=33xIygk9KQLetcvO2sjPVcAmenQjw6dQs8LpLDyez9o=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=YDqjGHwO9iwaz1Bms9OfBPdDzZWDeVCKflA4w6mX7xYM2TUr09KjLdi/vhI6Aqfoo OAysQ1hkwkyMHrsG9X9r3FUqf4//vk6SrQbqqEsAiiio4QnNPSMhlpQ8xqKt5BLz3P ARCkVnq+dSw2JtURnhG/pd1fL8cIfm3uef+jcLTbt/vMHV0aqgPBuGP92VrhdZgZuM 38OfkMB9zGZy0jMXnJp/uNPWeZJ4RFzxr1XxH/X7IGo3PQW+dQPQKrSacpZkxbk0M+ +RxE1bmOGALBKJOtzr6hkZhzf+cZOLkVkzt54/V/SvutItg6eEMrgB9DBFfpDQGn1f RZzeSNHrGCJBg== Subject: Re: [PATCH net-next V4 5/5] net/mlx5: nodnic: Add health monitoring 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, willemb@google.com, cjubran@nvidia.com, gal@nvidia.com, linux-kernel@vger.kernel.org, shshitrit@nvidia.com Date: Fri, 04 Dec 2026 21:45:49 +0000 Message-ID: <179642074964.3146.12790578096162085018@kernel.org> In-Reply-To: <20261203205721.4090361-6-tariqt@nvidia.com> References: <20261203205721.4090361-6-tariqt@nvidia.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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] On a fatal condition the new health monitor marks the device as unhealthy, but the only thing that ever acts on that mark is the… -- net/mlx5: nodnic: Add health monitoring This adds a timer that polls the firmware health buffer in the initialization segment every two seconds. It detects fatal device conditions, health counter stalls and syndrome changes, logs them with their severity, and marks the device as being in an internal error state. Probe starts the polling and remove stops it. > diff --git a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c > index 8eebd86e7a747..a45f651ed9ac2 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c > +++ b/drivers/net/ethernet/mellanox/mlx5/nodnic/en_cfg.c > @@ -919,6 +919,12 @@ static int mlx5_nodnic_open_locked(struct net_device *netdev) > struct mlx5_nodnic_core_dev *dev = priv->core_dev; > int err; > > + if (READ_ONCE(dev->state) == NODNIC_DEVICE_STATE_INTERNAL_ERROR) { > + netdev_err(netdev, > + "Cannot open: device is in a fatal error state\n"); > + return -EIO; > + } > + > err = mlx5_nodnic_init_uar_map(dev); > if (err) > return err; > 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 [ ... ] > +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] Is setting the state flag enough when the netdev is already open? Any of the five fatal sensors (PCI error, PCI comm error, NIC disabled, NIC SW reset, FW RFR) takes this branch. It logs, sets dev->state to NODNIC_DEVICE_STATE_INTERNAL_ERROR, and returns without re-arming the timer. This branch calls none of netif_carrier_off(), netif_device_detach(), napi_disable() or mlx5_nodnic_deactivate_queues(). Carrier stays up, NAPI keeps re-arming the CQ, and ndo_start_xmit keeps ringing UAR doorbells on a device that is reset, disabled or unreachable. In the nodnic directory, dev->state is written in only two places: mlx5_nodnic_probe_one() sets it to UP and this branch sets it to INTERNAL_ERROR. It is read in only two places: the early return at the top of mlx5_nodnic_poll_health() and the new check in mlx5_nodnic_open_locked(). Nothing resets the state to UP, and the timer is not re-armed after this branch. The pci_driver also has no err_handler or reset_prepare/reset_done hooks. Given that, can a single transient trigger make every later open fail with -EIO until the driver is unbound and rebound? One example would be sensor_pci_not_working() reading fw_ver == 0xffffffff once. The close and remove paths also ignore the new state. These calls still run VSC handshakes against a device already known to be dead: mlx5_nodnic_close_locked()->mlx5_nodnic_deactivate_queues() mlx5_nodnic_dev_cleanup()->mlx5_nodnic_write_nic_interface() mlx5_nodnic_dev_cleanup()->mlx5_nodnic_wait_fw_init() The waits are bounded by MLX5_NODNIC_FW_INIT_TIMEOUT_MS, and this teardown behaviour predates the patch. Should these paths skip the handshake once INTERNAL_ERROR is set? For comparison, mlx5 core pairs these same sensors with mlx5_enter_error_state() and health recovery work. The commit message says: "Report health errors together with their severity and mark the device as unhealthy on fatal conditions." Could it state that the only visible effect of the mark is a permanent -EIO from ndo_open? The new mlx5_nodnic_printk() and mlx5_nodnic_log() helpers in nodnic.h are not mentioned in the commit message either. > + > + count = ioread32be(health->health_counter); > + if (count == health->prev_counter) > + ++health->miss_counter; > + else > + health->miss_counter = 0; [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203205721.4090361-1-tariqt%40nvidia.com