Skip to content

Commit c82d360

Browse files
Tariq ToukanSaeed Mahameed
authored andcommitted
net/mlx5: SD, Add informative prints in kernel log
Print to kernel log when an SD group moves from/to ready state. Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 605fcce commit c82d360

File tree

1 file changed

+21
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+21
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/sd.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,21 @@ static void sd_cmd_unset_secondary(struct mlx5_core_dev *secondary)
373373
mlx5_fs_cmd_set_l2table_entry_silent(secondary, 0);
374374
}
375375

376+
static void sd_print_group(struct mlx5_core_dev *primary)
377+
{
378+
struct mlx5_sd *sd = mlx5_get_sd(primary);
379+
struct mlx5_core_dev *pos;
380+
int i;
381+
382+
sd_info(primary, "group id %#x, primary %s, vhca %u\n",
383+
sd->group_id, pci_name(primary->pdev),
384+
MLX5_CAP_GEN(primary, vhca_id));
385+
mlx5_sd_for_each_secondary(i, primary, pos)
386+
sd_info(primary, "group id %#x, secondary#%d %s, vhca %u\n",
387+
sd->group_id, i - 1, pci_name(pos->pdev),
388+
MLX5_CAP_GEN(pos, vhca_id));
389+
}
390+
376391
int mlx5_sd_init(struct mlx5_core_dev *dev)
377392
{
378393
struct mlx5_core_dev *primary, *pos, *to;
@@ -410,6 +425,10 @@ int mlx5_sd_init(struct mlx5_core_dev *dev)
410425
goto err_unset_secondaries;
411426
}
412427

428+
sd_info(primary, "group id %#x, size %d, combined\n",
429+
sd->group_id, mlx5_devcom_comp_get_size(sd->devcom));
430+
sd_print_group(primary);
431+
413432
return 0;
414433

415434
err_unset_secondaries:
@@ -440,6 +459,8 @@ void mlx5_sd_cleanup(struct mlx5_core_dev *dev)
440459
mlx5_sd_for_each_secondary(i, primary, pos)
441460
sd_cmd_unset_secondary(pos);
442461
sd_cmd_unset_primary(primary);
462+
463+
sd_info(primary, "group id %#x, uncombined\n", sd->group_id);
443464
out:
444465
sd_unregister(dev);
445466
sd_cleanup(dev);

0 commit comments

Comments
 (0)