sonic-net / sonic-buildimage

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

Optional hwsku params not applying to all interfaces #20594

Open bobbymcgonigle opened 2 weeks ago

bobbymcgonigle commented 2 weeks ago

Description

Currently optional params only get applied to the first child port in group. We want optional parameters to apply to all child ports in group. This applies to all optional params.

Steps to reproduce the issue:

  1. add an optional param (autoneg, fec etc) to a breakout config in hwsku.json and look at the config_db.json generated

Describe the results you received:

    "Ethernet0": {
        "default_brkout_mode": "2x400G",
        "autoneg": "on"
    },

generates:

(Pdb++) pp child_ports
{'Ethernet0': {'alias': 'Ethernet1/1',
               'autoneg': 'on',
               'index': '1',
               'lanes': '17,18,19,20',
               'speed': '400000',
               'subport': '1'},
 'Ethernet4': {'alias': 'Ethernet1/5',
               'index': '1',
               'lanes': '21,22,23,24',
               'speed': '400000',
               'subport': '2'}}

Describe the results you expected:

(Pdb) pp child_ports
{'Ethernet0': {'alias': 'Ethernet1/1',
               'autoneg': 'on',
               'index': '1',
               'lanes': '17,18,19,20',
               'speed': '400000',
               'subport': '1'},
 'Ethernet4': {'alias': 'Ethernet1/5',
               'autoneg': 'on',
               'index': '1',
               'lanes': '21,22,23,24',
               'speed': '400000',
               'subport': '2'}}

All branches

Fix is: https://github.com/sonic-net/sonic-buildimage/pull/20313

aparkhomenko-xsight commented 1 week ago

This issue also raises a question should or not hwsku.json contain all possible ports or just front panel ports Before I thought hwsku.json should contain a front panel ports only with a specified breakout mode but commit 744a15268 was supposed to change it.