sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
740 stars 1.43k forks source link

[DPB] Optional fields not set for child ports after DPB #7578

Open dmytroxshevchuk opened 3 years ago

dmytroxshevchuk commented 3 years ago

Description

Dynamic Port Breakout does not work properly because of new port configuration is not consist optional fields for that port. For example if we have installed fec field for parent port, than after DPB fec will not be set for child ports.

Steps to reproduce the issue:

  1. Add any optional field to hwsku.json, for example it can be "fec": "rs"
  2. Generate and apply config_db.json using hwsku.json and platform.json
  3. Perform show interface status command and take a look that the fec is filled in the correct value rs
    Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
    -----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
    Ethernet0          0,1,2,3     100G   9100     rs    Ethernet0  routed      up       up  QSFP28 or later         N/A
    Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A
  4. Perform DBP, e.g. sudo config interface breakout Ethernet0 2x50G -f for split single interface Ethernet0 into 2 interfaces Ethernet0 and Ethernet2
  5. Check result using show interface status command and take a look that the fec field is filled as N/A for Ethernet0 and Ethernet2 interfaces
    Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
    -----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
    Ethernet0              0,1      50G   9100    N/A    Ethernet0  routed    down       up  QSFP28 or later         N/A
    Ethernet2              2,3      50G   9100    N/A    Ethernet2  routed    down       up              N/A         N/A
    Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A
  6. Perform DPB again, e.g. sudo config interface breakout Ethernet0 1x100G -f for unite 2 interfaces Ethernet0 and Ethernet2 into single interface Ethernet0
  7. Perform show interface status command and take a look that the fec field still in N/A state for Ethernet0
    Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
    -----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
    Ethernet0          0,1,2,3     100G   9100    N/A    Ethernet0  routed    down       up  QSFP28 or later         N/A
    Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A
  8. Compare Ethernet0/fec field in step 3 (before DPB flow) and in step 8 (after DPB flow)

Describe the results you received:

Default configuration of ports after apply config_db.json generated using platform.json, hwsku.json:

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0          0,1,2,3     100G   9100     rs    Ethernet0  routed      up       up  QSFP28 or later         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

After first execution of DPB using sudo config interface breakout Ethernet0 2x50G -f

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0              0,1      50G   9100    N/A    Ethernet0  routed    down       up  QSFP28 or later         N/A
  Ethernet2              2,3      50G   9100    N/A    Ethernet2  routed    down       up              N/A         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

After second execution of DBP using sudo config interface breakout Ethernet0 1x100G[40G] -f

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0          0,1,2,3     100G   9100    N/A    Ethernet0  routed    down       up  QSFP28 or later         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

Describe the results you expected:

Default configuration of ports after apply config_db.json generated using platform.json, hwsku.json:

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0          0,1,2,3     100G   9100     rs    Ethernet0  routed      up       up  QSFP28 or later         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

After first execution of DPB using sudo config interface breakout Ethernet0 2x50G -f:

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0              0,1      50G   9100     rs    Ethernet0  routed    down       up  QSFP28 or later         N/A
  Ethernet2              2,3      50G   9100     rs    Ethernet2  routed    down       up              N/A         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

After second execution of DPB using sudo config interface breakout Ethernet0 1x100G[40G] -f:

  Interface            Lanes    Speed    MTU    FEC        Alias    Vlan    Oper    Admin             Type    Asym PFC
-----------  ---------------  -------  -----  -----  -----------  ------  ------  -------  ---------------  ----------
  Ethernet0          0,1,2,3     100G   9100     rs    Ethernet0  routed      up       up  QSFP28 or later         N/A
  Ethernet4          4,5,6,7     100G   9100     rs    Ethernet4  routed      up       up  QSFP28 or later         N/A

Configurations

hwsku.json:

{
    "interfaces": {
        "Ethernet0": {
            "default_brkout_mode": "1x100G[40G]",
            "autoneg": "off",
            "fec": "rs"
        },
...

platform.json:

{
    "interfaces": {
        "Ethernet0": {
            "index": "1,1,1,1",
            "lanes": "0,1,2,3",
            "breakout_modes": {
                "1x100G[40G]": ["Ethernet0"],
                "2x50G": ["Ethernet0", "Ethernet2"],
                "4x25G[10G]": ["Ethernet0", "Ethernet1", "Ethernet2", "Ethernet3"]
            }
        },
...

config_db.json:

    "PORT": {
        "Ethernet0": {
            "alias": "Ethernet0",
            "lanes": "0,1,2,3",
            "speed": "100000",
            "index": "1",
            "admin_status": "up",
            "autoneg": "off",
            "fec": "rs",
            "mtu": "9100"
        },

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

dmytroxshevchuk commented 3 years ago

Please take a look possible way for resolve this issue. For now I created 2 PRs for resolve that: https://github.com/Azure/sonic-buildimage/pull/6660 https://github.com/Azure/sonic-utilities/pull/1492 For resolve the issue we need merge both PR.

FYI: PR 1492 depends from 6660, so we need merge 6660 after that CI will pass and then we can merge 1492. In any case we can merge 6660 without 1492 and it will work.

anshuv-mfst commented 3 years ago

@zhenggen-xu - could you please provide input on the issue, thanks.

zhenggen-xu commented 3 years ago

The child port optional field values were not part of the initial DPB design. If we would like the DPB to take care of setting that automatically, we would need enhance the design to have the breakout-mode mapping to fields/values in platform.json, so we can apply them with our defined values.

Without those fields available, we could use CLI to set the autoneg and fec etc manually. If the CLI is not available, we should add them, not just for DPB but for generic operations too.

bebeisdog commented 2 months ago

Hello, I would like to ask if there are any results regarding this series of related issues? I noticed that #6660 is still open. After completing DPB, if Fec is not set and passed to the chip vendor, will there be any unexpected issues? Moreover, as speeds continue to increase, should it be mandatory to configure Fec?