@@ -356,8 +356,41 @@ static acl_table_match_field_lookup_t stageMandatoryMatchFields =
356
356
}
357
357
}
358
358
}
359
+ },
360
+ {
361
+ TABLE_TYPE_L3,
362
+ {
363
+ {
364
+ ACL_STAGE_INGRESS,
365
+ {
366
+ SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE
367
+ }
368
+ },
369
+ {
370
+ ACL_STAGE_EGRESS,
371
+ {
372
+ SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE
373
+ }
374
+ }
375
+ }
376
+ },
377
+ {
378
+ TABLE_TYPE_L3V6,
379
+ {
380
+ {
381
+ ACL_STAGE_INGRESS,
382
+ {
383
+ SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE
384
+ }
385
+ },
386
+ {
387
+ ACL_STAGE_EGRESS,
388
+ {
389
+ SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE
390
+ }
391
+ }
392
+ }
359
393
}
360
-
361
394
};
362
395
363
396
static acl_ip_type_lookup_t aclIpTypeLookup =
@@ -2091,6 +2124,29 @@ bool AclTable::addMandatoryActions()
2091
2124
return true ;
2092
2125
}
2093
2126
2127
+ bool AclTable::addStageMandatoryRangeFields ()
2128
+ {
2129
+ SWSS_LOG_ENTER ();
2130
+
2131
+ string platform = getenv (" platform" ) ? getenv (" platform" ) : " " ;
2132
+ auto match = SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE;
2133
+
2134
+ if ((platform == BRCM_PLATFORM_SUBSTRING) &&
2135
+ (stage == ACL_STAGE_EGRESS))
2136
+ {
2137
+ return false ;
2138
+ }
2139
+
2140
+ type.addMatch (make_shared<AclTableRangeMatch>(set<sai_acl_range_type_t >{
2141
+ {SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE, SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE}}));
2142
+ SWSS_LOG_INFO (" Added mandatory match field %s for table type %s stage %d" ,
2143
+ sai_serialize_enum (match, &sai_metadata_enum_sai_acl_table_attr_t ).c_str (),
2144
+ type.getName ().c_str (), stage);
2145
+
2146
+ return true ;
2147
+ }
2148
+
2149
+
2094
2150
bool AclTable::addStageMandatoryMatchFields ()
2095
2151
{
2096
2152
SWSS_LOG_ENTER ();
@@ -2108,10 +2164,17 @@ bool AclTable::addStageMandatoryMatchFields()
2108
2164
// Add the stage particular matching fields
2109
2165
for (auto match : fields_for_stage[stage])
2110
2166
{
2111
- type.addMatch (make_shared<AclTableMatch>(match));
2112
- SWSS_LOG_INFO (" Added mandatory match field %s for table type %s stage %d" ,
2113
- sai_serialize_enum (match, &sai_metadata_enum_sai_acl_table_attr_t ).c_str (),
2114
- type.getName ().c_str (), stage);
2167
+ if (match != SAI_ACL_TABLE_ATTR_FIELD_ACL_RANGE_TYPE)
2168
+ {
2169
+ type.addMatch (make_shared<AclTableMatch>(match));
2170
+ SWSS_LOG_INFO (" Added mandatory match field %s for table type %s stage %d" ,
2171
+ sai_serialize_enum (match, &sai_metadata_enum_sai_acl_table_attr_t ).c_str (),
2172
+ type.getName ().c_str (), stage);
2173
+ }
2174
+ else
2175
+ {
2176
+ addStageMandatoryRangeFields ();
2177
+ }
2115
2178
}
2116
2179
}
2117
2180
}
@@ -3035,8 +3098,6 @@ void AclOrch::initDefaultTableTypes()
3035
3098
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT))
3036
3099
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT))
3037
3100
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS))
3038
- .withMatch (make_shared<AclTableRangeMatch>(set<sai_acl_range_type_t >{
3039
- {SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE, SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE}}))
3040
3101
.build ()
3041
3102
);
3042
3103
@@ -3054,8 +3115,6 @@ void AclOrch::initDefaultTableTypes()
3054
3115
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_SRC_PORT))
3055
3116
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_L4_DST_PORT))
3056
3117
.withMatch (make_shared<AclTableMatch>(SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS))
3057
- .withMatch (make_shared<AclTableRangeMatch>(set<sai_acl_range_type_t >{
3058
- {SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE, SAI_ACL_RANGE_TYPE_L4_DST_PORT_RANGE}}))
3059
3118
.build ()
3060
3119
);
3061
3120
0 commit comments