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

[aclorch] Fix and simplify DTel watchlist tables and entries #2155

Merged
merged 10 commits into from
Jun 17, 2022

Conversation

mickeyspiegel
Copy link
Contributor

@mickeyspiegel mickeyspiegel commented Feb 22, 2022

What I did

  • Fixed the logic that determines which subclass of AclRule to create,
    by referencing the correct set of enum mappings for DTel actions.
  • Removed the DTel drop watchlist table and entries, leaving only the
    DTel flow watchlist table and entries, which support the superset of
    actions for both flow and drop.
  • Renamed AclRuleDTelFlowWatchListEntry to AclRuleDTelWatchListEntry
    (without ...Flow...) to clarify that there is only one common watchlist
    for DTel, covering both flow and drop actions.
    Note: Left definition of TABLE_TYPE_DTEL_FLOW_WATCHLIST unchanged
    for backwards compatibility.
  • Updated the list of actions in the DTel Flow watchlist table so that
    it matches the existing allowed actions in DTel AclRule subclasses.

Why I did it

The significant rewrite of aclorch when adding ACL_TABLE_TYPE
configuration caused two major issues that prevent the DTel
watchlist from operating correctly:

  1. Introduced a bug that prevents configuration of any DTel rules.
    This is due to a reference to an incorrect set of enum mappings,
    while determining which subclass of AclRule to create.

  2. Changed the way that the AclRule subclass is determined so that it
    is no longer tied to ACL_TABLE_TYPE. The new logic assumes
    that each subclass of AclRule has a disjoint set of actions that do not
    overlap any of the actions in other AclRule subclasses. This assumption
    does not hold for DTel which currently has two AclRule subclasses,
    for flow and drop.

    Since the 201911 release, the DTel drop actions have been
    supported in the DTel flow watchlist as well as the DTel drop
    watchlist. This allows for simplified operation where there is a
    single watchlist (DTel flow watchlist) that contains both flow and
    drop actions. The ACL_TABLE_TYPE changes effectively reverted
    this change. A fix to this logic would remove the distinction
    between AclRules of subclass DTelFlow and DTelDrop, allowing for the
    larger set of actions supported by DTelFlow in either table.

    With this change in behavior, this seems like a good time to remove
    the DTel drop watchlist, leaving only one DTel watchlist that supports
    the superset of actions for both flow and drop.

How I verified it

Manual testing, verifying that syncd sends down the corresponding
acl entries, and that these rules are programmed in the switch hardware.

We also added sonic-swss tests for DTel acls that verify the SAI calls
generated for DTel acl entries.

Details if related

Signed-off-by: mickeyspiegel mickey.spiegel@intel.com

The significant rewrite of aclorch when adding ACL_TABLE_TYPE
configuration caused a bug that prevents configuration of any
DTel rules. This is due to use of an incorrect set of enum
mappings while determining which type of AclRule to create.

This commit changes that set of enum mappings.

This also updates the list of actions in the DTel Flow and Drop
watchlist tables so that they match the existing allowed actions
in DTel acl rules.

Signed-off-by: mickeyspiegel <mickey.spiegel@intel.com>
Since the 201911 release, the DTel drop actions have been supported in
the DTel Flow Watchlist as well as the DTel Drop Watchlist. This allows
for simplified operation where there is a single watchlist (DTel Flow
Watchlist) that contains both flow and drop actions.

The significant rewrite of aclorch when adding ACL_TABLE_TYPE
configuration changed the way that the type of AclRule is determined.
The current logic to distinguish between DTelFlow and DTelDrop AclRules
is not correct. A fix to this logic would effectively remove the
distinction between AclRules of type DTelFlow and DTelDrop, allowing
for the larger set of actions supported by DTelFlow in either table.

With this change in behavior, this seems like a good time to remove the
DTel Drop Watchlist, leaving only the DTel Flow Watchlist that supports
the superset of actions for both flow and drop.

Signed-off-by: mickeyspiegel <mickey.spiegel@intel.com>
Note: Leaving definition of TABLE_TYPE_DTEL_FLOW_WATCHLIST unchanged
      for backwards compatibility.

