Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimze ACL Table/Rule notification handling #5621

Merged
merged 2 commits into from
Oct 14, 2020

Conversation

abdosi
Copy link
Contributor

@abdosi abdosi commented Oct 13, 2020

What I did:
Optimize ACL Table/Rule notification handling
to loop pop() until empty to consume all the data in a batch
This way we prevent multiple call to iptable updates

- How to verify it

Loaded (sudo acl-loader update full acl.json) with 100 rules and verified all the set notification are batch together in one update to iptables .

Similarly (sudo acl-loader delete) batch all del operation in one update.

to loop pop() until empty to consume all the data in a batch

This wau we prevent multiple call to iptable updates

Signed-off-by: Abhishek Dosi <[email protected]>
jleveque
jleveque previously approved these changes Oct 14, 2020
Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

Looks good to me. @qiluo-msft to review, as well.

# Check ACL Rule notification and make sure Rule point to ACL Table which is Controlplane
else:
acl_table = key.split(acl_rule_table_seprator)[0]
if self.config_db_map[namespace].get_table(self.ACL_TABLE)[acl_table]["type"] == self.ACL_TABLE_TYPE_CTRLPLANE:
Copy link
Collaborator

Choose a reason for hiding this comment

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

[](start = 102, length = 1)

Use only one space

Copy link
Contributor Author

@abdosi abdosi Oct 14, 2020

Choose a reason for hiding this comment

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

@qiluo-msft Updated.


In reply to: 504353871 [](ancestors = 504353871)

Signed-off-by: Abhishek Dosi <[email protected]>
@abdosi abdosi merged commit 9094e21 into sonic-net:master Oct 14, 2020
@abdosi abdosi deleted the cacl_optimization branch October 14, 2020 15:05
abdosi added a commit that referenced this pull request Oct 14, 2020
* Optimze ACL Table/Rule notifcation handling
to loop pop() until empty to consume all the data in a batch

This wau we prevent multiple call to iptable updates

Signed-off-by: Abhishek Dosi <[email protected]>

* Address review comments

Signed-off-by: Abhishek Dosi <[email protected]>
@qiluo-msft
Copy link
Collaborator

Do you have performance test result?

@abdosi
Copy link
Contributor Author

abdosi commented Oct 15, 2020

Do you have performance test result?

@qiluo-msft
I verified the number of update happening to iptable (function update_control_plane_acls) for 100 rule is only 1 time. Previously it was called 100 times.

Also there was no delay in notification and all notification were available in one batch of loop.

I did not measure in time perspective.

santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
* Optimze ACL Table/Rule notifcation handling
to loop pop() until empty to consume all the data in a batch

This wau we prevent multiple call to iptable updates

Signed-off-by: Abhishek Dosi <[email protected]>

* Address review comments

Signed-off-by: Abhishek Dosi <[email protected]>
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.

COPP with ~350 rules take more than 10 min to install at iptables
3 participants