1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021, Mellanox Technologies inc. All rights reserved. */
4 #ifndef __MLX5_EN_RQT_H__
5 #define __MLX5_EN_RQT_H__
7 #include <linux/kernel.h>
9 #define MLX5E_INDIR_MIN_RQT_SIZE (BIT(8))
13 struct mlx5e_rss_params_indir {
15 u32 actual_table_size;
19 void mlx5e_rss_params_indir_init_uniform(struct mlx5e_rss_params_indir *indir,
20 unsigned int num_channels);
23 struct mlx5_core_dev *mdev; /* primary */
28 int mlx5e_rqt_init_direct(struct mlx5e_rqt *rqt, struct mlx5_core_dev *mdev,
29 bool indir_enabled, u32 init_rqn, u32 indir_table_size);
30 int mlx5e_rqt_init_indir(struct mlx5e_rqt *rqt, struct mlx5_core_dev *mdev,
31 u32 *rqns, u32 *vhca_ids, unsigned int num_rqns,
32 u8 hfunc, struct mlx5e_rss_params_indir *indir);
33 void mlx5e_rqt_destroy(struct mlx5e_rqt *rqt);
35 static inline u32 mlx5e_rqt_get_rqtn(struct mlx5e_rqt *rqt)
40 u32 mlx5e_rqt_size(struct mlx5_core_dev *mdev, unsigned int num_channels);
41 unsigned int mlx5e_rqt_max_num_channels_allowed_for_xor8(void);
42 int mlx5e_rqt_redirect_direct(struct mlx5e_rqt *rqt, u32 rqn, u32 *vhca_id);
43 int mlx5e_rqt_redirect_indir(struct mlx5e_rqt *rqt, u32 *rqns, u32 *vhca_ids,
44 unsigned int num_rqns,
45 u8 hfunc, struct mlx5e_rss_params_indir *indir);
47 #endif /* __MLX5_EN_RQT_H__ */