Commit | Line | Data |
---|---|---|
06e9f13a MM |
1 | /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ |
2 | /* Copyright (c) 2021, Mellanox Technologies inc. All rights reserved. */ | |
3 | ||
4 | #ifndef __MLX5_EN_RQT_H__ | |
5 | #define __MLX5_EN_RQT_H__ | |
6 | ||
7 | #include <linux/kernel.h> | |
8 | ||
74a8dada | 9 | #define MLX5E_INDIR_MIN_RQT_SIZE (BIT(8)) |
06e9f13a MM |
10 | |
11 | struct mlx5_core_dev; | |
12 | ||
13 | struct mlx5e_rss_params_indir { | |
74a8dada AF |
14 | u32 *table; |
15 | u32 actual_table_size; | |
16 | u32 max_table_size; | |
06e9f13a MM |
17 | }; |
18 | ||
43befe99 MM |
19 | void mlx5e_rss_params_indir_init_uniform(struct mlx5e_rss_params_indir *indir, |
20 | unsigned int num_channels); | |
21 | ||
06e9f13a | 22 | struct mlx5e_rqt { |
3fbf6120 | 23 | struct mlx5_core_dev *mdev; |
06e9f13a MM |
24 | u32 rqtn; |
25 | u16 size; | |
26 | }; | |
27 | ||
28 | int mlx5e_rqt_init_direct(struct mlx5e_rqt *rqt, struct mlx5_core_dev *mdev, | |
74a8dada | 29 | bool indir_enabled, u32 init_rqn, u32 indir_table_size); |
06e9f13a | 30 | int mlx5e_rqt_init_indir(struct mlx5e_rqt *rqt, struct mlx5_core_dev *mdev, |
3fbf6120 | 31 | u32 *rqns, unsigned int num_rqns, |
06e9f13a MM |
32 | u8 hfunc, struct mlx5e_rss_params_indir *indir); |
33 | void mlx5e_rqt_destroy(struct mlx5e_rqt *rqt); | |
34 | ||
35 | static inline u32 mlx5e_rqt_get_rqtn(struct mlx5e_rqt *rqt) | |
36 | { | |
37 | return rqt->rqtn; | |
38 | } | |
39 | ||
74a8dada | 40 | u32 mlx5e_rqt_size(struct mlx5_core_dev *mdev, unsigned int num_channels); |
3fbf6120 JK |
41 | int mlx5e_rqt_redirect_direct(struct mlx5e_rqt *rqt, u32 rqn); |
42 | int mlx5e_rqt_redirect_indir(struct mlx5e_rqt *rqt, u32 *rqns, unsigned int num_rqns, | |
06e9f13a MM |
43 | u8 hfunc, struct mlx5e_rss_params_indir *indir); |
44 | ||
45 | #endif /* __MLX5_EN_RQT_H__ */ |