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

Fix optional hwsku params not applying to all interfaces #20313

Conversation

bobbymcgonigle
Copy link
Contributor

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.

For example:

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

In this scenario we want autoneg on to be in the config_db entry for
both interfaces that belong to the group; Ethernet0 and Ethernet4.

Currently this only gets applied to Ethernet0:

(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'}}

With this change it now gets applied to all interfaces in the group as 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'}}

Why I did it

I need to apply optional hwsku params for a group of interfaces.

How I did it

Just changed to iterate over every child port in group.

How to verify it

Introduction to the problem shows verification of the solution. Check the output manually and also fixed the unit test to correspond and pass.

Which release branch to backport (provide reason below if selected)

  • 202405

Tested branch (Please provide the tested image version)

master and 202405

Description for the changelog

fix optional hwsku params not applying to all interfaces in defined group.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

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
@StormLiangMS
Copy link
Contributor

hi @prgeor could you help to review?

@StormLiangMS
Copy link
Contributor

hi @prgeor could you help to review?

@@ -430,7 +430,8 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file):
if child_port in hwsku_entry:
for key, item in hwsku_entry[child_port].items():
if key in OPTIONAL_HWSKU_ATTRIBUTES:
child_ports.get(child_port)[key] = item
for child in child_ports:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prgeor
Copy link
Contributor

prgeor commented Nov 13, 2024

@liat-grozovik please have someone review. thanks.

@StormLiangMS
Copy link
Contributor

hi @liat-grozovik, could you have someone to take a look by this week?

@StormLiangMS StormLiangMS merged commit f222ff9 into sonic-net:master Dec 5, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants