From nobody Mon Oct 6 04:59:35 2025 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) (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 684102ECD39; Thu, 24 Jul 2025 20:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390248; cv=fail; b=YPCRaiV/AOs+hYo2UcielsHoiLsbA7xyov6tTRJsx4VfSh3LuwqNjfQSr79Q9KJdrlqU2kyJdOThVXZSRO23sEqo6GPYjJDVdfjTCAwVmCrG2sYpwPruAFlfIqAHmc0ukTQfTPSk0GYXNkk7FpWBxbxaMZEuUy8mMAvdBlhkOg0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390248; c=relaxed/simple; bh=BvhYurb0heOvjuYajOcz1jnCGJ0jkwlCwGdLZzJpo9M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NBRYpPCtNSWxxQ1f8M49tRTsNW9/f6nq5sXj9gpn7XJQ2GxL8UQUSi4sfCZOPDJE5UHjcxS1k5TNTIIDsW/KsZHFzTjq404kR8SVSBx84ce7jwIPevSTNqnlF2Lhnb/V5vT2TWR2ssedsVaeF3Ysu5lNSJZljhbP6SYsd0qNb/g= 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=YEzHZimS; arc=fail smtp.client-ip=40.107.243.62 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="YEzHZimS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=au3DnX5rJlLd/b7nqxGlMz+JTwnn29qbPl1XV1622DTsfKtql3IImcZupMeG2CI3nr8ZLe0CRxMj4wFd+kbfJF/mvGFVsekQF2KZvFQWdN0gqcGBGv7NQ4X65E3uCwDbFSAbVywNIgr23JZ1XBNchhn82GiFX+bf5yVtKqglDdhmV5FxUloECMX6BF+8rMCXdMs7VeuD8PVaptgpZ4PyZCtg3ENX3qGZfenX3Lx6U/W3qmgxsou9v3LgsaiF6f2PwKIWC+97FJOvZp0N/gY9hRXmPgXV3ztaQ5+U6ao5QYkH87bCvs5GtXEUEUxjvWjzYWsBW6agCxlH4QvPPyTOnw== 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=Qy5sf8xHtt7VTqNK1SGp1oY+L+UVIIve/ZxCo+d8l9k=; b=CBVP93HEWEn2ZpCP0dHSQPEZ25NhxDkGX6Jeh+3xl95utdFRgrfPnigLEgjSfNuYPXspqHe3RlpzYonzLnfvuDYBxH7Zh1mZjyaiMS/G8UemXs5uBglqLRIjiWgtPswqiNbErKFz5Hn5bX95I+D2hw7AAsSxTCuM9pNu1ew8nYyF7SjSliEjuvfNS0apqNcyhoZrxXqDQZpSmQs61g+m6fGmtoJhUjTq/mV1Wrj379GG0OORHANrLLQXH9TjZh9/P6zNFBvPitDz3NeZnUhD9NmEQryplfLv+ZclhldTxcgKwDJYRMXIhc10gTOBnq7NVjNsUMcLoQ2fm/mCtQpx4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Qy5sf8xHtt7VTqNK1SGp1oY+L+UVIIve/ZxCo+d8l9k=; b=YEzHZimS8UD6xRZHZpHh/1y4VIND9rqUrL7OR4dpdw/+60XQYbmNQCLpqFutYe6iMjn8MdgxzPwWMOygk0op5OOvlUDLr+vq868z9tNjtCJ4YfIpfuK3/Z9PSwUOFZ4JjhCbRWb0PyqWFh+0gSJ+Pd5hg30zwqMNK0P40IQjQ5SPesA7MmktAkKnnEFZloNDjIVsnuIM31YjafO4h/GlQoYqpINuz71cbCk7yn2qDpSz1hz/IPbrzpCDLijcL4gkX2w+EP76nj25dMntwSewd7uLiDcFmU5ne20Qn4lo4y56ti6TLi9zke6gzcIaZNIlNHyjdqapultWBmJjOeyUhg== Received: from CH0PR13CA0060.namprd13.prod.outlook.com (2603:10b6:610:b2::35) by DS0PR12MB9039.namprd12.prod.outlook.com (2603:10b6:8:de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.21; Thu, 24 Jul 2025 20:50:39 +0000 Received: from DS3PEPF0000C37A.namprd04.prod.outlook.com (2603:10b6:610:b2:cafe::fc) by CH0PR13CA0060.outlook.office365.com (2603:10b6:610:b2::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.5 via Frontend Transport; Thu, 24 Jul 2025 20:50:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS3PEPF0000C37A.mail.protection.outlook.com (10.167.23.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.20 via Frontend Transport; Thu, 24 Jul 2025 20:50:39 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:29 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:29 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Thu, 24 Jul 2025 13:50:22 -0700 From: Tariq Toukan To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , Jiri Pirko CC: Donald Hunter , Jonathan Corbet , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Ido Schimmel , Petr Machata , Manish Chopra , , , , , , "Shahar Shitrit" , Gal Pressman Subject: [PATCH net-next V2 1/5] devlink: Move graceful period parameter to reporter ops Date: Thu, 24 Jul 2025 23:48:50 +0300 Message-ID: <1753390134-345154-2-git-send-email-tariqt@nvidia.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> References: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37A:EE_|DS0PR12MB9039:EE_ X-MS-Office365-Filtering-Correlation-Id: f4671458-7ad2-45e4-c762-08ddcaf3bf92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|7416014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sEOY1NB1Vv9QWm0ViOnkerawunJ29TrPnioPcJRjyEhqwufvIXj/b7uC/FGS?= =?us-ascii?Q?uEMw53f57C+sHMbCZDXYw9NtAT0ocSJutg+N+Wg3kuCyUjyGmwq36OHOHC+W?= =?us-ascii?Q?nOgeOOpXc1HtkoWpIJKKNy0vSu0OpEbkIhn/nGGWG05a7Xz9fZ7b7vTExbMg?= =?us-ascii?Q?JWM0UnCR3Do8K46BQqYm0GPaLHgactntQrwHwnty4VM6zW0wPQxrQ2f3WNqN?= =?us-ascii?Q?cqL2q7h9nmY6LeU4oa0mWw57P8j/Ut8sNnmX3d+ATCy1elGP41gQp8IF4X0m?= =?us-ascii?Q?/Fef0NTYqDXHSKpsB1SSKS6WMcovIvGTmZyDoA/LCmSwSCHEu99DU9gefL7a?= =?us-ascii?Q?I/eIpny6bQUEJxRCSueeyTCE3poX2jzvcnkC2TgjAyyWV+zuuShK6m9WM+Ge?= =?us-ascii?Q?PodTu5bAWGc563TL7OYJIv5ZAGqWqDoT8E7M1a62wEa63Roo16ObzeX/l6Wd?= =?us-ascii?Q?oFBxloHag6oQiapQPbXVidar3ikxuFUeN362UMpS7r/UMBSSj0uV/6+rfI2X?= =?us-ascii?Q?4oAD7GT6gTMkv648G3/wfBvNJTCIXBv2Udg8roVE2XWLvgX4FanClAjVlZR5?= =?us-ascii?Q?osva5bNws/iGnjtirtS2YQ4B61p5ROKiplSYxMJergClhoop1WFbCgCkdmO5?= =?us-ascii?Q?31UAvmXUwigkvk+6LgA8+tfWSPbgR6NrXxqqygXnv990ki31tlr+Yh48Qj+E?= =?us-ascii?Q?GEJ9P8ml8Fq5x0+DONkP64oUscUFKTsSm1t8jqBocsc0ESlgXmWMg3UuxdnN?= =?us-ascii?Q?yTYbuwvEVDGuYN1gS2IUKXEshGuhJbHtx7fXDsHCcyeuNjSbYAFzu7t6HDca?= =?us-ascii?Q?4HXyZPvEOzU4P4vvgg7sYUzUm/2CkV49XEN70Fxb2R7t/LWyrVXtu1Irg/WZ?= =?us-ascii?Q?ADq3vq2v8OkNlfjqi+beAMHbq0IC+TvomMGIGJYAjmWXz9dCKbANDsCdzJwd?= =?us-ascii?Q?qRFRoE7fRc+tRChJSXsu5Yx/o7Tow+AhA/A5gIdTxCICY5kXlbaJUV3066/i?= =?us-ascii?Q?6FU2RzRkfef2qjHAxY0L3l2MSNNd8Zfmd+ghG3ZIVkbRrNULsgFemC8prcSH?= =?us-ascii?Q?X/ocj5PUopqVR5VOs4ASg4x12Pbd6WA3HnRLdSaLHbPO5iW+1qIWcNl62prM?= =?us-ascii?Q?7G1Z7LzKLfz2OiYnRDKY6LadfJIEJSHNyRVaVNA0dIxjV3aREUAzi0IGFg83?= =?us-ascii?Q?cE5ycJpG6Y13CcU0VgBYtyezZHi7ULaoWPW/BX9OCxRkvlelKXEEYhEPYiPZ?= =?us-ascii?Q?L77LkWocTBmoudrmT7vcjFvJ9WsKCARYUmN4j2BTlSU3AoNI0bhoYWqYQkdu?= =?us-ascii?Q?RnKlpFHK6bRU+1L6O87qZaQhNLz1/O0PPspxS/YkKLtSZeBfqxm85wgb/Zxy?= =?us-ascii?Q?6P7zcnO9DnWfPnS0W86T7JCX5pwgk3haZ51I9Pu3VlnABhaCbUGhx1n2eNoR?= =?us-ascii?Q?f/YjeGKoTkbauElSTANVBX2kneH0z3LluMg0/ZKIDqdfc7aOtkp21Iilt2AQ?= =?us-ascii?Q?+RvER+v/KANm7PZoUr2fPnwm/K6hLGW8ej5m?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(7416014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2025 20:50:39.4924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4671458-7ad2-45e4-c762-08ddcaf3bf92 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF0000C37A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9039 Content-Transfer-Encoding: quoted-printable 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 grace period delay attribute whose default value will similarly be provided by the driver via the ops structure. Signed-off-by: Shahar Shitrit Reviewed-by: Jiri Pirko Reviewed-by: Carolina Jubran Signed-off-by: Tariq Toukan --- 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 | 10 +++-- drivers/net/netdevsim/health.c | 4 +- include/net/devlink.h | 11 +++-- net/devlink/health.c | 28 +++++-------- 15 files changed, 98 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 19c3d37aa768..3177496e7828 100644 --- a/drivers/net/ethernet/intel/ice/devlink/health.c +++ b/drivers/net/ethernet/intel/ice/devlink/health.c @@ -448,9 +448,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 86253a89c24c..878f9b46bf18 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/diag/reporter_vnic.c @@ -133,7 +133,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 e75759533ae0..e106f0696486 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -644,22 +644,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 bd96988e102c..6fb0d143ad1b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c @@ -514,22 +514,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..6959fea03443 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..d000ed734c7c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_devlink.c +++ b/drivers/net/ethernet/qlogic/qed/qed_devlink.c @@ -87,20 +87,22 @@ 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 93640a29427c..a65aa24e8df4 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -742,6 +742,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 { @@ -756,6 +758,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 /** @@ -1924,22 +1927,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.31.1 From nobody Mon Oct 6 04:59:35 2025 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2065.outbound.protection.outlook.com [40.107.243.65]) (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 73C882EBDDE; Thu, 24 Jul 2025 20:50:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390259; cv=fail; b=nRfwdEIJWwrH7eqsQdbgtueu6KpWerIEfMVotHZAgKUs9OkpSor4Ib8eukncEQ2xJZ1rkJJMLYsRYl8x41DXKbG/DcbKwHiLPHPBB5zM5df/omWDfxGKVCC7L721xru5O+POTmHrpYbXKmwvOeJUBBVow7Aw/Y1Gf9zWv1AyFqw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390259; c=relaxed/simple; bh=TwZPPMblzIjxCnzBgEjNraazTzu+Z2j0GQjcnHgWnKo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YqN9xD5OZx5h3geKjaroot3uQc9uw5vNEQNRBiGm/23KeDccecoZ4P/Lkl8rT6Re8DH2XmdEs3+HyHC8otV3N0LYpkAiVGLw7mdMQ+dH9HC7xhYgImEhMop05IcEs9rT0DFuIb2HcBT2WFAFqExrJfK7LghY6R2mSwfi/Ofk8aA= 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=Qd+XWY5J; arc=fail smtp.client-ip=40.107.243.65 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="Qd+XWY5J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bAxQZh70N/O8+exfedv+kBRCARdZMzSLs2R6AdZS3vBgVTu7wcTk06Dcy3REawtKWnxNZvCyXQplheoQDhD9pBbEJyBLOBH5k2Obz0dyRUzrENFsAOOyuhCDsBt277lpDZpcMoBVWGqEjXIRY4xS3QFXYOGFAC5Zza7G4Alpl7Tofa7nhauORUo8jW3qR+g7wJMYlM7O7sFlPrRcWXykHA6l83CQanCJl5mlPMRSwhO2NbNoOofbjT8fzrVR+m+wXaTeSvSQxOertUMdhVQZM5pGUhnVJGc/b/DdyE7oztrXNcyvBR3IsE41+b/WhLl72H6WSBNpa7nzXqj4bqKmnw== 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=V2VsP58gcTBgl+B7yHn1gkPfe18/m3I0VOOzDPttrck=; b=musdSc7kk2UWrCvDjOKmw9rjKsUUVBv/Wupx7tiCgDGizs/viOOxqIgVAjr3QNmWGL4+w2I9aMVEI+apba4YBk12jp1L2HSCQ66gcw9bhGLx9KYcFCHavimxVMKfwPLSb70aWwqKm3AcNS22lE0lOKaBm5IcB+cWrMxu3WfApkP4OO/AjHF0UBKYyQzzDEqUbhyRYzSZzmOqgSVH0Y44Rv2BEBNv9OwojclkqlPhWVXqFRzZtYBMDcOdvVqcM1U4/f5hd50Zzuee3gtxV8P3aWF26yGR86wZWk9gB8k4QYYl4NhkT8nuOukdmXo/P+T9QUuyXK2Jaj191Br8gYnu8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=V2VsP58gcTBgl+B7yHn1gkPfe18/m3I0VOOzDPttrck=; b=Qd+XWY5JGCunyvGFrHtenWQaI9MsDvYoa6BIX8Yxsbbz02tfAEv7YhPrkcR0EVAkgKSczQ6tfgqQLtcltit3D0uit4q2MUlX83gBPcqOwmvopJMlLuH1+LFwWh3wsCw/QviOt/UwfBBg10HlP+TzpgBkB3RAB7+LoTi2S/19AqMd9YzfIUYbXNFp36fSdBsDLhBFdZ0yiRvchyS9WeIGLdDp2lzu+LKgt6sgXpijW4FOsnj5vUggo9b8Pq9shBP+aV/0LAXCy/NGK+lV0VVnGbkhDsmCUnV5eblfzdYCV4dwd+7MNRHFn5PHcA8ym+18KxORK0QNZDBRkCXa2PdR4g== Received: from CH2PR10CA0019.namprd10.prod.outlook.com (2603:10b6:610:4c::29) by DM4PR12MB6544.namprd12.prod.outlook.com (2603:10b6:8:8d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.22; Thu, 24 Jul 2025 20:50:53 +0000 Received: from CY4PEPF0000EE3E.namprd03.prod.outlook.com (2603:10b6:610:4c:cafe::f0) by CH2PR10CA0019.outlook.office365.com (2603:10b6:610:4c::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.22 via Frontend Transport; Thu, 24 Jul 2025 20:50:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) 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.8964.20 via Frontend Transport; Thu, 24 Jul 2025 20:50:52 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:37 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:36 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Thu, 24 Jul 2025 13:50:29 -0700 From: Tariq Toukan To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , Jiri Pirko CC: Donald Hunter , Jonathan Corbet , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Ido Schimmel , Petr Machata , Manish Chopra , , , , , , "Shahar Shitrit" , Gal Pressman Subject: [PATCH net-next V2 2/5] devlink: Move health reporter recovery abort logic to a separate function Date: Thu, 24 Jul 2025 23:48:51 +0300 Message-ID: <1753390134-345154-3-git-send-email-tariqt@nvidia.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> References: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3E:EE_|DM4PR12MB6544:EE_ X-MS-Office365-Filtering-Correlation-Id: cf1d5d1d-5086-49ac-8527-08ddcaf3c751 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qZL4j/LnUNMQhflhCqJATJ/wl0bSvqRw4f9cT5EA0a890tU4DSjjyRsOgjjA?= =?us-ascii?Q?EbqsNTJxTZ3eMh6b4p7Z4YkW2nvWiz6UXT8GJhLmtbK+X87euzsanCe2R48S?= =?us-ascii?Q?pwEazxbAYPDGwPmIGlyhX7veDpRljOG2sycnloPaew5VObCsy/5Lszm4ttHa?= =?us-ascii?Q?cS725WMKmHerf2DuB89RrniTG1h/Yuxmf7KITdBcNV0xA7V4v4ZERDUbOYck?= =?us-ascii?Q?1GdG83QRfoS0r/KLd2Sac0LokL4o1QmUMAvahQrZS6h+z1KbyWHB/mJLMtSh?= =?us-ascii?Q?XmSQJOYK8rsvMmNAA4Qmwgv67C6G2nGupE+qAda13qDBHRBz0x1B8Hz4RYfv?= =?us-ascii?Q?DJESJn/kU7zldmbt3rgTPh7z9QKZy0u+SWoi3O5cH1bJy2+TkEE+H9r7JBZF?= =?us-ascii?Q?GP0YrHtYsLjGJmv8ewU82qPYAzgTw8uZqNd+ScQqhu2qH1YV2zd69tTbh414?= =?us-ascii?Q?A6iZ8VmjhOgOs95ETPlAbKlk+Q2Ar9w9fOLzguilOPIH6tsWt2PtaIn81r5A?= =?us-ascii?Q?0hPdcUKjzAeWQ4etfa8RzDvTihPhdly3o3gq2+5o1cmABALltQ6++5Sh/rxY?= =?us-ascii?Q?gSEdsCRwhy9oHZKTle4iN4L+1IB30PSxS6u0wsVOvA6QfFLQ18sTi7nUdwpK?= =?us-ascii?Q?wWwDuWi0IJVsaFrbnYlNEMgNaxBKrqhA+5yqRq7ghkX+Bse/ufbRxcePwz/K?= =?us-ascii?Q?yehp8fZ1oiLo1MRjq/CQWgB/GVbhnuE3Ggs7qiIHdYg32fOagvMJR9I/kLQR?= =?us-ascii?Q?m39nseWye8WPltQqaQyTH5vES3olNUvlLL04sllz+mYBF1wW60KskG/hbNk8?= =?us-ascii?Q?ZLBZSUegNF4YBJXROZIXVXsyWvX7EbncO9jP0UWV+Zs5WgIgs6KgeJ0hLEZJ?= =?us-ascii?Q?nyKF64o30lHv50bUywwJvdzR0J+qc8WEXINmp7eM3ughV43kO/hon/Ce0WkP?= =?us-ascii?Q?4QBYodn2q+jQnMpanSqamUU7LcSUFGjnq87J4+3am8p4HL+4d/219BSxyzbi?= =?us-ascii?Q?wBg86G61300Z4Rk6SPteE2G9rhee4Y8jpB6WLD/Iloeek9Z5yxHYsr1N9Fh1?= =?us-ascii?Q?Y9LKVivTu/y1rQtxugeJm3l5EODWis8WR7XqJK7Dwpk61sLWDcSUA2hBzr+O?= =?us-ascii?Q?qOMtdsoULJAkbegNY1J14ElPHF5/RUaxqu/CNHiy5HO8iDpe8TEThdR+pLjx?= =?us-ascii?Q?92Zkujnl9Te46ImRk/9RVPBlIIZwEOhco++O9oZLiTnJ3+oqSq7rHji+GVW1?= =?us-ascii?Q?Sz+ephou1mkrmLsdTO2882xcfuRy/960bBsc+BXD3yUr8nAvLMY0FZjDf2W3?= =?us-ascii?Q?tTD+qKeJK/mCrpDFcjRyimVTRGyQsHEtaf2zFR48/nrMhbK6sQxpDjWbRnwu?= =?us-ascii?Q?RIKgzt3S7xEK/7WbVqgoAjxWBHpVCkRmCvAHC+lHwyQnft/5FcRu2CY9AXeE?= =?us-ascii?Q?7Eq1Hau2v8jDEB9xkZvSKozuz2o3TnrDEDU+lq1D4hahUkVCfalQ+b5r7VOB?= =?us-ascii?Q?8ESbboc5Sp6fcLlJrlH9H2Iu+nBozHvF3+9W?= X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2025 20:50:52.5319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf1d5d1d-5086-49ac-8527-08ddcaf3c751 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];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: DM4PR12MB6544 Content-Transfer-Encoding: quoted-printable 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: Carolina Jubran Reviewed-by: Jiri Pirko Signed-off-by: Tariq Toukan --- 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.31.1 From nobody Mon Oct 6 04:59:35 2025 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2085.outbound.protection.outlook.com [40.107.92.85]) (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 BD8472EE260; Thu, 24 Jul 2025 20:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390266; cv=fail; b=AAJMFKrRnHQ2i4mofe1AB1K5n5Zu6pTR7SH4gQCOziVeRtGeto1oRSXlA9j3I1IJKznryvOVoTC/kBbJk0Ff1yO2rrRnxxDqfeLW4QBSp+CqXp0P95HDL2znRb9wqZJfSzXjmFYvEfmnd1wXxAtLaWNoK0Xrvw3VcgBuiBXHApM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390266; c=relaxed/simple; bh=Ptid0KVs6XW7RgOUizJOvPHWXXk9hYFH0mDoTqV5kWY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u55pvSlJflQy64KEEGh3VkPWT73Qw/ExzxKqg+JJX44N1ilDQQYe+YhrY7qDyF9KRIRnPKeutezlGZWRhvjrWzGNWNaXkQ6L85hDdhX+JAkQE8+/yQfuv892zhaO7UCcX123ul7cyacRzAtw/nxHefVICiDpoYJ9tHmV3rjiwqs= 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=lEQ6CPpL; arc=fail smtp.client-ip=40.107.92.85 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="lEQ6CPpL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T9hmjjfH9JNuXF3GOM1GVczG6+9GjHEpkkktRUMPB8ByAmgG5M36JoQTZBEO71QkhzKmwSkbBVNFQfRH4/AINlqe0lfCJRy1RR9y8Hiss+61bo2E9emOJh4jTp6VYTnQvZx4siev9zHTm7VVCdJl3xdPmUUqGgpzhLaLg0VJ7cP6qcvmQW7ZmZL3ZLCsU7flGFSk/QzIeULhHWeZdm4Gdy21RgWVqpldxDQDIaR6DYZ7vDz2RT8iSvFqnPzhUzaeRuFeDnwTPNdBlCLUgVE1g8SCIqDfCqT/9O5lrjQMHC95S26xCtuilWwHshEOrlbzK2ze+iCWy7r+jeumYkIUgg== 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=UzEMvehUkpClpAf8Ou7/MxlBJA91dQOGryB4NHB2zcE=; b=D4IijDi5R4x3gibgAmUCAp1zywzpngpbpAAUOIglYgt7HOvEhEpSbwsV/sfUacrfLSjO/QkiVt48I8XG8h86BeXTG/pr/HZ838ZLIVSkuPiyEqYGuwzNVtRYlye1o/ttRcmuum47tigxqB7uQCcBRH4ircaqdJn+Dxi+HEuEb84kFztK2z2YT9VTnxh/xLBbU+xM9Q+KlKWKzx/4WhkedDFGHSMtHz8IcPcD2Fnk48LC5dktK4bOeEixQ2/gkzt3NY82ugMqJjdoyEa4bAdsEgPJ6+JtG5wYpODw1xv/PHW8/PujcvKw90YqmjYmPo/+GuDl1yCVPUyPbdV97vna4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=UzEMvehUkpClpAf8Ou7/MxlBJA91dQOGryB4NHB2zcE=; b=lEQ6CPpLfwLVWlwanEXT8Y0KigmcmK4yRS/nnw6zvnsCxhDoo/7hlkz/quJtTAkwUHISx3eYCJ1Ze4REtP5waAECAz5OxlF96zBGjstEpinbVUoPzAXgRPBzqcgQcQDHH98KWar9WGMJ77c9TE5aakEWG8DHBP93Aoj+jhEIJXkAoINctyX9I3ZlVx+pyeGc6UTWXETAdDW9Gp52X1AV9TuC/b3U5yAUiy+EATUval2IOsk8/HTWQfukbYGdbSOcoNdm51K0GibI8x6/cVYKFOjYxOS2JZ4nki1ZnJqCTwRJV4WexdkclsMawjuky2+bb+TTqp+7Ml133eJ2ZOnqsw== Received: from CH0PR13CA0046.namprd13.prod.outlook.com (2603:10b6:610:b2::21) by MW5PR12MB5622.namprd12.prod.outlook.com (2603:10b6:303:198::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.21; Thu, 24 Jul 2025 20:51:01 +0000 Received: from DS3PEPF0000C37A.namprd04.prod.outlook.com (2603:10b6:610:b2:cafe::c3) by CH0PR13CA0046.outlook.office365.com (2603:10b6:610:b2::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.5 via Frontend Transport; Thu, 24 Jul 2025 20:51:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS3PEPF0000C37A.mail.protection.outlook.com (10.167.23.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.20 via Frontend Transport; Thu, 24 Jul 2025 20:51:00 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:45 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:44 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Thu, 24 Jul 2025 13:50:37 -0700 From: Tariq Toukan To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , Jiri Pirko CC: Donald Hunter , Jonathan Corbet , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Ido Schimmel , Petr Machata , Manish Chopra , , , , , , "Shahar Shitrit" , Gal Pressman Subject: [PATCH net-next V2 3/5] devlink: Introduce grace period delay for health reporter Date: Thu, 24 Jul 2025 23:48:52 +0300 Message-ID: <1753390134-345154-4-git-send-email-tariqt@nvidia.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> References: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37A:EE_|MW5PR12MB5622:EE_ X-MS-Office365-Filtering-Correlation-Id: e29807ac-e164-4d3f-3f06-08ddcaf3cc4d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?oZ41gv+PdkVOIX8sqOfmLtveFFaujAu/HAKzKTpeMRjnJ4T8a9RODGOzTcQK?= =?us-ascii?Q?gP8WHjnoLkGCgiXe1FBNXcCmm0snb4aE18pyDmV46wrgyOFDhlA/d8XWIT7J?= =?us-ascii?Q?ST6G9mVy9CIaAlZ3sLmui+OGydjgGoZqUW2RWT7wLvEBgf497Sc3HgTWdUIJ?= =?us-ascii?Q?3nQbzUrGcJCDSVCz7SsYWpCzmOKcdI7+mNY9MJhJNn3xal7Nu3Eon4akg7pJ?= =?us-ascii?Q?vxG4/d1ZGyW99mUszcLe2yqoxOXOlL0+0qSWHYnZOk+OHt6QDD+cJcj1MrVP?= =?us-ascii?Q?/4eIPBwV9TAl8qPNWw0cud4QfiXw6MzE5BRNxFX1IGYo4dBTytYfRn6TC0jm?= =?us-ascii?Q?LFB1MVpgOqM8IZofUwRg14/dCO+w+jE8B/1GwbY9U9XMxLJcwpP+M3oT1aq5?= =?us-ascii?Q?+aZ2rd2d2wyfcn14QSr7Ay8xVFlSuUE9VXHNnoYLH6Ef5psyeD4YJRVI3l0r?= =?us-ascii?Q?xc3lH5JyxHoGa5qr6q7jiNH0UykQFNFiN+XASAroqlQOVXsCeOQlf/HhetUM?= =?us-ascii?Q?UCZWxumwypdv7BxITzaCZ/FGeyhGeUML1SrciZW6vZTzasOJcDqObLkD/qvG?= =?us-ascii?Q?bKr3vlkBPqG6W76Rf29bjj4+xn24XT/2yso9gCoz7eWafvpPPy6Hjc85z2PV?= =?us-ascii?Q?5R3GictMp8YkZlw7Oz8LHF4TPfy4jAvfhUNf2/K6NOOi6qGitEuvZR90BeT0?= =?us-ascii?Q?DCzYpS0PmWEBnCAgTIbrQrA8ePikv/dUngCfWbb+OVbkMIA7mG8As6zdnlxW?= =?us-ascii?Q?c9PN0pLYhPSqQevC35AtlLplb5C4eWQGhwTUyVCNTVw2KwHgEeYYGNxEnbvA?= =?us-ascii?Q?JY86d4ABckEwv4PZUn/XjdtIID9k//ol6J2x9toMGJuUGWpY8Qxys+6srCup?= =?us-ascii?Q?U5XuE4SOMovaFvm8ctvUNdTarOF7XIReK+i8zX+lYauwwpX4bR+Tatq0R6WN?= =?us-ascii?Q?BM8rXVK5Rr0fTs8mgw8QEUPq1viGu3J2DiOo3MUgSBVmFubA9vsn1MBuTLLs?= =?us-ascii?Q?NTKI+Nd/95nGxNaJxw8PMkkwCBZ5hm3UCSEBv4rupOfPjGqfNIgWY1O/CrVE?= =?us-ascii?Q?oTgRnTb0em3SRZGrlbKFl2wCNMj7Wo11LsvCrQNFiPXnyFNL0yb2U0tfIkfR?= =?us-ascii?Q?MS0GdDMMzyEaWcCeA0f9VuU9T4M8TKgLtIgWy0BuxzoqXaciquw/OVgYPRvc?= =?us-ascii?Q?WqJOG/2jx5bboc+KlarYEPwJsq07gljib+QQePxoVx/dAGyHTMPNjQ7RUkay?= =?us-ascii?Q?8nndinkdo1TFs0Sy0CzayG1tGllz+/ajCFQ8IbaccDC9TrQ0yFfQeOC7kL36?= =?us-ascii?Q?x6LjHq+fw/QVC7fX7ldtD9qyyl9SvYpsbzFXbRDfoeb9jk76aQe+JldQHpEC?= =?us-ascii?Q?WXShDWxmcbe5cFK2Njb5Mj+WOg3ocoVu8oroxNdNyBIy8XvIBJ3eMCa4Zt1j?= =?us-ascii?Q?n4BkbYl+LSCEMDij8gs9qMz0YL4KhjEl3IP1vPR24O9soeEno/kzOhe9Ye6M?= =?us-ascii?Q?lFkYri8VuqDWPJS+usql/y3RU1xaIvf6fDzN?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2025 20:51:00.9373 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e29807ac-e164-4d3f-3f06-08ddcaf3cc4d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF0000C37A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5622 Content-Transfer-Encoding: quoted-printable 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 grace period delay for devlink health reporter. Start this delay when the first error is handled, and allow recovery attempts for reported errors during this window. Once the delay expires, begin the grace period to block further recoveries until it concludes. Timeline summary: ----|--------|------------------------------/----------------------/-- error is error is grace period delay grace period reported recovered (recoveries allowed) (recoveries blocked) For calculating the grace period delay duration, use the same last_recovery_ts as the grace period. Update it on recovery only when the delay is inactive (either disabled or at the first error). This patch implements the framework for the grace period delay 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 grace period delay configurable. Signed-off-by: Shahar Shitrit Reviewed-by: Carolina Jubran Reviewed-by: Jiri Pirko Signed-off-by: Tariq Toukan --- include/net/devlink.h | 4 ++++ net/devlink/health.c | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/net/devlink.h b/include/net/devlink.h index a65aa24e8df4..3ab85de9c862 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -744,6 +744,9 @@ enum devlink_health_reporter_state { * @test: callback to trigger a test event * @default_graceful_period: default min time (in msec) between recovery attempts + * @default_graceful_period_delay: default time (in msec) for + * error recoveries before + * starting the grace period */ =20 struct devlink_health_reporter_ops { @@ -759,6 +762,7 @@ struct devlink_health_reporter_ops { int (*test)(struct devlink_health_reporter *reporter, struct netlink_ext_ack *extack); u64 default_graceful_period; + u64 default_graceful_period_delay; }; =20 /** diff --git a/net/devlink/health.c b/net/devlink/health.c index 9d0d4a9face7..a0269975f592 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 graceful_period_delay; 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->graceful_period_delay =3D ops->default_graceful_period_delay; 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_delay_active(struct devlink_health_reporter *repor= ter) +{ + unsigned long delay_threshold =3D reporter->last_recovery_ts + + msecs_to_jiffies(reporter->graceful_period_delay); + + return time_is_after_jiffies(delay_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_delay_active(reporter)) + /* When grace period delay is set, last_recovery_ts marks + * the first recovery within the delay, 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_delay_active(reporter)) + return false; + recover_ts_threshold =3D reporter->last_recovery_ts + + msecs_to_jiffies(reporter->graceful_period_delay) + msecs_to_jiffies(reporter->graceful_period); if (reporter->last_recovery_ts && reporter->recovery_count && time_is_after_jiffies(recover_ts_threshold)) --=20 2.31.1 From nobody Mon Oct 6 04:59:35 2025 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) (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 BA3A02EE281; Thu, 24 Jul 2025 20:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390270; cv=fail; b=VKijuHPW91BLD+o0VCYMglm2pOTAyqFy/dmPIaH7WPx4j3jAKg9er5WCkjierxOWskBSKWPpvx4mYS453zj7Wkh8bsQ8pSmfrvLpST0o7lJBJ7L7Z7U8mld8O23sfIsYldiy1zVfrPM2tT+5cBCU5i2x96fNK1u8bpGyXgZ0XOA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390270; c=relaxed/simple; bh=uzUjCrfhAPOPAwhG/9Vg2/PoIxgs9te4GCB2/EhoDfo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NVnjOtoM0xr3b4iz3P/BhSLakdX2m1dsbEyUazCoG4vRBMSXdWJyHq9/y8hW6yinK2MHd6wTdfIvblHm3ErRI++ekyzx6QrfMTcFR/F67T3XXmZwaTqt+dTnYTSW4SoXIVHiYWZDyA4ZHq6bYl/UPpJtp+rM47gLFoSVncL3rZ0= 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=YALwO3U/; arc=fail smtp.client-ip=40.107.223.69 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="YALwO3U/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wrW227dU5vAne2yHM428ROrmGCWOMs7ZCMBAGXQwx2wR8JtHpixXPOp7FvLhveFR9YS8X0eJg2/Z3VAxj3s5z8wSXlfxAUUb2rzlg2wRNHYWx8FrLUQzQzkEjqxyoZrLvLCm/5aQR6oDHvuk/2EFDrmNjouCVXTuzfbu/9k6iX4XuFAcOVadNbZs9yPCVLgKPDX28zl3Gg241kMlMhzrqbdwMP+SNQmU/YdvTFRFRcdk+hZjvsTBgrCFlzx+y8rdqO4U1s74o3WhOLuBajtNRT1I+x4a/NEG9S/QIJ58HOTrH1TwJm1m8p1HLgCH6XInwcL/bKvTn7XBZpbkJSwmNw== 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=WqVEsIRDTmfGdODm1MzM6eyYNwTU7ioS9dtVataAO04=; b=jwM67jjpWgC3v3OLho/Ci/kNNtFQFX+8PULnbwfTzyy3FWYMY5BZb9c0oua8Mx2jHUIoxVXsFCWwIguefHsDpyB0sDZPnL3hTrqRz9Hd4zd7Ge5W1I2m/ZJJ1Eb3fR3yHx/GsDbsvWoL8R+HvSOEjoMlUxTKUBN9AQTGUVn6JVDv9fp72QXkYx3RsggGp+dXth5nUVSDnj42JbYSLxp97yAlydt/rZYMaIvBcsAxGq1Md9SqLvheAWsOpbE1H2fR2H+9sgN4G5ds3GfkgB75Sg3DfzshJztBnMLqDYVZseQyLPjyJr2DTDPtJng0DMOpYjDFkPht49oLJSeIc2WibQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=WqVEsIRDTmfGdODm1MzM6eyYNwTU7ioS9dtVataAO04=; b=YALwO3U//MJ2oPE7tyZp4qeQgzbZ/SVi1/TzUSbA5RFqwQTHXpuuP1PzF0wXognAj6kj7HqBTd74Ov6IjS8H1iReSVc8qjUDYAF/11jgcnskPFc1hs0mfJYYZassqym1MH7pKZFqvgHU1i4pIRAdhOHQz74J/uV3vtjiHQmHJJXCLGrfg5lTe6keJ+67VTt2fE8wa29CDHpWTC/lpJtBBt6VKdl+W5RZfh9CGB4ROPC4wJ4nnBStfCuFo2wS3wChfZb/6s1MwY9aungmPkIYHM/kGy0ZXrSEF4wpb9Lh026eECz7TkZJwvgRcfJVVMszAacZ50+xDWtiwzLXcjaqxg== Received: from DM6PR06CA0045.namprd06.prod.outlook.com (2603:10b6:5:54::22) by SA0PR12MB4461.namprd12.prod.outlook.com (2603:10b6:806:9c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.22; Thu, 24 Jul 2025 20:51:05 +0000 Received: from DS3PEPF0000C381.namprd04.prod.outlook.com (2603:10b6:5:54:cafe::ff) by DM6PR06CA0045.outlook.office365.com (2603:10b6:5:54::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.21 via Frontend Transport; Thu, 24 Jul 2025 20:51:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS3PEPF0000C381.mail.protection.outlook.com (10.167.23.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.20 via Frontend Transport; Thu, 24 Jul 2025 20:51:05 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:52 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:52 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Thu, 24 Jul 2025 13:50:45 -0700 From: Tariq Toukan To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , Jiri Pirko CC: Donald Hunter , Jonathan Corbet , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Ido Schimmel , Petr Machata , Manish Chopra , , , , , , "Shahar Shitrit" , Gal Pressman Subject: [PATCH net-next V2 4/5] devlink: Make health reporter grace period delay configurable Date: Thu, 24 Jul 2025 23:48:53 +0300 Message-ID: <1753390134-345154-5-git-send-email-tariqt@nvidia.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> References: <1753390134-345154-1-git-send-email-tariqt@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: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C381:EE_|SA0PR12MB4461:EE_ X-MS-Office365-Filtering-Correlation-Id: c1541bdf-1f10-44eb-b09f-08ddcaf3cec9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?NkszSnB6d0xjQXl1eGZqdUZReXM5NW1DbTZxd2FzY214NytnTHZFVlZLUDBM?= =?utf-8?B?dzRFaTc0VlJHakw1R05PdXZ6ZmZYOUZwL041a2FRYThqaHhmbzNqRkF3ZVJV?= =?utf-8?B?REVzT05wdHlMK2Vvdi9UaHFWOUFFRTRMOG14SFFMWXZlb2JCYjJkZmhsZk9W?= =?utf-8?B?V2plbGtPZTNyTzIxUXFWa0YvVWl6d3laSWdsL2NmYUNMSlk5NXVSUjJaQVJq?= =?utf-8?B?RXB3aXdaQ2hzTzV6bkoveHVqME0zUWp5eVkrOGFNSUZkMEtlTXJrQkh6VnJo?= =?utf-8?B?ek1LaUg3Rm5OcytSaFRsa3ZkT1I2OElUNGhxeHd4aStIQzlCcG9acFQySGc2?= =?utf-8?B?R2VMM2RUMU04K2NmWnJhYUxOYm1TbzF0cmVGOFZFbk1Sb0NYTVR1bGt1bWlk?= =?utf-8?B?ZFN0c1BHT3puNyszSUdZM1lWazY4Q2Z3MUw2Wk5UK3lsd0lTN1UreHd4by9Y?= =?utf-8?B?dStmc0tva3VIUDdMS3J4NnFndVV3ZHJiVXBTYnhhWVZ1YlkvT2l2THR2YjZx?= =?utf-8?B?RGh5TUM3UTZvVG9HeWQwR3BsNS94UzNjSVZaTFZwZjBqQW0rTmF3Mzk0ZkJY?= =?utf-8?B?K3psVElrYTB2UC95bERTb3dtdzNsMml5WHFmQ25xWHBwcVFISmxnejBSU1FG?= =?utf-8?B?azZ4V2wxRjhhWEIwUUlVODB2VDdkNnBnNzdiYzBKTU9FbVpHYkJrK3dzWkFB?= =?utf-8?B?TlZUSGhwUjZWU1RXeFNQbFUzS1ArNnViOVZEd2FTZ005MjUxT085THlEUVcz?= =?utf-8?B?cXVaQnYxWmNrREIyWW1OTEduam95eWxuamF6Q1pkU0FZaFJOS2g0US8zRlZJ?= =?utf-8?B?UkdtYmlPSmpRTzZaWXdyMys2eHRhU3pudTJhRTdCVG5jcCtJOEtJZUxTME9m?= =?utf-8?B?TUZLTWcyNmtDQUNkVENiYVFCTmRLWDd3SitFK0V4cWpqQ2w1OHJ5SGpBeXdQ?= =?utf-8?B?amVDRytLU2pxTzVVTlg2ckFrRmVpZHNqS2tBd0IzbFBpczM5c0J0WTVNeE9D?= =?utf-8?B?K2NOWElOb0NtN1ZEVVpWVHdWdzd6dDQydSs3ZzMvZXdvY0ppWFZBQWdkcEFZ?= =?utf-8?B?cmN3cHNkRDl3UHJpR1VhcTJVVDdMRzhhbVpRZWtZVE1tZXE2eVZVQ0VPQVdj?= =?utf-8?B?SnJTZndJMHMrTWhGVzNaV0FaMGV3RlFpZlI3Q05McFlWRmhlNmVjUWhiN3ZU?= =?utf-8?B?QnlXK0Nuem5JTktTd1RpNFcyU2owVmlWVjlpMk5EU3NjV1B4dWtGeksvVTNU?= =?utf-8?B?cjBmSXl1N0w0TFBZNktFems4ekppdUlTS1JkeC9heElxYkdDN0pQS0RoN2p1?= =?utf-8?B?Ni8veGFHVlZLODU5RVhnQXBPd2VySndkZnlvODZWbDdRR0hmUEd3V2Q4K2VV?= =?utf-8?B?MUZsdFNDZUhIcEhMMi8vdEFTK1hUejJMV2kvNVVDSmVpZCtiaVJaNG13aGN2?= =?utf-8?B?U2pUYWN1YjNCSENLM2VNcEovYzdEMHlRaVlURUpSOWg3cW1HWFp3QzV5SXJ6?= =?utf-8?B?UDFuL3lobFNnUmpkYjZZNHdyUG1QWTVIOWwvWU91cm9hQWFqZ0hVQlJvejFu?= =?utf-8?B?dE9hSmxuMXEvMytvSk1VYVZqendNMHBvZG9MSzU5NnZuTDlsUnV3bDFIRnV5?= =?utf-8?B?TjBmSStxVHhBVTVuUERETVdhTW1sTzQwQWNoT05RNktoSmJVSjJwZ2NGZXdV?= =?utf-8?B?Z1IrcTdZaXJ1SmZ1N2J3cGw1TjQrT2dPa1FYUDNqWkgwRWtxaGJYYUYyTXIz?= =?utf-8?B?R1JCR2w1Q1d4eGxISTVCUnhPNm5wOEY3VGxLbWUvMzdGdEY5QWswTk1jZ0JM?= =?utf-8?B?YzB4UExTRGE4U0VNZFRnaFFNZi9TQ3FFVTQxTFlmNTZCTUdndmRtMHQveWIv?= =?utf-8?B?dkxMNEhGcVUzSlJPS0F0b3VYcjlNVkt0cUw5ZXpGNXEvelRmTlJsTTNLWko5?= =?utf-8?B?UmlTMytTWUlWdFB2ZGxKeDFkNUsvSER6VUErYkVaTW1yWHViNFBYTEhlTzNp?= =?utf-8?B?RFhQTC9mSVo0Vk9YcSszM0YrVllMVlpOQUFOSWVDNENVTUlvaFQ0dzlYeUgw?= =?utf-8?Q?LEhwNS?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2025 20:51:05.0304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1541bdf-1f10-44eb-b09f-08ddcaf3cec9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF0000C381.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4461 From: Shahar Shitrit Enable configuration of the grace period delay =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 grace period delay could allow all affected TX queues to be recovered within that window. Without this delay, 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 grace_period_delay 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-gp-delay": 500 }' Signed-off-by: Shahar Shitrit Reviewed-by: Carolina Jubran Reviewed-by: Jiri Pirko Signed-off-by: Tariq Toukan --- Documentation/netlink/specs/devlink.yaml | 6 ++++ .../networking/devlink/devlink-health.rst | 2 +- include/uapi/linux/devlink.h | 2 ++ net/devlink/health.c | 29 +++++++++++++++++-- net/devlink/netlink_gen.c | 5 ++-- 5 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netli= nk/specs/devlink.yaml index bb87111d5e16..9b996d0abfd3 100644 --- a/Documentation/netlink/specs/devlink.yaml +++ b/Documentation/netlink/specs/devlink.yaml @@ -853,6 +853,9 @@ attribute-sets: type: nest multi-attr: true nested-attributes: dl-rate-tc-bws + - + name: health-reporter-gp-delay + type: u64 - name: dl-dev-stats subset-of: devlink @@ -1216,6 +1219,8 @@ attribute-sets: name: health-reporter-dump-ts-ns - name: health-reporter-auto-dump + - + name: health-reporter-gp-delay =20 - name: dl-attr-stats @@ -1961,6 +1966,7 @@ operations: - health-reporter-graceful-period - health-reporter-auto-recover - health-reporter-auto-dump + - health-reporter-gp-delay =20 - name: health-reporter-recover diff --git a/Documentation/networking/devlink/devlink-health.rst b/Document= ation/networking/devlink/devlink-health.rst index e0b8cfed610a..07602f678282 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 grace period delay) vs. time passed since last re= cover =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..a47e7f413511 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_GP_DELAY, /* 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 a0269975f592..1e9a2d0d0631 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -113,7 +113,9 @@ __devlink_health_reporter_create(struct devlink *devlin= k, { struct devlink_health_reporter *reporter; =20 - if (WARN_ON(ops->default_graceful_period && !ops->recover)) + if (WARN_ON(ops->default_graceful_period_delay && + !ops->default_graceful_period) || + WARN_ON(ops->default_graceful_period && !ops->recover)) return ERR_PTR(-EINVAL); =20 reporter =3D kzalloc(sizeof(*reporter), GFP_KERNEL); @@ -293,6 +295,11 @@ 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_GP_DELAY, + reporter->graceful_period_delay)) + goto reporter_nest_cancel; if (reporter->ops->recover && nla_put_u8(msg, DEVLINK_ATTR_HEALTH_REPORTER_AUTO_RECOVER, reporter->auto_recover)) @@ -458,16 +465,32 @@ 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_GP_DELAY])) 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->graceful_period_delay =3D 0; + } + + if (info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GP_DELAY]) { + u64 configured_delay =3D + nla_get_u64(info->attrs[DEVLINK_ATTR_HEALTH_REPORTER_GP_DELAY]); + + if (!reporter->graceful_period && configured_delay) { + NL_SET_ERR_MSG_MOD(info->extack, "Cannot set grace period delay without= a grace period."); + return -EINVAL; + } + + reporter->graceful_period_delay =3D configured_delay; + } =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..de3aabba37b5 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_GP_DELAY + 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_GP_DELAY] =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_GP_DELAY, .flags =3D GENL_ADMIN_PERM | GENL_CMD_CAP_DO, }, { --=20 2.31.1 From nobody Mon Oct 6 04:59:35 2025 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.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 CF8C32EE61D; Thu, 24 Jul 2025 20:51:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390275; cv=fail; b=CBS+UjVW8EpMjATcBClUKRLPZdcwuxQhccdzX5Ziq0abnPTkAbKdjYIqCXVGrnhOovg7SL7E1BEjTo5fhGvpobyJtqgcgRijTI6PIdb89VhXQQFX+himFgGhpseRj2jFhdBZVPM6XGNZcK9rQsPxEYG2XO0qNEUttC/7q9eVqIc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753390275; c=relaxed/simple; bh=oK9huO71GVBFPTzg+7HUwEJ6PSx/zgEhF42TvI/9wHw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GIG3SYTPpg/0/C8POsm3xE58YzJCl1G/93RqqqkMZg946KOrJV6F40THIci0yy9dcPU/8oHF21qtpfigxyekLs1V7tAJWrwlLi1IjbQrnD9fBI4G2/QEYsG3Zn2rJ0R584aZy5Z78tnNGhnXOKjlGxGWPcGwWXIlOmjrvaG3too= 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=fH3HSOAI; arc=fail smtp.client-ip=40.107.92.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="fH3HSOAI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jtjiima+MgEyChngK/1U/ZtJn0OMndzIZWvRbsTwvBGFizPq2FcF+Xb4aOyZh7Dhl0qxXZPN9dr1Hs2eqTo1LVF09V5kd0Ox3dbFTiFTulFEFjnNeFIvVDjo5fZBBwEF/8ztcHmcBKP1x+fD/0qJ1b2mR0Ee4KIt3mVTWQf6emgz6RDi6fmuqP1oLRP9yQZdRSTSgbVLqq6niLLU5nhgzI/wVU1M85MYJSF58q+PfDaGwj3IhYaHRdr7HFRw/SaTDPvyOU6erwZAz54e7i+8G6l3c1hL1t/Zl28C7z8312chPI35QL1iSBPV9UC34M4VSxp79l3TWLRuub7CQCimZw== 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=Xt3kHktPKRSnrcenZBz2XPWcf7NMVPM90QGFthmoE+g=; b=omrzr27xRFCBs8q9kIull6JTcNn9HQVfXBf6HMEc/gfYZnWwQYQnI/TvLW/naSQNjAEyULTtagJDk/nP0jO304sDjAMKCq5oLVJ7qTtchssDINtRe/nK3eeeXrI4j536nP5jUyJMMfZkz3+UU+vuUpl4/MixFZvAB5J3XMf+9zO9vzExReY1fGSILq4XtCHepNHS81bQ7cHGmiANzjbAVnaGU6x14Qz9am/WQpPwvf8fEV3lKb5eCUlJhwmRZmzlC0qvikLX7ntwWCMsI0pRCNSKjg+JmH2g11SvIyQbSwe+PfdNCXqAM8oux/KzI7pZfEYvg2qbrG9MbAcROvh/+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=Xt3kHktPKRSnrcenZBz2XPWcf7NMVPM90QGFthmoE+g=; b=fH3HSOAIEdT5W7QG6KnwvgsDDAQo5wW5HUp75UJo0CmOuiFE3Jk8X02lpZo2/uiLcdX7FKYa3F9ZMA/vzSu1NCgWvtnJWKs/dXRpgMGsMxH3FsndNyGXkozwwbQoKAVsxlxXeZCZKDjqij/2rjc+31XSvRh/2/9m9M0V4NyuHujrV+ZTxRnqVE71NK+Z/apoBETZefqSORh6YudyIuEdx4EoiBQHvNnXY9MEd+DsjFW+XpbCV+RVJT6X2xvn4fU5fwTn/fzcc97Bu6kw/zQPvjilfpYkDisRr17nXc82DyfFShc7i4//XUI1X9E2HXhOvi18WLD2w9fXYp6vtt82sw== Received: from CH0PR13CA0039.namprd13.prod.outlook.com (2603:10b6:610:b2::14) by SA5PPF0EB7D076B.namprd12.prod.outlook.com (2603:10b6:80f:fc04::8c5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8943.30; Thu, 24 Jul 2025 20:51:11 +0000 Received: from DS3PEPF0000C37A.namprd04.prod.outlook.com (2603:10b6:610:b2:cafe::dc) by CH0PR13CA0039.outlook.office365.com (2603:10b6:610:b2::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8964.21 via Frontend Transport; Thu, 24 Jul 2025 20:51:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS3PEPF0000C37A.mail.protection.outlook.com (10.167.23.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.20 via Frontend Transport; Thu, 24 Jul 2025 20:51:10 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:51:00 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Thu, 24 Jul 2025 13:50:59 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1544.14 via Frontend Transport; Thu, 24 Jul 2025 13:50:52 -0700 From: Tariq Toukan To: Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , "David S. Miller" , Jiri Pirko , Jiri Pirko CC: Donald Hunter , Jonathan Corbet , Brett Creeley , Michael Chan , Pavan Chebbi , "Cai Huoqing" , Tony Nguyen , Przemek Kitszel , Sunil Goutham , Linu Cherian , Geetha sowjanya , Jerin Jacob , hariprasad , Subbaraya Sundeep , Saeed Mahameed , Leon Romanovsky , Tariq Toukan , Mark Bloch , Ido Schimmel , Petr Machata , Manish Chopra , , , , , , "Shahar Shitrit" , Gal Pressman Subject: [PATCH net-next V2 5/5] net/mlx5e: Set default grace period delay for TX and RX reporters Date: Thu, 24 Jul 2025 23:48:54 +0300 Message-ID: <1753390134-345154-6-git-send-email-tariqt@nvidia.com> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> References: <1753390134-345154-1-git-send-email-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: AnonymousSubmission X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37A:EE_|SA5PPF0EB7D076B:EE_ X-MS-Office365-Filtering-Correlation-Id: bd2d78c7-bf00-476e-3a7e-08ddcaf3d226 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?DUa/9RRbvj4Nolugb0FkEI4xI3YAFHaxq1U4f8fTrcx7wqg5EAsJ+K+Vp6HZ?= =?us-ascii?Q?KJeN+DmzglNnU+xFv8Q2kHju2F0meS6JDhvCGmn+iOSW9qlm6TuU7AwehkmP?= =?us-ascii?Q?u3hY5ioytz4ilQVcx2c1ONHf0k3Xtan16DCafUSO/xWQk+uTt6rWlk2XcmYa?= =?us-ascii?Q?dfoXQJf3Wcyzk0i2x8K7RjH0+vCa9S3ah1mBumPErh9QWYk+vd+Mw4dn429d?= =?us-ascii?Q?AuJn4TAA2PjELbUdzYKEnSpt6Yss+bOQIcSEQfGfutq0n75QiscAmGjz2+iu?= =?us-ascii?Q?45NnlhK+okIVZ2R6PB1M9AImQYwaq8pIdSApjzG4U9SXiKY1FhWSVxgxVcMj?= =?us-ascii?Q?DXKhWOGo7icjhis77EQ7RFey37UfAdmm3q2RrJgUfJiDu5qsXRCQ/lUv/b3k?= =?us-ascii?Q?r8LszQhtjAlZVHMTNO7yRcJV0NKY2mZkGw4YWVpKRlU5/2QSC52l748T/l/r?= =?us-ascii?Q?xmQcn57G/0Ch9M7hdGiIFq7Q4o8ClzmraybzcQ/5yFRNpyY75okvOfibmwZd?= =?us-ascii?Q?2Jyi+o2RxLQTfaZuyNaI1TqaipGDaOfRSJhIQjoXxVykNrzT0wPYgUzBSSHH?= =?us-ascii?Q?suxh5NckilDngu01s3ik9aFKw8mzlI4X3JTnfgU16vRn0cnX9hatrBUh3Zum?= =?us-ascii?Q?VsVxPdB43RaW2KdqbX58d3213juiCp2pGBEeXqX/q+pdYv+HQhPcpbs3QYTo?= =?us-ascii?Q?Efqnkrq+xLIpk/gIjkZsyJjyw3UwFWQe7ssrT9an43kUAoMCBofYvaxdY6ib?= =?us-ascii?Q?wHfwAs6xjNM6uR/US0VVb3GhVCJSwG6JguYOmZDer43OYBWmoNteVUm25apf?= =?us-ascii?Q?cOr7UCliVO6221UB8Jj6/jOiSRjCVFHKEw4jPuWyUM4qb0jgXfJYFEELv+Qb?= =?us-ascii?Q?ypO8J5Z9w2n7U2BRv/tcvTatfleMtlc128icK8yBPS5M7/39TuW5QjqSpvw9?= =?us-ascii?Q?SBqPlWszIHPsxuaY7ppBfb7ISoubzIxttng53SrbuqZir8SH7713roB6j0cO?= =?us-ascii?Q?7o1SC0EUiO/Vp1ac9xZzO7rS0FAIz1a6ScS6nBdPP/FUMJCEgDr3UnAZC+cA?= =?us-ascii?Q?4dTez081dtMaWmt6FtZBzmrFYai7u+Zt1bo/G23apRJIjVW/kGdycKPe2Oie?= =?us-ascii?Q?7x1+VLkCGvpN7PZyuqoo458NxwTRgtAib1icj3IvfDBXWIA1Zr0jQT68YrHs?= =?us-ascii?Q?XZwlAughDCBxK2iVTON8fY6lsWvqsezdlhB9HRnDNMd7d7Phfuk+4E2iJFDw?= =?us-ascii?Q?zx+hEqAGi+CaqGALP/PFK09fhqmj1oDnTRfoHkuRNnkNQLST/W5RddXW8SjM?= =?us-ascii?Q?ODYlY83jTwK6bQfo57dOXV/asLeJ2vE0CeIOMW8pXw4Qgpl5X8qfDlWUoD/v?= =?us-ascii?Q?9vqsUJQ3TTXOD8Al9ud3A0RAQRVK+nrRNr0p0+N620PtaG6h/njPRAQi0TRM?= =?us-ascii?Q?ofU9sO8dXTdpPi++1J/XwrSU0jJpTBxdLpmfcbsc9Y8srqGMdEaOoTv7gbNX?= =?us-ascii?Q?+z+mhRUxPNfPDUFvpDPUeGxdl8F4WQM5gE7j?= X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2025 20:51:10.7477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd2d78c7-bf00-476e-3a7e-08ddcaf3d226 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF0000C37A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA5PPF0EB7D076B Content-Transfer-Encoding: quoted-printable 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 grace period delay to 0.5 second. This allows the reporter to detect and handle all timed-out SQs within this delay window before initiating the grace period. To account for the possibility of a similar issue in the RX reporter, its default grace period delay 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: Carolina Jubran Reviewed-by: Jiri Pirko Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 3 +++ drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 7 +++++-- 2 files changed, 8 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 e106f0696486..feb3f2bce830 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c @@ -645,6 +645,7 @@ void mlx5e_reporter_icosq_resume_recovery(struct mlx5e_= channel *c) } =20 #define MLX5E_REPORTER_RX_GRACEFUL_PERIOD 500 +#define MLX5E_REPORTER_RX_GRACEFUL_PERIOD_DELAY 500 =20 static const struct devlink_health_reporter_ops mlx5_rx_reporter_ops =3D { .name =3D "rx", @@ -652,6 +653,8 @@ 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_graceful_period_delay =3D + MLX5E_REPORTER_RX_GRACEFUL_PERIOD_DELAY, }; =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 6fb0d143ad1b..515b77585926 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c @@ -514,14 +514,17 @@ 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_GRACEFUL_PERIOD_DELAY 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_graceful_period_delay =3D + MLX5E_REPORTER_TX_GRACEFUL_PERIOD_DELAY, }; =20 void mlx5e_reporter_tx_create(struct mlx5e_priv *priv) --=20 2.31.1