@@ -1235,6 +1235,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
1235
1235
outer_headers );
1236
1236
void * headers_v = MLX5_ADDR_OF (fte_match_param , spec -> match_value ,
1237
1237
outer_headers );
1238
+ void * misc_c = MLX5_ADDR_OF (fte_match_param , spec -> match_criteria ,
1239
+ misc_parameters );
1240
+ void * misc_v = MLX5_ADDR_OF (fte_match_param , spec -> match_value ,
1241
+ misc_parameters );
1238
1242
u16 addr_type = 0 ;
1239
1243
u8 ip_proto = 0 ;
1240
1244
@@ -1245,6 +1249,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
1245
1249
BIT (FLOW_DISSECTOR_KEY_BASIC ) |
1246
1250
BIT (FLOW_DISSECTOR_KEY_ETH_ADDRS ) |
1247
1251
BIT (FLOW_DISSECTOR_KEY_VLAN ) |
1252
+ BIT (FLOW_DISSECTOR_KEY_CVLAN ) |
1248
1253
BIT (FLOW_DISSECTOR_KEY_IPV4_ADDRS ) |
1249
1254
BIT (FLOW_DISSECTOR_KEY_IPV6_ADDRS ) |
1250
1255
BIT (FLOW_DISSECTOR_KEY_PORTS ) |
@@ -1325,9 +1330,18 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
1325
1330
skb_flow_dissector_target (f -> dissector ,
1326
1331
FLOW_DISSECTOR_KEY_VLAN ,
1327
1332
f -> mask );
1328
- if (mask -> vlan_id || mask -> vlan_priority ) {
1329
- MLX5_SET (fte_match_set_lyr_2_4 , headers_c , cvlan_tag , 1 );
1330
- MLX5_SET (fte_match_set_lyr_2_4 , headers_v , cvlan_tag , 1 );
1333
+ if (mask -> vlan_id || mask -> vlan_priority || mask -> vlan_tpid ) {
1334
+ if (key -> vlan_tpid == htons (ETH_P_8021AD )) {
1335
+ MLX5_SET (fte_match_set_lyr_2_4 , headers_c ,
1336
+ svlan_tag , 1 );
1337
+ MLX5_SET (fte_match_set_lyr_2_4 , headers_v ,
1338
+ svlan_tag , 1 );
1339
+ } else {
1340
+ MLX5_SET (fte_match_set_lyr_2_4 , headers_c ,
1341
+ cvlan_tag , 1 );
1342
+ MLX5_SET (fte_match_set_lyr_2_4 , headers_v ,
1343
+ cvlan_tag , 1 );
1344
+ }
1331
1345
1332
1346
MLX5_SET (fte_match_set_lyr_2_4 , headers_c , first_vid , mask -> vlan_id );
1333
1347
MLX5_SET (fte_match_set_lyr_2_4 , headers_v , first_vid , key -> vlan_id );
@@ -1339,6 +1353,41 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
1339
1353
}
1340
1354
}
1341
1355
1356
+ if (dissector_uses_key (f -> dissector , FLOW_DISSECTOR_KEY_CVLAN )) {
1357
+ struct flow_dissector_key_vlan * key =
1358
+ skb_flow_dissector_target (f -> dissector ,
1359
+ FLOW_DISSECTOR_KEY_CVLAN ,
1360
+ f -> key );
1361
+ struct flow_dissector_key_vlan * mask =
1362
+ skb_flow_dissector_target (f -> dissector ,
1363
+ FLOW_DISSECTOR_KEY_CVLAN ,
1364
+ f -> mask );
1365
+ if (mask -> vlan_id || mask -> vlan_priority || mask -> vlan_tpid ) {
1366
+ if (key -> vlan_tpid == htons (ETH_P_8021AD )) {
1367
+ MLX5_SET (fte_match_set_misc , misc_c ,
1368
+ outer_second_svlan_tag , 1 );
1369
+ MLX5_SET (fte_match_set_misc , misc_v ,
1370
+ outer_second_svlan_tag , 1 );
1371
+ } else {
1372
+ MLX5_SET (fte_match_set_misc , misc_c ,
1373
+ outer_second_cvlan_tag , 1 );
1374
+ MLX5_SET (fte_match_set_misc , misc_v ,
1375
+ outer_second_cvlan_tag , 1 );
1376
+ }
1377
+
1378
+ MLX5_SET (fte_match_set_misc , misc_c , outer_second_vid ,
1379
+ mask -> vlan_id );
1380
+ MLX5_SET (fte_match_set_misc , misc_v , outer_second_vid ,
1381
+ key -> vlan_id );
1382
+ MLX5_SET (fte_match_set_misc , misc_c , outer_second_prio ,
1383
+ mask -> vlan_priority );
1384
+ MLX5_SET (fte_match_set_misc , misc_v , outer_second_prio ,
1385
+ key -> vlan_priority );
1386
+
1387
+ * match_level = MLX5_MATCH_L2 ;
1388
+ }
1389
+ }
1390
+
1342
1391
if (dissector_uses_key (f -> dissector , FLOW_DISSECTOR_KEY_BASIC )) {
1343
1392
struct flow_dissector_key_basic * key =
1344
1393
skb_flow_dissector_target (f -> dissector ,
0 commit comments