-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
sonic-buildimage: ignore missing hwsku dict intfs #20618
sonic-buildimage: ignore missing hwsku dict intfs #20618
Conversation
With the introduction of new hwskus that do not utilize every front panel port available, i.e. the ports are not fully populated, the sonic-config-engine will raise an exception when checking the hwsku dict for such interfaces. This change removes that exception.
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.
LGTM
@r12f can you help to review this one? |
@@ -417,7 +417,7 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): | |||
|
|||
for intf in port_dict[INTF_KEY]: | |||
if intf not in hwsku_dict[INTF_KEY]: | |||
raise Exception("{} is not available in hwsku_dict".format(intf)) | |||
continue |
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.
hi Chris, do you mind to help fix the platform.json instead of hack it here? If the interface doesn't exist, it is reasonable to throw, because things doesn't look right.
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.
Hi @r12f, this change is related to the platform.json complications with unused interfaces, from this discussion here: #20107 (comment)
The platform.json file is common to all hwskus under the same platform folder, so updating platform.json to work with C256S2 would for example break other hwskus such as O128S2.
Atlernatively, if we add the unused interfaces back to the hwsku then we would not need to touch platform.json, but then the unused interfaces would show up in the output of show interface status
.
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.
I see. how about reverse the logic? In my understanding, platform.json is more complete and more recent design than port_config.ini, so if a port exists in the hwsku, it should exist in the platform.json as long as the platform.json file exists.
what do you think?
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.
@r12f that sounds like a reasonable alternative, I will test the change and post the update once verified.
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.
hi Chris, how things go with the reversed check? : D
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.
Hi Riff, interestingly, reversing the logic causes at least one unit test to fail, meaning there is likely a fix to be had in the unit tests as well. I'll take a closer look to see what can be done there.
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.
@r12f @ccroy-arista can we introduce dummy entry in hwsku json file :-
"interfaces": {
"Ethernet0": {
"default_brkout_mode": "8x100G"
},
"Ethernet8": {
}, <<< DUMMY
"Ethernet16": {
"default_brkout_mode": "8x100G"
},
"Ethernet24": {
}, <<< DUMMY
"Ethernet32": {
"default_brkout_mode": "8x100G"
},
"Ethernet40": {
} <<< DUMMY
"Ethernet48": {
"default_brkout_mode": "8x100G"
},
hi @ccroy-arista , I have sync'ed up with PrinceG, to get this working, we can try add dummy entries in the hwsku.json without changing this. In particular: Do you mind to help give this a try? |
Hi @r12f, yes I will try out your suggestions and let you know how it goes. |
@ccroy-arista any update on this? |
Hi @prgeor , gently ping on this one : D |
Maybe we can remove the check of the default breakout? |
@Gfrom2016 for viz |
@ccroy-arista can you make following change in portconfig.py to ignore ports that does not specify the |
@ccroy-arista can you make the change suggested by Prince? |
@sdszhang @prgeor the unit tests make it further now, eventually failing at
|
I'm looking into the failure at |
From the AssertionError, it looks like one of the other test files used for comparison is missing Dpc role entries for Ethernet140 and Ethernet141:
I'll add those and check the status of the unit tests once they've had a chance to run. |
The unit tests have passed with the latest adjustments. Just waiting for a build to finish to test against Arista-7060X6-64PE-C256S2 to ensure no regression, then will update the PR. |
Now that the sonic-config-engine unit tests pass, the build eventually fails at the sonic-device-data
|
@ccroy-arista @prgeor can we add some skips here to skip them for TH5 hwskus?
|
@sdszhang I am ok with that. |
@prgeor will it be okay?
|
Why I did it
For new hwskus that leave some front panel ports unpopulated, sonic-config-engine will raise an exception when checking the hwsku dict for interfaces corresponding to those front panel ports. This change removes that exception, allowing duts for those hwskus to be configured.
Work item tracking
How I did it
Replaced the raised exception with a continue statement.
How to verify it
This can be verfied by configuring an appropriate dut against the Arista-7060X6-64PE-C256S2 hwsku.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
202405
Description for the changelog
With the introduction of new hwskus that do not utilize every front panel port available, i.e. the ports are not fully populated, the
sonic-config-engine will raise an exception when checking the hwsku dict for such interfaces. This change removes that exception, allowing duts for those hwskus to be configured.