From nobody Fri Oct 3 21:55:27 2025 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2074.outbound.protection.outlook.com [40.107.237.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF3CB25B2FD; Sun, 24 Aug 2025 08:44:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.237.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025082; cv=fail; b=XqI+Tz9XAhwmQqX5sHBNGqy3j4hM0yXpFlrWNIRTFyLmCB6DU1ZRkMDtCaRHEs/YDGAjH7cUnR580bXrnexgJeYpsbO+xFc2uoloEAjW9Hfc7J8lxTa2rCLZMOq/cpmofxMYLfYYlLuy0gxDAofrcf1GC1xETIdy1B5w5ZPmKaY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025082; c=relaxed/simple; bh=xorofwhgVEN1M2LVpCWyGOxnOUKh2RbLDxXrkQC/KnA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=scNoQmVJ1Qi+5KBvzehgNAL+jiB9++7WJk3VKok0t+WPzsb1CuEiQP+Tz9RC9tBrGrp3+1Nge3DWAkyDo1C8EaSqEIXL94To8DZexKzctrgwuxu7WUURgKb9nfmJGMgbpTXO2xhQ66D6qkIhb65kIgT1fSp+y3P/bb2deSkqu9I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=X95bjk8I; arc=fail smtp.client-ip=40.107.237.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="X95bjk8I" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bOq8QTv1f8YVQevQBVuikYf9QUto2CKDi7I8WZV4Nw69UkYhgY8SfCth222bsmv+3Iysjoa3GvtFp4xOuWef+mZ/lNPjZ2YYWTd6Oc5uUZ7RKEY4K2cPxRZJZr7TQ627UjqaKXmpQlcU3NhyZWH9BrdX9H3jJSElgXQnpTZ2UWZ8SWajvAsAg/zYub9ydv/ucaUa9DyeWpi3oIKgLZb4MOYp+nO14Uw2/A/d8ZzxJR0kup+OcdxrxDVceknQfK9BOiKZ5tDil507eh9qdgAlaJBrYH/j9wfj5bNyueylJGkTjfHOfDu6SRH30FyCPDBzSBCTLuaVwHt85ELBqDUCXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=88KKm5IIVNMwk8uug+LhX1pThGunkE3f2lQ19Ky32+0=; b=mLol0ijAuKeAat1QIbDiN0OjQ2DMOJxaMNRplCu9KANe0t1bR/8BuE88QDzpxDnCa3iT/Xd7S8gkGJFJVHXcPH3LcwRy9m2rIFTLKMxO/A8pN22339j4F9R2zROJc/H6GDQKGPgIADZEclJEJB+DVtyCtTmJv0YylCdbJ3rtyFge0kCKcOzxw111rnni3s2kCqrn3QNR6i040StFVRckpFkkmNmi7O5PMoip6JWy0nJ6cAgvi5A4tGZLXp1sbZPfhFgcRyvyxSTJQL6fx4jh+TnVh3gauL/BCq0Nzl5VGH0Rv0gWLzClVRfg8HzMCIEjEGbd0pbDyFwMEsKKQ1nI5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=88KKm5IIVNMwk8uug+LhX1pThGunkE3f2lQ19Ky32+0=; b=X95bjk8IO59AqtXOB29uVnqawjNWVNFcklAtc2V5JW36EIajVzfNk0Goe2rXbaDmsr2GEOT6fzc5y1iP3dd+Kbb9mWM7mRLvjhGvW+ZtZMaqqc2wwc5VTJZZw24fLw2cmW7zvqSORDsBexd6yWeNWZMohj9ZL018QfvLmaEEbDXwGiEefb6Y//fFxGvRXK61Z8C7ClEyhAteUkW1sCbfquiAhblQawf2J0z2ayH11Ao4DnOj/AX3+vSoRZc0snmbCIjtwENZK/7NOGmZekFzv9PQqsuhzc9l/6wS2g/5y3uutXMJIYZNJ6EvlqK0+onCOSs9wVMBOGKzV+Y7D5U80w== Received: from DM5PR08CA0026.namprd08.prod.outlook.com (2603:10b6:4:60::15) by CH2PR12MB4229.namprd12.prod.outlook.com (2603:10b6:610:a5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9031.22; Sun, 24 Aug 2025 08:44:30 +0000 Received: from CY4PEPF0000EE3C.namprd03.prod.outlook.com (2603:10b6:4:60:cafe::10) by DM5PR08CA0026.outlook.office365.com (2603:10b6:4:60::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.20 via Frontend Transport; Sun, 24 Aug 2025 08:44:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE3C.mail.protection.outlook.com (10.167.242.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Sun, 24 Aug 2025 08:44:29 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:10 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:10 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Sun, 24 Aug 2025 01:44:03 -0700 From: Mark Bloch To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" CC: Tariq Toukan , Leon Romanovsky , "Saeed Mahameed" , , , Gal Pressman , Shahar Shitrit , Jiri Pirko , Mark Bloch , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Ido Schimmel , Petr Machata , Manish Chopra , Jiri Pirko Subject: [PATCH net-next V4 1/5] devlink: Move graceful period parameter to reporter ops Date: Sun, 24 Aug 2025 11:43:50 +0300 Message-ID: <20250824084354.533182-2-mbloch@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250824084354.533182-1-mbloch@nvidia.com> References: <20250824084354.533182-1-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3C:EE_|CH2PR12MB4229:EE_ X-MS-Office365-Filtering-Correlation-Id: e62ed930-5c20-4c01-96aa-08dde2ea70dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|7416014|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+hpGAKA9BkeH3QNBVVz5ETq/62XoskMvM1URu1XV+1jJ2Hi6XxDpvVRm+VI9?= =?us-ascii?Q?5IqANYj/h1uXeYuxQXA8IfGPP641u3s1EbU8qMTEnaKDcTo677miaQhhYFZ7?= =?us-ascii?Q?gim4rLWo3Z+6XJzxtw5dmJ4+V5Rlu7/sPIp20xyxONlNKHKMNQtwr7TsUGUn?= =?us-ascii?Q?0lQr4zH4k62VRGq1Q7M/CSAbcE/VBMAEBnn2NI/hL/F/vTOOJ56maz7ZYxkl?= =?us-ascii?Q?idaZrdvP0YD1AhES5Aeb0A166o0smM3NLIgTyZssEakCenBY+B5wCoLcGlH3?= =?us-ascii?Q?0UhFHrsfwLmbSY8YC6GXvN2eOHtjIeFPhCdKkIQclwCnHjKHQLvC0vIusijS?= =?us-ascii?Q?MeVbKSEIcAsfpwmTTQWlJLjCBiJwX2Jl1SvboxbzdOS1J2JUmrI87MPf8CZq?= =?us-ascii?Q?iW5SugLdrVG/4bJFrntD33AkNdlzSBpk6msmHFGMEASn0gqfkKnsJt3RxqRb?= =?us-ascii?Q?zSUhpMZYPqfyEDze7GZegueGbvFdidclaZSmu6td4r49qdeUjiOJovw01xIA?= =?us-ascii?Q?Gpsy1ZONbz5cmgpXb8wG3wZCpbe032nUmJv2YvdzmYL+JPo/GSZux4RyLiqU?= =?us-ascii?Q?Zy1dep6TiNIAWE6sCv6gIfF675UCdITyfJG4DhBXbvi4D2LYfvPzATlYMhpN?= =?us-ascii?Q?oRzFk22mABDnM34neVlTQeu5TuidoJWrGFiPv3IfWkpjsyp5Si9ExQYHRCnp?= =?us-ascii?Q?zKdFtad1d+bFAaz/GBCb/WlqLA7/H/GszIqQFo9JufrWwINyXgK/HUnw9VNs?= =?us-ascii?Q?DWNVP/FkzoWa0zxu/JlVZXnZxjAt5m1N/vdRd8iWnK5XHTbjE6KuPrZmQTwP?= =?us-ascii?Q?mr/fjf59n2prSxPDFsqZ+3Qr59cMzOQ3txmNPXnKYFPpd/PgyaVP4BAqbfi/?= =?us-ascii?Q?cE/W2beWpiUcfDW5B+aQoChInTUt0pb4PRtLE6SDF2FmNbdlOcuuKnKbhNq/?= =?us-ascii?Q?q1DTY2nYUamJ3zwIxpd0l1WE4BGZ12H5OmiyzWJ9MFNdPN5mEh+1v3Kuxqml?= =?us-ascii?Q?AtxR1VNlHhGRYnT4vZ8YL1gNdW30I7/lhatCs35v4LwZOqjx/yqa1R9F4/YU?= =?us-ascii?Q?271TzjRfXrVFXnDTimSGxfTd0B6kgGCQB7v6rtceex70xlYWgZ62cXgQLtKl?= =?us-ascii?Q?F4oMqjHYZwwztBthudbHUNeGVW8q0F0Mm7p2S7N5OoOUtNlTruSTlqfHnUVN?= =?us-ascii?Q?S1pi2Sg+UK0XRzUrJCJQkOLpG6XRsKQKddAoTy7LFNKwwB5QSupPnuEGCCdS?= =?us-ascii?Q?7TuNnlQT90MbzY3ZnpWXQnj+wjAj2tKBHfyfdPdQdZCsdba9iK3TUhyEOrNO?= =?us-ascii?Q?wdaXiNJzeN9nWDygneUjb7rqckr9AqTrieyAJ75tg3RGKM6NJXh2i6gY6lYJ?= =?us-ascii?Q?9kOYHqKrfhc5gqkIbr0I28en7cXQaxhvmwmGwe969oW5SStCFquXLQY5huzZ?= =?us-ascii?Q?ypcwWIKqWDeZv4zRtbfEggSiC1Xy6DxXhm6IT9anMc+Ok84oH8hxTqahk4pQ?= =?us-ascii?Q?xLab/X8muP+jyZxUIs8mtpj8qAGinhpWwTGd?= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(7416014)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2025 08:44:29.8978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e62ed930-5c20-4c01-96aa-08dde2ea70dd X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4229 Content-Type: text/plain; charset="utf-8" From: Shahar Shitrit Move the default graceful period from a parameter to devlink_health_reporter_create() to a field in the devlink_health_reporter_ops structure. This change improves consistency, as the graceful period is inherently tied to the reporter's behavior and recovery policy. It simplifies the signature of devlink_health_reporter_create() and its internal helper functions. It also centralizes the reporter configuration at the ops structure, preparing the groundwork for a downstream patch that will introduce a devlink health reporter burst period attribute whose default value will similarly be provided by the driver via the ops structure. Signed-off-by: Shahar Shitrit Reviewed-by: Jiri Pirko Signed-off-by: Mark Bloch --- drivers/net/ethernet/amd/pds_core/main.c | 2 +- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 2 +- .../net/ethernet/huawei/hinic/hinic_devlink.c | 10 +++-- .../net/ethernet/intel/ice/devlink/health.c | 3 +- .../marvell/octeontx2/af/rvu_devlink.c | 32 +++++++++++---- .../mellanox/mlx5/core/diag/reporter_vnic.c | 2 +- .../mellanox/mlx5/core/en/reporter_rx.c | 10 +++-- .../mellanox/mlx5/core/en/reporter_tx.c | 10 +++-- .../net/ethernet/mellanox/mlx5/core/en_rep.c | 2 +- .../net/ethernet/mellanox/mlx5/core/health.c | 41 +++++++++++-------- drivers/net/ethernet/mellanox/mlxsw/core.c | 2 +- drivers/net/ethernet/qlogic/qed/qed_devlink.c | 9 ++-- drivers/net/netdevsim/health.c | 4 +- include/net/devlink.h | 11 +++-- net/devlink/health.c | 28 +++++-------- 15 files changed, 97 insertions(+), 71 deletions(-) diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/etherne= t/amd/pds_core/main.c index 9b81e1c260c2..c7a2eff57632 100644 --- a/drivers/net/ethernet/amd/pds_core/main.c +++ b/drivers/net/ethernet/amd/pds_core/main.c @@ -280,7 +280,7 @@ static int pdsc_init_pf(struct pdsc *pdsc) goto err_out_del_dev; } =20 - hr =3D devl_health_reporter_create(dl, &pdsc_fw_reporter_ops, 0, pdsc); + hr =3D devl_health_reporter_create(dl, &pdsc_fw_reporter_ops, pdsc); if (IS_ERR(hr)) { devl_unlock(dl); dev_warn(pdsc->dev, "Failed to create fw reporter: %pe\n", hr); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/ne= t/ethernet/broadcom/bnxt/bnxt_devlink.c index 4c4581b0342e..43fb75806cd6 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -220,7 +220,7 @@ __bnxt_dl_reporter_create(struct bnxt *bp, { struct devlink_health_reporter *reporter; =20 - reporter =3D devlink_health_reporter_create(bp->dl, ops, 0, bp); + reporter =3D devlink_health_reporter_create(bp->dl, ops, bp); if (IS_ERR(reporter)) { netdev_warn(bp->dev, "Failed to create %s health reporter, rc =3D %ld\n", ops->name, PTR_ERR(reporter)); diff --git a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c b/drivers/ne= t/ethernet/huawei/hinic/hinic_devlink.c index 03e42512a2d5..300bc267a259 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_devlink.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_devlink.c @@ -443,8 +443,9 @@ int hinic_health_reporters_create(struct hinic_devlink_= priv *priv) struct devlink *devlink =3D priv_to_devlink(priv); =20 priv->hw_fault_reporter =3D - devlink_health_reporter_create(devlink, &hinic_hw_fault_reporter_ops, - 0, priv); + devlink_health_reporter_create(devlink, + &hinic_hw_fault_reporter_ops, + priv); if (IS_ERR(priv->hw_fault_reporter)) { dev_warn(&priv->hwdev->hwif->pdev->dev, "Failed to create hw fault repor= ter, err: %ld\n", PTR_ERR(priv->hw_fault_reporter)); @@ -452,8 +453,9 @@ int hinic_health_reporters_create(struct hinic_devlink_= priv *priv) } =20 priv->fw_fault_reporter =3D - devlink_health_reporter_create(devlink, &hinic_fw_fault_reporter_ops, - 0, priv); + devlink_health_reporter_create(devlink, + &hinic_fw_fault_reporter_ops, + priv); if (IS_ERR(priv->fw_fault_reporter)) { dev_warn(&priv->hwdev->hwif->pdev->dev, "Failed to create fw fault repor= ter, err: %ld\n", PTR_ERR(priv->fw_fault_reporter)); diff --git a/drivers/net/ethernet/intel/ice/devlink/health.c b/drivers/net/= ethernet/intel/ice/devlink/health.c index ab519c0f28bf..8e9a8a8178d4 100644 --- a/drivers/net/ethernet/intel/ice/devlink/health.c +++ b/drivers/net/ethernet/intel/ice/devlink/health.c @@ -450,9 +450,8 @@ ice_init_devlink_rep(struct ice_pf *pf, { struct devlink *devlink =3D priv_to_devlink(pf); struct devlink_health_reporter *rep; - const u64 graceful_period =3D 0; =20 - rep =3D devl_health_reporter_create(devlink, ops, graceful_period, pf); + rep =3D devl_health_reporter_create(devlink, ops, pf); if (IS_ERR(rep)) { struct device *dev =3D ice_pf_to_dev(pf); =20 diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/driv= ers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c index 27c3a2daaaa9..3735372539bd 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c @@ -505,7 +505,9 @@ static int rvu_nix_register_reporters(struct rvu_devlin= k *rvu_dl) =20 rvu_reporters->nix_event_ctx =3D nix_event_context; rvu_reporters->rvu_hw_nix_intr_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_nix_intr_reporter_ops= , 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_nix_intr_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_nix_intr_reporter)) { dev_warn(rvu->dev, "Failed to create hw_nix_intr reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_nix_intr_reporter)); @@ -513,7 +515,9 @@ static int rvu_nix_register_reporters(struct rvu_devlin= k *rvu_dl) } =20 rvu_reporters->rvu_hw_nix_gen_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_nix_gen_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_nix_gen_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_nix_gen_reporter)) { dev_warn(rvu->dev, "Failed to create hw_nix_gen reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_nix_gen_reporter)); @@ -521,7 +525,9 @@ static int rvu_nix_register_reporters(struct rvu_devlin= k *rvu_dl) } =20 rvu_reporters->rvu_hw_nix_err_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_nix_err_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_nix_err_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_nix_err_reporter)) { dev_warn(rvu->dev, "Failed to create hw_nix_err reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_nix_err_reporter)); @@ -529,7 +535,9 @@ static int rvu_nix_register_reporters(struct rvu_devlin= k *rvu_dl) } =20 rvu_reporters->rvu_hw_nix_ras_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_nix_ras_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_nix_ras_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_nix_ras_reporter)) { dev_warn(rvu->dev, "Failed to create hw_nix_ras reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_nix_ras_reporter)); @@ -1051,7 +1059,9 @@ static int rvu_npa_register_reporters(struct rvu_devl= ink *rvu_dl) =20 rvu_reporters->npa_event_ctx =3D npa_event_context; rvu_reporters->rvu_hw_npa_intr_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_npa_intr_reporter_ops= , 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_npa_intr_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_npa_intr_reporter)) { dev_warn(rvu->dev, "Failed to create hw_npa_intr reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_npa_intr_reporter)); @@ -1059,7 +1069,9 @@ static int rvu_npa_register_reporters(struct rvu_devl= ink *rvu_dl) } =20 rvu_reporters->rvu_hw_npa_gen_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_npa_gen_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_npa_gen_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_npa_gen_reporter)) { dev_warn(rvu->dev, "Failed to create hw_npa_gen reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_npa_gen_reporter)); @@ -1067,7 +1079,9 @@ static int rvu_npa_register_reporters(struct rvu_devl= ink *rvu_dl) } =20 rvu_reporters->rvu_hw_npa_err_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_npa_err_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_npa_err_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_npa_err_reporter)) { dev_warn(rvu->dev, "Failed to create hw_npa_err reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_npa_err_reporter)); @@ -1075,7 +1089,9 @@ static int rvu_npa_register_reporters(struct rvu_devl= ink *rvu_dl) } =20 rvu_reporters->rvu_hw_npa_ras_reporter =3D - devlink_health_reporter_create(rvu_dl->dl, &rvu_hw_npa_ras_reporter_ops,= 0, rvu); + devlink_health_reporter_create(rvu_dl->dl, + &rvu_hw_npa_ras_reporter_ops, + rvu); if (IS_ERR(rvu_reporters->rvu_hw_npa_ras_reporter)) { dev_warn(rvu->dev, "Failed to create hw_npa_ras reporter, err=3D%ld\n", PTR_ERR(rvu_reporters->rvu_hw_npa_ras_reporter)); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c b= /drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c index 32bb769f1829..73f5b62b8c7f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c @@ -135,7 +135,7 @@ void mlx5_reporter_vnic_create(struct mlx5_core_dev *de= v) health->vnic_reporter =3D devlink_health_reporter_create(devlink, &mlx5_reporter_vnic_ops, - 0, dev); + dev); if (IS_ERR(health->vnic_reporter)) mlx5_core_warn(dev, "Failed to create vnic reporter, err =3D %ld\n", diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/dri= vers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c index 16c44d628eda..1b9ea72abc5a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -651,22 +651,24 @@ void mlx5e_reporter_icosq_resume_recovery(struct mlx5= e_channel *c) mutex_unlock(&c->icosq_recovery_lock); } =20 +#define MLX5E_REPORTER_RX_GRACEFUL_PERIOD 500 + static const struct devlink_health_reporter_ops mlx5_rx_reporter_ops =3D { .name =3D "rx", .recover =3D mlx5e_rx_reporter_recover, .diagnose =3D mlx5e_rx_reporter_diagnose, .dump =3D mlx5e_rx_reporter_dump, + .default_graceful_period =3D MLX5E_REPORTER_RX_GRACEFUL_PERIOD, }; =20 -#define MLX5E_REPORTER_RX_GRACEFUL_PERIOD 500 - void mlx5e_reporter_rx_create(struct mlx5e_priv *priv) { + struct devlink_port *port =3D priv->netdev->devlink_port; struct devlink_health_reporter *reporter; =20 - reporter =3D devlink_port_health_reporter_create(priv->netdev->devlink_po= rt, + reporter =3D devlink_port_health_reporter_create(port, &mlx5_rx_reporter_ops, - MLX5E_REPORTER_RX_GRACEFUL_PERIOD, priv); + priv); if (IS_ERR(reporter)) { netdev_warn(priv->netdev, "Failed to create rx reporter, err =3D %ld\n", PTR_ERR(reporter)); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/dri= vers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c index 85d5cb39b107..7a4a77f6fe6a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c @@ -539,22 +539,24 @@ void mlx5e_reporter_tx_ptpsq_unhealthy(struct mlx5e_p= tpsq *ptpsq) mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx); } =20 +#define MLX5_REPORTER_TX_GRACEFUL_PERIOD 500 + static const struct devlink_health_reporter_ops mlx5_tx_reporter_ops =3D { .name =3D "tx", .recover =3D mlx5e_tx_reporter_recover, .diagnose =3D mlx5e_tx_reporter_diagnose, .dump =3D mlx5e_tx_reporter_dump, + .default_graceful_period =3D MLX5_REPORTER_TX_GRACEFUL_PERIOD, }; =20 -#define MLX5_REPORTER_TX_GRACEFUL_PERIOD 500 - void mlx5e_reporter_tx_create(struct mlx5e_priv *priv) { + struct devlink_port *port =3D priv->netdev->devlink_port; struct devlink_health_reporter *reporter; =20 - reporter =3D devlink_port_health_reporter_create(priv->netdev->devlink_po= rt, + reporter =3D devlink_port_health_reporter_create(port, &mlx5_tx_reporter_ops, - MLX5_REPORTER_TX_GRACEFUL_PERIOD, priv); + priv); if (IS_ERR(reporter)) { netdev_warn(priv->netdev, "Failed to create tx reporter, err =3D %ld\n", diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net= /ethernet/mellanox/mlx5/core/en_rep.c index 63a7a788fb0d..b231e7855bca 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -1447,7 +1447,7 @@ static void mlx5e_rep_vnic_reporter_create(struct mlx= 5e_priv *priv, =20 reporter =3D devl_port_health_reporter_create(dl_port, &mlx5_rep_vnic_reporter_ops, - 0, rpriv); + rpriv); if (IS_ERR(reporter)) { mlx5_core_err(priv->mdev, "Failed to create representor vnic reporter, err =3D %ld\n", diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net= /ethernet/mellanox/mlx5/core/health.c index cf7a1edd0530..b63c5a221eb9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/health.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c @@ -669,54 +669,61 @@ static void mlx5_fw_fatal_reporter_err_work(struct wo= rk_struct *work) } } =20 +#define MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD 180000 +#define MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD 60000 +#define MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD 30000 +#define MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD \ + MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD + +static +const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_ecpf_ops = =3D { + .name =3D "fw_fatal", + .recover =3D mlx5_fw_fatal_reporter_recover, + .dump =3D mlx5_fw_fatal_reporter_dump, + .default_graceful_period =3D + MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD, +}; + static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_pf_= ops =3D { .name =3D "fw_fatal", .recover =3D mlx5_fw_fatal_reporter_recover, .dump =3D mlx5_fw_fatal_reporter_dump, + .default_graceful_period =3D MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD, }; =20 static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_ops= =3D { .name =3D "fw_fatal", .recover =3D mlx5_fw_fatal_reporter_recover, + .default_graceful_period =3D + MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD, }; =20 -#define MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD 180000 -#define MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD 60000 -#define MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD 30000 -#define MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD MLX5_FW_REPORTER_VF_GRACE= FUL_PERIOD - void mlx5_fw_reporters_create(struct mlx5_core_dev *dev) { const struct devlink_health_reporter_ops *fw_fatal_ops; struct mlx5_core_health *health =3D &dev->priv.health; const struct devlink_health_reporter_ops *fw_ops; struct devlink *devlink =3D priv_to_devlink(dev); - u64 grace_period; =20 - fw_fatal_ops =3D &mlx5_fw_fatal_reporter_pf_ops; fw_ops =3D &mlx5_fw_reporter_pf_ops; if (mlx5_core_is_ecpf(dev)) { - grace_period =3D MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD; + fw_fatal_ops =3D &mlx5_fw_fatal_reporter_ecpf_ops; } else if (mlx5_core_is_pf(dev)) { - grace_period =3D MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD; + fw_fatal_ops =3D &mlx5_fw_fatal_reporter_pf_ops; } else { /* VF or SF */ - grace_period =3D MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD; fw_fatal_ops =3D &mlx5_fw_fatal_reporter_ops; fw_ops =3D &mlx5_fw_reporter_ops; } =20 - health->fw_reporter =3D - devl_health_reporter_create(devlink, fw_ops, 0, dev); + health->fw_reporter =3D devl_health_reporter_create(devlink, fw_ops, dev); if (IS_ERR(health->fw_reporter)) mlx5_core_warn(dev, "Failed to create fw reporter, err =3D %ld\n", PTR_ERR(health->fw_reporter)); =20 - health->fw_fatal_reporter =3D - devl_health_reporter_create(devlink, - fw_fatal_ops, - grace_period, - dev); + health->fw_fatal_reporter =3D devl_health_reporter_create(devlink, + fw_fatal_ops, + dev); if (IS_ERR(health->fw_fatal_reporter)) mlx5_core_warn(dev, "Failed to create fw fatal reporter, err =3D %ld\n", PTR_ERR(health->fw_fatal_reporter)); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ether= net/mellanox/mlxsw/core.c index 2bb2b77351bd..980f3223f124 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core.c @@ -2043,7 +2043,7 @@ static int mlxsw_core_health_init(struct mlxsw_core *= mlxsw_core) return 0; =20 fw_fatal =3D devl_health_reporter_create(devlink, &mlxsw_core_health_fw_f= atal_ops, - 0, mlxsw_core); + mlxsw_core); if (IS_ERR(fw_fatal)) { dev_err(mlxsw_core->bus_info->dev, "Failed to create fw fatal reporter"); return PTR_ERR(fw_fatal); diff --git a/drivers/net/ethernet/qlogic/qed/qed_devlink.c b/drivers/net/et= hernet/qlogic/qed/qed_devlink.c index 1adc7fbb3f2f..94c5689b5abd 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_devlink.c +++ b/drivers/net/ethernet/qlogic/qed/qed_devlink.c @@ -87,20 +87,21 @@ qed_fw_fatal_reporter_recover(struct devlink_health_rep= orter *reporter, return 0; } =20 +#define QED_REPORTER_FW_GRACEFUL_PERIOD 0 + static const struct devlink_health_reporter_ops qed_fw_fatal_reporter_ops = =3D { .name =3D "fw_fatal", .recover =3D qed_fw_fatal_reporter_recover, .dump =3D qed_fw_fatal_reporter_dump, + .default_graceful_period =3D QED_REPORTER_FW_GRACEFUL_PERIOD, }; =20 -#define QED_REPORTER_FW_GRACEFUL_PERIOD 0 - void qed_fw_reporters_create(struct devlink *devlink) { struct qed_devlink *dl =3D devlink_priv(devlink); =20 - dl->fw_reporter =3D devlink_health_reporter_create(devlink, &qed_fw_fatal= _reporter_ops, - QED_REPORTER_FW_GRACEFUL_PERIOD, dl); + dl->fw_reporter =3D devlink_health_reporter_create(devlink, + &qed_fw_fatal_reporter_ops, dl); if (IS_ERR(dl->fw_reporter)) { DP_NOTICE(dl->cdev, "Failed to create fw reporter, err =3D %ld\n", PTR_ERR(dl->fw_reporter)); diff --git a/drivers/net/netdevsim/health.c b/drivers/net/netdevsim/health.c index 688f05316b5e..3bd0e7a489c3 100644 --- a/drivers/net/netdevsim/health.c +++ b/drivers/net/netdevsim/health.c @@ -183,14 +183,14 @@ int nsim_dev_health_init(struct nsim_dev *nsim_dev, s= truct devlink *devlink) health->empty_reporter =3D devl_health_reporter_create(devlink, &nsim_dev_empty_reporter_ops, - 0, health); + health); if (IS_ERR(health->empty_reporter)) return PTR_ERR(health->empty_reporter); =20 health->dummy_reporter =3D devl_health_reporter_create(devlink, &nsim_dev_dummy_reporter_ops, - 0, health); + health); if (IS_ERR(health->dummy_reporter)) { err =3D PTR_ERR(health->dummy_reporter); goto err_empty_reporter_destroy; diff --git a/include/net/devlink.h b/include/net/devlink.h index 3119d053bc4d..c7ad7a981b39 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -746,6 +746,8 @@ enum devlink_health_reporter_state { * if priv_ctx is NULL, run a full dump * @diagnose: callback to diagnose the current status * @test: callback to trigger a test event + * @default_graceful_period: default min time (in msec) + * between recovery attempts */ =20 struct devlink_health_reporter_ops { @@ -760,6 +762,7 @@ struct devlink_health_reporter_ops { struct netlink_ext_ack *extack); int (*test)(struct devlink_health_reporter *reporter, struct netlink_ext_ack *extack); + u64 default_graceful_period; }; =20 /** @@ -1928,22 +1931,22 @@ void devlink_fmsg_binary_pair_put(struct devlink_fm= sg *fmsg, const char *name, struct devlink_health_reporter * devl_port_health_reporter_create(struct devlink_port *port, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv); + void *priv); =20 struct devlink_health_reporter * devlink_port_health_reporter_create(struct devlink_port *port, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv); + void *priv); =20 struct devlink_health_reporter * devl_health_reporter_create(struct devlink *devlink, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv); + void *priv); =20 struct devlink_health_reporter * devlink_health_reporter_create(struct devlink *devlink, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv); + void *priv); =20 void devl_health_reporter_destroy(struct devlink_health_reporter *reporter); diff --git a/net/devlink/health.c b/net/devlink/health.c index b3ce8ecbb7fb..ba144b7426fa 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -108,11 +108,11 @@ devlink_port_health_reporter_find_by_name(struct devl= ink_port *devlink_port, static struct devlink_health_reporter * __devlink_health_reporter_create(struct devlink *devlink, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv) + void *priv) { struct devlink_health_reporter *reporter; =20 - if (WARN_ON(graceful_period && !ops->recover)) + if (WARN_ON(ops->default_graceful_period && !ops->recover)) return ERR_PTR(-EINVAL); =20 reporter =3D kzalloc(sizeof(*reporter), GFP_KERNEL); @@ -122,7 +122,7 @@ __devlink_health_reporter_create(struct devlink *devlin= k, reporter->priv =3D priv; reporter->ops =3D ops; reporter->devlink =3D devlink; - reporter->graceful_period =3D graceful_period; + reporter->graceful_period =3D ops->default_graceful_period; reporter->auto_recover =3D !!ops->recover; reporter->auto_dump =3D !!ops->dump; return reporter; @@ -134,13 +134,12 @@ __devlink_health_reporter_create(struct devlink *devl= ink, * * @port: devlink_port to which health reports will relate * @ops: devlink health reporter ops - * @graceful_period: min time (in msec) between recovery attempts * @priv: driver priv pointer */ struct devlink_health_reporter * devl_port_health_reporter_create(struct devlink_port *port, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv) + void *priv) { struct devlink_health_reporter *reporter; =20 @@ -150,8 +149,7 @@ devl_port_health_reporter_create(struct devlink_port *p= ort, ops->name)) return ERR_PTR(-EEXIST); =20 - reporter =3D __devlink_health_reporter_create(port->devlink, ops, - graceful_period, priv); + reporter =3D __devlink_health_reporter_create(port->devlink, ops, priv); if (IS_ERR(reporter)) return reporter; =20 @@ -164,14 +162,13 @@ EXPORT_SYMBOL_GPL(devl_port_health_reporter_create); struct devlink_health_reporter * devlink_port_health_reporter_create(struct devlink_port *port, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv) + void *priv) { struct devlink_health_reporter *reporter; struct devlink *devlink =3D port->devlink; =20 devl_lock(devlink); - reporter =3D devl_port_health_reporter_create(port, ops, - graceful_period, priv); + reporter =3D devl_port_health_reporter_create(port, ops, priv); devl_unlock(devlink); return reporter; } @@ -182,13 +179,12 @@ EXPORT_SYMBOL_GPL(devlink_port_health_reporter_create= ); * * @devlink: devlink instance which the health reports will relate * @ops: devlink health reporter ops - * @graceful_period: min time (in msec) between recovery attempts * @priv: driver priv pointer */ struct devlink_health_reporter * devl_health_reporter_create(struct devlink *devlink, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv) + void *priv) { struct devlink_health_reporter *reporter; =20 @@ -197,8 +193,7 @@ devl_health_reporter_create(struct devlink *devlink, if (devlink_health_reporter_find_by_name(devlink, ops->name)) return ERR_PTR(-EEXIST); =20 - reporter =3D __devlink_health_reporter_create(devlink, ops, - graceful_period, priv); + reporter =3D __devlink_health_reporter_create(devlink, ops, priv); if (IS_ERR(reporter)) return reporter; =20 @@ -210,13 +205,12 @@ EXPORT_SYMBOL_GPL(devl_health_reporter_create); struct devlink_health_reporter * devlink_health_reporter_create(struct devlink *devlink, const struct devlink_health_reporter_ops *ops, - u64 graceful_period, void *priv) + void *priv) { struct devlink_health_reporter *reporter; =20 devl_lock(devlink); - reporter =3D devl_health_reporter_create(devlink, ops, - graceful_period, priv); + reporter =3D devl_health_reporter_create(devlink, ops, priv); devl_unlock(devlink); return reporter; } --=20 2.34.1 From nobody Fri Oct 3 21:55:27 2025 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2083.outbound.protection.outlook.com [40.107.236.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A7ED25B66A; Sun, 24 Aug 2025 08:44:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025081; cv=fail; b=lg9ImWZOe/5oW3tKN4VYYZo5gjR3ilSssXVyEooZ9ARtbZMu2lTVWegw3Ms6dWBKyMaGexzEXWHJ+ZgEmWNUy7trMxHNpo6PaBn5LSRIwvx3EifSxw3Y779CZ9ZzR3VpKjQurABmLJ80h3WdyFDYWUliFxQy8qeSBggEYEyJRuw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025081; c=relaxed/simple; bh=QJogPt28XNiac0cz5XotOkTUu/r5POzee98tmFzdDTg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l9zi2hTTIQIkJH9um1uHhGYKAK7rfnpIudZHT3jEIxIJX/ksr0ldGqJ7x5t1LTNNVYF0O78sKdnyffF5eglOWzQV/S1RjommTEzPxWILcxFGd0tPnrWt45aYDYRTjDHLl7RD2xk1yjT5QXYcnk4a76P7dAyCTJu720j57Yv9Vc4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=Atqzo1Xg; arc=fail smtp.client-ip=40.107.236.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="Atqzo1Xg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=amg4eoboRsZ6o4BVGmbf0RCyXd79uyOQ0HLUXWTbI/PPYmMzdBcvhaKHa3U0sZGm41yOcW9f0aWZP/8tgipjAEMxpN4RWhq8HwMQeAJ2UnBD28VcSnM3t4lNdXoFVEgTqrs8ezFvWa+NQ7ZcAfa+8lH8cL0NSZTaG/zghG8UDPGIASBHhNUzIUEz/sUXqhJDTepcBSNPU3An7nFMHdx/G0Zl3Pe/xsEd+0xmRUeEB6usWf5MGTfKvC81yF2d6Z9/fof0KDKegwramWTVvvtv9bNz9tO1r04JSSQ6xqUqTHetXxhvIUh0rwWFZJHotokT8K1zxL5QNO7Le0eR7/T9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ghvVq6+64GyhIqo3kmoASpSz2wHNXDVQIBUNfgiYBNM=; b=rqisa+Jn5mpHfoMtet9IU4JyCusi3IokM2HzltcVUjQBJArVniZz+P9xCdBDDZLIt+nf0ls7kyb1Xqj2qw6Lg0B+7Nosrqp/D06ExZ/1BOBFLHMCJaKw49Ov4Bv334Z2j1QBjBuf5zlvPhvQlLjg2slRHQOOlOt1W0K4UXjdxYbOkTtXwrxTZ31t7a8g1O1ael5ThKqJRsjs3p6MqDv8VxxCzNbD575tmqPWbx9k5cYJYUkiCIdbvMk0jOYsGVFxq238gm7QP5rnsNJno7j4tf/C/87G4TYnkH/XrlX0aM0xbXgV8ust++lxEZ3sNLkSQwc+/0gAx2EEwaZgmWoYBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ghvVq6+64GyhIqo3kmoASpSz2wHNXDVQIBUNfgiYBNM=; b=Atqzo1XgBlwaCEjDSPyKK3uPd4zlRmemILAeHBCfqilqRxAXdrH3RUAfhDXqWe3HLx+jQDtjLVRiDUp95FTG3HC8N30+dHZdruSLSIy2f79GSG+HIRbsuaXopKOMToIFruYzOfh5dxydNpu0dCh3RpAZ/rXRtSj8NBPukzYbERHIbSo/VsA2qU6HrR5IfXm4lF7OED8wfcJ/MFIGu8oyZxFAYLz274QPqjlfOpqlgU+e3XwiTcp0W8BqAxcjMocjOJOfzRlKdx3lMKf0SVFILXq/B8/TRs+eiQFAOHkYEReLME5RgTGZCVMz4CTfbufygClOKPV3peghdCPNFpfoyw== Received: from DS7PR03CA0332.namprd03.prod.outlook.com (2603:10b6:8:55::19) by SA0PR12MB4448.namprd12.prod.outlook.com (2603:10b6:806:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.20; Sun, 24 Aug 2025 08:44:34 +0000 Received: from CY4PEPF0000EE38.namprd03.prod.outlook.com (2603:10b6:8:55:cafe::20) by DS7PR03CA0332.outlook.office365.com (2603:10b6:8:55::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.21 via Frontend Transport; Sun, 24 Aug 2025 08:44:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE38.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Sun, 24 Aug 2025 08:44:34 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:15 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:15 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Sun, 24 Aug 2025 01:44:11 -0700 From: Mark Bloch To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" CC: Tariq Toukan , Leon Romanovsky , "Saeed Mahameed" , , , Gal Pressman , Shahar Shitrit , Jiri Pirko , Dragos Tatulea , Carolina Jubran , Mark Bloch , Jiri Pirko Subject: [PATCH net-next V4 2/5] devlink: Move health reporter recovery abort logic to a separate function Date: Sun, 24 Aug 2025 11:43:51 +0300 Message-ID: <20250824084354.533182-3-mbloch@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250824084354.533182-1-mbloch@nvidia.com> References: <20250824084354.533182-1-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE38:EE_|SA0PR12MB4448:EE_ X-MS-Office365-Filtering-Correlation-Id: 02cef42b-074c-4c66-3a5c-08dde2ea736f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8km3aoNGWSk9H/zPCLM9Z+PdaObC1xG6dRN/NEHB4Z8AnGH8XeYNgWQCw3Ty?= =?us-ascii?Q?4ESuEyrSq/5k1LaEOccmhVo9v/e7nvML2L6c2+NQ+vgdmkNwfO9yjW8KKn36?= =?us-ascii?Q?YdQjKc0QxEMb8GJEWoMGuQHKS0iUMqIm/Fi0V5EklFICHvrOVFvK9jnRxuhc?= =?us-ascii?Q?rFSBJjgWhCxW4TfqUH+I3V1ZkyJLfXWZcPkD0QDLVZrzXP5527C4e26if22o?= =?us-ascii?Q?OOw/I9siyK1EPgpKZ4BYIrLSR7DcA5vhmtGRKv/njb+HqrdY1Zub0XZF/4eR?= =?us-ascii?Q?4bAMG7PFHboXzsaHanfS8vTiaNusCsFHImTjVjIfbYInwa6fr3kXuIMtT0mZ?= =?us-ascii?Q?kF1FGTllInIb1GZAb4Z2qNAL/StwP3+7vcY9d3/o89tcNyF+w9iPwRexfTKU?= =?us-ascii?Q?acNLP+vpYGZAdXmmrPuVk6Vx3mrsrkdeoVv3gJ7HI3WTpCz1TaCWd5/sV3kb?= =?us-ascii?Q?tAsUgEy3IifqTpnqz1vvXuqafCTyg6y9fWiceMRB9mpEf8xnyTjjlgRZHUT+?= =?us-ascii?Q?TKsKjHXTg0BsonDxsSdB3JlXz8Av0hsVETE7xF9ujgJ2UUhw6kBP19HenR27?= =?us-ascii?Q?AF0fYCUazwh4Bj5GHPP7RtkhlzYmFQastHOeL/FGKldRy6QC98ms03TAIbJE?= =?us-ascii?Q?CAae3wximF+prEvaujuvhqiMWvGuUmHFQB+RrN6cld+YflROHFNHYGJbyyKr?= =?us-ascii?Q?VrYqCeojXNS159zrN5UNaYIUu1Xvtkhv3rX2DEdvzTntbmGpwHcmWknvjY4Y?= =?us-ascii?Q?TjapHkuw3Van2eHRJOQbcY6nzgVBvx8LSUysHADHDNf0CjTPgEeyjpE0xWUz?= =?us-ascii?Q?n7esSO8GCv44A7vXbp0x0DytQinz/bBstdpoI3NPR2SDWegkj37hnEZOxMk2?= =?us-ascii?Q?tM1CljrWeK00tXbaJGUmkzeXJ4nVKdGJv+dUuWhPaWZXUTRQP6J9nLrlH0pb?= =?us-ascii?Q?Rwl1Xft9C85RYojHYFuJ4E6S3afY9moRaLXkQPhBkBDzFmqdbdvTMzJI+AtA?= =?us-ascii?Q?SIy8veCfsVgrRWdYpTZMxHyg3DseG0DS7/zkCLAKkjUCaVmLSiJb6khrlqzx?= =?us-ascii?Q?XOneIu+ArxV+6NbMQu5ztJTq+zKyp8W3gQxuiJYYjK7PVx/3RDuaLKQBDUqq?= =?us-ascii?Q?Qd5vex2y2Dz+Z6yFHy14YdcNS64bN2UbA3ltvpB/A5xIxQsSjjYJVrkhpzfE?= =?us-ascii?Q?P2NaP/68cFsvYl/dJY3RgSD7oVtDMQS8MNBHY+pgA4amo3hq7VkzrwRxfmu2?= =?us-ascii?Q?wuyuInoLVAqLgo8LCCDlp2a2INg9y/8HRKf/HoBo3bsj9Ou1nTcqO3gL85cB?= =?us-ascii?Q?9l+LJ078ChLEh9QoMIqgR/n5CSOT7/VwD38FUv6EfFPUIxq4dH3NsDGYcaZh?= =?us-ascii?Q?01IVRuNItgRkeT0hGuCLr57/psYIOPKLEnJE+ZeXtx3k/Fvxg3Lg5EgEPfHk?= =?us-ascii?Q?1htC5ZWQXTnIZ9kmRYaWmwikssZoEGij2VXr9RC7fq/C9RCIoAx6fhmDwbdT?= =?us-ascii?Q?3P3OWWcszZCViCaQAj3k59q7t/s7jQm2C3Ly?= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2025 08:44:34.2272 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02cef42b-074c-4c66-3a5c-08dde2ea736f X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE38.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4448 Content-Type: text/plain; charset="utf-8" From: Shahar Shitrit Extract the health reporter recovery abort logic into a separate function devlink_health_recover_abort(). The function encapsulates the conditions for aborting recovery: - When auto-recovery is disabled - When previous error wasn't recovered - When within the grace period after last recovery Signed-off-by: Shahar Shitrit Reviewed-by: Jiri Pirko Reviewed-by: Dragos Tatulea Reviewed-by: Carolina Jubran Signed-off-by: Mark Bloch --- net/devlink/health.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/net/devlink/health.c b/net/devlink/health.c index ba144b7426fa..9d0d4a9face7 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -586,12 +586,33 @@ static int devlink_health_do_dump(struct devlink_heal= th_reporter *reporter, return err; } =20 +static bool +devlink_health_recover_abort(struct devlink_health_reporter *reporter, + enum devlink_health_reporter_state prev_state) +{ + unsigned long recover_ts_threshold; + + if (!reporter->auto_recover) + return false; + + /* abort if the previous error wasn't recovered */ + if (prev_state !=3D DEVLINK_HEALTH_REPORTER_STATE_HEALTHY) + return true; + + recover_ts_threshold =3D reporter->last_recovery_ts + + msecs_to_jiffies(reporter->graceful_period); + if (reporter->last_recovery_ts && reporter->recovery_count && + time_is_after_jiffies(recover_ts_threshold)) + return true; + + return false; +} + int devlink_health_report(struct devlink_health_reporter *reporter, const char *msg, void *priv_ctx) { enum devlink_health_reporter_state prev_health_state; struct devlink *devlink =3D reporter->devlink; - unsigned long recover_ts_threshold; int ret; =20 /* write a log message of the current error */ @@ -602,13 +623,7 @@ int devlink_health_report(struct devlink_health_report= er *reporter, reporter->health_state =3D DEVLINK_HEALTH_REPORTER_STATE_ERROR; devlink_recover_notify(reporter, DEVLINK_CMD_HEALTH_REPORTER_RECOVER); =20 - /* abort if the previous error wasn't recovered */ - recover_ts_threshold =3D reporter->last_recovery_ts + - msecs_to_jiffies(reporter->graceful_period); - if (reporter->auto_recover && - (prev_health_state !=3D DEVLINK_HEALTH_REPORTER_STATE_HEALTHY || - (reporter->last_recovery_ts && reporter->recovery_count && - time_is_after_jiffies(recover_ts_threshold)))) { + if (devlink_health_recover_abort(reporter, prev_health_state)) { trace_devlink_health_recover_aborted(devlink, reporter->ops->name, reporter->health_state, --=20 2.34.1 From nobody Fri Oct 3 21:55:27 2025 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2070.outbound.protection.outlook.com [40.107.244.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C16B02641FC; Sun, 24 Aug 2025 08:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025089; cv=fail; b=KaEdLkm8PRbtAf3YvfHvivnIelXPOKES4qY5/u8EnOLXulHI4dvBPqD9igX1VuOuayFsU8//Ip4uPpWhKMbQ/m1N7X/GW+hHxk4tcdwyjgA33clEKSGZzzG2fVImaUuzFNc/rOP0YUs41gQyUIuH7TlAsOu0FaZOnjf6r1TQDc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025089; c=relaxed/simple; bh=wVlTTx0zcB3+Pt1SF4QYDNB/RXopu1ew6HD95avLsEs=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PvzEytjwqSczUGlqURM0Qiacjn34p4E5JMW2fwLi3aNE4vQ/mrcdnhfwmxKSK/xASKYOBdDtu8tLCvZIHAFgB8hyxJdtZ0j2F/FpPq75q5UqCtmkWH5276JSsuzS2JcM2dI2/VxvzcGR17hq9uhxiUDjq3FZYFJ1+Et8Mxv2XKo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=jfV2PHl3; arc=fail smtp.client-ip=40.107.244.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jfV2PHl3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aKoyBf6McSxvYlquUMMLS7aCbOOc8yBrUpnzqkfhJnqdG4Llmirtbkxm7CU35aTWxZ/uIX4ciMmTapBZvzJqiYr5dEXmJRAh3pvBr6bJKmzLdMx7V71tk0osBSgt4I6D6CHQ+0z85PQWhDBuK6NrmYXOpyeaCi7nR2iSbngshhv4SocYe3XebPKeCSEESSoQj5NqX8NGVkXcE4GizTI8uAiP4qE0GOHNyo7eVRpdFfcwv2EsmHFdDV4J4pzmNRVeihj/NfvmHBSDJwc8V48qdOHCp7C8ZotP12rLPvJPWA5dlPzJ4KAjh7MV9EWun1Vz1cqa7VVIH4VxNlAS155yfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9GAwcZX6l2oFKra56W+9ZWC8gNRB0OjkIGR2Ov8XSbI=; b=CKzq/KiXKWPNhEF6++F6R1O88t6S26926Wi7v3pp9xShFjcGuj+cXWK3LABmOtINFkHgYvwehixsLTDDClpHRxFSCt0EVmOK2dPE8KvOgYJIUzsI/uN4cC/nPWW0xg4DoycVAkVs/DzjzRomKsDwvmxClfPPiyU/SvsbOw7+/FtesXj58e9j2XRvI7mWT3fNo6dsTWfw/e3K/EqRdcmRxjjSAghjBZWEfVIR3CLIfByURiL8HLLF2ZpNPBOsvYUrMUDD8aDyYRyFpasiIO+Ee3sY2Beh7pI8muFM7TNSOFJ8nbSDfuxe2pECxQXQJdkZMfWJJF1K+HRX/DMEGJrabA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9GAwcZX6l2oFKra56W+9ZWC8gNRB0OjkIGR2Ov8XSbI=; b=jfV2PHl3tN0DPmDfJOH3OBIYGHZ0NVCRty3Rug6Tj1CKjBf3F8xYOCiy6JXAjPUc6n1Ot5Xx1mNW3YR39HYIjNgQXyK7WkDku/Z47SDe9YlInIcUrp184xmx4vqujsASyNsDFX/gewxJQOeWO/9ikdMnKwz1gB9DLJ9IuXYvWZ2bj5PiL2wUmtDyjsoV/vqP+7U07WDiJIXAHEc53ShBiMpp8HiYqL5jJkXOlLAK19niDh/ShQ7acNgrNEhit7ggjGklp5XHwPeIsiDgydyZq83rpJB4h3rPbeZvqcoXFmRrPj/qErAy9IRw5hTTYxmXryY2Yj4eFE5/vg0CIKLE6w== Received: from BLAPR05CA0019.namprd05.prod.outlook.com (2603:10b6:208:36e::24) by IA0PR12MB8747.namprd12.prod.outlook.com (2603:10b6:208:48b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9009.16; Sun, 24 Aug 2025 08:44:37 +0000 Received: from BL6PEPF00020E63.namprd04.prod.outlook.com (2603:10b6:208:36e:cafe::8a) by BLAPR05CA0019.outlook.office365.com (2603:10b6:208:36e::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.12 via Frontend Transport; Sun, 24 Aug 2025 08:44:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E63.mail.protection.outlook.com (10.167.249.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Sun, 24 Aug 2025 08:44:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:20 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:20 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Sun, 24 Aug 2025 01:44:16 -0700 From: Mark Bloch To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" CC: Tariq Toukan , Leon Romanovsky , "Saeed Mahameed" , , , Gal Pressman , Shahar Shitrit , Jiri Pirko , Mark Bloch , Jiri Pirko Subject: [PATCH net-next V4 3/5] devlink: Introduce burst period for health reporter Date: Sun, 24 Aug 2025 11:43:52 +0300 Message-ID: <20250824084354.533182-4-mbloch@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250824084354.533182-1-mbloch@nvidia.com> References: <20250824084354.533182-1-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E63:EE_|IA0PR12MB8747:EE_ X-MS-Office365-Filtering-Correlation-Id: 486bfefc-989b-425e-79a0-08dde2ea754c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rgHnnW9F2zuaK240Hyd50G2COqqY/IREfwhfk9nboSJZvCp9O3PA2kH/iKRA?= =?us-ascii?Q?cMlve4W7hsAsijClmL3RVCaLUcJDv7tskb73jK8jPN7B6hVTU6cEupDXgxYG?= =?us-ascii?Q?EWOjxZekv2Pa2LQRRZiWFbhlPCM4MDXrPWnhJClfcelAqOq/zzovc0UhEltF?= =?us-ascii?Q?QxAbq8DrRTiXv21t2pfE1+3AFhx8duQUwKqJxMOypBgRTgtIJDu1u+0mTiN0?= =?us-ascii?Q?mOJPtT1TDU3lxQMioLYnXtzJymKlVuk8okX21DXJu1GSWO7x+6gkqTrOSelb?= =?us-ascii?Q?ngUVbiKBfDlS/IIk0UnCUgreiC7kbQfXs12EPgqMgVe2itxmaiyzI+KHHPaF?= =?us-ascii?Q?RNA1288CVVUkOPJ+9Yq8d3A50vnjH2ItYJSJPDAlQWYxa70s6AOFheuQnvWn?= =?us-ascii?Q?ssUTYgfXkv1pahYv85O4AnwzdEDZwQYKSX5pvl/cCcEi34ga9nK6ewbjHwvd?= =?us-ascii?Q?hF3YCMWOD+bxZp8aGosMn4wH0dQ8cjKjExGrtt/S8feUIbK0xD/74kovj/Ik?= =?us-ascii?Q?VOfTOYYbYO1ndyaY+gY+R0SARM2JjdGSAbtd9Ne2rEIFXPc/YJUVRIxKqmkP?= =?us-ascii?Q?3IiYfpyDzPEpndmpuIDJneEe9gVXBSmv/4fhUaZZx1EJXk0uLo6pR9PRTXBt?= =?us-ascii?Q?+fOQoPrNFPQogc1aey5BY8QVyIqRVccly3fuOQ5y+aAhW0A+Ros/6PTpitAS?= =?us-ascii?Q?pGtzgFaZW8RLNACFB0ny5cg8F/hz38ITRP+6+kBKFf1zIpGNefoN+6dUUxqJ?= =?us-ascii?Q?BZZlZnLz6usEmkuj/KHyK3aDN5n/RrsTR2nQ2zdMB5DqCBsyVZq1+XRFoMwL?= =?us-ascii?Q?K+cuRbpG3bBpxMQFRx4G4tCH5Vx7bt534cpIEk2OfDJVVNqPln/jitpXhnI/?= =?us-ascii?Q?osn96qxCQgW3c94EJdbiKprd6gjq53mg60NiL9bsNB4Dszv83LLhgHpFfCB/?= =?us-ascii?Q?rJTzR8+CamYT2UuzYs5i/Jxaiy6jTdY3nLZSUogJbe9iZmGiqmXni3EGtl4U?= =?us-ascii?Q?G6Mv3bhaCBx3VHm7LauYcF5N544ok66sTtlsFZB6lUYj/ScqvEYRSrKBXJR4?= =?us-ascii?Q?cuclJS0iyLdtutF6i9mkSG+lIjSGX/FGNFmkPWxdJCqikTsVoRO26FX6z1mg?= =?us-ascii?Q?CzxD8wd+msK5ceHaClGll8QNnWWOL6SAuQGrVExJnkyFX2oJbG+U7H0FNLXO?= =?us-ascii?Q?q411RbV88xUI/YBjJXsawaA0sVyZ5xVsnnmkWqJx3OJK1hIC5YmL+bNowVAO?= =?us-ascii?Q?Kg582tkvOBNqD4YlTuYt/xqSQWlu+Iv8gUKXT64TMsyOkdsvvMhXEX/tHBsr?= =?us-ascii?Q?OjewbCkZQZOAddmj1HTgD77Gio7Lax0x5vcDTTlWaQqDtW0eUfM2Ksm0YxMt?= =?us-ascii?Q?Ii74qOlJpXxH5ACY54HYHWggxNFiTArdLeOYd1G4KwkZnYSvm+yvuR3iyGOp?= =?us-ascii?Q?fl19F8kHQ2aGd/9gyu6EpJViQ0+GvH73IEOQkenbn/9qiGVDqEJBWktdE3xV?= =?us-ascii?Q?ns+oy2aADUWj40NIiuo8EbFMJJzY1XSrnJ9z?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2025 08:44:37.2695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 486bfefc-989b-425e-79a0-08dde2ea754c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E63.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8747 Content-Type: text/plain; charset="utf-8" From: Shahar Shitrit Currently, the devlink health reporter starts the grace period immediately after handling an error, blocking any further recoveries until it finished. However, when a single root cause triggers multiple errors in a short time frame, it is desirable to treat them as a bulk of errors and to allow their recoveries, avoiding premature blocking of subsequent related errors, and reducing the risk of inconsistent or incomplete error handling. To address this, introduce a configurable burst period for devlink health reporter. Start this period when the first error is handled, and allow recovery attempts for reported errors during this window. Once burst period expires, begin the grace period to block further recoveries until it concludes. Timeline summary: ----|--------|------------------------------/----------------------/-- error is error is burst period grace period reported recovered (recoveries allowed) (recoveries blocked) For calculating the burst period duration, use the same last_recovery_ts as the grace period. Update it on recovery only when the burst period is inactive (either disabled or at the first error). This patch implements the framework for the burst period and effectively sets its value to 0 at reporter creation, so the current behavior remains unchanged, which ensures backward compatibility. A downstream patch will make the burst period configurable. Signed-off-by: Shahar Shitrit Reviewed-by: Jiri Pirko Signed-off-by: Mark Bloch --- include/net/devlink.h | 3 +++ net/devlink/health.c | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/include/net/devlink.h b/include/net/devlink.h index c7ad7a981b39..5f44e702c25c 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -748,6 +748,8 @@ enum devlink_health_reporter_state { * @test: callback to trigger a test event * @default_graceful_period: default min time (in msec) * between recovery attempts + * @default_burst_period: default time (in msec) for + * error recoveries before starting the grace period */ =20 struct devlink_health_reporter_ops { @@ -763,6 +765,7 @@ struct devlink_health_reporter_ops { int (*test)(struct devlink_health_reporter *reporter, struct netlink_ext_ack *extack); u64 default_graceful_period; + u64 default_burst_period; }; =20 /** diff --git a/net/devlink/health.c b/net/devlink/health.c index 9d0d4a9face7..94ab77f77add 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -60,6 +60,7 @@ struct devlink_health_reporter { struct devlink_port *devlink_port; struct devlink_fmsg *dump_fmsg; u64 graceful_period; + u64 burst_period; bool auto_recover; bool auto_dump; u8 health_state; @@ -123,6 +124,7 @@ __devlink_health_reporter_create(struct devlink *devlin= k, reporter->ops =3D ops; reporter->devlink =3D devlink; reporter->graceful_period =3D ops->default_graceful_period; + reporter->burst_period =3D ops->default_burst_period; reporter->auto_recover =3D !!ops->recover; reporter->auto_dump =3D !!ops->dump; return reporter; @@ -508,11 +510,25 @@ static void devlink_recover_notify(struct devlink_hea= lth_reporter *reporter, devlink_nl_notify_send_desc(devlink, msg, &desc); } =20 +static bool +devlink_health_reporter_in_burst(struct devlink_health_reporter *reporter) +{ + unsigned long burst_threshold =3D reporter->last_recovery_ts + + msecs_to_jiffies(reporter->burst_period); + + return time_is_after_jiffies(burst_threshold); +} + void devlink_health_reporter_recovery_done(struct devlink_health_reporter *repo= rter) { reporter->recovery_count++; - reporter->last_recovery_ts =3D jiffies; + if (!devlink_health_reporter_in_burst(reporter)) + /* When burst period is set, last_recovery_ts marks the first + * recovery within the burst period, not necessarily the last + * one. + */ + reporter->last_recovery_ts =3D jiffies; } EXPORT_SYMBOL_GPL(devlink_health_reporter_recovery_done); =20 @@ -599,7 +615,11 @@ devlink_health_recover_abort(struct devlink_health_rep= orter *reporter, if (prev_state !=3D DEVLINK_HEALTH_REPORTER_STATE_HEALTHY) return true; =20 + if (devlink_health_reporter_in_burst(reporter)) + return false; + recover_ts_threshold =3D reporter->last_recovery_ts + + msecs_to_jiffies(reporter->burst_period) + msecs_to_jiffies(reporter->graceful_period); if (reporter->last_recovery_ts && reporter->recovery_count && time_is_after_jiffies(recover_ts_threshold)) --=20 2.34.1 From nobody Fri Oct 3 21:55:27 2025 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2072.outbound.protection.outlook.com [40.107.94.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF727264628; Sun, 24 Aug 2025 08:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025090; cv=fail; b=OkV5FHfxrYp3F+CUn6ZKi07oBztuh9NYq+JxrzLfYb+cfDswcoVLhWbQoS91BV7mfqJVTnbEyQkuYWQpoMlhSiM8TROLL8Q6y+qLKjSmYpQT2N1TxyPXGd/RFnXIXqy7I6SgkcIhC4C+p1ebp+wM2y9hynUU/rUn165b0kn8Bn0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025090; c=relaxed/simple; bh=pcHCxmr3Pnrs+Xm2lk27wl7sR69q7o5v2zMT742AdUE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UtQOsjZtF33miA4k+oM+Xo5D/+aRP8TxnIyQ1RiGW+OkO3052MxAa6EFsy0w1ifIpGLwmP4+iiBeLyWqRlYNFFz4TRQbF1O9nvLU10WUFkeClQVt1Nmg0z+9ccXMKulnmhEqKx9pcBOmU2WJNjiHBC8M245/sqTE17liqaUCyVk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=aELXWLP3; arc=fail smtp.client-ip=40.107.94.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="aELXWLP3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lv5uAFtRxAD1pAB0XO0vkNZDvjZ4pIE3y4boD30+lEYRzdXnIs4Xj8aC5PvPbR+a2I5r/VSfcdOWLL3LSFH8UdgUsZUS272w9yQgKoFNlWORLUnKJKpWIDZ+AYHA+lksHL7fLTiEA3gTSahSIb0+WlNq7ZdTF+GA8raAPiKzgbMIdIxYaQktbuAe6qu4z8ajvQwUPoc6iQcnvg5SwY6LUtmq44Pu/C1ahm32wpfqZ72NxXOaruPC8gb0SZJYdypCHu1d4yUV7HhJ7VRNpShaTRAq4CMnFzKkHOgCYOqQ4lto6853CCrXMrVrDRSigeLw5U+/MkvQspXiVxG52Cn74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ojhk3Ht1Oix4jfbENgatscQlP/4oEIY8hqGfGWO33l4=; b=FJ5sSeRW2T5hYHKJyEO8iH1FPY9qNhk7YC+/d/TwLMIwZ7XxeD2J2TeetG6AgtlJMIKJ7qy7R6yIFMQfa9ePMKTSpDiDiGsNJmn/7Vh3sjZuzRCSufJmtooyB/ZzaKG1kYOrxD32ai4/DM3L3WyTVysAs4gFMZXslaJrBvstbYHd6ZFbvQR9YsZEX6ONboH4KmuZgyzSWh8Ww5im6fiLGcmZZL409SLuXcoNhD3dFFfjhGpAJ0yyclpPEkzvFTU6c4tvFjdtFxwN4P43V0OoYDR1dXbKJON6CPSyANaxZDciYufMVqTpIedbd+/vO4sF7wdMO6n3+5zQkn32zBEInA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ojhk3Ht1Oix4jfbENgatscQlP/4oEIY8hqGfGWO33l4=; b=aELXWLP3iB8nJ/3hMEeNCdR5gBknvenrTf/zNDX40R/d2nqmQc5QlPvcJfnQm0d+TYjiTUof/ZmGPeSJKIkgJXZWBRyfF35f2ppSk6KZsOO9Vaz9rulYvcbYzke/0AHV8U9GE8e59pjmzUqJwzBOhvaOGTki0BS8YU2sqj94PaOjr8zllvRmP3j6DCucR3f5dNnKak68Wh2yREixCpmDWgWA/yPQrkDyik2sVE8QxCRJW6NPDVR/LulSXLfipjQdDbz/h3S/5FXo16OSYaZwn09Hk3iI5OWP+O57BjD939UtzCZ8W8jB2AXZFxJp+f32yICk/NqpjMdyqnda0wG+gQ== Received: from CY8PR10CA0048.namprd10.prod.outlook.com (2603:10b6:930:4b::14) by CY8PR12MB9036.namprd12.prod.outlook.com (2603:10b6:930:78::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.20; Sun, 24 Aug 2025 08:44:41 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:930:4b:cafe::8d) by CY8PR10CA0048.outlook.office365.com (2603:10b6:930:4b::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9052.21 via Frontend Transport; Sun, 24 Aug 2025 08:44:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CY4PEPF0000EE3E.mail.protection.outlook.com (10.167.242.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Sun, 24 Aug 2025 08:44:41 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:27 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:26 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Sun, 24 Aug 2025 01:44:22 -0700 From: Mark Bloch To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" CC: Tariq Toukan , Leon Romanovsky , "Saeed Mahameed" , , , Gal Pressman , Shahar Shitrit , Jiri Pirko , Dragos Tatulea , Carolina Jubran , Mark Bloch , Donald Hunter , Jiri Pirko , Jonathan Corbet Subject: [PATCH net-next V4 4/5] devlink: Make health reporter burst period configurable Date: Sun, 24 Aug 2025 11:43:53 +0300 Message-ID: <20250824084354.533182-5-mbloch@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250824084354.533182-1-mbloch@nvidia.com> References: <20250824084354.533182-1-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|CY8PR12MB9036:EE_ X-MS-Office365-Filtering-Correlation-Id: df0a62fa-ed6e-43a4-fc79-08dde2ea77a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?dG1BVVNLR1BJbmd5VkgvQ1pqMmQrOVdpbmJFc3p2bXlPL2tXaGQ5dmdsQW9O?= =?utf-8?B?eWpscmVJRzlRME9WMHBwTEd5Zi9VbkdsZWJEQmd5d1FHQUd4RlhlUXZSWXhx?= =?utf-8?B?c2ZEc1p3NnViU3Z6dGJkdzZjMzV5bktZenlRWkJpU3V4Tk9hbUc2ZzdXNHdK?= =?utf-8?B?c1ZWWmJZN2Z0NllDWUtqbk9lK256elAyZkhQRGJvanE0b25IaXBOSmF4VjN0?= =?utf-8?B?cURPb3pCZEdSMjFqWlVGUG9tQngyWW5PRU02OWdNc2hrU2xNd0NJRmVJOW1n?= =?utf-8?B?OHJnajJybFJnVWl4UGJVcTFVSEF4Tm1oTXBmaGUxY3Z0THNYa2VISVpCeXB0?= =?utf-8?B?c2FBeUlXNDRzK1lqSnFlTWJQcUN2M0tPM1NGclh4NkdUNERlSGQ2ZW5jN1FT?= =?utf-8?B?V3lKQ2NKNlNVbm8xa1ZTYVlRZWFHNUZwNFFpb3dBVEFJZXJiR3VJWnoxazdy?= =?utf-8?B?Q3hoVGlzQk9JUmM5dEFKTWhLQk5HU21mSU5tY05wWGhpdStmbXVEWW9Gd0xZ?= =?utf-8?B?NG5NVHZPSEpYcVF0NW5hdlR0UDVXKzNOM2FTTURMYmpvT2RtMlNmVGZodThU?= =?utf-8?B?cHN3b1ZaYnBQL2ZrRHlSa2xmMzIwWkZsWEpGL3F0bUU3K2E3WlRmWFRDRGJC?= =?utf-8?B?ZVc2MkVJOFppMW8zUSsvVEJ1UUhYUXRBVFpCQW1WVHg5RHozZ0FGamhWUDFs?= =?utf-8?B?eU5mU3UwbEJIb0lXZG10QXlmdDNFdkVCK2lKc0ZHaldicjlwRW9ld3RpUENs?= =?utf-8?B?bWlCak81b3JuUjdSR1puT204R05wR0dNbWpteVJHeVNXSWFKaXVYSHM3S1Yr?= =?utf-8?B?c1dtakJ6czR4MVFuVTg1c0tpWDZDeDZCQ2NFbzMvQW5odGZxcVc4QTRhREdS?= =?utf-8?B?TElVRlJVY1NQMTAzaHZZaDdwUkZFUG9FMmdCY0lla0pQU004SVFoVmRueHFv?= =?utf-8?B?UXBIc2ZmRnZaZ0IzTERyTVJXOWVGMW0rNENzcVc3WjlEcHloTHNETVdoQlRW?= =?utf-8?B?UjNmZ0gvVzYvSnJMRklBbzh0cFpYUDhhVWptSTdobUc3bldFc0RtR0x4RGo4?= =?utf-8?B?Z1NaNnJOTDZ2eVpaVnlzNEgzejllL2N0d1N1czZGUW9kdG9kRnRyTWl5Vzly?= =?utf-8?B?SUUrSEZ2RE1GbzY5dUlLNzN3b1RodnNjWjZSK0ZNVk5iZHdLMVJQdU5RbFhq?= =?utf-8?B?RkI5ZUVHYWRQczdJWUxCc0JONlMvYzdQeEw2NjVQK3BNSVlPV2JVVzRJZlVD?= =?utf-8?B?WWh0UnoraHp2eEFpUzFSRGNuaWpoUHBHQ0dRUVJ4eGJuNVlJRVlEcnlwL05G?= =?utf-8?B?U3N6OS9SMkZTRm1xb3BGa2N5d2pqVmdnOGwxMGlVaHNPSTBsR3dvMEtTeXBJ?= =?utf-8?B?VllCUUZPWVE5NHRrR0w4TEJIY0RhbVpIRVYyam5RWm15K0tYVVE4dStrSWwr?= =?utf-8?B?RTAzcWxUMzUxQXZWVGRYRXBqdnZyY0xXQlhGZyttc05sNmEyeEU3cDhkcCs4?= =?utf-8?B?Q0phZmxJOWtpeWxBcjg4ZVhLeU5SNGRodmVhNEQ1dTIwU2srNzM1WDVBKzNO?= =?utf-8?B?bkVtdDdTY3Z0VlMxcldrbFovSUppZGJOd1kzM05OMTNGdmdyemRtd3FMZXdo?= =?utf-8?B?L0FGZmEyTkdBZ3hpLytuazZtUDFkcjNzcEhYUlZaTDhya3ZmSW02L1Vmd3JK?= =?utf-8?B?aVJBYXhSMW5nUnZIeXIwTUpJUTA5VU83R2x3Q3hYSUQvTTFoSlB5Nk9mcXM1?= =?utf-8?B?cWVYWFJ6WmRvVnJNYVdiZTZMakhTS2R4Sys2cXJjNmlUVzY3YXIvd0hhV1Vo?= =?utf-8?B?SWNKaVVyUklLMVFuU1d1bjRVbk1xenZpN0FYdkpzVUFwS0VkSVE5aVdmbk81?= =?utf-8?B?UWVkUnhaSHFqbFg4TzdZRy9YeG1jTDJJNlYrTUpiQnVpNWtYajBkR1M5eHdO?= =?utf-8?B?a01SVEhCZmwwTmo2VC9TK2pRc1E2eDFBRXpRUStYZkt4LzVEWWVvaDBZZnNr?= =?utf-8?B?Q2E0QjlJSW5ySHpLbHJaZWZ4K1JzbndLK2FDZVRNSThNcWN1YzFVZU1GM2Ux?= =?utf-8?Q?Nca0qY?= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2025 08:44:41.1827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df0a62fa-ed6e-43a4-fc79-08dde2ea77a4 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB9036 From: Shahar Shitrit Enable configuration of the burst period =E2=80=94 a time window starting from the first error recovery, during which the reporter allows recovery attempts for each reported error. This feature is helpful when a single underlying issue causes multiple errors, as it delays the start of the grace period to allow sufficient time for recovering all related errors. For example, if multiple TX queues time out simultaneously, a sufficient burst period could allow all affected TX queues to be recovered within that window. Without this period, only the first TX queue that reports a timeout will undergo recovery, while the remaining TX queues will be blocked once the grace period begins. Configuration example: $ devlink health set pci/0000:00:09.0 reporter tx burst_period 500 Configuration example with ynl: ./tools/net/ynl/pyynl/cli.py \ --spec Documentation/netlink/specs/devlink.yaml \ --do health-reporter-set --json '{ "bus-name": "auxiliary", "dev-name": "mlx5_core.eth.0", "port-index": 65535, "health-reporter-name": "tx", "health-reporter-burst-period": 500 }' Signed-off-by: Shahar Shitrit Reviewed-by: Jiri Pirko Reviewed-by: Dragos Tatulea Reviewed-by: Carolina Jubran Signed-off-by: Mark Bloch --- Documentation/netlink/specs/devlink.yaml | 7 +++++ .../networking/devlink/devlink-health.rst | 2 +- include/uapi/linux/devlink.h | 2 ++ net/devlink/health.c | 28 +++++++++++++++++-- net/devlink/netlink_gen.c | 5 ++-- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netli= nk/specs/devlink.yaml index bb87111d5e16..3db59c965869 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -853,6 +853,10 @@ attribute-sets: type: nest multi-attr: true nested-attributes: dl-rate-tc-bws + - + name: health-reporter-burst-period + type: u64 + doc: Time (in msec) for recoveries before starting the grace perio= d. - name: dl-dev-stats subset-of: devlink @@ -1216,6 +1220,8 @@ attribute-sets: name: health-reporter-dump-ts-ns - name: health-reporter-auto-dump + - + name: health-reporter-burst-period =20 - name: dl-attr-stats @@ -1961,6 +1967,7 @@ operations: - health-reporter-graceful-period - health-reporter-auto-recover - health-reporter-auto-dump + - health-reporter-burst-period =20 - name: health-reporter-recover diff --git a/Documentation/networking/devlink/devlink-health.rst b/Document= ation/networking/devlink/devlink-health.rst index e0b8cfed610a..4d10536377ab 100644 --- a/Documentation/networking/devlink/devlink-health.rst +++ b/Documentation/networking/devlink/devlink-health.rst @@ -50,7 +50,7 @@ Once an error is reported, devlink health will perform th= e following actions: * Auto recovery attempt is being done. Depends on: =20 - Auto-recovery configuration - - Grace period vs. time passed since last recover + - Grace period (and burst period) vs. time passed since last recover =20 Devlink formatted message =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index 9fcb25a0f447..bcad11a787a5 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -636,6 +636,8 @@ enum devlink_attr { =20 DEVLINK_ATTR_RATE_TC_BWS, /* nested */ =20 + DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */ + /* Add new attributes above here, update the spec in * Documentation/netlink/specs/devlink.yaml and re-generate * net/devlink/netlink_gen.c. diff --git a/net/devlink/health.c b/net/devlink/health.c index 94ab77f77add..136a67c36a20 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -116,6 +116,9 @@ __devlink_health_reporter_create(struct devlink *devlin= k, if (WARN_ON(ops->default_graceful_period && !ops->recover)) return ERR_PTR(-EINVAL); =20 + if (WARN_ON(ops->default_burst_period && !ops->default_graceful_period)) + return ERR_PTR(-EINVAL); + reporter =3D kzalloc(sizeof(*reporter), GFP_KERNEL); if (!reporter) return ERR_PTR(-ENOMEM); @@ -293,6 +296,10 @@ devlink_nl_health_reporter_fill(struct sk_buff *msg, devlink_nl_put_u64(msg, DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD, reporter->graceful_period)) goto reporter_nest_cancel; + if (reporter->ops->recover && + devlink_nl_put_u64(msg, DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, + reporter->burst_period)) + goto reporter_nest_cancel; if (reporter->ops->recover && nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, reporter->auto_recover)) @@ -458,16 +465,33 @@ int devlink_nl_health_reporter_set_doit(struct sk_buf= f *skb, =20 if (!reporter->ops->recover && (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD] || - info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER])) + info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER] || + info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD])) return -EOPNOTSUPP; =20 if (!reporter->ops->dump && info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP]) return -EOPNOTSUPP; =20 - if (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD]) + if (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD]) { reporter->graceful_period =3D nla_get_u64(info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD]); + if (!reporter->graceful_period) + reporter->burst_period =3D 0; + } + + if (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD]) { + u64 burst_period =3D + nla_get_u64(info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD]); + + if (!reporter->graceful_period && burst_period) { + NL_SET_ERR_MSG_MOD(info->extack, + "Cannot set burst period without a grace period."); + return -EINVAL; + } + + reporter->burst_period =3D burst_period; + } =20 if (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER]) reporter->auto_recover =3D diff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c index d97c326a9045..9fd00977d59e 100644 --- a/net/devlink/netlink_gen.c +++ b/net/devlink/netlink_gen.c @@ -389,7 +389,7 @@ static const struct nla_policy devlink_health_reporter_= get_dump_nl_policy[DEVLIN }; =20 /* DEVLINK_CMD_HEALTH_REPORTER_SET - do */ -static const struct nla_policy devlink_health_reporter_set_nl_policy[DEVLI= NK_ATTR_HEALTH_REPORTER_AUTO_DUMP + 1] =3D { +static const struct nla_policy devlink_health_reporter_set_nl_policy[DEVLI= NK_ATTR_HEALTH_REPORTER_BURST_PERIOD + 1] =3D { [DEVLINK_ATTR_BUS_NAME] =3D { .type =3D NLA_NUL_STRING, }, [DEVLINK_ATTR_DEV_NAME] =3D { .type =3D NLA_NUL_STRING, }, [DEVLINK_ATTR_PORT_INDEX] =3D { .type =3D NLA_U32, }, @@ -397,6 +397,7 @@ static const struct nla_policy devlink_health_reporter_= set_nl_policy[DEVLINK_ATT [DEVLINK_ATTR_HEALTH_REPORTER_GRACEFUL_PERIOD] =3D { .type =3D NLA_U64, }, [DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER] =3D { .type =3D NLA_U8, }, [DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP] =3D { .type =3D NLA_U8, }, + [DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD] =3D { .type =3D NLA_U64, }, }; =20 /* DEVLINK_CMD_HEALTH_REPORTER_RECOVER - do */ @@ -1032,7 +1033,7 @@ const struct genl_split_ops devlink_nl_ops[74] =3D { .doit =3D devlink_nl_health_reporter_set_doit, .post_doit =3D devlink_nl_post_doit, .policy =3D devlink_health_reporter_set_nl_policy, - .maxattr =3D DEVLINK_ATTR_HEALTH_REPORTER_AUTO_DUMP, + .maxattr =3D DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, .flags =3D GENL_ADMIN_PERM | GENL_CMD_CAP_DO, }, { --=20 2.34.1 From nobody Fri Oct 3 21:55:27 2025 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2059.outbound.protection.outlook.com [40.107.93.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9628325A337; Sun, 24 Aug 2025 08:44:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025096; cv=fail; b=gcFsUeyFR7T2L8V5HHhjA3jkNqC0yKKdNlJXbzklXl9IirPsKWFv05qxfmB/5p73wxJiYsAA6Y0rrrvT2kiEdDAtOgbN7TTP6tbNpDcLK4vNEVNMyI/xjV264HjO1kIb91mrxK3Zem/FZQ8sSZQefJWwnLu1URfQG457Jy/3WXk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756025096; c=relaxed/simple; bh=fsZuoY3JiOgc70G68aOUfCs9XZC1kzdyDUu5vUb8Oto=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LnTKm9gm9db1O1rgWJ7jCALyMqTZ8B1Kuu+52fRSX62Dwx1Q55U/m2iuse4zg32+HYPNXHeNbX1rZkR7O01SwJ4RkVJX/sNkZEQF/qjhogvlocLxE9DGjAgAft4cdAaa33N+aP+nm3ughRTVsvKl/mpuS4yqwP6OIxhtJwbWEa8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=agZCl5LN; arc=fail smtp.client-ip=40.107.93.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="agZCl5LN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QMmAkQGCXbNelny7P7t641al9lyDQoebPlkXHwqXGwUiQShU710uN0a3jkYpzx6ti/Y6FVh1zIvG+W8MQkNYokfQxHB7pL3CdwTM4ipjKUUV6T2+qNkZnzoty+9PrtNYn9uHGMA52kq3w8XHE/sDhDOfaGosNzGlXWqLSfiWgoNb+nDCa6mPMHkPfXPD2lBq9xHbiAnvqkPTfCxBYNNTeuoBV0b4GgRgC2U/1ldeMLoktvGCPdLV2XhAfIpLc6BDn8JmCkhy2PRzCBQH7ix6tvW5ipKk7CzAqWk+W/V9nYO7bQ7HYYTgkCB44y1/nVqBkZFyd8H9m9kWEjckYnhuNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mycVIQ5DSrEz1588wsnAMB8LCFlQWu8ItT9fUmZTZro=; b=IixhrFSNXm0MOy0JcTkbrzELhfwc1JgYxME0EC9X7m09/XrpIBc2NDbw49/+IF6Xh8b8v0cOVnFl/OIvCE9CkPmjO8GrZctvXkxjB7LBGu0WFwb/RbGnh+OzfX8PYOQZ2Sc8xoI4tGcLJR2Mw5M1H1XPzNz6ca8PaQG7s01F9pfahmWrnE3B4Z0/7VOxwW5T30eogfjmdhEacRodCvuHMWVS79lMTxyFITsvajw32iWNPeJIUrqJ8tG7LG/6Q8Texj1tJ1XVGKeXXZEqJe6w6oi8R+ykCh9T/QWA3goBei7ivezW6Ch6sOHMjGh+kf1/2AC0/VzH35Ga/IU0UXOyvQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=google.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mycVIQ5DSrEz1588wsnAMB8LCFlQWu8ItT9fUmZTZro=; b=agZCl5LNI5dXb+IYcenc0divfc9tCMamtXJygLIIWkWnipDw3gLtrAJjF7Wa7PqUy7MbHw6kRqqzggcMjyPo5gIaMS9JNCW+at7YRBpTj6SLOTlK3x4NJJe0dTHKYcwY3XxQZEr11+TVvfqeDK7vdxQjcbL8U9e7VA8XB9LCWCQEhi9vvWLlo91e2Pc5gcG17SPZ2XhU28h70kY9/rlExfes3g/IeLFv5OIRv7uz7Wb4qqyvwU9/fGvpGtuEDP+dnPtxBxj5gLRprSXUAejFFvLUGTUsZhZlGSCL/UTYOE1xOuIc4LfBZJu1Rww9Eb1Ygqp6mAZWFy5K4KfcVsPz4g== Received: from BN1PR13CA0002.namprd13.prod.outlook.com (2603:10b6:408:e2::7) by MN2PR12MB4304.namprd12.prod.outlook.com (2603:10b6:208:1d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.20; Sun, 24 Aug 2025 08:44:50 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:408:e2:cafe::37) by BN1PR13CA0002.outlook.office365.com (2603:10b6:408:e2::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.12 via Frontend Transport; Sun, 24 Aug 2025 08:44:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.11 via Frontend Transport; Sun, 24 Aug 2025 08:44:49 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:31 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Sun, 24 Aug 2025 01:44:30 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Sun, 24 Aug 2025 01:44:27 -0700 From: Mark Bloch To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" CC: Tariq Toukan , Leon Romanovsky , "Saeed Mahameed" , , , Gal Pressman , Shahar Shitrit , Dragos Tatulea , Carolina Jubran , Mark Bloch Subject: [PATCH net-next V4 5/5] net/mlx5e: Set default burst period for TX and RX reporters Date: Sun, 24 Aug 2025 11:43:54 +0300 Message-ID: <20250824084354.533182-6-mbloch@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250824084354.533182-1-mbloch@nvidia.com> References: <20250824084354.533182-1-mbloch@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|MN2PR12MB4304:EE_ X-MS-Office365-Filtering-Correlation-Id: e666c922-b1d2-4d21-ed1b-08dde2ea7cc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?HJvddYkd9QVN5LwhRWqlGVPc2X84ylrLcwyXEbOTwE2tpe+hRNFNs9VCztVl?= =?us-ascii?Q?I6qMCZkuNEQCgcY/oT5vbQ2bPtTMYSuO3cRioWnUcUBseIdoa0l867Al/tYN?= =?us-ascii?Q?9oHVeevv1j5TKd3kbnddeCcFYp7xUgWXyxMHzR93H/Z3fmOXaM7vsAfH3Jxi?= =?us-ascii?Q?rxkg6fGZ6xHm+SpAGNqgQoefOzenzw4i9PqTFGBOQ3wxIY7Y+Rv+LhAYwR7y?= =?us-ascii?Q?lLE0q7/t68uu/DXEL6Afv8nLaZwrY5NLZa/Qi72sdLXjqe9Ev3d1yny4ItKa?= =?us-ascii?Q?zCZ69++lGuYepohcexI0r0JfQze5pYLTn5O/keOLlk07TdNEUj5i/z7ZNk4+?= =?us-ascii?Q?60yBPZDqD+NPAGwLYO74L3hWzOqflkcRzLMW4p/7Fc0EN3CBz4iayqLiAJ85?= =?us-ascii?Q?5nL7cvdBxTMkLT+Gyup1i+NjvSu2xQd8q+66a78YuvIbO7XtonfgvfV+zNMo?= =?us-ascii?Q?3rTQ6iDDBIYCecv4XUk/WfErUrMjG+1IUcV1om+bOdhvv7XODEKuc6IbvQjr?= =?us-ascii?Q?Fns7VfRjX5YXpSGYfBicdT8Y5t8w8FwsBxTp7J9eAOemayDEvggkX5wZ8x1d?= =?us-ascii?Q?mvi8MbZLT7M3ykQIZA8TXXKvVD2B9znM0K5ufvtpuFE5a5r95KBTc0ElLYKD?= =?us-ascii?Q?5/OFQUlx2IshU5nFLnqKYrcIK7AMeMnOdP4hN2BXwBgXPoAv5tVzmQaicuMe?= =?us-ascii?Q?dRMwZKTXUPildRKcbbY+1YNPKn8fw4W1B8DqwCZuLWJEIkXqKnKvNPnliqAQ?= =?us-ascii?Q?0vLeVsV1d6ddZ0nawl3Qz88AvcRGU2MmQfH2QgdTzE6NN2iXT3VHzjn3uXEw?= =?us-ascii?Q?PqBc/WNvA42YgXoGtx6ptH8k9c1ScrtF+T9uEvtpLvMkF3jGz3ogt98MX9gv?= =?us-ascii?Q?6yyfrh4YQx+eQOG1hHR9NVTQXjJyaf6USymCR5fYsgw6V+gm1DiU81LjVl3/?= =?us-ascii?Q?L2uWiP8GAq3LKRlvN4MgPxA7FnmsDN2wnFVdjPLTr5OByoCIhoJtKQ4QCtnP?= =?us-ascii?Q?Gjkn/Tvw1u/QFBs7hirw1Z8anDjVoF7pYnbjCmGiBfmU8h0RHwvLuTiemStc?= =?us-ascii?Q?yJ5yZjIvv2OD6Fugk9IeglHWiu6KGGD8pK01n7ZTkuYARabquHwu5CJZYCX6?= =?us-ascii?Q?yNsk84XyD3io6tcsXBVBjpRkWekHaPOzw7kkHb1EFHBWdUYs4yJ3JjgnvrRV?= =?us-ascii?Q?TEfRL7nUwP9dhjSfkfI/mzUugyVJW/QOJAcf66Ez6zj69CMI1IYo+4k5IA6u?= =?us-ascii?Q?hb5xOesiPcj8vy7tPsKe3DlF/JJO4pzTnvHMXqae1s+uWh63Y9Kp2Ssy3UAC?= =?us-ascii?Q?xKhNyF8LKkptVckNPrRdOj4ZMXLwHkdPxv1xi0y0/mYwUjTt8zX6X3GOWmWB?= =?us-ascii?Q?xxAKJSFaRNQShQ8HphKO0jFVGDnDTzkeX++kG8xeevqVsZxqTM+vhBhTk/hq?= =?us-ascii?Q?colJSZxOnoza7h/rgjIqD1cM6GqBdvJluc9PGE9aHrT0sftfzoVCORrXvxWa?= =?us-ascii?Q?E4RvwosB4qaSEbtabMFjErEOxvheIH6gsycc?= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2025 08:44:49.7574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e666c922-b1d2-4d21-ed1b-08dde2ea7cc2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4304 Content-Type: text/plain; charset="utf-8" From: Shahar Shitrit System errors can sometimes cause multiple errors to be reported to the TX reporter at the same time. For instance, lost interrupts may cause several SQs to time out simultaneously. When dev_watchdog notifies the driver for that, it iterates over all SQs to trigger recovery for the timed-out ones, via TX health reporter. However, grace period allows only one recovery at a time, so only the first SQ recovers while others remain blocked. Since no further recoveries are allowed during the grace period, subsequent errors cause the reporter to enter an ERROR state, requiring manual intervention. To address this, set the TX reporter's default burst period to 0.5 second. This allows the reporter to detect and handle all timed-out SQs within this window before initiating the grace period. To account for the possibility of a similar issue in the RX reporter, its default burst period is also configured. Additionally, while here, align the TX definition prefix with the RX, as these are used only in EN driver. Signed-off-by: Shahar Shitrit Reviewed-by: Dragos Tatulea Reviewed-by: Carolina Jubran Signed-off-by: Mark Bloch --- drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 2 ++ drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/dri= vers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c index 1b9ea72abc5a..eb1cace5910c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -652,6 +652,7 @@ void mlx5e_reporter_icosq_resume_recovery(struct mlx5e_= channel *c) } =20 #define MLX5E_REPORTER_RX_GRACEFUL_PERIOD 500 +#define MLX5E_REPORTER_RX_BURST_PERIOD 500 =20 static const struct devlink_health_reporter_ops mlx5_rx_reporter_ops =3D { .name =3D "rx", @@ -659,6 +660,7 @@ static const struct devlink_health_reporter_ops mlx5_rx= _reporter_ops =3D { .diagnose =3D mlx5e_rx_reporter_diagnose, .dump =3D mlx5e_rx_reporter_dump, .default_graceful_period =3D MLX5E_REPORTER_RX_GRACEFUL_PERIOD, + .default_burst_period =3D MLX5E_REPORTER_RX_BURST_PERIOD, }; =20 void mlx5e_reporter_rx_create(struct mlx5e_priv *priv) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/dri= vers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c index 7a4a77f6fe6a..5a4fe8403a21 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c @@ -539,14 +539,16 @@ void mlx5e_reporter_tx_ptpsq_unhealthy(struct mlx5e_p= tpsq *ptpsq) mlx5e_health_report(priv, priv->tx_reporter, err_str, &err_ctx); } =20 -#define MLX5_REPORTER_TX_GRACEFUL_PERIOD 500 +#define MLX5E_REPORTER_TX_GRACEFUL_PERIOD 500 +#define MLX5E_REPORTER_TX_BURST_PERIOD 500 =20 static const struct devlink_health_reporter_ops mlx5_tx_reporter_ops =3D { .name =3D "tx", .recover =3D mlx5e_tx_reporter_recover, .diagnose =3D mlx5e_tx_reporter_diagnose, .dump =3D mlx5e_tx_reporter_dump, - .default_graceful_period =3D MLX5_REPORTER_TX_GRACEFUL_PERIOD, + .default_graceful_period =3D MLX5E_REPORTER_TX_GRACEFUL_PERIOD, + .default_burst_period =3D MLX5E_REPORTER_TX_BURST_PERIOD, }; =20 void mlx5e_reporter_tx_create(struct mlx5e_priv *priv) --=20 2.34.1