1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2  * Copyright (c) 2019 Mellanox Technologies
3  */
4 
5 #ifndef _MLX5_FS_DR_
6 #define _MLX5_FS_DR_
7 
8 #include "mlx5dr.h"
9 
10 struct mlx5_flow_root_namespace;
11 struct fs_fte;
12 
13 struct mlx5_fs_dr_action {
14 	struct mlx5dr_action *dr_action;
15 };
16 
17 struct mlx5_fs_dr_ns {
18 	struct mlx5_dr_ns *dr_ns;
19 };
20 
21 struct mlx5_fs_dr_rule {
22 	struct mlx5dr_rule    *dr_rule;
23 	/* Only actions created by fs_dr */
24 	struct mlx5dr_action  **dr_actions;
25 	int                      num_actions;
26 };
27 
28 struct mlx5_fs_dr_domain {
29 	struct mlx5dr_domain	*dr_domain;
30 };
31 
32 struct mlx5_fs_dr_matcher {
33 	struct mlx5dr_matcher *dr_matcher;
34 };
35 
36 struct mlx5_fs_dr_table {
37 	struct mlx5dr_table  *dr_table;
38 	struct mlx5dr_action *miss_action;
39 };
40 
41 #ifdef CONFIG_MLX5_SW_STEERING
42 
43 bool mlx5_fs_dr_is_supported(struct mlx5_core_dev *dev);
44 
45 const struct mlx5_flow_cmds *mlx5_fs_cmd_get_dr_cmds(void);
46 
47 #else
48 
49 static inline const struct mlx5_flow_cmds *mlx5_fs_cmd_get_dr_cmds(void)
50 {
51 	return NULL;
52 }
53 
54 static inline bool mlx5_fs_dr_is_supported(struct mlx5_core_dev *dev)
55 {
56 	return false;
57 }
58 
59 #endif /* CONFIG_MLX5_SW_STEERING */
60 #endif
61