Skip to content

Commit daa6a6e

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
net/mlx5: remove fw_fatal reporter dump option for non PF
In case function is not a Physical Function it is not allowed to collect crdump, so if tried it will fail the fw_fatal health reporter dump option. Instead of failing on permission, remove the option of fw_fatal health reporter dump for such function. Signed-off-by: Moshe Shemesh <[email protected]> Reviewed-by: Aya Levin <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8d7db0a commit daa6a6e

File tree

1 file changed

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

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,30 +646,38 @@ static void mlx5_fw_fatal_reporter_err_work(struct work_struct *work)
646646
}
647647
}
648648

649-
static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_ops = {
649+
static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_pf_ops = {
650650
.name = "fw_fatal",
651651
.recover = mlx5_fw_fatal_reporter_recover,
652652
.dump = mlx5_fw_fatal_reporter_dump,
653653
};
654654

655+
static const struct devlink_health_reporter_ops mlx5_fw_fatal_reporter_ops = {
656+
.name = "fw_fatal",
657+
.recover = mlx5_fw_fatal_reporter_recover,
658+
};
659+
655660
#define MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD 180000
656661
#define MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD 60000
657662
#define MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD 30000
658663
#define MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD MLX5_FW_REPORTER_VF_GRACEFUL_PERIOD
659664

660665
void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
661666
{
667+
const struct devlink_health_reporter_ops *fw_fatal_ops;
662668
struct mlx5_core_health *health = &dev->priv.health;
663669
struct devlink *devlink = priv_to_devlink(dev);
664670
u64 grace_period;
665671

672+
fw_fatal_ops = &mlx5_fw_fatal_reporter_pf_ops;
666673
if (mlx5_core_is_ecpf(dev)) {
667674
grace_period = MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD;
668675
} else if (mlx5_core_is_pf(dev)) {
669676
grace_period = MLX5_FW_REPORTER_PF_GRACEFUL_PERIOD;
670677
} else {
671678
/* VF or SF */
672679
grace_period = MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD;
680+
fw_fatal_ops = &mlx5_fw_fatal_reporter_ops;
673681
}
674682

675683
health->fw_reporter =
@@ -681,7 +689,7 @@ void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
681689

682690
health->fw_fatal_reporter =
683691
devl_health_reporter_create(devlink,
684-
&mlx5_fw_fatal_reporter_ops,
692+
fw_fatal_ops,
685693
grace_period,
686694
dev);
687695
if (IS_ERR(health->fw_fatal_reporter))

0 commit comments

Comments
 (0)