55#define __MLX5E_FLOW_STEER_H__
66
77#include "mod_hdr.h"
8+ #include "lib/fs_ttc.h"
89
910enum {
1011 MLX5E_TC_FT_LEVEL = 0 ,
@@ -67,21 +68,6 @@ struct mlx5e_l2_table {
6768 bool promisc_enabled ;
6869};
6970
70- enum mlx5_traffic_types {
71- MLX5_TT_IPV4_TCP ,
72- MLX5_TT_IPV6_TCP ,
73- MLX5_TT_IPV4_UDP ,
74- MLX5_TT_IPV6_UDP ,
75- MLX5_TT_IPV4_IPSEC_AH ,
76- MLX5_TT_IPV6_IPSEC_AH ,
77- MLX5_TT_IPV4_IPSEC_ESP ,
78- MLX5_TT_IPV6_IPSEC_ESP ,
79- MLX5_TT_IPV4 ,
80- MLX5_TT_IPV6 ,
81- MLX5_TT_ANY ,
82- MLX5_NUM_TT ,
83- };
84-
8571#define MLX5E_NUM_INDIR_TIRS (MLX5_NUM_TT - 1)
8672
8773#define MLX5_HASH_IP (MLX5_HASH_FIELD_SEL_SRC_IP |\
@@ -94,32 +80,6 @@ enum mlx5_traffic_types {
9480 MLX5_HASH_FIELD_SEL_DST_IP |\
9581 MLX5_HASH_FIELD_SEL_IPSEC_SPI)
9682
97- enum mlx5_tunnel_types {
98- MLX5_TT_IPV4_GRE ,
99- MLX5_TT_IPV6_GRE ,
100- MLX5_TT_IPV4_IPIP ,
101- MLX5_TT_IPV6_IPIP ,
102- MLX5_TT_IPV4_IPV6 ,
103- MLX5_TT_IPV6_IPV6 ,
104- MLX5_NUM_TUNNEL_TT ,
105- };
106-
107- bool mlx5_tunnel_inner_ft_supported (struct mlx5_core_dev * mdev );
108-
109- struct mlx5_ttc_rule {
110- struct mlx5_flow_handle * rule ;
111- struct mlx5_flow_destination default_dest ;
112- };
113-
114- /* L3/L4 traffic type classifier */
115- struct mlx5_ttc_table {
116- int num_groups ;
117- struct mlx5_flow_table * t ;
118- struct mlx5_flow_group * * g ;
119- struct mlx5_ttc_rule rules [MLX5_NUM_TT ];
120- struct mlx5_flow_handle * tunnel_rules [MLX5_NUM_TUNNEL_TT ];
121- };
122-
12383/* NIC prio FTS */
12484enum {
12585 MLX5E_PROMISC_FT_LEVEL ,
@@ -141,22 +101,6 @@ enum {
141101#endif
142102};
143103
144- #define MLX5_TTC_NUM_GROUPS 3
145- #define MLX5_TTC_GROUP1_SIZE (BIT(3) + MLX5_NUM_TUNNEL_TT)
146- #define MLX5_TTC_GROUP2_SIZE BIT(1)
147- #define MLX5_TTC_GROUP3_SIZE BIT(0)
148- #define MLX5_TTC_TABLE_SIZE (MLX5_TTC_GROUP1_SIZE +\
149- MLX5_TTC_GROUP2_SIZE +\
150- MLX5_TTC_GROUP3_SIZE)
151-
152- #define MLX5_INNER_TTC_NUM_GROUPS 3
153- #define MLX5_INNER_TTC_GROUP1_SIZE BIT(3)
154- #define MLX5_INNER_TTC_GROUP2_SIZE BIT(1)
155- #define MLX5_INNER_TTC_GROUP3_SIZE BIT(0)
156- #define MLX5_INNER_TTC_TABLE_SIZE (MLX5_INNER_TTC_GROUP1_SIZE +\
157- MLX5_INNER_TTC_GROUP2_SIZE +\
158- MLX5_INNER_TTC_GROUP3_SIZE)
159-
160104struct mlx5e_priv ;
161105
162106#ifdef CONFIG_MLX5_EN_RXNFC
@@ -238,37 +182,17 @@ struct mlx5e_flow_steering {
238182 struct mlx5e_ptp_fs * ptp_fs ;
239183};
240184
241- struct ttc_params {
242- struct mlx5_flow_namespace * ns ;
243- struct mlx5_flow_table_attr ft_attr ;
244- struct mlx5_flow_destination dests [MLX5_NUM_TT ];
245- bool inner_ttc ;
246- struct mlx5_flow_destination tunnel_dests [MLX5_NUM_TUNNEL_TT ];
247- };
248-
249185void mlx5e_set_ttc_params (struct mlx5e_priv * priv ,
250186 struct ttc_params * ttc_params , bool tunnel );
251187
252- int mlx5_create_ttc_table (struct mlx5_core_dev * dev , struct ttc_params * params ,
253- struct mlx5_ttc_table * ttc );
254- void mlx5_destroy_ttc_table (struct mlx5_ttc_table * ttc );
255-
256188void mlx5e_destroy_flow_table (struct mlx5e_flow_table * ft );
257- int mlx5_ttc_fwd_dest (struct mlx5_ttc_table * ttc , enum mlx5_traffic_types type ,
258- struct mlx5_flow_destination * new_dest );
259- struct mlx5_flow_destination
260- mlx5_ttc_get_default_dest (struct mlx5_ttc_table * ttc ,
261- enum mlx5_traffic_types type );
262- int mlx5_ttc_fwd_default_dest (struct mlx5_ttc_table * ttc ,
263- enum mlx5_traffic_types type );
264189
265190void mlx5e_enable_cvlan_filter (struct mlx5e_priv * priv );
266191void mlx5e_disable_cvlan_filter (struct mlx5e_priv * priv );
267192
268193int mlx5e_create_flow_steering (struct mlx5e_priv * priv );
269194void mlx5e_destroy_flow_steering (struct mlx5e_priv * priv );
270195
271- u8 mlx5_get_proto_by_tunnel_type (enum mlx5_tunnel_types tt );
272196int mlx5e_add_vlan_trap (struct mlx5e_priv * priv , int trap_id , int tir_num );
273197void mlx5e_remove_vlan_trap (struct mlx5e_priv * priv );
274198int mlx5e_add_mac_trap (struct mlx5e_priv * priv , int trap_id , int tir_num );
0 commit comments