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

Shut down interface after config validation of port\dependencies deletion and port addition #1303

Merged
merged 7 commits into from
May 12, 2021

Conversation

praveen-li
Copy link
Member

@praveen-li praveen-li commented Dec 11, 2020

Changes:
-- Shutdown the interfaces after config validation while Dy Port Breakout.
-- Validate del ports before calling breakOutPorts API.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

Fixes sonic-net/sonic-buildimage#6646, sonic-net/sonic-buildimage#6631,

- What I did
Changes:
-- Shutdown the interfaces after config validation while Dy Port Breakout.

- How I did it
-- move shutdown part to config_mgmt.py, because we need to shutdown only when DPB is initiated.

- How to verify it

svc-lnos-user@server10:/home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests$ cat test_port_dpb_system.py | grep -A 4 -B 4 Uncomment

        # Verify port is removed from ACL table
        self.dvs_acl.verify_acl_table_count(1)

        #TBD: Uncomment this, or explain why Ethernet0 is being added back to ACL table
        # Also, string "None" is being added as port to ACL port list after the breakout
        self.dvs_acl.verify_acl_group_num(0)

        # Verify child ports are created.

svc-lnos-user@server10:/home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests$ sudo pytest --dvsname=vs-jk test_port_dpb_system.py -k test_port_breakout_with_acl --junitxml=report.xml | tee out
============================= test session starts ==============================
platform linux2 -- Python 2.7.12, pytest-3.3.0, py-1.6.0, pluggy-0.6.0
rootdir: /home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 2 items

test_port_dpb_system.py .                                                [100%]

 generated xml file: /home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests/report.xml
============================== 1 tests deselected ==============================
=================== 1 passed, 1 deselected in 92.36 seconds ====================
Jun  5 06:16:37.007136 fec26aa9f1be INFO #sonic_yang: Try to load Data in the tree
Jun  5 06:16:37.007722 fec26aa9f1be INFO #configMgmt: Data Validation successful
Jun  5 06:16:37.031857 fec26aa9f1be INFO #configMgmt: shutdown Interfaces: {'PORT': {'Ethernet2': {'admin_status': 'down'}, 'Ethernet3': {'admin_status': 'down'}, 'Ethernet0': {'admin_status': 'down'}, 'Ethernet1': {'admin_status': 'down'}}}
Jun  5 06:16:37.032485 fec26aa9f1be INFO #configMgmt: Write in DB: {'PORT': OrderedDict([('Ethernet0', {'admin_status': 'down'}), ('Ethernet1', {'admin_status': 'down'}), ('Ethernet2', {'admin_status': 'down'}), ('Ethernet3', {'admin_status': 'down'})])}
Jun  5 06:16:37.033823 fec26aa9f1be NOTICE #orchagent: :- doPortTask: Set port Ethernet0 admin status to down
Jun  5 06:16:37.034270 fec26aa9f1be INFO #configMgmt: Write in DB: {u'PORT': OrderedDict([(u'Ethernet0', None), (u'Ethernet1', None), (u'Ethernet2', None), (u'Ethernet3', None)])}
Jun  5 06:16:37.034383 fec26aa9f1be NOTICE #orchagent: :- doPortTask: Set port Ethernet1 admin status to down
Jun  5 06:16:37.034486 fec26aa9f1be NOTICE #orchagent: :- doPortTask: Set port Ethernet2 admin status to down
Jun  5 06:16:37.034872 fec26aa9f1be NOTICE #portsyncd: :- onMsg: nlmsg type:16 key:Ethernet0 admin:0 oper:0 addr:02:42:ac:11:00:0c ifindex:1199 master:0 type:tun
Jun  5 06:16:37.035004 fec26aa9f1be NOTICE #orchagent: :- doPortTask: Set port Ethernet3 admin status to down
Jun  5 06:16:37.035166 fec26aa9f1be NOTICE #portsyncd: :- onMsg: Publish Ethernet0(ok) to state db
Jun  5 06:16:37.035317 fec26aa9f1be INFO #configMgmt: Verify Port Deletion from Asic DB, Wait...

——Test 06/09/2020

Jun  9 23:58:26.590188 fec26aa9f1be INFO #configMgmt: shutdown Interfaces: {'PORT': {'Ethernet2': {'admin_status': 'down'}, 'Ethernet0': {'admin_status': 'down'}}}
Jun  9 23:58:26.590828 fec26aa9f1be INFO #configMgmt: Write in DB: {'PORT': OrderedDict([('Ethernet0', {'admin_status': 'down'}), ('Ethernet2', {'admin_status': 'down'})])}
Jun  9 23:58:26.591800 fec26aa9f1be INFO #configMgmt: Write in DB: {u'PORT': OrderedDict([(u'Ethernet0', None), (u'Ethernet2', None)])}
Jun  9 23:58:26.592121 fec26aa9f1be INFO #configMgmt: Verify Port Deletion from Asic DB, Wait...

