Skip to content

Commit 0f08d82

Browse files
committed
Community Review
1 parent 767a9a0 commit 0f08d82

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed
Loading

doc/acl/custom_acl_based_metering/Custom-ACL-Based-Metering.md

+23-29
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
- [**Configuration Flow**](#configuration-flow)
1818
- [Configuration and Management](#configuration-and-management)
1919
- [Config DB Enhancements](#config-db-enhancements)
20+
- [ACL Table Type Table --\> New Action Attribute](#acl-table-type-table----new-action-attribute)
2021
- [ACL Tables Table --\> No Change](#acl-tables-table----no-change)
21-
- [ACL Table Type Table](#acl-table-type-table)
22-
- [ACL Rules Table](#acl-rules-table)
22+
- [ACL Rules Table --\> New Field](#acl-rules-table----new-field)
2323
- [YANG Model Enhancements](#yang-model-enhancements)
2424
- [CLI Config Commands](#cli-config-commands)
2525
- [CLI Show Commands](#cli-show-commands)
@@ -81,7 +81,7 @@ Usage examples:
8181
- Ability to have customer specific table that contains a list of actions and match fields.
8282
- Gracefully handle unsupported or invalid configurations (e.g., rules referencing non-existent policers).
8383
### Scalability Requirements:
84-
- Support binding of multiple ACL rules to a single policer.
84+
- Support binding of multiple ACL rules to a single policer - the policer rates will be shared cumulatively.
8585
- Query and validate SAI capabilities.
8686
#### CLI Requirements
8787
- Extend ACL table command to support policer.
@@ -106,10 +106,10 @@ Custom ACL Based Metering (CABM) builds directly upon this custom ACL mechanism
106106
![alt text](Config_Flow.jpg)
107107

108108

109-
1. Query Capabilities on Initialization: ACL-Orch queries SAI to retrieve supported ACL actions, including SAI_ACL_ACTION_TYPE_SET_POLICER.
109+
1. Query Capabilities on Initialization: ACL-Orch queries SAI to retrieve supported ACL actions and store it in both STATE_DB and local DB, including SAI_ACL_ACTION_TYPE_SET_POLICER.
110110
2. Create Policer Object: Policer configurations are defined in POLICER_TABLE, validated, and created in SAI.
111111
3. Define Custom ACL Table Type: Users define custom ACL table types in ACL_TABLE_TYPE with specified matches and actions, including POLICER_ACTION.
112-
4. Verify Table Capabilities: ACL-Orch ensures that the custom table type's action set, including POLICER_ACTION, is supported by the queried SAI capabilities.
112+
4. Verify Table Capabilities: ACL-Orch ensures with the stored queried SAI capabilities if POLICER_ACTION is supported.
113113
5. Create ACL Table: Add an ACL table in ACL_TABLE, referencing the custom table type and validates the configuration.
114114
6. Create ACL Rule: Add an ACL rule in ACL_RULE, referencing actions, including policer_action.
115115
7. Verify Rule Compatibility: ACL-Orch validates that the rule action compatibility with the associated ACL table type.
@@ -121,9 +121,7 @@ Custom ACL Based Metering (CABM) builds directly upon this custom ACL mechanism
121121
### Configuration and Management
122122
#### Config DB Enhancements
123123

124-
##### ACL Tables Table --> No Change
125-
126-
##### ACL Table Type Table
124+
##### ACL Table Type Table --> New Action Attribute
127125
When a new ACL table is created, SAI needs to receive a list of supported actions which the rules belonging to this table are allowed to use.
128126
To support the new policer action, the custom table types table schema will be extended with a policer action attribute - **"POLICER_ACTION"** for the actions attribute field.
129127

@@ -137,7 +135,16 @@ actions = action-list ; list of actions for this table.
137135
; ["REDIRECT_ACTION", ... , "POLICER_ACTION"]
138136
```
139137

140-
##### ACL Rules Table
138+
##### ACL Tables Table --> No Change
139+
```
140+
key: ACL_TABLE|<TABLE_NAME> ; acl_table_name must be unique
141+
;field = value
142+
policy_desc = 1*255VCHAR ; name of the ACL policy table description
143+
type = 1*255VCHAR ; type of acl table, every type of table defines
144+
... ; the match/action a specific set of match and actions.
145+
```
146+
147+
##### ACL Rules Table --> New Field
141148
The CONFIG_DB ACL Rules Table schema will be updated with a new attribute field **"policer_action"** with the value of one of the existing policer object names.
142149

143150
```
@@ -157,6 +164,9 @@ mirror_ingress_action = 1*255VCHAR ; refer to the mirror session
157164
+ policer_action = 1*255VCHAR ; refer to the policer object name
158165
```
159166

167+
Note that each ACL rule can only specify a single action due to the design of the ACLs.
168+
For example, a rule specifying 'packet_action = DROP' cannot also include 'policer_action = "M_POLICER_7"'.
169+
160170
#### YANG Model Enhancements
161171

162172
sonic-yang-models/yang-templates/**sonic-acl**.yang.j2:
@@ -193,25 +203,6 @@ sonic-yang-models/yang-templates/**sonic-acl**.yang.j2:
193203
}
194204
```
195205
196-
sonic-yang-models/yang-templates/**sonic-policer**.yang.j2:
197-
```c++
198-
...
199-
+ import sonic-acl {
200-
+ prefix acl;
201-
+ }
202-
...
203-
container sonic-policer {
204-
container POLICER {
205-
...
206-
+ /* prevent deletion of policer that referenced by ACL rule.
207-
+ Note that new policer won't be referenced by any ACL rules initially */
208-
+ must "not(../acl:sonic-acl/acl:ACL_RULE/acl:ACL_RULE_LIST[acl:policer_action=current()/name])" {
209-
+ error-message "Policer cannot be deleted when referenced by an ACL rule.";
210-
+ }
211-
}
212-
}
213-
```
214-
215206
#### CLI Config Commands
216207
217208
- **Policers configuration** - No changes (no CLI commands).
@@ -232,6 +223,7 @@ Two options to bind policer with ACL rules:
232223
"cir": "5000",
233224
"cbs": "5000",
234225
"green_packet_action": "forward",
226+
"yellow_packet_action": "forward",
235227
"red_packet_action": "drop"
236228
},
237229
"POLICER_TABLE|M_POLICER_93": {
@@ -240,6 +232,8 @@ Two options to bind policer with ACL rules:
240232
"color": "aware",
241233
"cir": "73000",
242234
"cbs": "82000",
235+
"green_packet_action": "forward",
236+
"yellow_packet_action": "drop",
243237
"red_packet_action": "drop"
244238
},
245239
@@ -368,7 +362,7 @@ During warmboot or fastboot, both ACL rules and policers configurations are rest
368362

369363
- Policers must be supported.
370364
- PRE/POST INGRESS stage isn't supported (not supported by the existing ACL creation logic).
371-
- Single Action per Rule - each ACL rule performs one action due to the existing ACL-Orch implementation.
365+
- Single Action per Rule - each ACL rule can only specify a single action due to the ACL-Orch design and implementation.
372366

373367
---
374368
### Testing Requirements/Design
-65.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)