@@ -105,6 +105,22 @@ static void mlx5e_del_eth_addr_from_flow_table(struct mlx5e_priv *priv,
105
105
{
106
106
void * ft = priv -> ft .main ;
107
107
108
+ if (ai -> tt_vec & BIT (MLX5E_TT_IPV6_IPSEC_ESP ))
109
+ mlx5_del_flow_table_entry (ft ,
110
+ ai -> ft_ix [MLX5E_TT_IPV6_IPSEC_ESP ]);
111
+
112
+ if (ai -> tt_vec & BIT (MLX5E_TT_IPV4_IPSEC_ESP ))
113
+ mlx5_del_flow_table_entry (ft ,
114
+ ai -> ft_ix [MLX5E_TT_IPV4_IPSEC_ESP ]);
115
+
116
+ if (ai -> tt_vec & BIT (MLX5E_TT_IPV6_IPSEC_AH ))
117
+ mlx5_del_flow_table_entry (ft ,
118
+ ai -> ft_ix [MLX5E_TT_IPV6_IPSEC_AH ]);
119
+
120
+ if (ai -> tt_vec & BIT (MLX5E_TT_IPV4_IPSEC_AH ))
121
+ mlx5_del_flow_table_entry (ft ,
122
+ ai -> ft_ix [MLX5E_TT_IPV4_IPSEC_AH ]);
123
+
108
124
if (ai -> tt_vec & BIT (MLX5E_TT_IPV6_TCP ))
109
125
mlx5_del_flow_table_entry (ft , ai -> ft_ix [MLX5E_TT_IPV6_TCP ]);
110
126
@@ -160,6 +176,10 @@ static u32 mlx5e_get_tt_vec(struct mlx5e_eth_addr_info *ai, int type)
160
176
BIT (MLX5E_TT_IPV6_TCP ) |
161
177
BIT (MLX5E_TT_IPV4_UDP ) |
162
178
BIT (MLX5E_TT_IPV6_UDP ) |
179
+ BIT (MLX5E_TT_IPV4_IPSEC_AH ) |
180
+ BIT (MLX5E_TT_IPV6_IPSEC_AH ) |
181
+ BIT (MLX5E_TT_IPV4_IPSEC_ESP ) |
182
+ BIT (MLX5E_TT_IPV6_IPSEC_ESP ) |
163
183
BIT (MLX5E_TT_IPV4 ) |
164
184
BIT (MLX5E_TT_IPV6 ) |
165
185
BIT (MLX5E_TT_ANY ) |
@@ -205,6 +225,10 @@ static u32 mlx5e_get_tt_vec(struct mlx5e_eth_addr_info *ai, int type)
205
225
BIT (MLX5E_TT_IPV6_TCP ) |
206
226
BIT (MLX5E_TT_IPV4_UDP ) |
207
227
BIT (MLX5E_TT_IPV6_UDP ) |
228
+ BIT (MLX5E_TT_IPV4_IPSEC_AH ) |
229
+ BIT (MLX5E_TT_IPV6_IPSEC_AH ) |
230
+ BIT (MLX5E_TT_IPV4_IPSEC_ESP ) |
231
+ BIT (MLX5E_TT_IPV6_IPSEC_ESP ) |
208
232
BIT (MLX5E_TT_IPV4 ) |
209
233
BIT (MLX5E_TT_IPV6 ) |
210
234
BIT (MLX5E_TT_ANY ) |
@@ -377,6 +401,72 @@ static int __mlx5e_add_eth_addr_rule(struct mlx5e_priv *priv,
377
401
ai -> tt_vec |= BIT (MLX5E_TT_IPV6_TCP );
378
402
}
379
403
404
+ MLX5_SET (fte_match_param , match_value , outer_headers .ip_protocol ,
405
+ IPPROTO_AH );
406
+
407
+ ft_ix = & ai -> ft_ix [MLX5E_TT_IPV4_IPSEC_AH ];
408
+ if (tt_vec & BIT (MLX5E_TT_IPV4_IPSEC_AH )) {
409
+ MLX5_SET (fte_match_param , match_value , outer_headers .ethertype ,
410
+ ETH_P_IP );
411
+ MLX5_SET (dest_format_struct , dest , destination_id ,
412
+ tirn [MLX5E_TT_IPV4_IPSEC_AH ]);
413
+ err = mlx5_add_flow_table_entry (ft , match_criteria_enable ,
414
+ match_criteria , flow_context ,
415
+ ft_ix );
416
+ if (err )
417
+ goto err_del_ai ;
418
+
419
+ ai -> tt_vec |= BIT (MLX5E_TT_IPV4_IPSEC_AH );
420
+ }
421
+
422
+ ft_ix = & ai -> ft_ix [MLX5E_TT_IPV6_IPSEC_AH ];
423
+ if (tt_vec & BIT (MLX5E_TT_IPV6_IPSEC_AH )) {
424
+ MLX5_SET (fte_match_param , match_value , outer_headers .ethertype ,
425
+ ETH_P_IPV6 );
426
+ MLX5_SET (dest_format_struct , dest , destination_id ,
427
+ tirn [MLX5E_TT_IPV6_IPSEC_AH ]);
428
+ err = mlx5_add_flow_table_entry (ft , match_criteria_enable ,
429
+ match_criteria , flow_context ,
430
+ ft_ix );
431
+ if (err )
432
+ goto err_del_ai ;
433
+
434
+ ai -> tt_vec |= BIT (MLX5E_TT_IPV6_IPSEC_AH );
435
+ }
436
+
437
+ MLX5_SET (fte_match_param , match_value , outer_headers .ip_protocol ,
438
+ IPPROTO_ESP );
439
+
440
+ ft_ix = & ai -> ft_ix [MLX5E_TT_IPV4_IPSEC_ESP ];
441
+ if (tt_vec & BIT (MLX5E_TT_IPV4_IPSEC_ESP )) {
442
+ MLX5_SET (fte_match_param , match_value , outer_headers .ethertype ,
443
+ ETH_P_IP );
444
+ MLX5_SET (dest_format_struct , dest , destination_id ,
445
+ tirn [MLX5E_TT_IPV4_IPSEC_ESP ]);
446
+ err = mlx5_add_flow_table_entry (ft , match_criteria_enable ,
447
+ match_criteria , flow_context ,
448
+ ft_ix );
449
+ if (err )
450
+ goto err_del_ai ;
451
+
452
+ ai -> tt_vec |= BIT (MLX5E_TT_IPV4_IPSEC_ESP );
453
+ }
454
+
455
+ ft_ix = & ai -> ft_ix [MLX5E_TT_IPV6_IPSEC_ESP ];
456
+ if (tt_vec & BIT (MLX5E_TT_IPV6_IPSEC_ESP )) {
457
+ MLX5_SET (fte_match_param , match_value , outer_headers .ethertype ,
458
+ ETH_P_IPV6 );
459
+ MLX5_SET (dest_format_struct , dest , destination_id ,
460
+ tirn [MLX5E_TT_IPV6_IPSEC_ESP ]);
461
+ err = mlx5_add_flow_table_entry (ft , match_criteria_enable ,
462
+ match_criteria , flow_context ,
463
+ ft_ix );
464
+ if (err )
465
+ goto err_del_ai ;
466
+
467
+ ai -> tt_vec |= BIT (MLX5E_TT_IPV6_IPSEC_ESP );
468
+ }
469
+
380
470
return 0 ;
381
471
382
472
err_del_ai :
@@ -731,7 +821,7 @@ static int mlx5e_create_main_flow_table(struct mlx5e_priv *priv)
731
821
if (!g )
732
822
return - ENOMEM ;
733
823
734
- g [0 ].log_sz = 2 ;
824
+ g [0 ].log_sz = 3 ;
735
825
g [0 ].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS ;
736
826
MLX5_SET_TO_ONES (fte_match_param , g [0 ].match_criteria ,
737
827
outer_headers .ethertype );
0 commit comments