sonic-utilities
sonic-utilities copied to clipboard
[DPB] Remove the optimization logic for delete/add ports.
What I did
Fix https://github.com/sonic-net/sonic-buildimage/issues/9663
How I did it
Removed the logic which stopped port deletion when DPB is done
How to verify it
root@sonic:~# config interface breakout Ethernet0 "1x100G(4)" -y -f
Running Breakout Mode : 1x400G
Target Breakout Mode : 1x100G(4)
Ports to be deleted :
{
"Ethernet0": "400000"
}
Ports to be added :
{
"Ethernet0": "100000"
}
After running Logic to limit the impact
Final list of ports to be deleted :
{
"Ethernet0": "400000"
}
Final list of ports to be added :
{
"Ethernet0": "100000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:~#
root@sonic:~#
root@sonic:~# config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
root@sonic:~# config interface breakout Ethernet0 "4x100G[50G]" -y -f
Running Breakout Mode : 1x100G(4)
Target Breakout Mode : 4x100G[50G]
Ports to be deleted :
{
"Ethernet0": "100000"
}
Ports to be added :
{
"Ethernet0": "100000",
"Ethernet2": "100000",
"Ethernet4": "100000",
"Ethernet6": "100000"
}
After running Logic to limit the impact
Final list of ports to be deleted :
{
"Ethernet0": "100000"
}
Final list of ports to be added :
{
"Ethernet0": "100000",
"Ethernet2": "100000",
"Ethernet4": "100000",
"Ethernet6": "100000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:~# config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
root@sonic:~# show interface status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- ------------------------------- ------- ----- ----- ------- ------ ------ ------- ----------------------------------------------- ----------
Ethernet0 33,34 100G 9100 N/A etp1a routed down down QSFP-DD Double Density 8X Pluggable Transceiver N/A
Ethernet2 35,36 100G 9100 N/A etp1b routed down down N/A N/A
Ethernet4 37,38 100G 9100 N/A etp1c routed down down N/A N/A
Ethernet6 39,40 100G 9100 N/A etp1d routed down down N/A N/A
@praveen-li @samaity @zhenggen-xu Could you please review this PR?.
This pull request introduces 2 alerts when merging 06291709dc3ed8cd2ba2ca04459cf64d0b5dd784 into 8473517e931d47f0a5e9f4bc05fbe760113165e3 - view on LGTM.com
new alerts:
- 1 for Unused local variable
- 1 for Unreachable code
/azpw run Azure.sonic-utilities
/AzurePipelines run Azure.sonic-utilities
Azure Pipelines successfully started running 1 pipeline(s).
This pull request introduces 1 alert when merging 88ea63f5b789e2e9d0278abb05ddb5fb1409c923 into a5eb26b682c42b5cf0716dc98b72be4feb81b333 - view on LGTM.com
new alerts:
- 1 for Unreachable code
Please update your test results after the last change.
Media Type is not displayed due to the following issue: https://github.com/sonic-net/sonic-buildimage/issues/10144#issuecomment-1303009039. It can be tracked separately.
Please update your test results after the last change.
Please update the PR description How to verify it
field directly since the old one is not applicable anymore.
Done.
@aravindmani-1 can you fix the LGTM alert?
UT after latest commit: root@sonic:/# config interface breakout Ethernet8 "4x100G[50G]" -y -f
Running Breakout Mode : 1x400G
Target Breakout Mode : 4x100G[50G]
Ports to be deleted :
{
"Ethernet8": "400000"
}
Ports to be added :
{
"Ethernet8": "100000",
"Ethernet10": "100000",
"Ethernet12": "100000",
"Ethernet14": "100000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:/#
root@sonic:/# config interface breakout Ethernet16 "1x100G(4)" -y -f
Running Breakout Mode : 1x400G
Target Breakout Mode : 1x100G(4)
Ports to be deleted :
{
"Ethernet16": "400000"
}
Ports to be added :
{
"Ethernet16": "100000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:/#
@aravindmani-1 can you test this flow:-
- Port is currently in 1x400G.
- Do breakout to 4x100G
- undo the breakout back to 1x400G
@aravindmani-1 can you test this flow:-
- Port is currently in 1x400G.
- Do breakout to 4x100G
- undo the breakout back to 1x400G
root@sonic:~# config interface breakout Ethernet24 "4x100G[50G]" -y -f g': c
Running Breakout Mode : 1x400G g interface breakout Ethernet16 "1x100G(4)" -y -f
Target Breakout Mode : 4x100G[50G]
Ports to be deleted :
{
"Ethernet24": "400000"
}
Ports to be added :
{
"Ethernet24": "100000",
"Ethernet26": "100000",
"Ethernet28": "100000",
"Ethernet30": "100000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:~# config interface breakout Ethernet24 "1x400G" -y -f
Running Breakout Mode : 4x100G[50G]
Target Breakout Mode : 1x400G
Ports to be deleted :
{
"Ethernet24": "100000",
"Ethernet26": "100000",
"Ethernet28": "100000",
"Ethernet30": "100000"
}
Ports to be added :
{
"Ethernet24": "400000"
}
Breakout process got successfully completed.
Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.
root@sonic:~# cd /var/core
root@sonic:/var/core# ls
root@sonic:/var/core#
@yxieca any plans to take to 202205 soon?
@yxieca any plans to take to 202205 soon?
Sorry, this just come to my attention. Why is this change needed in 202205? Is it fixing some issue? Can you share the issue link?
@yxieca the issue is described and referred in the PR description. please check https://github.com/sonic-net/sonic-buildimage/issues/9663
@yxieca This fix is required to handle the case when we do dynamic breakout to a mode with same speed but different number of lanes as described in the issue https://github.com/sonic-net/sonic-buildimage/issues/9663 As this issue affects multiple vendors I recommend to prioritize cherry-picking this to 202205.
Cherry-pick PR to 202205: https://github.com/sonic-net/sonic-utilities/pull/3094