-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[hwsku] set optional fields for child ports #6660
base: master
Are you sure you want to change the base?
[hwsku] set optional fields for child ports #6660
Conversation
@@ -255,7 +255,8 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): | |||
# take optional fields from hwsku.json | |||
for key, item in hwsku_dict[INTF_KEY][intf].items(): | |||
if key in OPTIONAL_HWSKU_ATTRIBUTES: | |||
child_ports.get(intf)[key] = item | |||
for child_key in child_ports.keys(): | |||
child_ports.get(child_key)[key] = item |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a unit test for catch such error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lguohan , done, please check
04a09ec
to
94ede95
Compare
@lguohan , reminder for review |
@lguohan please merge |
@lguohan @daall @jleveque @qiluo-msft please review and merge this PR. |
d0f33e9
to
a788f8e
Compare
This pull request introduces 1 alert when merging a788f8e243b798658c8f0c7e1dfddb78af640369 into 070b020 - view on LGTM.com new alerts:
|
a788f8e
to
5de0919
Compare
Can someone take a look, please? |
@lguohan, please merge |
@@ -226,6 +226,16 @@ def get_child_ports(interface, breakout_mode, platform_json_file): | |||
parent_intf_id = int(re.search("Ethernet(\d+)", interface).group(1)) | |||
for k in match_list: | |||
offset = gen_port_config(child_ports, parent_intf_id, index, alias_list, lanes, k, offset) | |||
|
|||
if hwsku_dict is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in #7578 , what we really need is to enhance the design to support other fields in platform.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Design change is needed.
- Why I did it
Currently after split ports using
mode
in hwsku, optional parameters set only for parent ports.Example:
if we set
autoneg
,fec
in hwsku forEthernet0
like this:config_db will be:
Its not really correct because of we need set this parameters for all generate interfaces.
After fix, config_db will be:
- How I did it
Add optional fields for child ports.
- How to verify it
Add optional fields in hwsku.json and generate config_db
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)