-
Notifications
You must be signed in to change notification settings - Fork 545
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
[portmgrd] prevent runtime exception (crash) in setting MTU on portchannel member #3432
base: master
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@prsunny please review |
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
…annel member (PR sonic-net#3432) Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
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.
Please add UT to cover this scenario.
@bradh352 We do have this check at CLI level https://github.com/sonic-net/sonic-utilities/blob/80d469886f120bfe9bc60024f608c039dce06646/config/main.py#L4948 Why do we need such checks at multiple places? @prsunny what are your thoughts on this? |
People using things like Ansible, don't use the CLI to set configuration. They modify the |
Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel. Signed-off-by: Brad House (@bradh352)
277e0ae
to
201d5b1
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
84669f9
to
d4b4b98
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I committed one, no idea if its right. |
coverage looks good, any other comments? |
Agree with @dgsudharsan , this is checked in the CLI and Yang level. I dont think its really needed in swss. |
Your evaluation is not correct. First, its not occurring at the yang level as per: There are no restrictions on MTU being set for a port. But that's besides the point. My configuration that triggered this behavior, as can be seen in the PR summary, did not have an MTU set at all on the port:
That means its getting inherited somewhere (I didn't look where), triggering it to call |
Ok, found where its being set by default to 9100, a hardcoded code path: Lines 163 to 172 in c20902f
Which is right above: Lines 222 to 226 in c20902f
Which is where it crashes due to the exception caused by The macro for the default value is here: Line 15 in c20902f
There's no way that any CLI or Yang verification can prevent a hardcoded default in the code path. |
What I did
Do not attempt to set the MTU directly on PortChannel members as it will likely fail. The MTU gets inherited as part of the PortChannel.
Why I did it
portmgr goes down which causes swss container to go down
How I verified it
Apply patch and verify this config no longer causes crash on Dell S5248F (Broadcom Trident3).
Tested on 202411 and master.
Details if related
Signed-off-by: Brad House (@bradh352)