[202205][cherry-pick] Fix mux_acl_rule adding issue #2358
Merged
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.
What I did
This PR is to cherry-pick #2356 to
202205
branch. The cherry-pick is clean, no conflict is found.This PR is to fix the issue of adding
mux_acl_rule
intoIngressTableDrop
.The error log is
PR #2341 added support for different matching field in different stage (INGRESS/EGRESS). For example,
SAI_ACL_ENTRY_ATTR_FIELD_IN_PORTS
is only supported atINGRESS
stage.However, PR #2341 only handled one path for creating ACL table, that is by CONFIG_DB entry.
There is a case that
addAclTable
is directly called from otherorch
, such asMuxOrch
. In that case, the stage dependent matcing field is not added. As a resule, we will see the above error logs.To address the issue, I moved the call of
addStageMandatoryMatchFields
fromdoAclTableTask
toaddAclTable
to ensureaddStageMandatoryMatchFields
is always called.Please be noted that
addMandatoryActions
is called from bothdoAclTableTask
andaddAclTable
to ensure the validation of ACL table is passing.Why I did it
To fix ACL rule issue for mux.
How I verified it
test_pfcwd
Details if related