Skip to content

[portsorch]: Prevent LAG member configuration when port has active ACL binding#2165

Merged
prsunny merged 2 commits intosonic-net:masterfrom
nazariig:master-lag-member-validation
Mar 30, 2022
Merged

[portsorch]: Prevent LAG member configuration when port has active ACL binding#2165
prsunny merged 2 commits intosonic-net:masterfrom
nazariig:master-lag-member-validation

Conversation

@nazariig
Copy link
Collaborator

@nazariig nazariig commented Mar 2, 2022

Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com

Add some extra validation to make sure that port can't be made a LAG member when ingress/egress ACL binding is configured.
Before moving port to LAG, user should disable active ACL binding, since LAG uses a different dedicated attributes

fixes sonic-net/sonic-buildimage#10233

What I did

  • Prevent LAG member configuration when port has active ACL binding

Why I did it

  • To fix ACL PORT/LAG config divergency

How I verified it

  1. Deploy t0 topology
  2. Create LAG interface
  3. Remove arbitrary port from VLAN
  4. Make port LAG member

Details if related

root@sonic:/home/admin# show acl table
Name        Type       Binding         Description    Stage
----------  ---------  --------------  -------------  -------
DATAACL     L3         PortChannel101  DATAACL        ingress
                       PortChannel102
                       PortChannel103
                       PortChannel104
EVERFLOW    MIRROR     Ethernet2       EVERFLOW       ingress
                       Ethernet4
                       Ethernet6
                       Ethernet8
                       Ethernet10
                       Ethernet12
                       Ethernet14
                       Ethernet16
                       Ethernet18
                       Ethernet20
                       Ethernet22
                       Ethernet24
                       Ethernet28
                       Ethernet32
                       Ethernet36
                       Ethernet40
                       Ethernet42
                       Ethernet44
                       Ethernet46
                       Ethernet48
                       Ethernet50
                       Ethernet52
                       Ethernet54
                       Ethernet56
                       PortChannel101
                       PortChannel102
                       PortChannel103
                       PortChannel104
EVERFLOWV6  MIRRORV6   Ethernet2       EVERFLOWV6     ingress
                       Ethernet4
                       Ethernet6
                       Ethernet8
                       Ethernet10
                       Ethernet12
                       Ethernet14
                       Ethernet16
                       Ethernet18
                       Ethernet20
                       Ethernet22
                       Ethernet24
                       Ethernet28
                       Ethernet32
                       Ethernet36
                       Ethernet40
                       Ethernet42
                       Ethernet44
                       Ethernet46
                       Ethernet48
                       Ethernet50
                       Ethernet52
                       Ethernet54
                       Ethernet56
                       PortChannel101
                       PortChannel102
                       PortChannel103
                       PortChannel104
NTP_ACL     CTRLPLANE  NTP             NTP_ACL        ingress
SNMP_ACL    CTRLPLANE  SNMP            SNMP_ACL       ingress
SSH_ONLY    CTRLPLANE  SSH             SSH_ONLY       ingress

root@sonic-vs-ut:~/sonic-swss/tests# pytest --dvsname=vs --log-cli-level=info test_acl_portchannel.py::TestAclInterfaceBinding -v
========================================================================= test session starts =========================================================================
platform linux -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/sonic-swss/tests
plugins: flaky-3.7.0
collected 2 items

