1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_POST_ACTION_H__
5 #define __MLX5_POST_ACTION_H__
6 
7 #include "en.h"
8 #include "lib/fs_chains.h"
9 
10 struct mlx5_flow_attr;
11 struct mlx5e_priv;
12 struct mlx5e_tc_mod_hdr_acts;
13 
14 struct mlx5e_post_act *
15 mlx5e_tc_post_act_init(struct mlx5e_priv *priv, struct mlx5_fs_chains *chains,
16 		       enum mlx5_flow_namespace_type ns_type);
17 
18 void
19 mlx5e_tc_post_act_destroy(struct mlx5e_post_act *post_act);
20 
21 struct mlx5e_post_act_handle *
22 mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *attr);
23 
24 void
25 mlx5e_tc_post_act_del(struct mlx5e_post_act *post_act, struct mlx5e_post_act_handle *handle);
26 
27 int
28 mlx5e_tc_post_act_offload(struct mlx5e_post_act *post_act,
29 			  struct mlx5e_post_act_handle *handle);
30 
31 void
32 mlx5e_tc_post_act_unoffload(struct mlx5e_post_act *post_act,
33 			    struct mlx5e_post_act_handle *handle);
34 
35 struct mlx5_flow_table *
36 mlx5e_tc_post_act_get_ft(struct mlx5e_post_act *post_act);
37 
38 int
39 mlx5e_tc_post_act_set_handle(struct mlx5_core_dev *dev,
40 			     struct mlx5e_post_act_handle *handle,
41 			     struct mlx5e_tc_mod_hdr_acts *acts);
42 
43 #endif /* __MLX5_POST_ACTION_H__ */
44