Fix deleting final ACL from a port#4815
Open
gizmoguy wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4815 +/- ##
=======================================
Coverage 91.42% 91.42%
=======================================
Files 46 46
Lines 8923 8923
=======================================
Hits 8157 8157
Misses 766 766 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While reviewing #4733 a bug was discovered when deleting the final ACL from a port and warm reloading faucet. The bug caused the flow rules for the deleted ACL to remain on the datapath after the warm reload.
When the ACL configuration for a port changes,
ValveAclManager.cold_start_port()will be called which sends a delete flowmod followed by the new ACL flowmods. In the case the final ACL is removed an implicit allow ACL rule is added, on the wire this looks like this:When flowmods are pushed to the dp, overlapping delete/adds that share match/cookie/priority/table_id (see: ece834d) are suppressed by
remove_overlap_ofmsgs(). Because these two flowmods share the same value for all these fields the port cold start only partially occurs, as the implicit allow rule is added but the old flow rules are not deleted because the flowdel is suppressed and not actually sent to the dp.To fix this issue, the priority is removed from the port ACL flowdel, so that flow rules will be correctly deleted and re-added.
I also found during testing that modifying an existing ACL worked fine and did not experience this bug because the key that was used to compare flowmods for overlap included an OFPMatch object (which lacks
___eq___or___hash___) so will only ever be equal with itself. Replacing this with a tuple of the flow match key/values makes the flow overlap suppression work in all cases.