test_acl_portchannel.py::TestAclInterfaceBinding::test_AclTablePortChannelMemberBinding[ingress]
--------------------------------------------------------------------------- live log setup ----------------------------------------------------------------------------
INFO     test_acl_portchannel:test_acl_portchannel.py:18 Initialize DVS API: ACL
---------------------------------------------------------------------------- live log call ----------------------------------------------------------------------------
INFO     test_acl_portchannel:test_acl_portchannel.py:30 Create ACL table: acl_table
INFO     test_acl_portchannel:test_acl_portchannel.py:39 Create LAG: PortChannel0001
INFO     test_acl_portchannel:test_acl_portchannel.py:43 Create LAG member: Ethernet120
INFO     test_acl_portchannel:test_acl_portchannel.py:47 Create LAG member: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:55 Verify LAG member hasn't been created: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:51 Remove LAG member: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:55 Remove LAG member: Ethernet120
INFO     test_acl_portchannel:test_acl_portchannel.py:59 Remove LAG: PortChannel0001
INFO     test_acl_portchannel:test_acl_portchannel.py:63 Remove ACL table: acl_table
PASSED                                                                                                                                                          [ 50%]
test_acl_portchannel.py::TestAclInterfaceBinding::test_AclTablePortChannelMemberBinding[egress]
---------------------------------------------------------------------------- live log call ----------------------------------------------------------------------------
INFO     test_acl_portchannel:test_acl_portchannel.py:30 Create ACL table: acl_table
INFO     test_acl_portchannel:test_acl_portchannel.py:39 Create LAG: PortChannel0001
INFO     test_acl_portchannel:test_acl_portchannel.py:43 Create LAG member: Ethernet120
INFO     test_acl_portchannel:test_acl_portchannel.py:47 Create LAG member: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:55 Verify LAG member hasn't been created: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:51 Remove LAG member: Ethernet124
INFO     test_acl_portchannel:test_acl_portchannel.py:55 Remove LAG member: Ethernet120
INFO     test_acl_portchannel:test_acl_portchannel.py:59 Remove LAG: PortChannel0001
INFO     test_acl_portchannel:test_acl_portchannel.py:63 Remove ACL table: acl_table
PASSED                                                                                                                                                          [100%]
-------------------------------------------------------------------------- live log teardown --------------------------------------------------------------------------
INFO     test_acl_portchannel:test_acl_portchannel.py:21 Deinitialize DVS API: ACL


-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================================== 2 passed, 8 warnings in 73.15s (0:01:13) ===============================================================

@nazariig nazariig requested a review from prsunny as a code owner March 2, 2022 21:24
@nazariig
Copy link
Collaborator Author

nazariig commented Mar 7, 2022

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig force-pushed the master-lag-member-validation branch from 07bb29d to 3eadcfb Compare March 14, 2022 09:35
@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@liat-grozovik liat-grozovik left a comment

Choose a reason for hiding this comment

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

please also add test cases to verify the new check/flow

@nazariig nazariig force-pushed the master-lag-member-validation branch from d5c5b97 to 84053d4 Compare March 22, 2022 16:21
@nazariig
Copy link
Collaborator Author

please also add test cases to verify the new check/flow

@liat-grozovik done

@nazariig nazariig force-pushed the master-lag-member-validation branch from 84053d4 to 8b4dd6a Compare March 22, 2022 16:52
@lgtm-com
Copy link

lgtm-com bot commented Mar 22, 2022

This pull request fixes 1 alert when merging 8b4dd6a into d80094b - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

prsunny
prsunny previously approved these changes Mar 23, 2022
@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lgtm-com
Copy link

lgtm-com bot commented Mar 24, 2022

This pull request fixes 1 alert when merging 623bfc8 into 6eda965 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…L binding.

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@nazariig nazariig force-pushed the master-lag-member-validation branch from 623bfc8 to 99778d1 Compare March 28, 2022 08:23
@lgtm-com
Copy link

lgtm-com bot commented Mar 28, 2022

This pull request fixes 1 alert when merging 99778d1 into 7350d49 - view on LGTM.com

fixed alerts:

  • 1 for Unused import

@nazariig
Copy link
Collaborator Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit 390cae1 into sonic-net:master Mar 30, 2022
judyjoseph pushed a commit that referenced this pull request Apr 4, 2022
…L binding (#2165)

* [portsorch]: Prevent LAG member configuration when port has active ACL binding.
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
bingwang-ms added a commit that referenced this pull request Jun 2, 2022
yxieca pushed a commit that referenced this pull request Jun 2, 2022
yxieca pushed a commit that referenced this pull request Jun 2, 2022
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
…L binding (sonic-net#2165)

* [portsorch]: Prevent LAG member configuration when port has active ACL binding.
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
…L binding (sonic-net#2165)

* [portsorch]: Prevent LAG member configuration when port has active ACL binding.
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
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.

[ACL/PBH] Invalid LAG member configuration when port has active ACL binding

6 participants