-
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
Increase min-links limit for portchannel from 128 to 1024. #7265
Conversation
do you need to update the libteam as well? |
The link I quoted above is the change in libteam. |
@@ -23,7 +23,7 @@ module sonic-portchannel { | |||
description "PORTCHANNEL yang Module for SONiC OS"; | |||
|
|||
revision 2019-07-01 { | |||
description "First Revision"; | |||
description "Increased range for min_links"; |
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.
Yang model subgroup meeting 4/8:
Please confirm if revision needs to be changed. (cc: @praveen-li)
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.
For each update to the yang, it is better to maintain a corresponding revision with the description of the change.
type uint8 { | ||
range 1..128; | ||
type uint16 { | ||
range 1..1024; | ||
} |
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.
Yang model subgroup meeting 4/8:
Do any tests need to be updated with new range limit (128->1024)? (cc: @praveen-li )
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.
Looks like a test case needs to be added for the range check.
That change is not available in sonic yet, right? The version being checked out is much older (from Feb 4, 2020).
|
@lguohan and @judyjoseph can you please clarify what is needed? |
Let's have it consistent. |
can you help to resolve conflict? |
@raphaelt-nvidia. Please update to have range from 1..255. |
The proposed change to the Yang model was to be consistent with ***@***.***<jpirko/libteam@69a7494>), which I wrongly thought had already been pushed. Working on that.
Raphael Tryster
Staff Engineer, Software
From: joyas-joseph ***@***.***>
Sent: Tuesday, 11 May, 2021 12:31 AM
To: Azure/sonic-buildimage ***@***.***>
Cc: Raphael Tryster ***@***.***>; Mention ***@***.***>
Subject: Re: [Azure/sonic-buildimage] Increase min-links limit for portchannel from 128 to 1024. (#7265)
@lguohan<https://github.com/lguohan> and @judyjoseph<https://github.com/judyjoseph> can you please clarify what is needed?
do we want to keep this change and work to fix the conflict or should we abandon this as libteam is not the latest one? i dont think libteam should be updated just because of this yang model.
Let's have it consistent.
We can have the range 1..1024, if we bring in at least the commit ***@***.***<jpirko/libteam@69a7494>) as a patch.
Without that, lets have the range 1..255.
@raphaelt-nvidia<https://github.com/raphaelt-nvidia>. Please update to have range from 1..255.
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#7265 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ASDJDC5GCTW5MFFDFKFA3O3TNBGA3ANCNFSM42TGQXOA>.
|
73f78ed
to
325c54e
Compare
325c54e
to
7d2b567
Compare
type uint8 { | ||
range 1..128; | ||
type uint16 { | ||
range 0..1024; | ||
} |
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.
Shouldnt the range be 1..1024?
If we do support value 0, what does it indicate? #Closed
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.
Agree
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 found this necessary to be compatible with related sonic-net/sonic-utilities#1630. The original code there sets the default value of min-links to 0, and now that I have introduced range checking there, keeping a lower bound of 1 causes range check to fail. So this change aligns yang with CLI.
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.
Did you test the 0 in current sonic image? Does teamd support it? ie. you set it as 0, and admin down all the member ports, and the portchannel itself is still up?
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.
Results are the same with current master and with the changes in this PR. Recall that the default value of min-links in sonic-utilities is 0. In both cases, shutting down all members of the LAG causes the portchannel to go oper down. I noticed some non-deterministic behaviour, that may be a separate bug: with one of two member ports down, the LAG is sometimes up and sometimes down.
Since the default is 0, one would expect that in the current master, a portchannel created with default min-links should be up when all members are down. On the other hand, the work in this PR is supposed to clean up mismatches, and based on Qi's question, I now think that it doesn't do what it should. What I did was align yang with CLI, but it seems teamd is now the odd one out, as the change in teamd only adjusted the upper limit and kept the lower at 1. If you think it is reasonable to specify that a portchannel with all members down should be up (i.e. min-links = 0), then we have some more work to do to make teamd comply. (Any other places?) If not, then I should do the alignment the other way: put the lower limit in yang back to 1, and change the lower limit and default in sonic-utilities to 1.
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.
Thanks for the great insight! I prefer set lower limit of min-link to 1 to make life a little bit easier.
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 agree. Let's have the lower limit of min-links set to 1.
src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json
Outdated
Show resolved
Hide resolved
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 comments
db7f697
to
fde97d1
Compare
a479ee7
Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
… tests Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
Signed-off-by: Raphael Tryster <raphaelt@nvidia.com>
a479ee7
to
2cd61b8
Compare
@qiluo-msft and @judyjoseph could you please help to review recent fixes and approve for merge? |
I am confused about the numbers in PR description, like 0, 255. So I changed it according to my understanding. Please double check. |
Now I am confused. What and where did you change? I think your confusion stems from the mismatches that existed before this work was done, and it appears above in the discussion. Originally, teamd was 1-255, cli was any integer with default 0, and yang was 1-128. Now, they should all be aligned on 1-1024. |
…#7265) #### Why I did it Restrict the min-links parameter in "config portchannel" to the range 1-1024. Fixes sonic-net#6781 in conjunction with sonic-net#1630. Align YANG model with limits in libteam and sonic-utilties. #### How I did it PR 1630 in sonic-utilities prevents CLI user from entering a value outside the allowed range. This PR does the following: - Increases the maximum value of min-links from 128 to 1024. - Provides validation in libteam, incorporating as a patch the code in https://git.kernel.org/pub/scm/linux/kernel/git/jpirko/libteam.git/commit/?id=69a7494bb77dc10bb27076add07b380dbd778592. - Updates the Yang model upper limit from 128 to 1024 (was inconsistent with libteam value). - Updates the Yang model lower limit from 1 to 0, since 0 is set as default in sonic-utilities which would fail its new range check otherwise. - Added Yang tests for valid and invalid value. #### How to verify it config portchannel add PortChannel0004 --min-links 1024 Command should be accepted. show interfaces portchannel Output should show PortChannel0004, no errors on CLI. config portchannel add PortChannel0005 --min-links 1025 Command should be rejected show interfaces portchannel Output should not show PortChannel0005 , no errors on CLI. #### Which release branch to backport (provide reason below if selected) #### Description for the changelog Updates YANG model to allow up to 1024 min_links for portchannel. Fixes sonic-net#6781 in conjunction with sonic-net#1630.
@liat-grozovik This PR fixes #6781 in conjunction with sonic-net/sonic-utilities#1630. The other PR was also merged to 202106 but this one was not. Please add a label to request that this PR be merged to 202106. I see no merge conflicts. |
#### Why I did it Restrict the min-links parameter in "config portchannel" to the range 1-1024. Fixes #6781 in conjunction with #1630. Align YANG model with limits in libteam and sonic-utilties. #### How I did it PR 1630 in sonic-utilities prevents CLI user from entering a value outside the allowed range. This PR does the following: - Increases the maximum value of min-links from 128 to 1024. - Provides validation in libteam, incorporating as a patch the code in https://git.kernel.org/pub/scm/linux/kernel/git/jpirko/libteam.git/commit/?id=69a7494bb77dc10bb27076add07b380dbd778592. - Updates the Yang model upper limit from 128 to 1024 (was inconsistent with libteam value). - Updates the Yang model lower limit from 1 to 0, since 0 is set as default in sonic-utilities which would fail its new range check otherwise. - Added Yang tests for valid and invalid value. #### How to verify it config portchannel add PortChannel0004 --min-links 1024 Command should be accepted. show interfaces portchannel Output should show PortChannel0004, no errors on CLI. config portchannel add PortChannel0005 --min-links 1025 Command should be rejected show interfaces portchannel Output should not show PortChannel0005 , no errors on CLI. #### Which release branch to backport (provide reason below if selected) #### Description for the changelog Updates YANG model to allow up to 1024 min_links for portchannel. Fixes #6781 in conjunction with #1630.
Signed-off-by: Raphael Tryster raphaelt@nvidia.com
Why I did it
Restrict the min-links parameter in "config portchannel" to the range 1-1024.
Fixes #6781 in conjunction with sonic-net/sonic-utilities#1630.
Align YANG model with limits in libteam and sonic-utilties.
How I did it
PR 1630 in sonic-utilities prevents CLI user from entering a value outside the allowed range. This PR does the following:
How to verify it
config portchannel add PortChannel0004 --min-links 1024
Command should be accepted.
show interfaces portchannel
Output should show PortChannel0004, no errors on CLI.
config portchannel add PortChannel0005 --min-links 1025
Command should be rejected
show interfaces portchannel
Output should not show PortChannel0005 , no errors on CLI.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Updates YANG model to allow up to 1024 min_links for portchannel. Fixes #6781 in conjunction with #1630.
A picture of a cute animal (not mandatory but encouraged)