1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021 Mellanox Technologies. */
3 
4 #ifndef __MLX5_EN_TC_TUN_ENCAP_H__
5 #define __MLX5_EN_TC_TUN_ENCAP_H__
6 
7 #include "tc_priv.h"
8 
9 void mlx5e_detach_encap(struct mlx5e_priv *priv,
10 			struct mlx5e_tc_flow *flow,
11 			struct mlx5_flow_attr *attr,
12 			int out_index);
13 
14 int mlx5e_attach_encap(struct mlx5e_priv *priv,
15 		       struct mlx5e_tc_flow *flow,
16 		       struct mlx5_flow_attr *attr,
17 		       struct net_device *mirred_dev,
18 		       int out_index,
19 		       struct netlink_ext_ack *extack,
20 		       struct net_device **encap_dev,
21 		       bool *encap_valid);
22 
23 int mlx5e_attach_decap(struct mlx5e_priv *priv,
24 		       struct mlx5e_tc_flow *flow,
25 		       struct netlink_ext_ack *extack);
26 void mlx5e_detach_decap(struct mlx5e_priv *priv,
27 			struct mlx5e_tc_flow *flow);
28 
29 int mlx5e_attach_decap_route(struct mlx5e_priv *priv,
30 			     struct mlx5e_tc_flow *flow);
31 void mlx5e_detach_decap_route(struct mlx5e_priv *priv,
32 			      struct mlx5e_tc_flow *flow);
33 
34 struct ip_tunnel_info *mlx5e_dup_tun_info(const struct ip_tunnel_info *tun_info);
35 
36 int mlx5e_tc_set_attr_rx_tun(struct mlx5e_tc_flow *flow,
37 			     struct mlx5_flow_spec *spec);
38 
39 struct mlx5e_tc_tun_encap *mlx5e_tc_tun_init(struct mlx5e_priv *priv);
40 void mlx5e_tc_tun_cleanup(struct mlx5e_tc_tun_encap *encap);
41 
42 #endif /* __MLX5_EN_TC_TUN_ENCAP_H__ */
43