Skip to content

Commit 17aa2d7

Browse files
mosheshemesh2Saeed Mahameed
authored andcommitted
net/mlx5: remove fw reporter dump option for non PF
In case function is not a Physical Function it is not allowed to get FW core dump, so if tried it will fail the fw health reporter dump option. Instead of failing, 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 daa6a6e commit 17aa2d7

File tree

1 file changed

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

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,12 +555,17 @@ static void mlx5_fw_reporter_err_work(struct work_struct *work)
555555
&fw_reporter_ctx);
556556
}
557557

558-
static const struct devlink_health_reporter_ops mlx5_fw_reporter_ops = {
558+
static const struct devlink_health_reporter_ops mlx5_fw_reporter_pf_ops = {
559559
.name = "fw",
560560
.diagnose = mlx5_fw_reporter_diagnose,
561561
.dump = mlx5_fw_reporter_dump,
562562
};
563563

564+
static const struct devlink_health_reporter_ops mlx5_fw_reporter_ops = {
565+
.name = "fw",
566+
.diagnose = mlx5_fw_reporter_diagnose,
567+
};
568+
564569
static int
565570
mlx5_fw_fatal_reporter_recover(struct devlink_health_reporter *reporter,
566571
void *priv_ctx,
@@ -666,10 +671,12 @@ void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
666671
{
667672
const struct devlink_health_reporter_ops *fw_fatal_ops;
668673
struct mlx5_core_health *health = &dev->priv.health;
674+
const struct devlink_health_reporter_ops *fw_ops;
669675
struct devlink *devlink = priv_to_devlink(dev);
670676
u64 grace_period;
671677

672678
fw_fatal_ops = &mlx5_fw_fatal_reporter_pf_ops;
679+
fw_ops = &mlx5_fw_reporter_pf_ops;
673680
if (mlx5_core_is_ecpf(dev)) {
674681
grace_period = MLX5_FW_REPORTER_ECPF_GRACEFUL_PERIOD;
675682
} else if (mlx5_core_is_pf(dev)) {
@@ -678,11 +685,11 @@ void mlx5_fw_reporters_create(struct mlx5_core_dev *dev)
678685
/* VF or SF */
679686
grace_period = MLX5_FW_REPORTER_DEFAULT_GRACEFUL_PERIOD;
680687
fw_fatal_ops = &mlx5_fw_fatal_reporter_ops;
688+
fw_ops = &mlx5_fw_reporter_ops;
681689
}
682690

683691
health->fw_reporter =
684-
devl_health_reporter_create(devlink, &mlx5_fw_reporter_ops,
685-
0, dev);
692+
devl_health_reporter_create(devlink, fw_ops, 0, dev);
686693
if (IS_ERR(health->fw_reporter))
687694
mlx5_core_warn(dev, "Failed to create fw reporter, err = %ld\n",
688695
PTR_ERR(health->fw_reporter));

0 commit comments

Comments
 (0)