Skip to content

Commit

Permalink
Portchannel min-links increased to 1024 in teamd and yang, added yang…
Browse files Browse the repository at this point in the history
… tests

Signed-off-by: Raphael Tryster <[email protected]>
  • Loading branch information
raphaelt-nvidia committed May 13, 2021
1 parent f06a3ad commit 73f78ed
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 1 deletion.
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 {
1 change: 1 addition & 0 deletions src/libteam/patch/series
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
0009-Fix-ifinfo_link_with_port-race-condition-with-newlink.patch
0010-When-read-of-timerfd-returned-0-don-t-consider-this-.patch
0011-Remove-extensive-debug-output.patch
0012-Increase-min_ports-upper-limit-to-1024.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"PORT_CHANNEL_TEST": {
"desc": "Configure a member port in PORT_CHANNEL table."
},
"PORT_CHANNEL_MAX_VALID_MIN_LINKS": {
"desc": "Configure PortChannel with maximum valid value of min-links."
},
"PORT_CHANNEL_OUT_OF_RANGE_MIN_LINKS": {
"desc": "Configure PortChannel with greater than maximum valid value of min-links.",
"eStr": ["Value", "does not satisfy the constraint"]
},
"PORT_CHANNEL_WRONG_PATTERN": {
"desc": "INCORRECT PORTCHANNEL_NAME IN PORT_CHANNEL TABLE.",
"eStrKey" : "Pattern",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,70 @@
"min_links": "1",
"mtu": "9100",
"lacp_key": "auto",
"name": "PortChannel0001"
}
]
}
}
},
"PORT_CHANNEL_MAX_VALID_MIN_LINKS": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"members": [
"Ethernet0"
],
"min_links": "1024",
"mtu": "9100",
"name": "PortChannel0001"
}
]
}
}
},
"PORT_CHANNEL_OUT_OF_RANGE_MIN_LINKS": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [
{
"admin_status": "up",
"members": [
"Ethernet0"
],
"min_links": "1025",
"mtu": "9100",
"name": "PortChannel0001"
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-portchannel.yang
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module sonic-portchannel {
description "PORTCHANNEL yang Module for SONiC OS";

revision 2021-05-13 {
description "Increased range for min_links";
description "Change min-links valid range from 1-128 to 0-1024";
}

revision 2021-03-31 {
Expand Down

0 comments on commit 73f78ed

Please sign in to comment.