svc-lnos-user@server10:/home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests$ cat test_port_dpb_system.py | grep -A 4 -B 4 Uncomment

        # Verify port is removed from ACL table
        self.dvs_acl.verify_acl_table_count(1)

        #TBD: Uncomment this, or explain why Ethernet0 is being added back to ACL table
        # Also, string "None" is being added as port to ACL port list after the breakout
        self.dvs_acl.verify_acl_group_num(0)

        # Verify child ports are created.
svc-lnos-user@server10:/home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests$ sudo pytest --dvsname=vs-jk test_port_dpb_system.py -k test_port_breakout_with_acl --junitxml=report.xml | tee out
============================= test session starts ==============================
platform linux2 -- Python 2.7.12, pytest-3.3.0, py-1.6.0, pluggy-0.6.0
rootdir: /home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests, inifile:
collected 2 items

test_port_dpb_system.py .                                                [100%]

 generated xml file: /home/svc-lnos-user/praveen/sonic-buildimage/src/sonic-swss/tests/report.xml
============================== 1 tests deselected ==============================
=================== 1 passed, 1 deselected in 93.69 seconds ====================

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

@praveen-li
Copy link
Member Author

Gentle Reminder for review.

@praveen-li
Copy link
Member Author

Solves: sonic-net/sonic-buildimage#6631
@qiluo-msft @jleveque kindly review.

qiluo-msft
qiluo-msft previously approved these changes Feb 3, 2021
@jleveque
Copy link
Contributor

jleveque commented Feb 3, 2021

Retest this please

@praveen-li
Copy link
Member Author

Let me check why tests are failing.

@praveen-li
Copy link
Member Author

Retest this please

@praveen-li
Copy link
Member Author

@jleveque : I think we can safely merge it now. As mentioned, Nvidia has raised a couple of issues that are solved by this PR.

@jleveque
Copy link
Contributor

jleveque commented Feb 4, 2021

@jleveque : I think we can safely merge it now. As mentioned, Nvidia has raised a couple of issues that are solved by this PR.

@praveen-li: Can you add either "Fixes <link to issue>" or "Resolves <link to issue>" to the PR description for each issue this fixes? This way the issues will be automatically closed when the PR merges.

Praveen Chaudhary added 6 commits February 16, 2021 22:21
…onic-net#28)

* [config_mgmt.py]: Shutdown the interfaces after config validation.

Changes:
-- Shutdown the interfaces after config validation while Dy Port Breakout.
-- Validate del ports before calling breakOutPorts API.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
Signed-off-by: Praveen Chaudhary<pchaudhary@linkedin.com>
Signed-off-by: Praveen Chaudhary <pchaudhary@linkedin.com>
@praveen-li
Copy link
Member Author

Forced pushed "praveen-li force-pushed the praveen-li:shut_down_intf_dpb branch from 210aeea to 2c500e6 now"

For rebase. No other changes.

@praveen-li
Copy link
Member Author

retest default please

@praveen-li
Copy link
Member Author

Retest this please

1 similar comment
@zhenggen-xu
Copy link
Collaborator

Retest this please

@praveen-li
Copy link
Member Author

@jleveque : gentle reminder for review.

@samaity
Copy link
Contributor

samaity commented Mar 9, 2021

@lguohan Kindly merge this PR to fix a few of the DPB issues mentioned in the description.

@allas-nvidia
Copy link
Contributor

Kindly merge this PR to fix a few of the DPB issues mentioned in the description.

@praveen-li
Copy link
Member Author

@jleveque
Kindly label it with Port Breakout 🔱. thx

@lguohan :
Kindly merge. thx.

@praveen-li
Copy link
Member Author

retest this please

@allas-nvidia
Copy link
Contributor

Kindly reminder to retest it.
Can be labeled with 202012?
Thanks

@praveen-li
Copy link
Member Author

@lguohan : Kindly merge, thx.

@jleveque : how can I run the tests again, seems a few are stuck.? thx.

@jleveque
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@praveen-li
Copy link
Member Author

@lguohan , @jleveque : gentle reminder for Merge.

@praveen-li praveen-li changed the title Shut down intf dpb Shut down interface before dynamic port breakout May 12, 2021
@lguohan lguohan merged commit a089e53 into sonic-net:master May 12, 2021
@praveen-li praveen-li changed the title Shut down interface before dynamic port breakout Shut down interface after config validation of port\dependencies deletion and port addition May 12, 2021
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
Changes:
-- Shutdown the interfaces after config validation while Dy Port Breakout.
-- Validate del ports before calling breakOutPorts API.

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com

Fixes sonic-net/sonic-buildimage#6646, sonic-net/sonic-buildimage#6631,

Signed-off-by: Praveen Chaudhary pchaudhary@linkedin.com
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.

[DPB] Port state is down after breakout on a port with dependencies without force
8 participants