Skip to content

Commit 1330bd9

Browse files
msanallakuba-moo
authored andcommitted
net/mlx5: Set default grace period based on function type
Currently, driver sets the same grace period for fw fatal health reporter to any type of function. Since the lower level functions are more vulnerable to fw fatal errors as a result of parent function closure/reload, set a smaller grace period for the lower level functions, as follows: 1. For ECPF: 180 seconds. 2. For PF: 60 seconds. 3. For VF/SF: 30 seconds. Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9b98d39 commit 1330bd9

File tree

1 file changed

+16
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+16
-2
lines changed

drivers/net/ethernet/mellanox/mlx5/core/health.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,25 @@ static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_ops = {
702702
.dump = mlx5_fw_fatal_reporter_dump,
703703
};
704704

705-
#define MLX5_REPORTER_FW_GRACEFUL_PERIOD 1200000
705+
#define MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD 180000
706+
#define MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD 60000
707+
#define MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD 30000
708+
#define MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD
709+
706710
static void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
707711
{
708712
struct mlx5_core_health *health = &dev->priv.health;
709713
struct devlink *devlink = priv_to_devlink(dev);
714+
u64 grace_period;
715+
716+
if (mlx5_core_is_ecpf(dev)) {
717+
grace_period = MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD;
718+
} else if (mlx5_core_is_pf(dev)) {
719+
grace_period = MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD;
720+
} else {
721+
/* VF or SF */
722+
grace_period = MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD;
723+
}
710724

711725
health->fw_reporter =
712726
devlink_health_reporter_create(devlink, &mlx5_fw_reporter_ops,
@@ -718,7 +732,7 @@ static void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
718732
health->fw_fatal_reporter =
719733
devlink_health_reporter_create(devlink,
720734
&mlx5_fw_fatal_reporter_ops,
721-
MLX5_REPORTER_FW_GRACEFUL_PERIOD,
735+
grace_period,
722736
dev);
723737
if (IS_ERR(health->fw_fatal_reporter))
724738
mlx5_core_warn(dev, "Failed to create fw fatal reporter, err = %ld\n",

0 commit comments

Comments
 (0)