@@ -86,13 +86,14 @@ acl_dtel_flow_op_type_lookup_t aclDTelFlowOpTypeLookup =
86
86
87
87
static acl_table_type_lookup_t aclTableTypeLookUp =
88
88
{
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 }
96
97
};
97
98
98
99
static acl_stage_type_lookup_t aclStageLookUp =
@@ -604,6 +605,7 @@ shared_ptr<AclRule> AclRule::makeShared(acl_table_type_t type, AclOrch *acl, Mir
604
605
type != ACL_TABLE_L3V6 &&
605
606
type != ACL_TABLE_MIRROR &&
606
607
type != ACL_TABLE_MIRRORV6 &&
608
+ type != ACL_TABLE_MIRROR_DSCP &&
607
609
type != ACL_TABLE_DTEL_FLOW_WATCHLIST &&
608
610
type != ACL_TABLE_DTEL_DROP_WATCHLIST)
609
611
{
@@ -974,7 +976,14 @@ bool AclRuleMirror::validateAddMatch(string attr_name, string attr_value)
974
976
if ((m_tableType == ACL_TABLE_L3 || m_tableType == ACL_TABLE_L3V6)
975
977
&& attr_name == MATCH_DSCP)
976
978
{
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 ());
978
987
return false ;
979
988
}
980
989
@@ -1188,6 +1197,29 @@ bool AclTable::create()
1188
1197
return status == SAI_STATUS_SUCCESS;
1189
1198
}
1190
1199
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
+
1191
1223
if (type != ACL_TABLE_MIRRORV6)
1192
1224
{
1193
1225
attr.id = SAI_ACL_TABLE_ATTR_FIELD_ETHER_TYPE;
0 commit comments