@@ -86,13 +86,14 @@ acl_dtel_flow_op_type_lookup_t aclDTelFlowOpTypeLookup =
8686
8787static acl_table_type_lookup_t aclTableTypeLookUp =
8888{
89- { TABLE_TYPE_L3, ACL_TABLE_L3 },
90- { TABLE_TYPE_L3V6, ACL_TABLE_L3V6 },
91- { TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR },
92- { TABLE_TYPE_MIRRORV6, ACL_TABLE_MIRRORV6 },
93- { TABLE_TYPE_CTRLPLANE, ACL_TABLE_CTRLPLANE },
94- { TABLE_TYPE_DTEL_FLOW_WATCHLIST, ACL_TABLE_DTEL_FLOW_WATCHLIST },
95- { TABLE_TYPE_DTEL_DROP_WATCHLIST, ACL_TABLE_DTEL_DROP_WATCHLIST }
89+ { TABLE_TYPE_L3, ACL_TABLE_L3 },
90+ { TABLE_TYPE_L3V6, ACL_TABLE_L3V6 },
91+ { TABLE_TYPE_MIRROR, ACL_TABLE_MIRROR },
92+ { TABLE_TYPE_MIRRORV6, ACL_TABLE_MIRRORV6 },
93+ { TABLE_TYPE_MIRROR_DSCP, ACL_TABLE_MIRROR_DSCP },
94+ { TABLE_TYPE_CTRLPLANE, ACL_TABLE_CTRLPLANE },
95+ { TABLE_TYPE_DTEL_FLOW_WATCHLIST, ACL_TABLE_DTEL_FLOW_WATCHLIST },
96+ { TABLE_TYPE_DTEL_DROP_WATCHLIST, ACL_TABLE_DTEL_DROP_WATCHLIST }
9697};
9798
9899static acl_stage_type_lookup_t aclStageLookUp =
@@ -604,6 +605,7 @@ shared_ptr<AclRule> AclRule::makeShared(acl_table_type_t type, AclOrch *acl, Mir
604605 type != ACL_TABLE_L3V6 &&
605606 type != ACL_TABLE_MIRROR &&
606607 type != ACL_TABLE_MIRRORV6 &&
608+ type != ACL_TABLE_MIRROR_DSCP &&
607609 type != ACL_TABLE_DTEL_FLOW_WATCHLIST &&
608610 type != ACL_TABLE_DTEL_DROP_WATCHLIST)
609611 {
@@ -974,7 +976,14 @@ bool AclRuleMirror::validateAddMatch(string attr_name, string attr_value)
974976 if ((m_tableType == ACL_TABLE_L3 || m_tableType == ACL_TABLE_L3V6)
975977 && attr_name == MATCH_DSCP)
976978 {
977- SWSS_LOG_ERROR (" DSCP match is not supported for the tables of type L3" );
979+ SWSS_LOG_ERROR (" DSCP match is not supported for the table of type L3" );
980+ return false ;
981+ }
982+
983+ if ((m_tableType == ACL_TABLE_MIRROR_DSCP && attr_name != MATCH_DSCP))
984+ {
985+ SWSS_LOG_ERROR (" %s match is not supported for the table of type MIRROR_DSCP" ,
986+ attr_name.c_str ());
978987 return false ;
979988 }
980989
@@ -1188,6 +1197,29 @@ bool AclTable::create()
11881197 return status == SAI_STATUS_SUCCESS;
11891198 }
11901199
1200+ if (type == ACL_TABLE_MIRROR_DSCP)
1201+ {
1202+ attr.id = SAI_ACL_TABLE_ATTR_FIELD_DSCP;
1203+ attr.value .booldata = true ;
1204+ table_attrs.push_back (attr);
1205+
1206+ attr.id = SAI_ACL_TABLE_ATTR_ACL_STAGE;
1207+ attr.value .s32 = stage == ACL_STAGE_INGRESS
1208+ ? SAI_ACL_STAGE_INGRESS : SAI_ACL_STAGE_EGRESS;
1209+ table_attrs.push_back (attr);
1210+
1211+ sai_status_t status = sai_acl_api->create_acl_table (
1212+ &m_oid, gSwitchId , (uint32_t )table_attrs.size (), table_attrs.data ());
1213+
1214+ if (status == SAI_STATUS_SUCCESS)
1215+ {
1216+ gCrmOrch ->incCrmAclUsedCounter (
1217+ CrmResourceType::CRM_ACL_TABLE, (sai_acl_stage_t )attr.value .s32 , SAI_ACL_BIND_POINT_TYPE_PORT);
1218+ }
1219+
1220+ return status == SAI_STATUS_SUCCESS;
1221+ }
1222+
11911223 if (type != ACL_TABLE_MIRRORV6)
11921224 {
11931225 attr.id = SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE;
0 commit comments