@@ -1455,23 +1455,14 @@ shared_ptr<AclRule> AclRule::makeShared(AclOrch *acl, MirrorOrch *mirror, DTelOr
1455
1455
{
1456
1456
return make_shared<AclRulePacket>(acl, rule, table);
1457
1457
}
1458
- else if (aclDTelFlowOpTypeLookup .find (action) != aclDTelFlowOpTypeLookup .cend ())
1458
+ else if (aclDTelActionLookup .find (action) != aclDTelActionLookup .cend ())
1459
1459
{
1460
1460
if (!dtel)
1461
1461
{
1462
1462
throw runtime_error (" DTel feature is not enabled. Watchlists cannot be configured" );
1463
1463
}
1464
1464
1465
- if (action == ACTION_DTEL_DROP_REPORT_ENABLE ||
1466
- action == ACTION_DTEL_TAIL_DROP_REPORT_ENABLE ||
1467
- action == ACTION_DTEL_REPORT_ALL_PACKETS)
1468
- {
1469
- return make_shared<AclRuleDTelDropWatchListEntry>(acl, dtel, rule, table);
1470
- }
1471
- else
1472
- {
1473
- return make_shared<AclRuleDTelFlowWatchListEntry>(acl, dtel, rule, table);
1474
- }
1465
+ return make_shared<AclRuleDTelWatchListEntry>(acl, dtel, rule, table);
1475
1466
}
1476
1467
}
1477
1468
@@ -2447,13 +2438,13 @@ bool AclTable::clear()
2447
2438
return true ;
2448
2439
}
2449
2440
2450
- AclRuleDTelFlowWatchListEntry::AclRuleDTelFlowWatchListEntry (AclOrch *aclOrch, DTelOrch *dtel, string rule, string table) :
2441
+ AclRuleDTelWatchListEntry::AclRuleDTelWatchListEntry (AclOrch *aclOrch, DTelOrch *dtel, string rule, string table) :
2451
2442
AclRule(aclOrch, rule, table),
2452
2443
m_pDTelOrch(dtel)
2453
2444
{
2454
2445
}
2455
2446
2456
- bool AclRuleDTelFlowWatchListEntry ::validateAddAction (string attr_name, string attr_val)
2447
+ bool AclRuleDTelWatchListEntry ::validateAddAction (string attr_name, string attr_val)
2457
2448
{
2458
2449
SWSS_LOG_ENTER ();
2459
2450
@@ -2535,7 +2526,7 @@ bool AclRuleDTelFlowWatchListEntry::validateAddAction(string attr_name, string a
2535
2526
return setAction (aclDTelActionLookup[attr_name], actionData);
2536
2527
}
2537
2528
2538
- bool AclRuleDTelFlowWatchListEntry ::validate ()
2529
+ bool AclRuleDTelWatchListEntry ::validate ()
2539
2530
{
2540
2531
SWSS_LOG_ENTER ();
2541
2532
@@ -2552,19 +2543,19 @@ bool AclRuleDTelFlowWatchListEntry::validate()
2552
2543
return true ;
2553
2544
}
2554
2545
2555
- bool AclRuleDTelFlowWatchListEntry ::createRule ()
2546
+ bool AclRuleDTelWatchListEntry ::createRule ()
2556
2547
{
2557
2548
SWSS_LOG_ENTER ();
2558
2549
2559
2550
return activate ();
2560
2551
}
2561
2552
2562
- bool AclRuleDTelFlowWatchListEntry ::removeRule ()
2553
+ bool AclRuleDTelWatchListEntry ::removeRule ()
2563
2554
{
2564
2555
return deactivate ();
2565
2556
}
2566
2557
2567
- bool AclRuleDTelFlowWatchListEntry ::activate ()
2558
+ bool AclRuleDTelWatchListEntry ::activate ()
2568
2559
{
2569
2560
SWSS_LOG_ENTER ();
2570
2561
@@ -2581,7 +2572,7 @@ bool AclRuleDTelFlowWatchListEntry::activate()
2581
2572
return AclRule::createRule ();
2582
2573
}
2583
2574
2584
- bool AclRuleDTelFlowWatchListEntry ::deactivate ()
2575
+ bool AclRuleDTelWatchListEntry ::deactivate ()
2585
2576
{
2586
2577
SWSS_LOG_ENTER ();
2587
2578
@@ -2612,7 +2603,7 @@ bool AclRuleDTelFlowWatchListEntry::deactivate()
2612
2603
return true ;
2613
2604
}
2614
2605
2615
- void AclRuleDTelFlowWatchListEntry ::onUpdate (SubjectType type, void *cntx)
2606
+ void AclRuleDTelWatchListEntry ::onUpdate (SubjectType type, void *cntx)
2616
2607
{
2617
2608
sai_acl_action_data_t actionData;
2618
2609
sai_object_id_t session_oid = SAI_NULL_OBJECT_ID;
@@ -2673,72 +2664,19 @@ void AclRuleDTelFlowWatchListEntry::onUpdate(SubjectType type, void *cntx)
2673
2664
}
2674
2665
}
2675
2666
2676
- bool AclRuleDTelFlowWatchListEntry ::update (const AclRule& rule)
2667
+ bool AclRuleDTelWatchListEntry ::update (const AclRule& rule)
2677
2668
{
2678
- auto dtelDropWathcListRule = dynamic_cast <const AclRuleDTelFlowWatchListEntry *>(&rule);
2679
- if (!dtelDropWathcListRule )
2669
+ auto dtelWatchListRule = dynamic_cast <const AclRuleDTelWatchListEntry *>(&rule);
2670
+ if (!dtelWatchListRule )
2680
2671
{
2681
- SWSS_LOG_ERROR (" Cannot update DTEL flow watch list rule with a rule of a different type" );
2672
+ SWSS_LOG_ERROR (" Cannot update DTEL watch list rule with a rule of a different type" );
2682
2673
return false ;
2683
2674
}
2684
2675
2685
- SWSS_LOG_ERROR (" Updating DTEL flow watch list rule is currently not implemented" );
2676
+ SWSS_LOG_ERROR (" Updating DTEL watch list rule is currently not implemented" );
2686
2677
return false ;
2687
2678
}
2688
2679
2689
- AclRuleDTelDropWatchListEntry::AclRuleDTelDropWatchListEntry (AclOrch *aclOrch, DTelOrch *dtel, string rule, string table) :
2690
- AclRule(aclOrch, rule, table),
2691
- m_pDTelOrch(dtel)
2692
- {
2693
- }
2694
-
2695
- bool AclRuleDTelDropWatchListEntry::validateAddAction (string attr_name, string attr_val)
2696
- {
2697
- SWSS_LOG_ENTER ();
2698
-
2699
- if (!m_pDTelOrch)
2700
- {
2701
- return false ;
2702
- }
2703
-
2704
- sai_acl_action_data_t actionData;
2705
- string attr_value = to_upper (attr_val);
2706
-
2707
- if (attr_name != ACTION_DTEL_DROP_REPORT_ENABLE &&
2708
- attr_name != ACTION_DTEL_TAIL_DROP_REPORT_ENABLE &&
2709
- attr_name != ACTION_DTEL_REPORT_ALL_PACKETS)
2710
- {
2711
- return false ;
2712
- }
2713
-
2714
- actionData.parameter .booldata = (attr_value == DTEL_ENABLED) ? true : false ;
2715
- actionData.enable = (attr_value == DTEL_ENABLED) ? true : false ;
2716
-
2717
- return setAction (aclDTelActionLookup[attr_name], actionData);
2718
- }
2719
-
2720
- bool AclRuleDTelDropWatchListEntry::validate ()
2721
- {
2722
- SWSS_LOG_ENTER ();
2723
-
2724
- if (!m_pDTelOrch)
2725
- {
2726
- return false ;
2727
- }
2728
-
2729
- if ((m_rangeConfig.empty () && m_matches.empty ()) || m_actions.size () == 0 )
2730
- {
2731
- return false ;
2732
- }
2733
-
2734
- return true ;
2735
- }
2736
-
2737
- void AclRuleDTelDropWatchListEntry::onUpdate (SubjectType, void *)
2738
- {
2739
- // Do nothing
2740
- }
2741
-
2742
2680
AclRange::AclRange (sai_acl_range_type_t type, sai_object_id_t oid, int min, int max):
2743
2681
m_oid(oid), m_refCnt(0 ), m_min(min), m_max(max), m_type(type)
2744
2682
{
@@ -4619,11 +4557,10 @@ void AclOrch::createDTelWatchListTables()
4619
4557
4620
4558
AclTableTypeBuilder builder;
4621
4559
4622
- AclTable flowWLTable (this , TABLE_TYPE_DTEL_FLOW_WATCHLIST);
4623
- AclTable dropWLTable (this , TABLE_TYPE_DTEL_DROP_WATCHLIST);
4560
+ AclTable dtelWLTable (this , TABLE_TYPE_DTEL_FLOW_WATCHLIST);
4624
4561
4625
- flowWLTable .validateAddStage (ACL_STAGE_INGRESS);
4626
- flowWLTable .validateAddType (builder
4562
+ dtelWLTable .validateAddStage (ACL_STAGE_INGRESS);
4563
+ dtelWLTable .validateAddType (builder
4627
4564
.withBindPointType (SAI_ACL_BIND_POINT_TYPE_SWITCH)
4628
4565
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE))
4629
4566
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP))
@@ -4635,39 +4572,35 @@ void AclOrch::createDTelWatchListTables()
4635
4572
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_INNER_ETHER_TYPE))
4636
4573
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_IP))
4637
4574
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_IP))
4575
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID))
4576
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE))
4577
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS))
4578
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_DSCP))
4579
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_SRC_IPV6))
4580
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6))
4581
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ICMP_TYPE))
4582
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ICMP_CODE))
4583
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_TYPE))
4584
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ICMPV6_CODE))
4585
+ .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_IPV6_NEXT_HEADER))
4638
4586
.withAction (SAI_ACL_ACTION_TYPE_ACL_DTEL_FLOW_OP)
4639
4587
.withAction (SAI_ACL_ACTION_TYPE_DTEL_INT_SESSION)
4640
- .withAction (SAI_ACL_ACTION_TYPE_DTEL_REPORT_ALL_PACKETS)
4641
- .withAction (SAI_ACL_ACTION_TYPE_DTEL_FLOW_SAMPLE_PERCENT)
4642
- .build ()
4643
- );
4644
- flowWLTable.setDescription (" Dataplane Telemetry Flow Watchlist table" );
4645
-
4646
- dropWLTable.validateAddStage (ACL_STAGE_INGRESS);
4647
- dropWLTable.validateAddType (builder
4648
- .withBindPointType (SAI_ACL_BIND_POINT_TYPE_SWITCH)
4649
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE))
4650
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_SRC_IP))
4651
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_DST_IP))
4652
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT))
4653
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT))
4654
- .withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_IP_PROTOCOL))
4655
4588
.withAction (SAI_ACL_ACTION_TYPE_DTEL_DROP_REPORT_ENABLE)
4656
4589
.withAction (SAI_ACL_ACTION_TYPE_DTEL_TAIL_DROP_REPORT_ENABLE)
4590
+ .withAction (SAI_ACL_ACTION_TYPE_DTEL_REPORT_ALL_PACKETS)
4591
+ .withAction (SAI_ACL_ACTION_TYPE_DTEL_FLOW_SAMPLE_PERCENT)
4657
4592
.build ()
4658
4593
);
4659
- dropWLTable .setDescription (" Dataplane Telemetry Drop Watchlist table" );
4594
+ dtelWLTable .setDescription (" Dataplane Telemetry Watchlist table" );
4660
4595
4661
- addAclTable (flowWLTable);
4662
- addAclTable (dropWLTable);
4596
+ addAclTable (dtelWLTable);
4663
4597
}
4664
4598
4665
4599
void AclOrch::deleteDTelWatchListTables ()
4666
4600
{
4667
4601
SWSS_LOG_ENTER ();
4668
4602
4669
4603
removeAclTable (TABLE_TYPE_DTEL_FLOW_WATCHLIST);
4670
- removeAclTable (TABLE_TYPE_DTEL_DROP_WATCHLIST);
4671
4604
}
4672
4605
4673
4606
void AclOrch::registerFlexCounter (const AclRule& rule)
0 commit comments