-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
84db180
Increase min-links limit for portchannel from 128 to 1024.
raphaelt-nvidia 7e88d04
Portchannel min-links increased to 1024 in teamd and yang, added yang…
raphaelt-nvidia 49700c1
Changed tabs to spaces
raphaelt-nvidia 2cd61b8
Changed min-links lower limit from 0 to 1
raphaelt-nvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/libteam/patch/0012-Increase-min_ports-upper-limit-to-1024.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
diff --git a/man/teamd.conf.5 b/man/teamd.conf.5 | ||
index 350ffc9..dc913cd 100644 | ||
--- a/man/teamd.conf.5 | ||
+++ b/man/teamd.conf.5 | ||
@@ -248,7 +248,7 @@ Default: | ||
.RE | ||
.TP | ||
.BR "runner.min_ports " (int) | ||
-Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 255. | ||
+Specifies the minimum number of ports that must be active before asserting carrier in the master interface, value can be 1 \(en 1024. | ||
.RS 7 | ||
.PP | ||
Default: | ||
diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c | ||
index 9354ebb..a901398 100644 | ||
--- a/teamd/teamd_runner_lacp.c | ||
+++ b/teamd/teamd_runner_lacp.c | ||
@@ -151,6 +151,7 @@ struct lacp { | ||
#define LACP_CFG_DFLT_FALLBACK false | ||
int min_ports; | ||
#define LACP_CFG_DFLT_MIN_PORTS 1 | ||
+#define LACP_CFG_DFLT_MIN_PORTS_MAX 1024 | ||
enum lacp_agg_select_policy agg_select_policy; | ||
#define LACP_CFG_DFLT_AGG_SELECT_POLICY LACP_AGG_SELECT_LACP_PRIO | ||
} cfg; | ||
@@ -493,7 +494,7 @@ static int lacp_load_config(struct teamd_context *ctx, struct lacp *lacp) | ||
err = teamd_config_int_get(ctx, &tmp, "$.runner.min_ports"); | ||
if (err) { | ||
lacp->cfg.min_ports = LACP_CFG_DFLT_MIN_PORTS; | ||
- } else if (tmp < 1 || tmp > UCHAR_MAX) { | ||
+ } else if (tmp < 1 || tmp > LACP_CFG_DFLT_MIN_PORTS_MAX) { | ||
teamd_log_err("\"min_ports\" value is out of its limits."); | ||
return -EINVAL; | ||
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.