Signed-off-by: mickeyspiegel <mickey.spiegel@intel.com>
@ghost
Copy link

ghost commented Feb 22, 2022

CLA assistant check
All CLA requirements met.

@prsunny
Copy link
Collaborator

prsunny commented Feb 22, 2022

Changes lgtm, @bingwang-ms to review/merge

@prsunny
Copy link
Collaborator

prsunny commented Feb 22, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sunesh
Copy link

sunesh commented Apr 11, 2022

@bingwang-ms could u please help merge this PR

Myron Sosyak and others added 2 commits April 13, 2022 13:43
Signed-off-by: Myron Sosyak <myronx.sosyak@intel.com>
@TomFletcher0
Copy link

@bingwang-ms can this be merged, or are we waiting for something?

@mickeyspiegel
Copy link
Contributor Author

@bingwang-ms Test failures between successive runs are disjoint. It does not seem like any of these failures are related to this patch.

@sunesh
Copy link

sunesh commented Jun 15, 2022

@prsunny , @bingwang-ms can this PR be merged? Is there any action required from @mickeyspiegel

@prsunny
Copy link
Collaborator

prsunny commented Jun 15, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mickeyspiegel
Copy link
Contributor Author

@prsunny I updated to latest master, all checks are passing now.

@prsunny prsunny merged commit 700492f into sonic-net:master Jun 17, 2022
@mickeyspiegel
Copy link
Contributor Author

@prsunny Thanks for merging this.
This should also go into 202111 and 202205.

yxieca pushed a commit that referenced this pull request Jun 20, 2022
* Fix DTel acl rule creation

The significant rewrite of aclorch when adding ACL_TABLE_TYPE
configuration caused a bug that prevents configuration of any
DTel rules. This is due to use of an incorrect set of enum
mappings while determining which type of AclRule to create.
jimmyzhai added a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 27, 2022
2022-06-24 93af69c: [PFC_WD] Avoid applying ZeroBuffer Profiles to ingress PG when a PFC storm is detected (sonic-net/sonic-swss#2304)
2022-06-24 37349cf: [swssconfig] Optimize performance of swssconfig (sonic-net/sonic-swss#2336)
2022-06-24 84e9b07: [fdborch] fix heap-use-after-free in clearFdbEntry() (sonic-net/sonic-swss#2353)
2022-06-24 1b8bd94: Create ACL table fails due to incorrect check for supported ACL actions #11235 (sonic-net/sonic-swss#2351)
2022-06-24 1ed0b4b: [macsec] Refactor the logic of macsec name map (sonic-net/sonic-swss#2348)
2022-06-23 f88f992: [mock_tests] Add Sflow Orch UTs (sonic-net/sonic-swss#2295)
2022-06-23 ec57bf1: [macsec] Update macsec flex counter (sonic-net/sonic-swss#2338)
2022-06-22 6e0fc85: [ACL] Support stage particular match fields (sonic-net/sonic-swss#2341)
2022-06-22 efb4530: [orchagent, DTel]: report session support to set user vrf (sonic-net/sonic-swss#2326)
2022-06-22 d82874d: Fix for "orchagent crashed when trying to delete fdb static entry with swssconfig #11046" (sonic-net/sonic-swss#2332)
2022-06-22 0c789e6: Fix qos map test in vs test (sonic-net/sonic-swss#2343)
2022-06-17 1bb5070: Enhance mock test for dynamic buffer manager for port removing and qos reload flows (sonic-net/sonic-swss#2262)
2022-06-16 700492f: [aclorch] Fix and simplify DTel watchlist tables and entries (sonic-net/sonic-swss#2155)
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
…et#2155)

* Fix DTel acl rule creation

The significant rewrite of aclorch when adding ACL_TABLE_TYPE
configuration caused a bug that prevents configuration of any
DTel rules. This is due to use of an incorrect set of enum
mappings while determining which type of AclRule to create.
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.

6 participants