1d63cc249SMaor Gottlieb /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2d63cc249SMaor Gottlieb /* Copyright (c) 2020 Mellanox Technologies inc. */ 3d63cc249SMaor Gottlieb 4d63cc249SMaor Gottlieb #include <linux/mlx5/driver.h> 5d63cc249SMaor Gottlieb 6d63cc249SMaor Gottlieb #ifndef __MLX5_RSC_DUMP 7d63cc249SMaor Gottlieb #define __MLX5_RSC_DUMP 8d63cc249SMaor Gottlieb 9d63cc249SMaor Gottlieb enum mlx5_sgmt_type { 10d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_HW_CQPC, 11d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_HW_SQPC, 12d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_HW_RQPC, 13d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_FULL_SRQC, 14d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_FULL_CQC, 15d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_FULL_EQC, 16d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_FULL_QPC, 17d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_SND_BUFF, 18d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_RCV_BUFF, 19d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_SRQ_BUFF, 20d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_CQ_BUFF, 21d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_EQ_BUFF, 22d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_SX_SLICE, 23d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_SX_SLICE_ALL, 24d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_RDB, 25d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_RX_SLICE_ALL, 26*608ca553SMaor Gottlieb MLX5_SGMT_TYPE_PRM_QUERY_QP, 27*608ca553SMaor Gottlieb MLX5_SGMT_TYPE_PRM_QUERY_CQ, 28*608ca553SMaor Gottlieb MLX5_SGMT_TYPE_PRM_QUERY_MKEY, 29d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_MENU, 30d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_TERMINATE, 31d63cc249SMaor Gottlieb 32d63cc249SMaor Gottlieb MLX5_SGMT_TYPE_NUM, /* Keep last */ 33d63cc249SMaor Gottlieb }; 34d63cc249SMaor Gottlieb 35d63cc249SMaor Gottlieb struct mlx5_rsc_key { 36d63cc249SMaor Gottlieb enum mlx5_sgmt_type rsc; 37d63cc249SMaor Gottlieb int index1; 38d63cc249SMaor Gottlieb int index2; 39d63cc249SMaor Gottlieb int num_of_obj1; 40d63cc249SMaor Gottlieb int num_of_obj2; 41d63cc249SMaor Gottlieb int size; 42d63cc249SMaor Gottlieb }; 43d63cc249SMaor Gottlieb 44d63cc249SMaor Gottlieb struct mlx5_rsc_dump_cmd; 45d63cc249SMaor Gottlieb 46d63cc249SMaor Gottlieb struct mlx5_rsc_dump_cmd *mlx5_rsc_dump_cmd_create(struct mlx5_core_dev *dev, 47d63cc249SMaor Gottlieb struct mlx5_rsc_key *key); 48d63cc249SMaor Gottlieb void mlx5_rsc_dump_cmd_destroy(struct mlx5_rsc_dump_cmd *cmd); 49d63cc249SMaor Gottlieb int mlx5_rsc_dump_next(struct mlx5_core_dev *dev, struct mlx5_rsc_dump_cmd *cmd, 50d63cc249SMaor Gottlieb struct page *page, int *size); 51d63cc249SMaor Gottlieb #endif /* __MLX5_RSC_DUMP */ 52