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, int out_index);
11 
12 int mlx5e_attach_encap(struct mlx5e_priv *priv,
13 		       struct mlx5e_tc_flow *flow,
14 		       struct net_device *mirred_dev,
15 		       int out_index,
16 		       struct netlink_ext_ack *extack,
17 		       struct net_device **encap_dev,
18 		       bool *encap_valid);
19 int mlx5e_attach_decap(struct mlx5e_priv *priv,
20 		       struct mlx5e_tc_flow *flow,
21 		       struct netlink_ext_ack *extack);
22 void mlx5e_detach_decap(struct mlx5e_priv *priv,
23 			struct mlx5e_tc_flow *flow);
24 
25 int mlx5e_attach_decap_route(struct mlx5e_priv *priv,
26 			     struct mlx5e_tc_flow *flow);
27 void mlx5e_detach_decap_route(struct mlx5e_priv *priv,
28 			      struct mlx5e_tc_flow *flow);
29 
30 struct ip_tunnel_info *mlx5e_dup_tun_info(const struct ip_tunnel_info *tun_info);
31 
32 int mlx5e_tc_set_attr_rx_tun(struct mlx5e_tc_flow *flow,
33 			     struct mlx5_flow_spec *spec);
34 
35 struct mlx5e_tc_tun_encap *mlx5e_tc_tun_init(struct mlx5e_priv *priv);
36 void mlx5e_tc_tun_cleanup(struct mlx5e_tc_tun_encap *encap);
37 
38 #endif /* __MLX5_EN_TC_TUN_ENCAP_H__ */
39