Skip to content

Commit 9965bbe

Browse files
msanallaSaeed Mahameed
authored andcommitted
net/mlx5: Expose SF firmware pages counter
Currently, each core device has VF pages counter which stores number of fw pages used by its VFs and SFs. The current design led to a hang when performing firmware reset on DPU, where the DPU PFs stalled in sriov unload flow due to waiting on release of SFs pages instead of waiting on only VFs pages. Thus, Add a separate counter for SF firmware pages, which will prevent the stall scenario described above. Fixes: 1958fc2 ("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Maher Sanalla <[email protected]> Reviewed-by: Shay Drory <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent c3bdbae commit 9965bbe

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ void mlx5_pages_debugfs_init(struct mlx5_core_dev *dev)
246246

247247
debugfs_create_u32("fw_pages_total", 0400, pages, &dev->priv.fw_pages);
248248
debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.page_counters[MLX5_VF]);
249+
debugfs_create_u32("fw_pages_sfs", 0400, pages, &dev->priv.page_counters[MLX5_SF]);
249250
debugfs_create_u32("fw_pages_host_pf", 0400, pages, &dev->priv.page_counters[MLX5_HOST_PF]);
250251
debugfs_create_u32("fw_pages_alloc_failed", 0400, pages, &dev->priv.fw_pages_alloc_failed);
251252
debugfs_create_u32("fw_pages_give_dropped", 0400, pages, &dev->priv.give_pages_dropped);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static u16 func_id_to_type(struct mlx5_core_dev *dev, u16 func_id, bool ec_funct
7979
if (!func_id)
8080
return mlx5_core_is_ecpf(dev) && !ec_function ? MLX5_HOST_PF : MLX5_PF;
8181

82-
return MLX5_VF;
82+
return func_id <= mlx5_core_max_vfs(dev) ? MLX5_VF : MLX5_SF;
8383
}
8484

8585
static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function)

include/linux/mlx5/driver.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ struct mlx5_debugfs_entries {
576576
enum mlx5_func_type {
577577
MLX5_PF,
578578
MLX5_VF,
579+
MLX5_SF,
579580
MLX5_HOST_PF,
580581
MLX5_FUNC_TYPE_NUM,
581582
};

0 commit comments

Comments
 (0)