1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2018 Mellanox Technologies. */
4 #ifndef __MLX5_EN_TC_TUNNEL_H__
5 #define __MLX5_EN_TC_TUNNEL_H__
7 #include <linux/netdevice.h>
8 #include <linux/mlx5/fs.h>
9 #include <net/pkt_cls.h>
10 #include <linux/netlink.h>
15 MLX5E_TC_TUNNEL_TYPE_UNKNOWN,
16 MLX5E_TC_TUNNEL_TYPE_VXLAN,
17 MLX5E_TC_TUNNEL_TYPE_GRETAP
20 int mlx5e_tc_tun_init_encap_attr(struct net_device *tunnel_dev,
21 struct mlx5e_priv *priv,
22 struct mlx5e_encap_entry *e,
23 struct netlink_ext_ack *extack);
25 int mlx5e_tc_tun_create_header_ipv4(struct mlx5e_priv *priv,
26 struct net_device *mirred_dev,
27 struct mlx5e_encap_entry *e);
29 int mlx5e_tc_tun_create_header_ipv6(struct mlx5e_priv *priv,
30 struct net_device *mirred_dev,
31 struct mlx5e_encap_entry *e);
33 int mlx5e_tc_tun_get_type(struct net_device *tunnel_dev);
34 bool mlx5e_tc_tun_device_to_offload(struct mlx5e_priv *priv,
35 struct net_device *netdev);
37 int mlx5e_tc_tun_parse(struct net_device *filter_dev,
38 struct mlx5e_priv *priv,
39 struct mlx5_flow_spec *spec,
40 struct tc_cls_flower_offload *f,
42 void *headers_v, u8 *match_level);
44 #endif //__MLX5_EN_TC_TUNNEL_H__