From 84db180bb4e0270028d1c0a28f79734e6bfcd69e Mon Sep 17 00:00:00 2001 From: Raphael Tryster Date: Thu, 8 Apr 2021 15:58:00 +0000 Subject: [PATCH 1/4] Increase min-links limit for portchannel from 128 to 1024. Signed-off-by: Raphael Tryster --- src/sonic-yang-models/yang-models/sonic-portchannel.yang | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sonic-yang-models/yang-models/sonic-portchannel.yang b/src/sonic-yang-models/yang-models/sonic-portchannel.yang index 837d18bef4c0..aaf051b078d4 100644 --- a/src/sonic-yang-models/yang-models/sonic-portchannel.yang +++ b/src/sonic-yang-models/yang-models/sonic-portchannel.yang @@ -74,6 +74,8 @@ module sonic-portchannel { } leaf min_links { + type uint16 { + range 1..1024; type uint8 { range 1..128; } From 7e88d04cdc9b9c538e129448bb1be96331ca2889 Mon Sep 17 00:00:00 2001 From: Raphael Tryster Date: Thu, 13 May 2021 13:41:10 +0000 Subject: [PATCH 2/4] Portchannel min-links increased to 1024 in teamd and yang, added yang tests Signed-off-by: Raphael Tryster --- ...crease-min_ports-upper-limit-to-1024.patch | 34 ++++++++++ src/libteam/patch/series | 1 + .../yang_model_tests/tests/portchannel.json | 7 ++ .../tests_config/portchannel.json | 64 +++++++++++++++++++ .../yang-models/sonic-portchannel.yang | 8 ++- 5 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 src/libteam/patch/0012-Increase-min_ports-upper-limit-to-1024.patch diff --git a/src/libteam/patch/0012-Increase-min_ports-upper-limit-to-1024.patch b/src/libteam/patch/0012-Increase-min_ports-upper-limit-to-1024.patch new file mode 100644 index 000000000000..286df05d7739 --- /dev/null +++ b/src/libteam/patch/0012-Increase-min_ports-upper-limit-to-1024.patch @@ -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 { diff --git a/src/libteam/patch/series b/src/libteam/patch/series index 5350d37e4653..cd7522918f43 100644 --- a/src/libteam/patch/series +++ b/src/libteam/patch/series @@ -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 diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/portchannel.json b/src/sonic-yang-models/tests/yang_model_tests/tests/portchannel.json index c461fae1b674..693b0fd47b75 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/portchannel.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/portchannel.json @@ -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", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json index 315d6cee6d91..098eb8d2357b 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json @@ -28,6 +28,70 @@ "mtu": "9100", "tpid": "0x8100", "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" } ] diff --git a/src/sonic-yang-models/yang-models/sonic-portchannel.yang b/src/sonic-yang-models/yang-models/sonic-portchannel.yang index aaf051b078d4..40b88d4d8f86 100644 --- a/src/sonic-yang-models/yang-models/sonic-portchannel.yang +++ b/src/sonic-yang-models/yang-models/sonic-portchannel.yang @@ -26,6 +26,10 @@ module sonic-portchannel { description "PORTCHANNEL yang Module for SONiC OS"; + revision 2021-05-13 { + description "Change min-links valid range from 1-128 to 0-1024"; + } + revision 2021-03-31 { description "Add PortChannel Interface List with VRF attribute"; } @@ -75,9 +79,7 @@ module sonic-portchannel { leaf min_links { type uint16 { - range 1..1024; - type uint8 { - range 1..128; + range 0..1024; } } From 49700c1fa8aab2b464f5c57b88ee2738c149f804 Mon Sep 17 00:00:00 2001 From: Raphael Tryster Date: Sun, 6 Jun 2021 04:27:10 +0000 Subject: [PATCH 3/4] Changed tabs to spaces Signed-off-by: Raphael Tryster --- .../tests/yang_model_tests/tests_config/portchannel.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json index 098eb8d2357b..d9a54b885958 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/portchannel.json @@ -28,7 +28,7 @@ "mtu": "9100", "tpid": "0x8100", "lacp_key": "auto", - "name": "PortChannel0001" + "name": "PortChannel0001" } ] } From 2cd61b81234f46670efe64d26ff6ff2b27b24949 Mon Sep 17 00:00:00 2001 From: Raphael Tryster Date: Sun, 13 Jun 2021 11:50:00 +0000 Subject: [PATCH 4/4] Changed min-links lower limit from 0 to 1 Signed-off-by: Raphael Tryster --- src/sonic-yang-models/yang-models/sonic-portchannel.yang | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sonic-yang-models/yang-models/sonic-portchannel.yang b/src/sonic-yang-models/yang-models/sonic-portchannel.yang index 40b88d4d8f86..f02a45d93917 100644 --- a/src/sonic-yang-models/yang-models/sonic-portchannel.yang +++ b/src/sonic-yang-models/yang-models/sonic-portchannel.yang @@ -26,8 +26,8 @@ module sonic-portchannel { description "PORTCHANNEL yang Module for SONiC OS"; - revision 2021-05-13 { - description "Change min-links valid range from 1-128 to 0-1024"; + revision 2021-06-13 { + description "Change min-links valid range from 1-128 to 1-1024"; } revision 2021-03-31 { @@ -79,7 +79,7 @@ module sonic-portchannel { leaf min_links { type uint16 { - range 0..1024; + range 1..1024; } }