Skip to content

[acl-loader] Fix and refactor incremental update#242

Merged
prsunny merged 3 commits intosonic-net:masterfrom
jleveque:acl_loader_incremental_update
Apr 25, 2018
Merged

[acl-loader] Fix and refactor incremental update#242
prsunny merged 3 commits intosonic-net:masterfrom
jleveque:acl_loader_incremental_update

Conversation

@jleveque
Copy link
Copy Markdown
Contributor

  • Incremental update was not working as intended. cmp(self.rules_info[key], self.rules_db_info[key]) would consistently fail because some string elements in rules_info were encoded in Unicode when loading the ACLs from a file, whereas all elements in rules_db_info, pulled from ConfigDB, were encoded in ASCII.
  • Now, string elements in rules_db_info are converted to ASCII, which causes the compare operation to work properly.
  • Also modified incremental update to only perform an incremental update on control plane ACLs. A full update is still performed on dataplane ACLs temporarily, until we fully test that we can insert ACLs (and shift existing ACLs) in the ASICs.

@jleveque jleveque added the Bug label Apr 19, 2018
@jleveque jleveque self-assigned this Apr 19, 2018
@jleveque jleveque requested a review from lguohan April 19, 2018 22:09
for key in existing_controlplane_rules:
if cmp(self.rules_info[key], self.rules_db_info[key]) != 0:
self.configdb.mod_entry(self.ACL_RULE, key, None)
self.configdb.mod_entry(self.ACL_RULE, key, self.rules_info[key])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.configdb.set_entry(self.ACL_RULE, key, self.rules_info[key])


for key in added_rules:
for key in added_controlplane_rules:
self.configdb.mod_entry(self.ACL_RULE, key, self.rules_info[key])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move added rules above removed rules

@prsunny prsunny merged commit d640c29 into sonic-net:master Apr 25, 2018
@jleveque jleveque deleted the acl_loader_incremental_update branch April 30, 2018 17:52
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
kktheballer pushed a commit to kktheballer/sonic-utilities that referenced this pull request Jan 14, 2026
```<br>* b1248a0 - (HEAD -> 202506) Merge branch '202505' of https://github.com/sonic-net/sonic-utilities into 202506 (2025-09-19) [Sonic Automation]
* 661ac61 - (origin/202505) DOM for flat memory transceiver modules (sonic-net#4063) (2025-09-19) [mssonicbld]<br>```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants