sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[DPB] Remove the optimization logic for delete/add ports.

Open aravindmani-1 opened this issue 2 years ago • 7 comments

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

aravindmani-1 avatar Oct 31 '22 05:10 aravindmani-1

@praveen-li @samaity @zhenggen-xu Could you please review this PR?.

aravindmani-1 avatar Oct 31 '22 05:10 aravindmani-1

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

lgtm-com[bot] avatar Oct 31 '22 06:10 lgtm-com[bot]

/azpw run Azure.sonic-utilities

aravindmani-1 avatar Nov 04 '22 06:11 aravindmani-1

/AzurePipelines run Azure.sonic-utilities

mssonicbld avatar Nov 04 '22 06:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 04 '22 06:11 azure-pipelines[bot]

This pull request introduces 1 alert when merging 88ea63f5b789e2e9d0278abb05ddb5fb1409c923 into a5eb26b682c42b5cf0716dc98b72be4feb81b333 - view on LGTM.com

new alerts:

  • 1 for Unreachable code

lgtm-com[bot] avatar Nov 11 '22 05:11 lgtm-com[bot]

Please update your test results after the last change.

zhenggen-xu avatar Nov 11 '22 06:11 zhenggen-xu

Please update your test results after the last change.

DPB_UT.txt

aravindmani-1 avatar Nov 14 '22 04:11 aravindmani-1

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.

aravindmani-1 avatar Nov 14 '22 04:11 aravindmani-1

Please update your test results after the last change.

DPB_UT.txt

Please update the PR description How to verify it field directly since the old one is not applicable anymore.

zhenggen-xu avatar Nov 14 '22 05:11 zhenggen-xu

Done.

aravindmani-1 avatar Nov 14 '22 09:11 aravindmani-1

@aravindmani-1 can you fix the LGTM alert?

prgeor avatar Nov 17 '22 15:11 prgeor

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 avatar Nov 17 '22 18:11 aravindmani-1

@aravindmani-1 can you test this flow:-

  1. Port is currently in 1x400G.
  2. Do breakout to 4x100G
  3. undo the breakout back to 1x400G

prgeor avatar Nov 17 '22 23:11 prgeor

@aravindmani-1 can you test this flow:-

  1. Port is currently in 1x400G.
  2. Do breakout to 4x100G
  3. 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#

aravindmani-1 avatar Nov 18 '22 03:11 aravindmani-1

@yxieca any plans to take to 202205 soon?

liat-grozovik avatar Nov 29 '23 13:11 liat-grozovik

@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 avatar Nov 29 '23 22:11 yxieca

@yxieca the issue is described and referred in the PR description. please check https://github.com/sonic-net/sonic-buildimage/issues/9663

liat-grozovik avatar Dec 18 '23 14:12 liat-grozovik

@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.

dgsudharsan avatar Dec 19 '23 04:12 dgsudharsan

Cherry-pick PR to 202205: https://github.com/sonic-net/sonic-utilities/pull/3094

mssonicbld avatar Dec 20 '23 17:12 mssonicbld