Skip to content

Commit 3a1def9

Browse files
authored
Merge pull request #1303 from bingwang-ms/improve_show_acl_cmd
[HLD] Improve HLD for show acl enhancement
2 parents 668987f + 821db23 commit 3a1def9

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

doc/acl/ACL-enhancements-on-show-command.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@
77
| Rev | Date | Author | Change Description |
88
|:---:|:-----------:|:------------------:|-----------------------------------|
99
| 0.1 | 2/6/2023 | Bing Wang | Initial version |
10+
| 0.2 | 3/23/2023 | Bing Wang | Address review comments |
1011

1112
### Scope
1213

1314
The scope of this document covers enhancements on show acl commands, including `show acl table` and `show acl rule`.
14-
Only dataplane ACL is covered in this design. The enhancement of control plane ACL will be covered in another document,
15+
Only dataplane ACL is covered in this design. The enhancement of control plane ACL will be covered in another document.
1516

1617
### Definitions/Abbreviations
1718

@@ -37,6 +38,8 @@ This design is to improve the show acl commands to add the status of ACL table o
3738

3839
In current implementation, `orchagent` checks return value from SAI, and writes a log to syslog.
3940
In the proposed design, we introduce a new table to `STATE_DB`, and `orchagent` will write the return status to the `STATE_DB` table. The user can check the status of ACL table or ACL rule creation with CLI `show acl table` or `show acl rule`. The `show` command reads the status from `STATE_DB`, and reads configuration from `CONFIG_DB`, and finally combine the status and configuration in the output.
41+
42+
The proposed change doesn't cover the internally added ACL table or ACL rule, such as the ACL table/rule added by PFC handler or Mux handler in dualtor setup. That is because the table/rule is not added by `CONFIG_DB` entries. Hence the show command can't find the corresponding configuration in `CONFIG_DB`.
4043
<p align=center>
4144
<img src="img/acl-work-flow-with-state-db.png" alt="Figure 2. ACL work flow with STATE_DB">
4245
</p>
@@ -64,7 +67,7 @@ ACL rule status
6467
```
6568
$ redis-cli -n 6 hgetall "ACL_RULE|DATAACL|RULE_1"
6669
1) "status"
67-
2) "Active"
70+
2) "Inactive"
6871
```
6972
#### Orchagent
7073
Add logic in `aclorch` to support writing return status into `STATE_DB`. When ACL table or ACL rule is being deleted, the corresponding entry in `STATE_DB` is also cleared.
@@ -87,9 +90,9 @@ DATAACL L3 Ethernet0 DATAACL ingress Active
8790
show acl rule
8891
Table Rule Priority Action Match Status
8992
------- ------------ ---------- -------- ------------------- --------
90-
DATAACL RULE_1 9999 DROP DST_IP: 9.5.9.3/32 Active
93+
DATAACL RULE_1 9999 DROP DST_IP: 9.5.9.3/32 Inactive
9194
ETHER_TYPE: 2048
92-
DATAACL RULE_2 9998 FORWARD DST_IP: 10.2.1.2/32 Active
95+
DATAACL RULE_2 9998 FORWARD DST_IP: 10.2.1.2/32 Inactive
9396
ETHER_TYPE: 2048
9497
IP_PROTOCOL: 6
9598
L4_DST_PORT: 22
@@ -100,7 +103,7 @@ The existing test script for ACL in sonic-mgmt is parsing syslog to find a keywo
100103
101104
### Warmboot and Fastboot Design Impact
102105

103-
No impact to Warmboot or Fastboot
106+
The new table in `STATE_DB` doesn't persist during warmboot or fastboot. So there is no impact to warmboot or fastboot.
104107

105108
### Restrictions/Limitations
106109
N/A

0 commit comments

Comments
 (0)