Skip to content

Commit d5af51f

Browse files
Ron Hemeta-codesync[bot]
authored andcommitted
Add the shared PBR ACL priority flag
Summary: Adds `FLAGS_pbr_acl_priority` (default 50000), the single priority every PBR ACL entry will be programmed at. Lives in `AgentFeatures` so it can be retuned without a rebuild. Nothing consumes it yet. Reviewed By: jasmeetbagga Differential Revision: D116378072 fbshipit-source-id: be8678e5e28e4bd43478bbbcadc8626046dbaab5
1 parent 1d6f6fa commit d5af51f

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

fboss/agent/AgentFeatures.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,12 @@ DEFINE_bool(
627627
false,
628628
"Enable bulk programming of ECMP members");
629629

630+
DEFINE_int32(
631+
pbr_acl_priority,
632+
50000,
633+
"Priority shared by every synthesized PBR ACL entry. Must stay below "
634+
"AclTable::kDataplaneAclMaxPriority so no config ACL can be assigned it");
635+
630636
DEFINE_bool(
631637
enable_pfc_priority_to_pg_map,
632638
false,

fboss/agent/AgentFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ DECLARE_bool(enforce_single_nbr_mac_per_intf);
173173
DECLARE_int32(max_tx_packets);
174174
DECLARE_bool(enable_acl_table_redirect_action);
175175
DECLARE_bool(enable_bulk_create_ecmp_members);
176+
DECLARE_int32(pbr_acl_priority);
176177
DECLARE_bool(enable_pfc_priority_to_pg_map);
177178
DECLARE_bool(enable_port_cl72_retry);
178179
DECLARE_bool(enable_remote_intf_route_reconcile);

fboss/agent/ApplyThriftConfig.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4189,6 +4189,8 @@ std::shared_ptr<AclMap> ThriftConfigApplier::updateAclsImpl(
41894189
int numExistingProcessed = 0;
41904190
int dataPriority = AclTable::kDataplaneAclMaxPriority;
41914191
int cpuPriority = 1;
4192+
CHECK_LT(FLAGS_pbr_acl_priority, AclTable::kDataplaneAclMaxPriority)
4193+
<< "PBR must sit below the dataplane band so no config ACL can reach it";
41924194

41934195
flat_map<std::string, const cfg::TrafficCounter*> counterByName;
41944196
folly::gen::from(*cfg_->trafficCounters()) |
@@ -4320,10 +4322,20 @@ std::shared_ptr<AclMap> ThriftConfigApplier::updateAclsImpl(
43204322
ma = &matchAction;
43214323
}
43224324

4325+
int aclPriority = isCoppAcl ? cpuPriority++ : dataPriority++;
4326+
if (aclPriority == FLAGS_pbr_acl_priority) {
4327+
throw FbossError(
4328+
"ACL ",
4329+
*aclCfg.name(),
4330+
" was assigned priority ",
4331+
aclPriority,
4332+
", which is reserved for PBR ACL entries");
4333+
}
4334+
43234335
auto acl = updateAcl(
43244336
aclStage,
43254337
aclCfg,
4326-
isCoppAcl ? cpuPriority++ : dataPriority++,
4338+
aclPriority,
43274339
&numExistingProcessed,
43284340
&changed,
43294341
tableName,

0 commit comments

Comments
 (0)