From 1357d10f073af17329c45933c99d90cc8f043ed6 Mon Sep 17 00:00:00 2001 From: Vadym Hlushko <62022266+vadymhlushko-mlnx@users.noreply.github.com> Date: Fri, 4 Feb 2022 04:03:17 +0200 Subject: [PATCH 001/139] [install.sh] Fixed the sed pattern to match the current image revision (#9813) #### Why I did it The test plan described in the `How to verify it` section caused an issue when 3 images (instead of 2) were present when executing `show boot` or `sonic-installer list` commands: ``` root@sonic:/home/admin# show boot Current: SONiC-OS-master.0-dirty-20220118.165941 Next: SONiC-OS-master.0-dirty-20220118.165941 Available: SONiC-OS-master.0-dirty-20220118.165941 SONiC-OS-202012.201-a0376a6e5_Internal SONiC-OS-202012.201-a0376a6e5_Internal_RPC ``` #### How I did it Fixed the `sed` pattern to match the current image revision in the `install.sh` script. #### How to verify it Test plan: 1. Install the `imageA` by using ONIE 2. Install the `imageA-rpc` by using `sonic-installer` 3. Reboot the switch 4. Swap to the `imageA` - `sonic-installer set-default imageA` 5. Reboot the switch 6. Install the `imageB` by using `sonic-installer` 7. Check an installed images - `show boot` 8. Reboot the switch 9. Check an installed images - `show boot` --- installer/x86_64/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 733dea43da6..dbab4d54ab7 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -652,7 +652,7 @@ fi # Note: assume that apparmor is supported in the kernel demo_grub_entry="$demo_volume_revision_label" if [ "$install_env" = "sonic" ]; then - old_sonic_menuentry=$(cat /host/grub/grub.cfg | sed "/$running_sonic_revision/,/}/!d") + old_sonic_menuentry=$(cat /host/grub/grub.cfg | sed "/^menuentry '${demo_volume_label}-${running_sonic_revision}'/,/}/!d") grub_cfg_root=$(echo $old_sonic_menuentry | sed -e "s/.*root\=\(.*\)rw.*/\1/") onie_menuentry=$(cat /host/grub/grub.cfg | sed "/menuentry ONIE/,/}/!d") elif [ "$install_env" = "build" ]; then From 0629e5b432229c5efa46fd07fba4cba568b2a0ec Mon Sep 17 00:00:00 2001 From: Ashok Daparthi-Dell Date: Fri, 4 Feb 2022 16:47:56 -0800 Subject: [PATCH 002/139] [yang] Fix for sonic-scheduler.yang name pattern (#9873) #### Why I did it PR9611 - sonic-scheduler.yang pattern issue #### How I did it Modified the scheduler name pattern string to accept any string #### How to verify it Sonic yang tests --- .../tests/files/sample_config_db.json | 24 +++++++++++ .../tests/yang_model_tests/tests/qos.json | 4 ++ .../yang_model_tests/tests_config/qos.json | 40 ++++++++++++++++++- .../yang-models/sonic-scheduler.yang | 9 +---- 4 files changed, 68 insertions(+), 9 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e6925562314..e8bbc59bcdb 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1375,6 +1375,24 @@ "pbs": "2048", "pir": "2560000", "type": "STRICT" + }, + "scheduler.0": { + "cbs": "256", + "cir": "1250000", + "meter_type": "bytes", + "pbs": "1024", + "pir": "25000000", + "type": "DWRR", + "weight": "20" + }, + + "scheduler.1": { + "cbs": "1024", + "cir": "1280000", + "meter_type": "bytes", + "pbs": "2048", + "pir": "2560000", + "type": "STRICT" } }, @@ -1404,6 +1422,12 @@ "Ethernet0|1": { "scheduler": "TEST@1", "wred_profile": "Wred1" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|3": { + "scheduler": "scheduler.1" } }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json index 96b7b4b8d94..189cec177a2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qos.json @@ -35,6 +35,10 @@ "eStr": ["pir must be greater than or equal to cir"] }, + "SCHEDULER_VALID_NAME": { + "desc": "Configure SCHEDULER table." + }, + "WRED_PROFILE_EMPTY": { "desc": "Configure Empty WRED profile." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json index 481990b4d65..67775b11db8 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qos.json @@ -116,7 +116,45 @@ } } }, - + + "SCHEDULER_VALID_NAME": { + "sonic-scheduler:sonic-scheduler":{ + "sonic-scheduler:SCHEDULER": { + "SCHEDULER_LIST": [ + { + "name":"scheduler.0", + "cbs": 256, + "cir": 1250000, + "meter_type": "bytes", + "pbs": 1024, + "pir": 25000000, + "type": "DWRR", + "weight": 10 + }, + { + "name":"scheduler.1", + "cbs": 1024, + "cir": 1280000, + "meter_type": "bytes", + "pbs": 2048, + "pir": 2560000, + "type": "STRICT", + "priority": 0 + }, + { + "name":"scheduler.2", + "cbs": 256, + "cir": 1250000, + "meter_type": "bytes", + "pbs": 1024, + "pir": 25000000, + "type": "WRR", + "weight": 20 + } + ] + } + } + }, "WRED_PROFILE_EMPTY": { "sonic-wred-profile:sonic-wred-profile":{ diff --git a/src/sonic-yang-models/yang-models/sonic-scheduler.yang b/src/sonic-yang-models/yang-models/sonic-scheduler.yang index e6d1b7468f9..8dcd4bef79b 100644 --- a/src/sonic-yang-models/yang-models/sonic-scheduler.yang +++ b/src/sonic-yang-models/yang-models/sonic-scheduler.yang @@ -31,14 +31,7 @@ module sonic-scheduler { key "name"; leaf name { - - type string { - pattern "[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})|[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})([@]{1})([0-9]{1,3})"; - length 1..36 { - error-message "Invalid length for scheduler name."; - error-app-tag scheduler-name-invalid-length; - } - } + type string; description "Scheduler name"; } From 7a4c58f118812a5ce6033d8ace65052fdc14874f Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Sat, 5 Feb 2022 13:07:32 -0800 Subject: [PATCH 003/139] [sonic-linkmgrd][master] submodule update (#9904) [sonic-linkmgrd][master] submodule update ef1f5eb Jing Zhang Feb 3 09:37:25 2022 [linkmgrd] linkmgrd subscribes MUX_CABLE_INFO table to handle peer OIR events (#17) bcd74b4 Jing Zhang Feb 1 09:52:00 2022 Collect ICMP packet loss information (#14) sign-off: Jing Zhang zhangjing@microsoft.com --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index 0c23756cd61..ef1f5ebc9a6 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit 0c23756cd618473064381618ef82687f98b7e31f +Subproject commit ef1f5ebc9a64207e622da1fb11eb78e6d95e7f45 From e5ee501116055d8ad6298f87b4926a0a418d1810 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Sun, 6 Feb 2022 02:23:00 -0500 Subject: [PATCH 004/139] Remove redundant breakout mode for SN3800 (#9912) --- .../x86_64-mlnx_msn3800-r0/platform.json | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json index 92865e228ee..db273059482 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json @@ -725,7 +725,6 @@ "lanes": "0,1,2,3", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp1"], - "1x10G[100G,50G,40G,25G]": ["etp1"], "2x50G[25G,10G]": ["etp1a", "etp1b"] } }, @@ -734,7 +733,6 @@ "lanes": "4,5,6,7", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp2"], - "1x10G[100G,50G,40G,25G]": ["etp2"], "2x50G[25G,10G]": ["etp2a", "etp2b"] } }, @@ -743,7 +741,6 @@ "lanes": "8,9,10,11", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp3"], - "1x10G[100G,50G,40G,25G]": ["etp3"], "2x50G[25G,10G]": ["etp3a", "etp3b"] } }, @@ -752,7 +749,6 @@ "lanes": "12,13,14,15", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp4"], - "1x10G[100G,50G,40G,25G]": ["etp4"], "2x50G[25G,10G]": ["etp4a", "etp4b"] } }, @@ -761,7 +757,6 @@ "lanes": "16,17,18,19", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp5"], - "1x10G[100G,50G,40G,25G]": ["etp5"], "2x50G[25G,10G]": ["etp5a", "etp5b"] } }, @@ -770,7 +765,6 @@ "lanes": "20,21,22,23", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp6"], - "1x10G[100G,50G,40G,25G]": ["etp6"], "2x50G[25G,10G]": ["etp6a", "etp6b"] } }, @@ -779,7 +773,6 @@ "lanes": "24,25,26,27", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp7"], - "1x10G[100G,50G,40G,25G]": ["etp7"], "2x50G[25G,10G]": ["etp7a", "etp7b"] } }, @@ -788,7 +781,6 @@ "lanes": "28,29,30,31", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp8"], - "1x10G[100G,50G,40G,25G]": ["etp8"], "2x50G[25G,10G]": ["etp8a", "etp8b"] } }, @@ -797,7 +789,6 @@ "lanes": "32,33,34,35", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp9"], - "1x10G[100G,50G,40G,25G]": ["etp9"], "2x50G[25G,10G]": ["etp9a", "etp9b"] } }, @@ -806,7 +797,6 @@ "lanes": "36,37,38,39", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp10"], - "1x10G[100G,50G,40G,25G]": ["etp10"], "2x50G[25G,10G]": ["etp10a", "etp10b"] } }, @@ -815,7 +805,6 @@ "lanes": "40,41,42,43", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp11"], - "1x10G[100G,50G,40G,25G]": ["etp11"], "2x50G[25G,10G]": ["etp11a", "etp11b"] } }, @@ -824,7 +813,6 @@ "lanes": "44,45,46,47", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp12"], - "1x10G[100G,50G,40G,25G]": ["etp12"], "2x50G[25G,10G]": ["etp12a", "etp12b"] } }, @@ -833,7 +821,6 @@ "lanes": "48,49,50,51", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp13"], - "1x10G[100G,50G,40G,25G]": ["etp13"], "2x50G[25G,10G]": ["etp13a", "etp13b"] } }, @@ -842,7 +829,6 @@ "lanes": "52,53,54,55", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp14"], - "1x10G[100G,50G,40G,25G]": ["etp14"], "2x50G[25G,10G]": ["etp14a", "etp14b"] } }, @@ -851,7 +837,6 @@ "lanes": "56,57,58,59", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp15"], - "1x10G[100G,50G,40G,25G]": ["etp15"], "2x50G[25G,10G]": ["etp15a", "etp15b"] } }, @@ -860,7 +845,6 @@ "lanes": "60,61,62,63", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp16"], - "1x10G[100G,50G,40G,25G]": ["etp16"], "2x50G[25G,10G]": ["etp16a", "etp16b"] } }, @@ -869,7 +853,6 @@ "lanes": "64,65,66,67", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp17"], - "1x10G[100G,50G,40G,25G]": ["etp17"], "2x50G[25G,10G]": ["etp17a", "etp17b"] } }, @@ -878,7 +861,6 @@ "lanes": "68,69,70,71", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp18"], - "1x10G[100G,50G,40G,25G]": ["etp18"], "2x50G[25G,10G]": ["etp18a", "etp18b"] } }, @@ -887,7 +869,6 @@ "lanes": "72,73,74,75", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp19"], - "1x10G[100G,50G,40G,25G]": ["etp19"], "2x50G[25G,10G]": ["etp19a", "etp19b"] } }, @@ -896,7 +877,6 @@ "lanes": "76,77,78,79", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp20"], - "1x10G[100G,50G,40G,25G]": ["etp20"], "2x50G[25G,10G]": ["etp20a", "etp20b"] } }, @@ -905,7 +885,6 @@ "lanes": "80,81,82,83", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp21"], - "1x10G[100G,50G,40G,25G]": ["etp21"], "2x50G[25G,10G]": ["etp21a", "etp21b"] } }, @@ -914,7 +893,6 @@ "lanes": "84,85,86,87", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp22"], - "1x10G[100G,50G,40G,25G]": ["etp22"], "2x50G[25G,10G]": ["etp22a", "etp22b"] } }, @@ -923,7 +901,6 @@ "lanes": "88,89,90,91", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp23"], - "1x10G[100G,50G,40G,25G]": ["etp23"], "2x50G[25G,10G]": ["etp23a", "etp23b"] } }, @@ -932,7 +909,6 @@ "lanes": "92,93,94,95", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp24"], - "1x10G[100G,50G,40G,25G]": ["etp24"], "2x50G[25G,10G]": ["etp24a", "etp24b"] } }, @@ -941,7 +917,6 @@ "lanes": "96,97,98,99", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp25"], - "1x10G[100G,50G,40G,25G]": ["etp25"], "2x50G[25G,10G]": ["etp25a", "etp25b"] } }, @@ -950,7 +925,6 @@ "lanes": "100,101,102,103", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp26"], - "1x10G[100G,50G,40G,25G]": ["etp26"], "2x50G[25G,10G]": ["etp26a", "etp26b"] } }, @@ -959,7 +933,6 @@ "lanes": "104,105,106,107", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp27"], - "1x10G[100G,50G,40G,25G]": ["etp27"], "2x50G[25G,10G]": ["etp27a", "etp27b"] } }, @@ -968,7 +941,6 @@ "lanes": "108,109,110,111", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp28"], - "1x10G[100G,50G,40G,25G]": ["etp28"], "2x50G[25G,10G]": ["etp28a", "etp28b"] } }, @@ -977,7 +949,6 @@ "lanes": "112,113,114,115", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp29"], - "1x10G[100G,50G,40G,25G]": ["etp29"], "2x50G[25G,10G]": ["etp29a", "etp29b"] } }, @@ -986,7 +957,6 @@ "lanes": "116,117,118,119", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp30"], - "1x10G[100G,50G,40G,25G]": ["etp30"], "2x50G[25G,10G]": ["etp30a", "etp30b"] } }, @@ -995,7 +965,6 @@ "lanes": "120,121,122,123", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp31"], - "1x10G[100G,50G,40G,25G]": ["etp31"], "2x50G[25G,10G]": ["etp31a", "etp31b"] } }, @@ -1004,7 +973,6 @@ "lanes": "124,125,126,127", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp32"], - "1x10G[100G,50G,40G,25G]": ["etp32"], "2x50G[25G,10G]": ["etp32a", "etp32b"] } }, @@ -1013,7 +981,6 @@ "lanes": "128,129,130,131", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp33"], - "1x10G[100G,50G,40G,25G]": ["etp33"], "2x50G[25G,10G]": ["etp33a", "etp33b"] } }, @@ -1022,7 +989,6 @@ "lanes": "132,133,134,135", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp34"], - "1x10G[100G,50G,40G,25G]": ["etp34"], "2x50G[25G,10G]": ["etp34a", "etp34b"] } }, @@ -1031,7 +997,6 @@ "lanes": "136,137,138,139", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp35"], - "1x10G[100G,50G,40G,25G]": ["etp35"], "2x50G[25G,10G]": ["etp35a", "etp35b"] } }, @@ -1040,7 +1005,6 @@ "lanes": "140,141,142,143", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp36"], - "1x10G[100G,50G,40G,25G]": ["etp36"], "2x50G[25G,10G]": ["etp36a", "etp36b"] } }, @@ -1049,7 +1013,6 @@ "lanes": "144,145,146,147", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp37"], - "1x10G[100G,50G,40G,25G]": ["etp37"], "2x50G[25G,10G]": ["etp37a", "etp37b"] } }, @@ -1058,7 +1021,6 @@ "lanes": "148,149,150,151", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp38"], - "1x10G[100G,50G,40G,25G]": ["etp38"], "2x50G[25G,10G]": ["etp38a", "etp38b"] } }, @@ -1067,7 +1029,6 @@ "lanes": "152,153,154,155", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp39"], - "1x10G[100G,50G,40G,25G]": ["etp39"], "2x50G[25G,10G]": ["etp39a", "etp39b"] } }, @@ -1076,7 +1037,6 @@ "lanes": "156,157,158,159", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp40"], - "1x10G[100G,50G,40G,25G]": ["etp40"], "2x50G[25G,10G]": ["etp40a", "etp40b"] } }, @@ -1085,7 +1045,6 @@ "lanes": "160,161,162,163", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp41"], - "1x10G[100G,50G,40G,25G]": ["etp41"], "2x50G[25G,10G]": ["etp41a", "etp41b"] } }, @@ -1094,7 +1053,6 @@ "lanes": "164,165,166,167", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp42"], - "1x10G[100G,50G,40G,25G]": ["etp42"], "2x50G[25G,10G]": ["etp42a", "etp42b"] } }, @@ -1103,7 +1061,6 @@ "lanes": "168,169,170,171", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp43"], - "1x10G[100G,50G,40G,25G]": ["etp43"], "2x50G[25G,10G]": ["etp43a", "etp43b"] } }, @@ -1112,7 +1069,6 @@ "lanes": "172,173,174,175", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp44"], - "1x10G[100G,50G,40G,25G]": ["etp44"], "2x50G[25G,10G]": ["etp44a", "etp44b"] } }, @@ -1121,7 +1077,6 @@ "lanes": "176,177,178,179", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp45"], - "1x10G[100G,50G,40G,25G]": ["etp45"], "2x50G[25G,10G]": ["etp45a", "etp45b"] } }, @@ -1130,7 +1085,6 @@ "lanes": "180,181,182,183", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp46"], - "1x10G[100G,50G,40G,25G]": ["etp46"], "2x50G[25G,10G]": ["etp46a", "etp46b"] } }, @@ -1139,7 +1093,6 @@ "lanes": "184,185,186,187", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp47"], - "1x10G[100G,50G,40G,25G]": ["etp47"], "2x50G[25G,10G]": ["etp47a", "etp47b"] } }, @@ -1148,7 +1101,6 @@ "lanes": "188,189,190,191", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp48"], - "1x10G[100G,50G,40G,25G]": ["etp48"], "2x50G[25G,10G]": ["etp48a", "etp48b"] } }, @@ -1157,7 +1109,6 @@ "lanes": "192,193,194,195", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp49"], - "1x10G[100G,50G,40G,25G]": ["etp49"], "2x50G[25G,10G]": ["etp49a", "etp49b"] } }, @@ -1166,7 +1117,6 @@ "lanes": "196,197,198,199", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp50"], - "1x10G[100G,50G,40G,25G]": ["etp50"], "2x50G[25G,10G]": ["etp50a", "etp50b"] } }, @@ -1175,7 +1125,6 @@ "lanes": "200,201,202,203", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp51"], - "1x10G[100G,50G,40G,25G]": ["etp51"], "2x50G[25G,10G]": ["etp51a", "etp51b"] } }, @@ -1184,7 +1133,6 @@ "lanes": "204,205,206,207", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp52"], - "1x10G[100G,50G,40G,25G]": ["etp52"], "2x50G[25G,10G]": ["etp52a", "etp52b"] } }, @@ -1193,7 +1141,6 @@ "lanes": "208,209,210,211", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp53"], - "1x10G[100G,50G,40G,25G]": ["etp53"], "2x50G[25G,10G]": ["etp53a", "etp53b"] } }, @@ -1202,7 +1149,6 @@ "lanes": "212,213,214,215", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp54"], - "1x10G[100G,50G,40G,25G]": ["etp54"], "2x50G[25G,10G]": ["etp54a", "etp54b"] } }, @@ -1211,7 +1157,6 @@ "lanes": "216,217,218,219", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp55"], - "1x10G[100G,50G,40G,25G]": ["etp55"], "2x50G[25G,10G]": ["etp55a", "etp55b"] } }, @@ -1220,7 +1165,6 @@ "lanes": "220,221,222,223", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp56"], - "1x10G[100G,50G,40G,25G]": ["etp56"], "2x50G[25G,10G]": ["etp56a", "etp56b"] } }, @@ -1229,7 +1173,6 @@ "lanes": "224,225,226,227", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp57"], - "1x10G[100G,50G,40G,25G]": ["etp57"], "2x50G[25G,10G]": ["etp57a", "etp57b"] } }, @@ -1238,7 +1181,6 @@ "lanes": "228,229,230,231", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp58"], - "1x10G[100G,50G,40G,25G]": ["etp58"], "2x50G[25G,10G]": ["etp58a", "etp58b"] } }, @@ -1247,7 +1189,6 @@ "lanes": "232,233,234,235", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp59"], - "1x10G[100G,50G,40G,25G]": ["etp59"], "2x50G[25G,10G]": ["etp59a", "etp59b"] } }, @@ -1256,7 +1197,6 @@ "lanes": "236,237,238,239", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp60"], - "1x10G[100G,50G,40G,25G]": ["etp60"], "2x50G[25G,10G]": ["etp60a", "etp60b"] } }, @@ -1265,7 +1205,6 @@ "lanes": "240,241,242,243", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp61"], - "1x10G[100G,50G,40G,25G]": ["etp61"], "2x50G[25G,10G]": ["etp61a", "etp61b"] } }, @@ -1274,7 +1213,6 @@ "lanes": "244,245,246,247", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp62"], - "1x10G[100G,50G,40G,25G]": ["etp62"], "2x50G[25G,10G]": ["etp62a", "etp62b"] } }, @@ -1283,7 +1221,6 @@ "lanes": "248,249,250,251", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp63"], - "1x10G[100G,50G,40G,25G]": ["etp63"], "2x50G[25G,10G]": ["etp63a", "etp63b"] } }, @@ -1292,7 +1229,6 @@ "lanes": "252,253,254,255", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp64"], - "1x10G[100G,50G,40G,25G]": ["etp64"], "2x50G[25G,10G]": ["etp64a", "etp64b"] } } From 0ae2906c0612b4df9c4052bfb633cf56cc240bbe Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Sun, 6 Feb 2022 09:42:53 -0500 Subject: [PATCH 005/139] [Mellanox] Update mellanox hw-mgmt submodule and versions to V.7.0020.1300 (#9860) - Why I did it New version of mellanox platform management code available adding support for new platforms and fixing bugs. - How I did it 1. Updated the submodule 2. Updated makefile version references 3. Regenerated SONiC patches --- platform/mellanox/hw-management.mk | 2 +- ...02-Disable-hw-mgmt-on-SimX-platforms.patch | 81 +++++++++++++++++++ .../0003-Make-hw-mgmt-SimX-compatiable.patch | 61 -------------- platform/mellanox/hw-management/hw-mgmt | 2 +- 4 files changed, 83 insertions(+), 63 deletions(-) create mode 100644 platform/mellanox/hw-management/0002-Disable-hw-mgmt-on-SimX-platforms.patch delete mode 100644 platform/mellanox/hw-management/0003-Make-hw-mgmt-SimX-compatiable.patch diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 4cf961ac7da..620dd39a96b 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -16,7 +16,7 @@ # # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0010.3331 +MLNX_HW_MANAGEMENT_VERSION = 7.0020.1300 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0002-Disable-hw-mgmt-on-SimX-platforms.patch b/platform/mellanox/hw-management/0002-Disable-hw-mgmt-on-SimX-platforms.patch new file mode 100644 index 00000000000..c12474712b9 --- /dev/null +++ b/platform/mellanox/hw-management/0002-Disable-hw-mgmt-on-SimX-platforms.patch @@ -0,0 +1,81 @@ +From 79dadd5b0d2f5e860b525c12d4d3843607b03a9f Mon Sep 17 00:00:00 2001 +From: Alexander Allen +Date: Fri, 21 Jan 2022 16:47:19 +0000 +Subject: [PATCH] Disable hw-mgmt on SimX platforms + +--- + usr/usr/bin/hw-management-ready.sh | 31 ++++++++++++++++-------------- + usr/usr/bin/hw-management.sh | 9 +++++++++ + 2 files changed, 26 insertions(+), 14 deletions(-) + +diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh +index 5a9698c..364f906 100755 +--- a/usr/usr/bin/hw-management-ready.sh ++++ b/usr/usr/bin/hw-management-ready.sh +@@ -51,19 +51,22 @@ if [ -d /var/run/hw-management ]; then + rm -fr /var/run/hw-management + fi + +-case $board_type in +-VMOD0014) +- while [ ! -d /sys/devices/pci0000:00/0000:00:1f.0/NVSN2201:00/mlxreg-hotplug/hwmon ] +- do +- sleep 1 +- done +- ;; +-*) +- while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] +- do +- sleep 1 +- done +- ;; +-esac ++if [ -z "$(lspci -vvv | grep SimX)" ]; then ++ case $board_type in ++ VMOD0014) ++ while [ ! -d /sys/devices/pci0000:00/0000:00:1f.0/NVSN2201:00/mlxreg-hotplug/hwmon ] ++ do ++ sleep 1 ++ done ++ ;; ++ *) ++ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] ++ do ++ sleep 1 ++ done ++ ;; ++ esac ++fi ++ + echo "Start Chassis HW management service." + logger -t hw-management -p daemon.notice "Start Chassis HW management service." +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index ebfabb0..c0c038e 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -1495,6 +1495,13 @@ do_chip_down() + /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p + } + ++check_simx() ++{ ++ if [ -n "$(lspci -vvv | grep SimX)" ]; then ++ exit 0 ++ fi ++} ++ + __usage=" + Usage: $(basename "$0") [Options] + +@@ -1520,6 +1527,8 @@ Options: + force-reload Performs hw-management 'stop' and the 'start. + " + ++check_simx ++ + case $ACTION in + start) + if [ -d /var/run/hw-management ]; then +-- +2.17.1 + diff --git a/platform/mellanox/hw-management/0003-Make-hw-mgmt-SimX-compatiable.patch b/platform/mellanox/hw-management/0003-Make-hw-mgmt-SimX-compatiable.patch deleted file mode 100644 index 4e49516c8d5..00000000000 --- a/platform/mellanox/hw-management/0003-Make-hw-mgmt-SimX-compatiable.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 5858f60aa5948a502ca8a1c9357ac81baa6f68dc Mon Sep 17 00:00:00 2001 -From: junchao -Date: Fri, 23 Apr 2021 09:27:43 +0800 -Subject: [PATCH] Make hw-mgmt SimX compatible - ---- - usr/usr/bin/hw-management-ready.sh | 11 +++++++---- - usr/usr/bin/hw-management.sh | 9 +++++++++ - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh -index 3c9f7b6..05d143f 100755 ---- a/usr/usr/bin/hw-management-ready.sh -+++ b/usr/usr/bin/hw-management-ready.sh -@@ -49,9 +49,12 @@ if [ -d /var/run/hw-management ]; then - rm -fr /var/run/hw-management - fi - --while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] --do -- sleep 1 --done -+if [ -z "$(lspci -vvv | grep SimX)" ]; then -+ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] -+ do -+ sleep 1 -+ done -+fi -+ - echo "Start Chassis HW management service." - logger -t hw-management -p daemon.notice "Start Chassis HW management service." -diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh -index 991cf45..16ad0bf 100755 ---- a/usr/usr/bin/hw-management.sh -+++ b/usr/usr/bin/hw-management.sh -@@ -1265,6 +1265,13 @@ do_chip_down() - /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p - } - -+check_simx() -+{ -+ if [ -n "$(lspci -vvv | grep SimX)" ]; then -+ exit 0 -+ fi -+} -+ - __usage=" - Usage: $(basename "$0") [Options] - -@@ -1290,6 +1297,8 @@ Options: - force-reload Performs hw-management 'stop' and the 'start. - " - -+check_simx -+ - case $ACTION in - start) - if [ -d /var/run/hw-management ]; then --- -1.9.1 - diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index 0ece116e31b..cd4e3f7bdc9 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit 0ece116e31bd15031af263e28a1b681d4575db5e +Subproject commit cd4e3f7bdc9fe77f0dc78b405e52fe876f7ca490 From cd77efa763aa60c13c08c04f26199b5768b11264 Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Mon, 7 Feb 2022 12:58:47 +0200 Subject: [PATCH 006/139] [submodule] Update sonic-utilities submodule (#9871) Update submodule sonic-utilities that contains the following commits: [build] allowPartiallySucceededBuilds: true (#2043) [system-health] Remove booting stage in system health service (#2022) [GCU] Mark children of bgp_neighbor as create-only (#2008) [generic_config_updater] Minor update - No logical code change (#2028) [generic-config-updater] Handle failed service restarts (#2020) [debug dump] Missing Dict Key handled in the MatchOptimizer (#2014) [Auto Techsupport] Added Event Driven TS to Command Reference (#1985) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index d9f3afe5b34..b6ca76b4821 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit d9f3afe5b34ef0f03f4137f607bc73bc625631ed +Subproject commit b6ca76b4821453171d9607383b808385968eeeeb From 9c5f38b9f39b67db35fc7eb7d45b315ac147f960 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Tue, 8 Feb 2022 00:33:11 +0800 Subject: [PATCH 007/139] [AS7726-32X] Add to support mulit PSU SN in PDDF (#8164) * [AS7726-32X] Add to support mulit PSU in PDDF Signed-off-by: Jostar Yang * Modify SN offset and include path * Fix device_name to PSU2-EEPROM in PSU2 Co-authored-by: Jostar Yang --- .../pddf/pddf-device.json | 69 ++++-- .../pmon_daemon_control.json | 1 + .../as7726-32x/modules/Makefile | 8 +- .../as7726-32x/modules/pddf_custom_psu.c | 207 ++++++++++++++++++ 4 files changed, 263 insertions(+), 22 deletions(-) create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/pddf_custom_psu.c diff --git a/device/accton/x86_64-accton_as7726_32x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7726_32x-r0/pddf/pddf-device.json index 8a4caec2772..68a18fd5c01 100644 --- a/device/accton/x86_64-accton_as7726_32x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as7726_32x-r0/pddf/pddf-device.json @@ -50,6 +50,10 @@ "pddf_fan_module", "pddf_led_module", "pddf_sysstatus_module" + ], + "custom_kos": + [ + "pddf_custom_psu" ] }, @@ -1631,7 +1635,8 @@ { "interface": [ - { "itf":"pmbus", "dev":"PSU2-PMBUS"} + { "itf":"pmbus", "dev":"PSU2-PMBUS"}, + { "itf":"eeprom","dev":"PSU2-EEPROM" } ] } }, @@ -1644,19 +1649,31 @@ "topo_info": { "parent_bus":"0x31", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, "attr_list": [ - { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x14", "attr_cmpval":"0x14", "attr_len":"1"}, - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_serial_num", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, { "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] } }, + "PSU2-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU2-EEPROM", "device_parent":"MUX7", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info":{ "parent_bus":"0x31", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_model_name", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"11" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x2e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"17" } + ] + } + }, "PSU1": { @@ -1666,7 +1683,8 @@ { "interface": [ - { "itf":"pmbus", "dev":"PSU1-PMBUS" } + { "itf":"pmbus", "dev":"PSU1-PMBUS" }, + { "itf":"eeprom","dev":"PSU1-EEPROM" } ] } }, @@ -1679,20 +1697,31 @@ "topo_info":{ "parent_bus":"0x32", "dev_addr":"0x5b", "dev_type":"psu_pmbus"}, "attr_list": [ - { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, - { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x28", "attr_cmpval":"0x28", "attr_len":"1"}, - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, - { "attr_name":"psu_serial_num", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} ] } }, - + "PSU1-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU1-EEPROM", "device_parent":"MUX7", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0x32", "dev_addr":"0x53", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_model_name", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x15", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"11" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x53", "attr_devtype":"eeprom", "attr_offset":"0x2e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"17" } + ] + } + }, "FAN-CTRL": { "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX7"}, @@ -1762,7 +1791,7 @@ "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX7"}, "i2c": { - "topo_info": { "parent_bus":"0x37", "dev_addr":"0x4c", "dev_type":"lm75"}, + "topo_info": { "parent_bus":"0x36", "dev_addr":"0x4c", "dev_type":"lm75"}, "attr_list": [ { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, @@ -1825,7 +1854,7 @@ "topo_info": { "parent_bus":"0x37", "dev_addr":"0x4b", "dev_type":"lm75"}, "attr_list": [ - { "attr_name": "temp1_max"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, { "attr_name": "temp1_max_hyst"}, { "attr_name": "temp1_input"} ] @@ -1860,8 +1889,8 @@ "i2c" : { "attr_list": [ - {"attr_name":"blue", "descr" : "Blue", "bits" : "7", "value" : "0x0", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, - {"attr_name":"off", "descr" : "Off", "bits" : "7", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} + {"attr_name":"STATUS_LED_COLOR_BLUE", "descr" : "", "bits" : "7", "value" : "0x0", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "descr" : "", "bits" : "7", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} ] } }, @@ -1873,9 +1902,9 @@ "i2c" : { "attr_list": [ - {"attr_name":"green", "descr" : "Green", "bits" : "1:0", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, - {"attr_name":"red", "descr" : "Red" ,"bits" : "1:0", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, - {"attr_name":"off", "descr" : "Off" ,"bits" : "1:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} + {"attr_name":"STATUS_LED_COLOR_GREEN", "descr" : "", "bits" : "1:0", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_RED", "descr" : "" ,"bits" : "1:0", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "descr" : "" ,"bits" : "1:0", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} ] } diff --git a/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json index 584a14b9d94..0d3f1fb4561 100644 --- a/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7726_32x-r0/pmon_daemon_control.json @@ -1,5 +1,6 @@ { "skip_ledd": true, + "skip_pcied": true, "skip_thermalctld": true } diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/Makefile index 5b5e6912c56..f591a9157a6 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/Makefile @@ -1,7 +1,11 @@ ifneq ($(KERNELRELEASE),) obj-m:= accton_as7726_32x_cpld.o accton_as7726_32x_fan.o \ - accton_as7726_32x_leds.o accton_as7726_32x_psu.o ym2651y.o - + accton_as7726_32x_leds.o accton_as7726_32x_psu.o ym2651y.o \ + pddf_custom_psu.o + +CFLAGS_pddf_custom_psu.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF + else ifeq (,$(KERNEL_SRC)) #$(error KERNEL_SRC is not defined) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/pddf_custom_psu.c new file mode 100644 index 00000000000..bf94146167a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/pddf_custom_psu.c @@ -0,0 +1,207 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "pddf_psu_defs.h" + +ssize_t pddf_get_custom_psu_model_name(struct device *dev, struct device_attribute *da, char *buf); +ssize_t pddf_get_custom_psu_serial_num(struct device *dev, struct device_attribute *da, char *buf); +extern PSU_SYSFS_ATTR_DATA access_psu_model_name; +extern PSU_SYSFS_ATTR_DATA access_psu_serial_num; + +#define MAX_MODEL_NAME 16 +#define MAX_SERIAL_NUMBER 19 + +enum psu_type { + PSU_TYPE_AC_110V, + PSU_TYPE_DC_48V, + PSU_TYPE_DC_12V, + PSU_TYPE_AC_ACBEL_FSF019, + PSU_TYPE_AC_ACBEL_FSF045 +}; + +struct model_name_info { + enum psu_type type; + u8 offset; + u8 length; + u8 chk_length; + char* model_name; +}; + +struct serial_number_info { + enum psu_type type; + u8 offset; + u8 length; + u8 chk_length; + char* serial_number; +}; + +struct model_name_info models[] = { +{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"}, +{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"}, +{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}, +{PSU_TYPE_AC_ACBEL_FSF045, 0x15, 10, 7, "FSF045-"} + +}; + +struct serial_number_info serials[] = { +{PSU_TYPE_AC_110V, 0x2e, 18, 18, "YM-2651Y"}, +{PSU_TYPE_DC_48V, 0x2e, 18, 18, "YM-2651V"}, +{PSU_TYPE_DC_12V, 0x2e, 18, 18, "PSU-12V-750"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF019-"}, +{PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF045-"} + +}; + +struct pddf_psu_data { + char model_name[MAX_MODEL_NAME+1]; + char serial_number[MAX_SERIAL_NUMBER+1]; +}; + + +static int pddf_psu_read_block(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int result = 0; + int retry_count = 10; + + while (retry_count) { + retry_count--; + + result = i2c_smbus_read_i2c_block_data(client, command, data_len, data); + + if (unlikely(result < 0)) { + msleep(10); + continue; + } + + if (unlikely(result != data_len)) { + result = -EIO; + msleep(10); + continue; + } + + result = 0; + break; + } + + return result; +} + +ssize_t pddf_get_custom_psu_serial_num(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct pddf_psu_data data; + int i, status; + + for (i = 0; i < ARRAY_SIZE(models); i++) { + memset(data.serial_number, 0, sizeof(data.serial_number)); + + status = pddf_psu_read_block(client, models[i].offset, + data.model_name, models[i].length); + if (status < 0) { + data.model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x%x)\n", + client->addr, models[i].offset); + return status; + } + else { + data.model_name[models[i].length] = '\0'; + } + + /* Determine if the model name is known, if not, read next index + */ + if (strncmp(data.model_name, models[i].model_name, models[i].chk_length) == 0) { + + status = pddf_psu_read_block(client, serials[i].offset, + data.serial_number, serials[i].length); + if (status < 0) { + data.serial_number[0] = '\0'; + dev_dbg(&client->dev, "unable to read serial num from (0x%x) offset(0x%x)\n", + client->addr, serials[i].offset); + return status; + } + else { + data.serial_number[serials[i].length] = '\0'; + return sprintf(buf, "%s\n", data.serial_number); + } + + return 0; + } + else { + data.serial_number[0] = '\0'; + } + } + + return -ENODATA; + + +} + +ssize_t pddf_get_custom_psu_model_name(struct device *dev, struct device_attribute *da, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct pddf_psu_data data; + int i, status; + + for (i = 0; i < ARRAY_SIZE(models); i++) { + memset(data.model_name, 0, sizeof(data.model_name)); + + status = pddf_psu_read_block(client, models[i].offset, + data.model_name, models[i].length); + if (status < 0) { + data.model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x%x)\n", + client->addr, models[i].offset); + return status; + } + else { + data.model_name[models[i].length] = '\0'; + } + + /* Determine if the model name is known, if not, read next index + */ + if (strncmp(data.model_name, models[i].model_name, models[i].chk_length) == 0) { + return sprintf(buf, "%s\n", data.model_name); + } + else { + data.model_name[0] = '\0'; + } + } + + return -ENODATA; + +} + +static int __init pddf_custom_psu_init(void) +{ + access_psu_serial_num.show = pddf_get_custom_psu_serial_num; + access_psu_serial_num.do_get = NULL; + + access_psu_model_name.show = pddf_get_custom_psu_model_name; + access_psu_model_name.do_get = NULL; + + return 0; +} + +static void __exit pddf_custom_psu_exit(void) +{ + printk(KERN_ERR "pddf_custom_psu_exit\n"); + return; +} + +MODULE_AUTHOR("Broadcom"); +MODULE_DESCRIPTION("pddf custom psu api"); +MODULE_LICENSE("GPL"); + +module_init(pddf_custom_psu_init); +module_exit(pddf_custom_psu_exit); + From ddfe87a71a84b7ce47324f178b4aeb5192887cf1 Mon Sep 17 00:00:00 2001 From: gechiang <62408185+gechiang@users.noreply.github.com> Date: Mon, 7 Feb 2022 08:56:06 -0800 Subject: [PATCH 008/139] [BRCMSAI 6.0.0.13-1] Fix Cancun file directory at new location causing TD3 platform boot issue (#9922) --- .../Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm | 2 +- .../Accton-AS7726-32X/td3-as7726-32x100G.config.bcm | 2 +- .../Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm | 2 +- .../td3-a7050cx3-32s-48x50G+8x100G.config.bcm | 2 +- .../x86_64-arista_7050cx3_32s/td3-a7050cx3-32s-flex.config.bcm | 2 +- .../Seastone_2/td3-seastone_2-32x100G.config.bcm | 2 +- .../DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm | 2 +- .../DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm | 2 +- .../DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm | 2 +- .../DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm | 2 +- .../DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm | 2 +- .../DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm | 2 +- .../DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm | 2 +- .../DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm | 2 +- .../DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm | 2 +- .../Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm | 2 +- .../INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm | 2 +- .../INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm | 2 +- .../Quanta-IX7-32X/td3-ix7-32x100G.config.bcm | 2 +- .../Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm | 2 +- .../Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm | 2 +- platform/broadcom/sai.mk | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm b/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm index 5da8cd015da..21ca8a2fa57 100755 --- a/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm +++ b/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ #polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm b/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm index f88656bfd5c..1dcd7e3ef5b 100755 --- a/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm +++ b/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ #polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm index 22a63ff0ed3..a575049dc06 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ l3_alpm_hit_skip=1 sai_adjust_acl_drop_in_rx_drop=1 host_as_route_disable=1 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm index 6d0bf6ddf3a..68ae982800c 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ l3_alpm_hit_skip=1 sai_adjust_acl_drop_in_rx_drop=1 host_as_route_disable=1 diff --git a/device/arista/x86_64-arista_7050cx3_32s/td3-a7050cx3-32s-flex.config.bcm b/device/arista/x86_64-arista_7050cx3_32s/td3-a7050cx3-32s-flex.config.bcm index 352409fbddd..fef962c852b 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/td3-a7050cx3-32s-flex.config.bcm +++ b/device/arista/x86_64-arista_7050cx3_32s/td3-a7050cx3-32s-flex.config.bcm @@ -395,7 +395,7 @@ port_phy_addr=0xff robust_hash_disable_egress_vlan=1 robust_hash_disable_mpls=1 robust_hash_disable_vlan=1 -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ sai_tunnel_support=1 serdes_core_rx_polarity_flip_physical{1}=0x8 serdes_core_rx_polarity_flip_physical{5}=0x2 diff --git a/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm b/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm index a7ee4a93ea0..d9d2f47750d 100644 --- a/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm +++ b/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ help_cli_enable=1 ifp_inports_support_enable=1 ipv6_lpm_128b_enable=0x1 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm index bf15510bf49..0985bd7712c 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm index 68fb77a4219..cae03e859b8 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm index c44e4805c62..164d1043644 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm index 6f62b720919..c5c6fc9c8d0 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm index a4fccde1968..ae1995d930f 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm index 021f94dc32f..69c3d1af90d 100644 --- a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix dpp_clock_ratio=2:3 oversubscribe_mode=1 diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm index 2630512df0c..468b7d52798 100644 --- a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix dpp_clock_ratio=2:3 diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm index ddc14d9363d..7f8213f322e 100644 --- a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix portmap_5.0=5:10 portmap_6.0=6:10 diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm index dd0901f5d01..2e4dfd6c97a 100644 --- a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ os=unix portmap_5.0=5:25 portmap_6.0=6:25 diff --git a/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm b/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm index 07600e0b8a6..c157e5f7b6c 100755 --- a/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm +++ b/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ pbmp_oversubscribe=0x00003fc000000ff0000003fc000001fe pbmp_xport_xe=0xffffffffffffffffffffffffffffffffffff core_clock_frequency=1525 diff --git a/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm b/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm index 8fe7622f4b8..7821bc7e6ce 100644 --- a/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm +++ b/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ ### fix for sonic ptp_ts_pll_fref=50000000 ptp_bs_fref_0=50000000 diff --git a/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm b/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm index 089207abd13..895e4389c6d 100644 --- a/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm +++ b/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ ### fix for sonic ptp_ts_pll_fref=50000000 ptp_bs_fref_0=50000000 diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm index 43ccba2a495..d3ac8bbf1f2 100644 --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ #polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm index 06ff6dc8003..25eaf07dc82 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ core_clock_frequency=1525 dpp_clock_ratio=2:3 mem_cache_enable=0 diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm b/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm index bf2248fbe44..aa8c6d02c57 100644 --- a/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm @@ -1,4 +1,4 @@ -sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_premium_issu/b870.6.4.1/ bcm_tunnel_term_compatible_mode=1 core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index fd3b3627235..ce3470e6635 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_VERSION = 6.0.0.13 +LIBSAIBCM_VERSION = 6.0.0.13-1 LIBSAIBCM_BRANCH_NAME = REL_6.0 LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)" From eff80f750fdfa7c24da917baaec71e3437f2a809 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Mon, 7 Feb 2022 11:55:48 -0800 Subject: [PATCH 009/139] [swss]: Reduce tunnel_packet_handler memory usage (#9762) * Configure scapy to not store sniffed packets Signed-off-by: Lawrence Lee --- .../docker-orchagent/tunnel_packet_handler.py | 75 ++++++++++++------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/dockers/docker-orchagent/tunnel_packet_handler.py b/dockers/docker-orchagent/tunnel_packet_handler.py index 7d9f7f56126..3d9b48b450b 100755 --- a/dockers/docker-orchagent/tunnel_packet_handler.py +++ b/dockers/docker-orchagent/tunnel_packet_handler.py @@ -9,15 +9,17 @@ """ import subprocess import time - from datetime import datetime from ipaddress import ip_interface + +from swsssdk import ConfigDBConnector, SonicV2Connector +from sonic_py_common import logger as log + from pyroute2 import IPRoute from scapy.layers.inet import IP from scapy.layers.inet6 import IPv6 from scapy.sendrecv import AsyncSniffer -from swsssdk import ConfigDBConnector, SonicV2Connector -from sonic_py_common import logger as log + logger = log.Logger() @@ -36,6 +38,10 @@ class TunnelPacketHandler(object): + """ + This class handles unroutable tunnel packets that are trapped + to the CPU from the ASIC. + """ def __init__(self): self.config_db = ConfigDBConnector() @@ -68,19 +74,32 @@ def portchannel_intfs(self): return self._portchannel_intfs - def get_portchannel_index_mapping(self): + def get_intf_name(self, msg): + """ + Gets the interface name for a netlink msg + + Returns: + (str) The interface name, or the empty string if no interface + name was found """ - Gets a mapping of interface kernel indices to portchannel interfaces + attr_list = msg.get('attrs', list()) + + for attribute, val in attr_list: + if attribute == 'IFLA_IFNAME': + return val + + return '' + + def netlink_msg_is_for_portchannel(self, msg): + """ + Determines if a netlink message is about a PortChannel interface Returns: (list) integers representing kernel indices """ - index_map = {} - for portchannel in self.portchannel_intfs: - index = self.netlink_api.link_lookup(ifname=portchannel[0])[0] - index_map[index] = portchannel + ifname = self.get_intf_name(msg) - return index_map + return ifname in [name for name, _ in self.portchannel_intfs] def get_up_portchannels(self): """ @@ -89,15 +108,16 @@ def get_up_portchannels(self): Returns: (list) of interface names which are up, as strings """ - pc_index_map = self.get_portchannel_index_mapping() - pc_indices = list(pc_index_map.keys()) - link_statuses = self.netlink_api.get_links(*pc_indices) + portchannel_intf_names = [name for name, _ in self.portchannel_intfs] + link_statuses = [] + for intf in portchannel_intf_names: + status = self.netlink_api.link("get", ifname=intf) + link_statuses.append(status[0]) up_portchannels = [] for status in link_statuses: if status['state'] == 'up': - port_index = status['index'] - up_portchannels.append(pc_index_map[port_index][0]) + up_portchannels.append(self.get_intf_name(status)) return up_portchannels @@ -117,7 +137,7 @@ def all_portchannels_established(self): STATE_DB, intf_table_name, STATE_KEY - ) + ) if intf_state and intf_state.lower() != 'ok': return False @@ -177,13 +197,13 @@ def get_ipinip_tunnel_addrs(self): tunnel_type = tunnel_table[TUNNEL_TYPE_KEY].lower() self_loopback_ip = tunnel_table[DST_IP_KEY] peer_loopback_ip = self.config_db.get_entry( - PEER_SWITCH_TABLE, peer_switch - )[ADDRESS_IPV4_KEY] - except KeyError as e: + PEER_SWITCH_TABLE, peer_switch + )[ADDRESS_IPV4_KEY] + except KeyError as error: logger.log_warning( 'PEER_SWITCH or TUNNEL table missing data, ' 'could not find key {}' - .format(e) + .format(error) ) return None, None @@ -242,12 +262,11 @@ def sniffer_restart_required(self, messages): come back up, we need to restart the sniffer to be able to sniff traffic on the interface that has come back up. """ - pc_index_map = self.get_portchannel_index_mapping() for msg in messages: - if msg['index'] in pc_index_map: + if self.netlink_msg_is_for_portchannel(msg): if msg['state'] == 'up': logger.log_info('{} came back up, sniffer restart required' - .format(pc_index_map[msg['index']])) + .format(self.get_intf_name(msg))) return True return False @@ -293,8 +312,8 @@ def _ping_inner_dst(packet): sniffer = AsyncSniffer( iface=sniff_intfs, filter=packet_filter, - prn=_ping_inner_dst - + prn=_ping_inner_dst, + store=0 ) sniffer.start() while True: @@ -307,11 +326,15 @@ def _ping_inner_dst(packet): sniffer = AsyncSniffer( iface=sniff_intfs, filter=packet_filter, - prn=_ping_inner_dst + prn=_ping_inner_dst, + store=0 ) sniffer.start() def run(self): + """ + Entry point for the TunnelPacketHandler class + """ self.wait_for_portchannels() self.listen_for_tunnel_pkts() From 4f480ecf3dbdd11d10ada052f394088a2928fe7d Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 8 Feb 2022 11:20:02 +0800 Subject: [PATCH 010/139] [build] Add more dependencies to sonic-config-engine (#9894) sonic-config-engine unit test always fails. let's restrict using cache in sonic-config-engine --- rules/sonic-config.dep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/sonic-config.dep b/rules/sonic-config.dep index ded91f7a6e8..9e6d1e92934 100644 --- a/rules/sonic-config.dep +++ b/rules/sonic-config.dep @@ -4,7 +4,7 @@ SPATH := $($(SONIC_CONFIG_ENGINE_PY3)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-config.mk rules/sonic-config.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(SPATH)) -DEP_FILES += files/image_config/interfaces/interfaces.j2 dockers/docker-orchagent/ports.json.j2 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 dockers/docker-lldp/lldpd.conf.j2 dockers/docker-orchagent/ipinip.json.j2 $(wildcard device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/*.j2 device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/*.j2) files/build_templates/qos_config.j2 dockers/docker-orchagent/switch.json.j2 dockers/docker-orchagent/vxlan.json.j2 files/image_config/constants/constants.yml +DEP_FILES += files/image_config/interfaces/interfaces.j2 dockers/docker-orchagent/ports.json.j2 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 dockers/docker-lldp/lldpd.conf.j2 dockers/docker-orchagent/ipinip.json.j2 $(wildcard device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/* device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/*) files/build_templates/qos_config.j2 dockers/docker-orchagent/switch.json.j2 dockers/docker-orchagent/vxlan.json.j2 files/image_config/constants/constants.yml ifeq ($(ENABLE_PY2_MODULES), y) $(SONIC_CONFIG_ENGINE_PY2)_CACHE_MODE := GIT_CONTENT_SHA From 09b3efccc958a3f51af12f736998bf121f83a275 Mon Sep 17 00:00:00 2001 From: Andriy Kokhan Date: Tue, 8 Feb 2022 12:36:07 +0200 Subject: [PATCH 011/139] [BFN] Updated SDK to 20220127_sai_1.9.1 (#9870) Signed-off-by: Andriy Kokhan --- platform/barefoot/bfn-platform.mk | 2 +- platform/barefoot/bfn-sai.mk | 2 +- platform/barefoot/docker-syncd-bfn/Dockerfile.j2 | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/bfn-platform.mk b/platform/barefoot/bfn-platform.mk index 077ee109f9c..7ea4cbcd5cb 100644 --- a/platform/barefoot/bfn-platform.mk +++ b/platform/barefoot/bfn-platform.mk @@ -1,4 +1,4 @@ -BFN_PLATFORM = bfnplatform_20211216_sai_1.9.1_deb10.deb +BFN_PLATFORM = bfnplatform_20220127_sai_1.9.1_deb10.deb $(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_PLATFORM)" SONIC_ONLINE_DEBS += $(BFN_PLATFORM) diff --git a/platform/barefoot/bfn-sai.mk b/platform/barefoot/bfn-sai.mk index 1e837ba4a90..c61abeb0ae5 100644 --- a/platform/barefoot/bfn-sai.mk +++ b/platform/barefoot/bfn-sai.mk @@ -1,4 +1,4 @@ -BFN_SAI = bfnsdk_20211216_sai_1.9.1_deb10.deb +BFN_SAI = bfnsdk_20220127_sai_1.9.1_deb10.deb $(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_SAI)" $(BFN_SAI)_DEPENDS += $(LIBNL_GENL3_DEV) diff --git a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 index 7071b0c8b51..e085ef130ae 100755 --- a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 @@ -22,6 +22,7 @@ RUN apt-get install -y \ libunwind8-dev \ libpython3.4 \ libc-ares2 \ + libedit2 \ libgoogle-perftools4 RUN dpkg -i \ From 49382d773e08d243c13640a18fb7364c3f79efee Mon Sep 17 00:00:00 2001 From: "Richard.Yu" Date: Tue, 8 Feb 2022 18:56:34 +0800 Subject: [PATCH 012/139] [SAIServerV2] Build SAI Serverv2 docker (#9509) Support saiserver v2 with python3 and thrift 0.13.0 add variables to support the saiserverv2 build different thrift in saithrift depends on saiserver version build differernt versions of saiserver make the saiserver and saiserver docker with version number test done: build two different versions of sasiserver in local build environment add saiserver to buster Co-authored-by: richard.yu --- Makefile.work | 1 + platform/broadcom/docker-saiserver-brcm.mk | 7 +++++-- platform/broadcom/libsaithrift-dev.mk | 23 +++++++++++++++------- slave.mk | 6 ++++++ sonic-slave-buster/Dockerfile.j2 | 7 +++++++ 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Makefile.work b/Makefile.work index 2ab0ae54d9f..9ec77600ca8 100644 --- a/Makefile.work +++ b/Makefile.work @@ -270,6 +270,7 @@ SONIC_BUILD_INSTRUCTION := make \ SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \ SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \ SONIC_INSTALL_DEBUG_TOOLS=$(INSTALL_DEBUG_TOOLS) \ + SONIC_SAITHRIFT_V2=$(SAITHRIFT_V2) \ MDEBUG=$(MDEBUG) \ PASSWORD=$(PASSWORD) \ USERNAME=$(USERNAME) \ diff --git a/platform/broadcom/docker-saiserver-brcm.mk b/platform/broadcom/docker-saiserver-brcm.mk index d39759ac7f2..f4f9cdd42a4 100644 --- a/platform/broadcom/docker-saiserver-brcm.mk +++ b/platform/broadcom/docker-saiserver-brcm.mk @@ -1,13 +1,16 @@ # docker image for brcm saiserver -DOCKER_SAISERVER_BRCM = docker-saiserver-brcm.gz +DOCKER_SAISERVER_BRCM = docker-saiserver$(SAITHRIFT_VER)-brcm.gz $(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm $(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER) $(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD) $(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM) +SONIC_BUSTER_DOCKERS += $(DOCKER_SAISERVER_BRCM) + +#Support two versions of saiserver +$(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER) -$(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver $(DOCKER_SAISERVER_BRCM)_RUN_OPT += --privileged -t $(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd diff --git a/platform/broadcom/libsaithrift-dev.mk b/platform/broadcom/libsaithrift-dev.mk index 543ea63e7f4..0d32a08a276 100644 --- a/platform/broadcom/libsaithrift-dev.mk +++ b/platform/broadcom/libsaithrift-dev.mk @@ -2,19 +2,28 @@ SAI_VER = 0.9.4 -LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb +LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(BRCM_SAI) $(BRCM_SAI_DEV) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) +#Support two different versions of thrift +ifeq ($(SAITHRIFT_V2),y) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_13_0) $(LIBTHRIFT_DEV_0_13_0) $(PYTHON3_THRIFT_0_13_0) $(THRIFT_COMPILER_0_13_0) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_13_0) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 +else +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) +endif +$(LIBSAITHRIFT_DEV)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(BRCM_SAI) SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) -PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb +PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) -SAISERVER = saiserver_$(SAI_VER)_amd64.deb -$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) +SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb +$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) -SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb +SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_amd64.deb $(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) diff --git a/slave.mk b/slave.mk index 7fe8c9db0f4..92320ed57a4 100644 --- a/slave.mk +++ b/slave.mk @@ -151,6 +151,11 @@ ifeq ($(SONIC_INSTALL_DEBUG_TOOLS),y) INSTALL_DEBUG_TOOLS = y endif +ifeq ($(SONIC_SAITHRIFT_V2),y) +SAITHRIFT_V2 = y +SAITHRIFT_VER = v2 +endif + ifeq ($(SONIC_INCLUDE_SFLOW),y) INCLUDE_SFLOW = y endif @@ -281,6 +286,7 @@ $(info "FRR_USER_UID" : "$(FRR_USER_UID)") $(info "FRR_USER_GID" : "$(FRR_USER_GID)") endif $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") +$(info "SAITHRIFT_V2" : "$(SAITHRIFT_V2)") $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)") diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 44f7410df46..8189338071e 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -110,6 +110,13 @@ RUN apt-get update && apt-get install -y \ libxml-simple-perl \ graphviz \ aspell \ +# For SAI meta rpc build - make rpc + libgetopt-long-descriptive-perl \ + libconst-fast-perl \ + libtemplate-perl \ + libnamespace-autoclean-perl \ + libmoose-perl \ + libmoosex-aliases-perl \ # For linux build bc \ fakeroot \ From e44a40cc3b214b904f77ab4652a4b258f7f3b504 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:36:32 -0800 Subject: [PATCH 013/139] Updated Internal BGP Templates for chassis packet (#9674) Fixes: https://github.com/Azure/sonic-buildimage/issues/9610 --- .../frr/bgpd/templates/internal/peer-group.conf.j2 | 6 ++---- .../internal/peer-group.conf/result_chasiss_packet.conf | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 index 0b15136c555..e14094a652e 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 @@ -1,14 +1,12 @@ ! ! template: bgpd/templates/internal/peer-group.conf.j2 -{% from "common/functions.conf.j2" import get_ipv4_loopback_address %} -{% from "common/functions.conf.j2" import get_ipv6_loopback_address %} ! neighbor INTERNAL_PEER_V4 peer-group neighbor INTERNAL_PEER_V6 peer-group address-family ipv4 {% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} - neighbor INTERNAL_PEER_V4 update-source {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} + neighbor INTERNAL_PEER_V4 update-source Loopback4096 {% elif CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} neighbor INTERNAL_PEER_V4 route-reflector-client {% endif %} @@ -19,7 +17,7 @@ exit-address-family address-family ipv6 {% if CONFIG_DB__DEVICE_METADATA['localhost']['switch_type'] == 'chassis-packet' %} - neighbor INTERNAL_PEER_V6 update-source {{ get_ipv6_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} + neighbor INTERNAL_PEER_V6 update-source Loopback4096 {% elif CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} neighbor INTERNAL_PEER_V6 route-reflector-client {% endif %} diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf index c36359de77d..3a6f0bad59a 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_chasiss_packet.conf @@ -4,14 +4,14 @@ neighbor INTERNAL_PEER_V4 peer-group neighbor INTERNAL_PEER_V6 peer-group address-family ipv4 - neighbor INTERNAL_PEER_V4 update-source 10.10.10.10 + neighbor INTERNAL_PEER_V4 update-source Loopback4096 neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound neighbor INTERNAL_PEER_V4 allowas-in 1 neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out exit-address-family address-family ipv6 - neighbor INTERNAL_PEER_V6 update-source 2603:10e2:400::3 + neighbor INTERNAL_PEER_V6 update-source Loopback4096 neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound neighbor INTERNAL_PEER_V6 allowas-in 1 neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in From d136a3952440ef0ae9cd0db58ad7bc83cd125877 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Tue, 8 Feb 2022 17:03:12 -0500 Subject: [PATCH 014/139] [Nokia][platform] Modified Nokia device data to support midplane (#9914) Added midplane_subnet in chassisdb.conf for interfaces-config.sh to create midplane interface in multi-asic namespaces. Signed-off-by: Sakthivadivu Saravanaraj --- device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/chassisdb.conf | 3 ++- .../nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json | 2 +- device/nokia/x86_64-nokia_ixr7250e_sup-r0/chassisdb.conf | 3 ++- device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/chassisdb.conf b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/chassisdb.conf index 175c0bb2b76..fa5af525eda 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/chassisdb.conf +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/chassisdb.conf @@ -1,2 +1,3 @@ -chassis_db_address=10.0.5.16 +chassis_db_address=10.6.0.100 chassis_internal_intfs=enp12s0f2,enp5s0f4,enp5s0f4.2 +midplane_subnet=10.6.0.0/16 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json index 5f0862c2e72..039b950f03b 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/platform_ndk.json @@ -6,7 +6,7 @@ }, { "key": "midplane_subnet", - "stringval": "10.0.5.0" + "stringval": "10.6.0.0/16" }, { "key": "midplane_monitor", diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/chassisdb.conf b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/chassisdb.conf index 26fefcd1827..a2daf40b9fe 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/chassisdb.conf +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/chassisdb.conf @@ -1,4 +1,5 @@ start_chassis_db=1 -chassis_db_address=10.0.5.16 +chassis_db_address=10.6.0.100 lag_id_start=1 lag_id_end=512 +midplane_subnet=10.6.0.0/16 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json index db906ccff28..10a09a91e0e 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_ndk.json @@ -2,7 +2,7 @@ "options": [ { "key": "midplane_subnet", - "stringval": "10.0.5.0" + "stringval": "10.6.0.0/16" }, { "key": "midplane_monitor", From 4361224686ffdc3dc3584555d4e24e10e8e0ae0d Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Wed, 9 Feb 2022 12:51:08 +0200 Subject: [PATCH 015/139] [Mellanox] Add platform.json file into sn4800 SIMx environment (#9931) - Why I did it There was a missing file of platform.json on SN4800 SIMx platform - How I did it Add symbolic link to platform.json file from the real SN4800 platform - How to verify it Run SN4800 SIMx and verify that platfrom.json file exist at the following folder: /usr/share/sonic/device/x86_64-nvidia_sn4800_simx-r0 --- device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform.json | 1 + 1 file changed, 1 insertion(+) create mode 120000 device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform.json diff --git a/device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform.json new file mode 120000 index 00000000000..4815676a68a --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn4800_simx-r0/platform.json @@ -0,0 +1 @@ +../x86_64-nvidia_sn4800-r0/platform.json \ No newline at end of file From 05cc8f9df26ed088d5e9aa87041e0da6a7fc76af Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:26:40 +0800 Subject: [PATCH 016/139] [Mellanox] Fix issue: SN4600C has 4 CPU core temperature sensors (#9930) - Why I did it platform.json of 4600C only has 2 CPU core thermal sensors, but there are 4 actually - How I did it Added thermal sensors for CPU core 2 and core 3. - How to verify it Build. --- device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json index ab22b4fd18d..70c5c60a550 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json @@ -95,6 +95,12 @@ { "name": "CPU Core 1 Temp" }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, { "name": "CPU Pack Temp" } From 25a0ce5eb17f5ccab3ce605da751b68986936d20 Mon Sep 17 00:00:00 2001 From: Oleksandr Ivantsiv Date: Wed, 9 Feb 2022 13:29:18 +0200 Subject: [PATCH 017/139] [asan] Add address sanitizer support. (#9857) Implement infrastructure that allows enabling address sanitizer for docker containers. Enable address sanitizer for SWSS container. - Why I did it To add a possibility to compile SONiC applications with address sanitizer (ASAN). ASAN is a memory error detector for C/C++. It finds: 1. Use after free (dangling pointer dereference) 2. Heap buffer overflow 3. Stack buffer overflow 4. Global buffer overflow 5. Use after return 6. Use after the scope 7. Initialization order bugs 8. Memory leaks - How I did it By adding new ENABLE_ASAN configuration option. - How to verify it By default ASAN is disabled and the SONiC image is not affected. When ASAN is enabled it inspects all allocation, deallocation, and memory usage that the application does in run time. To verify whether the application has memory errors tests that trigger memory usage of the application should be run. Ideally, the whole regression tests should be run. Memory leaks reports will be placed in /var/log/asan/ directory of SONiC host OS. Signed-off-by: Oleksandr Ivantsiv --- Makefile.work | 1 + dockers/docker-orchagent/Dockerfile.j2 | 6 ++- .../{docker-init.sh => docker-init.j2} | 3 ++ dockers/docker-orchagent/supervisord.conf.j2 | 45 +++++++++++++++++++ files/build_templates/docker_image_ctl.j2 | 9 ++++ rules/config | 3 ++ slave.mk | 9 ++++ 7 files changed, 75 insertions(+), 1 deletion(-) rename dockers/docker-orchagent/{docker-init.sh => docker-init.j2} (93%) diff --git a/Makefile.work b/Makefile.work index 9ec77600ca8..39879110d4e 100644 --- a/Makefile.work +++ b/Makefile.work @@ -295,6 +295,7 @@ SONIC_BUILD_INSTRUCTION := make \ SLAVE_DIR=$(SLAVE_DIR) \ ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \ BUILD_MULTIASIC_KVM=$(BUILD_MULTIASIC_KVM) \ + ENABLE_ASAN=$(ENABLE_ASAN) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index bf86e70d520..5e403213c1d 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -70,10 +70,14 @@ COPY ["files/arp_update", "/usr/bin"] COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"] COPY ["ndppd.conf", "/usr/share/sonic/templates/"] COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"] -COPY ["docker-init.sh", "orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"] +COPY ["orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] # Copy all Jinja2 template files into the templates folder COPY ["*.j2", "/usr/share/sonic/templates/"] +RUN sonic-cfggen -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" -t /usr/share/sonic/templates/docker-init.j2 > /usr/bin/docker-init.sh +RUN rm -f /usr/share/sonic/templates/docker-init.j2 +RUN chmod 755 /usr/bin/docker-init.sh + ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/dockers/docker-orchagent/docker-init.sh b/dockers/docker-orchagent/docker-init.j2 similarity index 93% rename from dockers/docker-orchagent/docker-init.sh rename to dockers/docker-orchagent/docker-init.j2 index da5a9463281..ff543c23490 100755 --- a/dockers/docker-orchagent/docker-init.sh +++ b/dockers/docker-orchagent/docker-init.j2 @@ -6,6 +6,9 @@ mkdir -p /etc/supervisor/conf.d/ CFGGEN_PARAMS=" \ -d \ +{% if ENABLE_ASAN == "y" %} + -a "{\"ENABLE_ASAN\":\"{{ENABLE_ASAN}}\"}" \ +{% endif %} -y /etc/sonic/constants.yml \ -t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \ -t /usr/share/sonic/templates/vxlan.json.j2,/etc/swss/config.d/vxlan.json \ diff --git a/dockers/docker-orchagent/supervisord.conf.j2 b/dockers/docker-orchagent/supervisord.conf.j2 index 51ead0db7c3..7cd31a11322 100644 --- a/dockers/docker-orchagent/supervisord.conf.j2 +++ b/dockers/docker-orchagent/supervisord.conf.j2 @@ -49,6 +49,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/gearsyncd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -61,6 +64,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/portsyncd-asan.log" +{% endif %} {%- endif %} [program:orchagent] @@ -72,6 +78,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for={{ orchagent_dependent_startup_wait_for }} +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/orchagent-asan.log" +{% endif %} [program:swssconfig] command=/usr/bin/swssconfig.sh @@ -84,6 +93,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=orchagent:running +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/swssconfig-asan.log" +{% endif %} {% if is_fabric_asic == 0 %} [program:restore_neighbors] @@ -111,6 +123,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=orchagent:running +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/coppmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -123,6 +138,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/neighsyncd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -135,6 +153,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/vlanmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -147,6 +168,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/intfmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -159,6 +183,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/portmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -171,6 +198,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/buffermgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -183,6 +213,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/vrfmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -195,6 +228,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/nbrmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -207,6 +243,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/vxlanmgrd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} @@ -219,6 +258,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/tunnelmgrd-asan.log" +{% endif %} {%- endif %} [program:enable_counters] @@ -241,6 +283,9 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited +{% if ENABLE_ASAN == "y" %} +environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log" +{% endif %} {%- endif %} {% if is_fabric_asic == 0 %} diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index e16ec4e20ee..b139eb570b3 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -302,6 +302,10 @@ start() { if [ ! -f /etc/sonic/zero_profiles.json ] && [ -f /usr/share/sonic/templates/zero_profiles.j2 ]; then sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/zero_profiles.j2 > /etc/sonic/zero_profiles.json fi + + {%- if enable_asan == "y" %} + mkdir -p /var/log/asan + {%- endif %} {%- endif %} # In Multi ASIC platforms the global database config file database_global.json will exist. @@ -425,6 +429,9 @@ start() { {%- endif %} {%- if docker_container_name == "swss" %} -e ASIC_VENDOR={{ sonic_asic_platform }} \ +{%- if enable_asan == "y" %} + -v /var/log/asan/:/var/log/asan \ +{%- endif -%} {%- endif -%} {%- if docker_container_name == "bgp" %} -v /etc/sonic/frr/$DEV:/etc/frr:rw \ @@ -486,6 +493,8 @@ stop() { {%- elif docker_container_name == "teamd" %} # Longer timeout of 60 sec to wait for Portchannels to be cleaned. /usr/local/bin/container stop -t 60 $DOCKERNAME + {%- elif docker_container_name == "swss" and enable_asan == "y" %} + /usr/local/bin/container stop -t 60 $DOCKERNAME {%- else %} /usr/local/bin/container stop $DOCKERNAME {%- endif %} diff --git a/rules/config b/rules/config index 1b7220f6db0..c7ffbcaa451 100644 --- a/rules/config +++ b/rules/config @@ -208,3 +208,6 @@ BUILD_MULTIASIC_KVM = n # INCLUDE_MUX - build docker-mux for dual ToR (Gemini) INCLUDE_MUX = y + +# ENABLE_ASAN - enable address sanitizer +ENABLE_ASAN ?= n diff --git a/slave.mk b/slave.mk index 92320ed57a4..53997e7ed10 100644 --- a/slave.mk +++ b/slave.mk @@ -189,6 +189,13 @@ ifeq ($(SONIC_INCLUDE_MUX),y) INCLUDE_MUX = y endif +ifeq ($(ENABLE_ASAN),y) + ifneq ($(CONFIGURED_ARCH),amd64) + @echo "Disabling SWSS address sanitizer due to incompatible CPU architecture: $(CONFIGURED_ARCH)" + override ENABLE_ASAN = n + endif +endif + include $(RULES_PATH)/functions ifeq ($(SONIC_USE_PDDF_FRAMEWORK),y) @@ -318,6 +325,7 @@ $(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)") $(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)") $(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") $(info "SONIC_VERSION_CONTROL_COMPONENTS": "$(SONIC_VERSION_CONTROL_COMPONENTS)") +$(info "ENABLE_ASAN" : "$(ENABLE_ASAN)") ifeq ($(CONFIGURED_PLATFORM),vs) $(info "BUILD_MULTIASIC_KVM" : "$(BUILD_MULTIASIC_KVM)") endif @@ -1017,6 +1025,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export include_p4rt="$(INCLUDE_P4RT)" export include_sflow="$(INCLUDE_SFLOW)" export enable_auto_tech_support="$(ENABLE_AUTO_TECH_SUPPORT)" + export enable_asan="$(ENABLE_ASAN)" export include_macsec="$(INCLUDE_MACSEC)" export include_mgmt_framework="$(INCLUDE_MGMT_FRAMEWORK)" export include_iccpd="$(INCLUDE_ICCPD)" From 914a8a17568fc0af57c73d5ac5200d6dcaf7e23b Mon Sep 17 00:00:00 2001 From: Jing Kan <672454911@qq.com> Date: Thu, 10 Feb 2022 13:30:54 +0800 Subject: [PATCH 018/139] [sonic-config-engine]: Update minigraph parser to support enable DHCP server for BmcMgmtToRRouter (#9938) Signed-off-by: Jing Kan jika@microsoft.com --- src/sonic-config-engine/minigraph.py | 5 +++++ .../tests/test_minigraph_case.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 121e3ed9e55..2d0e9ac0b66 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -37,6 +37,7 @@ backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] console_device_types = ['MgmtTsToR'] +dhcp_server_enabled_device_types = ['BmcMgmtToRRouter'] VLAN_SUB_INTERFACE_SEPARATOR = '.' VLAN_SUB_INTERFACE_VLAN_ID = '10' @@ -1684,6 +1685,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw } } + # Enable DHCP Server feature for specific device type + if current_device['type'] in dhcp_server_enabled_device_types: + results['DEVICE_METADATA']['localhost']['dhcp_server'] = 'enabled' + return results def get_tunnel_entries(tunnel_intfs, lo_intfs, hostname): diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index 051f33c918a..7377498c707 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -9,6 +9,7 @@ TOR_ROUTER = 'ToRRouter' BACKEND_TOR_ROUTER = 'BackEndToRRouter' +BMC_MGMT_TOR_ROUTER = 'BmcMgmtToRRouter' class TestCfgGenCaseInsensitive(TestCase): @@ -169,6 +170,19 @@ def test_minigraph_console_port(self): utils.to_dict(output.strip()), utils.to_dict("{'1': {'baud_rate': '9600', 'remote_device': 'managed_device', 'flow_control': 1}}")) + def test_minigraph_dhcp_server_feature(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'dhcp_server\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), '') + + try: + # For DHCP server enabled device type + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BMC_MGMT_TOR_ROUTER, self.sample_graph), shell=True) + output = self.run_script(argument) + self.assertEqual(output.strip(), 'enabled') + finally: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BMC_MGMT_TOR_ROUTER, TOR_ROUTER, self.sample_graph), shell=True) + def test_minigraph_deployment_id(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"' output = self.run_script(argument) From f9a29ef0562f8b35b107563c0b810e6f9fe7b735 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 11 Feb 2022 00:39:05 +0800 Subject: [PATCH 019/139] [AS4630-54PE] Add to support PDDF (#8014) * [AS4630-54PE] Add to support PDDF Signed-off-by: Jostar Yang * Fix LGTM alerts * Fix LGTM alerts * Fix LGTM alerts * Add post_device.sh to turn off stk led * Add to support system_health * Correct the wait and timeout mechanism for better CPU usage * Add event.c to support port evt change Co-authored-by: Jostar Yang --- .../pddf/pd-plugin.json | 66 ++ .../pddf/pddf-device.json | 638 ++++++++++++++++++ .../x86_64-accton_as4630_54pe-r0/pddf_support | 0 .../pmon_daemon_control.json | 2 +- .../system_health_monitoring_config.json | 17 + .../as4630-54pe-pddf-platform-monitor.service | 16 + .../service/pddf-platform-init.service | 1 + .../as4630-54pe/sonic_platform/__init__.py | 3 + .../as4630-54pe/sonic_platform/chassis.py | 70 ++ .../as4630-54pe/sonic_platform/component.py | 85 +++ .../as4630-54pe/sonic_platform/eeprom.py | 14 + .../as4630-54pe/sonic_platform/event.py | 60 ++ .../as4630-54pe/sonic_platform/fan.py | 48 ++ .../as4630-54pe/sonic_platform/platform.py | 25 + .../as4630-54pe/sonic_platform/psu.py | 51 ++ .../as4630-54pe/sonic_platform/sfp.py | 20 + .../as4630-54pe/sonic_platform/thermal.py | 17 + .../as4630-54pe/sonic_platform/watchdog.py | 24 + .../as4630-54pe/sonic_platform_setup.py | 25 + .../utils/accton_as4630_54pe_pddf_monitor.py | 332 +++++++++ .../utils/pddf_post_device_create.sh | 14 + .../as4630-54pe/utils/pddf_switch_svc.py | 118 ++++ .../sonic-platform-accton-as4630-54pe.install | 1 + ...sonic-platform-accton-as4630-54pe.postinst | 8 + 24 files changed, 1654 insertions(+), 1 deletion(-) create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/pddf_support create mode 100644 device/accton/x86_64-accton_as4630_54pe-r0/system_health_monitoring_config.json create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service create mode 120000 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/event.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/platform.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/watchdog.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_pddf_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_post_device_create.sh create mode 100755 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_switch_svc.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json new file mode 100644 index 00000000000..0abf66aab7a --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pd-plugin.json @@ -0,0 +1,66 @@ +{ + "XCVR": + { + "xcvr_present": + { + "i2c": + { + "valmap-SFP28": {"1":true, "0":false }, + "valmap-QSFP28": {"1":true, "0":false} + } + } + }, + + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"EXHAUST", "0":"INTAKE"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: ((dc*100.0)/625)", + + "pwm_to_duty_cycle": "lambda pwm: ((pwm*625.0)/100)" + } + +} diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json new file mode 100644 index 00000000000..b48506f9054 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json @@ -0,0 +1,638 @@ +{ + "PLATFORM": + { + "num_psus":2, + "num_fantrays":3, + "num_fans_pertray":1, + "num_ports":54, + "num_temps": 3, + "pddf_dev_types": + { + "description":"AS4630 - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", + "CPLD": + [ + "i2c_cpld" + ], + "PSU": + [ + "psu_eeprom", + "psu_pmbus" + ], + "FAN": + [ + "fan_ctrl", + "fan_eeprom", + "fan_cpld" + ], + "PORT_MODULE": + [ + "pddf_xcvr" + ] + + }, + "std_kos": + [ + "i2c_dev", + "i2c_mux_pca954x force_deselect_on_exit=1", + "optoe" + ], + "description":"kernel modules are loaded while moving to pdf mode, but they should not be unloaded while moving to nonpddf mode.", + "std_perm_kos": + [ + "i2c-i801", + "i2c-ismt" + ], + + "pddf_kos": + [ + "pddf_client_module", + "pddf_cpld_module", + "pddf_cpld_driver", + "pddf_mux_module", + "pddf_xcvr_module", + "pddf_xcvr_driver_module", + "pddf_psu_driver_module", + "pddf_psu_module", + "pddf_fan_driver_module", + "pddf_fan_module", + "pddf_led_module" + ] + }, + + "SYSTEM": + { + "dev_info": {"device_type":"CPU", "device_name":"ROOT_COMPLEX", "device_parent":null}, + "i2c": + { + "CONTROLLERS": + [ + { "dev_name":"i2c-1", "dev":"SMBUS1" } + ] + } + }, + + "SMBUS1": + { + "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM"}, + "i2c": + { + "topo_info": {"dev_addr": "0x1"}, + "DEVICES": + [ + {"dev": "EEPROM1"}, + {"dev": "MUX1"} + ] + } + }, + + + "EEPROM1": + { + "dev_info": {"device_type": "EEPROM", "device_name": "EEPROM1", "device_parent": "SMBUS1"}, + "i2c": + { + "topo_info": {"parent_bus": "0x1", "dev_addr": "0x57", "dev_type": "24c02"}, + "dev_attr": {"access_mode": "BLOCK"}, + "attr_list": [ + {"attr_name": "eeprom"} + ] + } + }, + + "MUX1": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX1", "device_parent":"SMBUS1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x77", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x2"}, + "channel": + [ + { "chn":"0", "dev":"MUX2" }, + { "chn":"1", "dev":"MUX3" }, + { "chn":"1", "dev":"CPLD1" }, + { "chn":"1", "dev":"FAN-CTRL" } + ] + } + }, + + "MUX2": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX2", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0xa"}, + "channel": + [ + { "chn":"0", "dev":"PSU1" }, + { "chn":"1", "dev":"PSU2" }, + { "chn":"4", "dev":"TEMP1" } + ] + } + }, + + "TEMP1" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_parent":"MUX2"}, + "dev_attr": { "display_name":"Temp_1"}, + "i2c": + { + "topo_info": { "parent_bus":"0xe", "dev_addr":"0x48", "dev_type":"lm77"}, + "attr_list": + [ + { "attr_name": "temp1_high_crit_threshold", "drv_attr_name":"temp1_crit"}, + { "attr_name": "temp1_crit_hyst"}, + { "attr_name": "temp1_crit_alarm"}, + { "attr_name": "temp1_max_alarm"}, + { "attr_name": "temp1_min_alarm"}, + { "attr_name": "temp1_input"}, + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_low_threshold", "drv_attr_name":"temp1_min"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_min_hyst"} + ] + } + }, + + "MUX3": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX3", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x70", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x12"}, + "channel": + [ + { "chn":"0", "dev":"PORT49" }, + { "chn":"1", "dev":"PORT50" }, + { "chn":"2", "dev":"PORT51" }, + { "chn":"3", "dev":"PORT52" }, + { "chn":"4", "dev":"PORT53" }, + { "chn":"5", "dev":"PORT54" }, + { "chn":"6", "dev":"TEMP2" }, + { "chn":"7", "dev":"TEMP3" } + ] + } + }, + + + "TEMP2" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_parent":"MUX3"}, + "dev_attr": { "display_name":"Temp_CPU"}, + + "i2c": + { + "topo_info": { "parent_bus":"0x18", "dev_addr":"0x4b", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + + "TEMP3" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_parent":"MUX3"}, + "dev_attr": { "display_name":"Temp_Fan"}, + "i2c": + { + "topo_info": { "parent_bus":"0x19", "dev_addr":"0x4a", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + + "CPLD1": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD1", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x60", "dev_type":"i2c_cpld"} + } + }, + + + "FAN-CTRL": + { + "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x66", "dev_type":"fan_cpld"}, + "dev_attr": { "num_fantrays":"3"}, + "attr_list": + [ + { "attr_name":"fan1_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan2_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan3_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan1_direction", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan2_direction", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"fan3_direction", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x87", "attr_mask":"0x40", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"fan1_input", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x88", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"114", "attr_is_divisor":0}, + { "attr_name":"fan2_input", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x89", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"114" , "attr_is_divisor":0}, + { "attr_name":"fan3_input", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x8a", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"114", "attr_is_divisor":0}, + { "attr_name":"fan1_pwm", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1a", "attr_mask":"0x1F", "attr_len":"1"}, + { "attr_name":"fan2_pwm", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1a", "attr_mask":"0x1F", "attr_len":"1"}, + { "attr_name":"fan3_pwm", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x1b", "attr_mask":"0x1F", "attr_len":"1"} + ] + } + }, + + + "SYS_LED": + { + "dev_info": { "device_type":"LED", "device_name":"SYS_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_GREEN", "bits" : "7:5", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_GREEN_BLINK", "bits" : "7:5", "descr" : "", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "bits" : "7:5", "descr" : "", "value" : "0x4", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_AMBER_BLINK", "bits" : "7:5", "descr" : "", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "7:5", "descr" : "", "value" : "0x7", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"} + ] + } + }, + + + "PSU1_LED": + { + "dev_info": { "device_type":"LED", "device_name":"PSU_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_GREEN", "bits" : "1:0", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "bits" : "1:0", "descr" : "", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "1:0", "descr" : "", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x30"} + ] + } + }, + + "PSU2_LED": + { + "dev_info": { "device_type":"LED", "device_name":"PSU_LED"}, + "dev_attr": { "index":"1"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_GREEN", "bits" : "7:6", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "bits" : "7:6", "descr" : "", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "7:6", "descr" : "", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"} + ] + } + }, + + "FAN_LED": + { + "dev_info": { "device_type":"LED", "device_name":"FAN_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_GREEN", "bits" : "3:2", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"}, + {"attr_name":"STATUS_LED_COLOR_AMBER", "bits" : "3:2", "descr" : "", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "3:2", "descr" : "", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x31"} + ] + } + }, + + "PSU1": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU1", "device_parent":"MUX2"}, + "dev_attr": { "dev_idx":"1", "num_psu_fans": "1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU1-PMBUS" }, + { "itf":"eeprom", "dev":"PSU1-EEPROM" } + ] + + } + }, + + "PSU1-PMBUS": + { + "dev_info": { "device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xa", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU1-EEPROM": + { + "dev_info": { "device_type":"PSU-EEPROM", "device_name":"PSU1-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xa", "dev_addr":"0x50", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x22", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x20", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"12" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x22", "attr_mask":"0x40", "attr_cmpval":"0x40", "attr_len":"1"}, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x50", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + ] + } + }, + + + "PSU2": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU2", "device_parent":"MUX2" }, + "dev_attr": { "dev_idx":"2", "num_psu_fans":"1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU2-PMBUS"}, + { "itf":"eeprom", "dev":"PSU2-EEPROM"} + ] + } + + }, + + "PSU2-PMBUS": + { + "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU2-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xb", "dev_addr":"0x59", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x59", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU2-EEPROM": + { + "dev_info": {"device_type":"PSU-EEPROM", "device_name":"PSU2-EEPROM", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xb", "dev_addr":"0x51", "dev_type":"psu_eeprom"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x22", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x51", "attr_devtype":"eeprom", "attr_offset":"0x20", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"12" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x22", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x51", "attr_devtype":"eeprom", "attr_offset":"0x35", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"19" } + ] + } + }, + + "PORT49": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT49", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"49"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT49-EEPROM" }, + { "itf":"control", "dev":"PORT49-CTRL" } + ] + } + }, + "PORT49-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT49-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT49-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT49-CTRL", "device_parent":"MUX3", "virt_parent":"PORT49"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT50": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT50", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"50"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT50-EEPROM" }, + { "itf":"control", "dev":"PORT50-CTRL" } + ] + } + }, + "PORT50-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT50-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT50-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT50-CTRL", "device_parent":"MUX3", "virt_parent":"PORT50"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT51": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT51", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"51"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT51-EEPROM" }, + { "itf":"control", "dev":"PORT51-CTRL" } + ] + } + }, + "PORT51-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT51-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT51-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT51-CTRL", "device_parent":"MUX3", "virt_parent":"PORT51"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + "PORT52": + { + "dev_info": { "device_type":"SFP28", "device_name":"PORT52", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"52"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT52-EEPROM" }, + { "itf":"control", "dev":"PORT52-CTRL" } + ] + } + }, + "PORT52-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT52-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x50", "dev_type":"optoe2"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT52-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT52-CTRL", "device_parent":"MUX3", "virt_parent":"PORT52"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT53": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT53", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"53"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT53-EEPROM" }, + { "itf":"control", "dev":"PORT53-CTRL" } + ] + } + }, + "PORT53-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT53-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT53-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT53-CTRL", "device_parent":"MUX3", "virt_parent":"PORT53"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x21", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT54": + { + "dev_info": { "device_type":"QSFP28", "device_name":"PORT54", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"54"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT54-EEPROM" }, + { "itf":"control", "dev":"PORT54-CTRL" } + ] + } + }, + "PORT54-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT54-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT54-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT54-CTRL", "device_parent":"MUX3", "virt_parent":"PORT54"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x21", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + } + +} diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support b/device/accton/x86_64-accton_as4630_54pe-r0/pddf_support new file mode 100644 index 00000000000..e69de29bb2d diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as4630_54pe-r0/pmon_daemon_control.json index 584a14b9d94..a3b204e20d8 100644 --- a/device/accton/x86_64-accton_as4630_54pe-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as4630_54pe-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { "skip_ledd": true, - "skip_thermalctld": true + "skip_pcied": true } diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as4630_54pe-r0/system_health_monitoring_config.json new file mode 100644 index 00000000000..61f624ee34c --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54pe-r0/system_health_monitoring_config.json @@ -0,0 +1,17 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.voltage", + "psu.temperature", + "PSU1_FAN1.speed", + "PSU2_FAN1.speed" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "STATUS_LED_COLOR_AMBER", + "normal": "STATUS_LED_COLOR_GREEN", + "booting": "STATUS_LED_COLOR_GREEN_BLINK" + } +} diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service new file mode 100644 index 00000000000..99bca2684f4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/as4630-54pe-pddf-platform-monitor.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS4630-54PE Platform Monitoring service +Before=pmon.service +After=pddf-platform-init.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as4630_54pe_pddf_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service new file mode 120000 index 00000000000..0fd9f25b6c5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/__init__.py new file mode 100644 index 00000000000..f0201e71779 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal"] +from . import platform diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/chassis.py new file mode 100644 index 00000000000..1dfca24ab32 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/chassis.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import sys + from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from .event import SfpEvent +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 2 + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + SYSLED_DEV_NAME = "SYS_LED" + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self.__initialize_components() + self._sfpevent = SfpEvent(self.get_all_sfps()) + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_change_event(self, timeout=0): + return self._sfpevent.get_sfp_event(timeout) + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + + Returns: + An object derived from SfpBase representing the specified sfp + """ + sfp = None + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp + + def initizalize_system_led(self): + return + + def get_status_led(self): + return self.get_system_led(self.SYSLED_DEV_NAME) + + def set_status_led(self, color): + return self.set_system_led(self.SYSLED_DEV_NAME, color) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/component.py new file mode 100644 index 00000000000..22696341523 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/component.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the component information (such as CPLD, FPGA, BIOS etc) which are available in the platform +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +#COMPONENT_NAME_LIST = ["CPLD1"] +COMPONENT_LIST = [ + ("CPLD1", "CPLD 1"), + ("BIOS", "Basic Input/Output System") +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + + def __init__(self, component_index): + self.index = component_index + self.name = self.get_name() + self.cpld_mapping = { + 0: ['3', '0x60'] + } + + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cmd = "i2cget -f -y {0} {1} 0x1".format(self.cpld_mapping[self.index][0], self.cpld_mapping[self.index][1]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + fw_version = value.rstrip() + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/eeprom.py new file mode 100644 index 00000000000..a87ecc9f6fe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/eeprom.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(PddfEeprom): + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/event.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/event.py new file mode 100644 index 00000000000..d5dac6d7f7e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/event.py @@ -0,0 +1,60 @@ +try: + import time + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + +POLL_INTERVAL_IN_SEC = 1 + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._sfp_list = sfp_list + self._logger = Logger() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.get_position_in_parent() - 1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + for sfp in self._sfp_list: + i=sfp.get_position_in_parent() - 1 + if (changed_ports & (1 << i)): + if (bitmap & (1 << i)) == 0: + port_dict[i+1] = '0' + else: + port_dict[i+1] = '1' + + + # Update the cache dict + self._sfp_change_event_data['present'] = bitmap + return True, change_dict + else: + return True, change_dict diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan.py new file mode 100644 index 00000000000..ef8deaffb6f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/fan.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten + # Since AS4630 psu_fan airflow direction cant be read from sysfs, it is fixed as 'F2B' or 'Exhaust' + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + if self.is_psu_fan: + direction = self.FAN_DIRECTION_EXHAUST + + else: + idx = (self.fantray_index-1)*self.platform['num_fans_pertray'] + self.fan_index + attr = "fan" + str(idx) + "_direction" + output = self.pddf_obj.get_attr_name_output("FAN-CTRL", attr) + if not output: + return False + + mode = output['mode'] + val = output['status'] + + val = val.rstrip() + vmap = self.plugin_data['FAN']['direction'][mode]['valmap'] + if val in vmap: + direction = vmap[val] + else: + direction = val + + return direction + diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/platform.py new file mode 100644 index 00000000000..406b1179ae1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/platform.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + + +try: + from sonic_platform_pddf_base.pddf_platform import PddfPlatform +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PddfPlatform): + """ + PDDF Platform-Specific Platform Class + """ + + def __init__(self): + PddfPlatform.__init__(self) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/psu.py new file mode 100644 index 00000000000..f002f5e0394 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/psu.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 1200 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + return (self.PLATFORM_PSU_CAPACITY) + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + ptype = "AC" + # Currently the platform supports only AC type of PSUs + #try: + #import sonic_platform.platform + #ch=sonic_platform.platform.Platform().get_chassis() + #e=ch.sys_eeprom.read_eeprom() + #ret, prod_name = ch.sys_eeprom.get_tlv_field(e,0x21) + #if ret: + #prod_name = prod_name[2] + ##print("Product name is {}".format(prod_name)) + #if '48V' in prod_name: + #ptype = 'DC' + #except Exception as e: + #print("Error while trying to read syseeprom to get PSU type") + + return ptype diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/sfp.py new file mode 100644 index 00000000000..c9fb07d6364 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/sfp.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_sfp import PddfSfp +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_position_in_parent(self): + """Retrieves 1-based relative physical position in parent device.""" + return self.port_index diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py new file mode 100644 index 00000000000..5b829fc26ca --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/thermal.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/watchdog.py new file mode 100644 index 00000000000..fe8554f6ec7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform/watchdog.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of platform specific watchdog API's +# +############################################################################# + +try: + from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Watchdog(PddfWatchdog): + """ + PDDF Platform-specific Chassis class + """ + + def __init__(self): + PddfWatchdog.__init__(self) + self.timeout = 180 + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py new file mode 100644 index 00000000000..59dad237f3b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/sonic_platform_setup.py @@ -0,0 +1,25 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms using PDDF', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_pddf_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_pddf_monitor.py new file mode 100755 index 00000000000..d9299b96a3b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_pddf_monitor.py @@ -0,0 +1,332 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -* +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# HISTORY: +# mm/dd/yyyy (A.D.)# +# 10/24/2019:Jostar create for as4630_54pe thermal plan +# ------------------------------------------------------------------ + +try: + import os + import sys + import getopt + import subprocess + import logging + import logging.handlers + import time + from sonic_platform import platform +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as4630_54pe_pddf_monitor' + + + + + +# Temperature Policy +# If any fan fail , please set fan speed register to 16 +# The max value of fan speed register is 14 +# LM77(48)+LM75(4B)+LM75(4A) > 140, Set 10 +# LM77(48)+LM75(4B)+LM75(4A) > 150, Set 12 +# LM77(48)+LM75(4B)+LM75(4A) > 160, Set 14 +# LM77(48)+LM75(4B)+LM75(4A) < 140, Set 8 +# LM77(48)+LM75(4B)+LM75(4A) < 150, Set 10 +# LM77(48)+LM75(4B)+LM75(4A) < 160, Set 12 +# Reset DUT:LM77(48)>=70C +# +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +def as4630_54pe_set_fan_speed(pwm): + # This platform has 2 fans controlled by one register on CPLD and 3rd fan by another register + # Hence, we need to change the speed for all + if pwm < 0 or pwm > 100: + print("Error: Wrong duty cycle value %d" % (pwm)) + platform_chassis.get_fan(0).set_speed(pwm) + platform_chassis.get_fan(2).set_speed(pwm) + + return 0 + + +fan_policy_state = 0 +fan_fail = 0 +fan_fail_list = [0, 0, 0] +alarm_state = 0 # 0->default or clear, 1-->alarm detect +test_temp = 0 +simulate_temp_decline = 0 +test_temp_list = [0, 0, 0] +temp_test_data = 0 +test_temp_revert = 0 +platform_chassis = None +# Make a class we can use to capture stdout and sterr in the log + + +class device_monitor(object): + # static temp var + temp = 0 + new_pwm = 0 + pwm = 0 + ori_pwm = 0 + default_pwm = 0x4 + + def __init__(self, log_file, log_level): + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(asctime)-15s %(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address='/dev/log') + sys_handler.setLevel(logging.WARNING) + logging.getLogger('').addHandler(sys_handler) + + def get_state_from_fan_policy(self, temp, policy): + state = 0 + for i in range(0, len(policy)): + if (temp > policy[i][2]): # temp_down + if temp <= policy[i][3]: # temp_up + state = i + + return state + + def manage_fans(self): + global fan_policy_state + global fan_fail + global fan_fail_list + global test_temp + global simulate_temp_decline + global test_temp_list + global alarm_state + global temp_test_data + global test_temp_revert + global platform_chassis + NUM_FANS = 3 + LEVEL_FAN_MIN = 0 + LEVEL_FAN_NORMAL = 1 + LEVEL_FAN_MID = 2 + LEVEL_FAN_HIGH = 3 + LEVEL_TEMP_CRITICAL = 4 + fan_policy = { + LEVEL_FAN_MIN: [50, 8, 0, 140000], + LEVEL_FAN_NORMAL: [62, 10, 140000, 150000], + LEVEL_FAN_MID: [75, 12, 150000, 160000], + LEVEL_FAN_HIGH: [88, 14, 160000, 240000], + LEVEL_TEMP_CRITICAL: [100, 16, 240000, 300000], + } + temp = [0, 0, 0] + + #thermal = ThermalUtil() + #fan = FanUtil() + # Supposedly all the fans are set with same duty cycle + ori_duty_cycle = platform_chassis.get_fan(0).get_speed() + new_duty_cycle = 0 + + if test_temp == 0: + for i in range(0, 3): + temp[i] = platform_chassis.get_thermal(i).get_temperature() + if temp[i] == 0.0 or temp[i] is None: + + logging.warning("Get temp-%d fail", i) + return False + temp[i] = int(temp[i]*1000) + else: + if test_temp_revert == 0: + temp_test_data = temp_test_data+2000 + else: + if temp_test_data > 0: + temp_test_data = temp_test_data-2000 + else: + # Stop the simulation + sys.exit('Simulation Ends !') + + for i in range(0, 3): + temp[i] = test_temp_list[i]+temp_test_data + fan_fail = 0 + + temp_val = 0 + for i in range(0, 3): + if temp[i] is None: + break + temp_val += temp[i] + + # Check Fan status + for i in range(NUM_FANS): + if not platform_chassis.get_fan(i).get_status(): + if test_temp == 0: + fan_fail = 1 + if fan_fail_list[i] == 0: + fan_fail_list[i] = 1 + else: + if fan_fail_list[i] == 1: + fan_fail_list[i] = 0 + + if sum(fan_fail_list) == NUM_FANS: + # Critical: Either all the fans are faulty or they are removed, shutdown the system + logging.critical('Alarm for all fan faulty/absent is detected') + logging.critical("Alarm for all fan faulty/absent is detected, reset DUT") + cmd_str = "i2cset -y -f 3 0x60 0x4 0xE4" + time.sleep(2) + subprocess.getstatusoutput('sync; sync; sync') + subprocess.getstatusoutput(cmd_str) + elif sum(fan_fail_list) != 0: + # Set the 100% speed only for first fan failure detection + logging.warning('Fan_{} failed, set remaining fan speed to 100%'.format( + ' Fan_'.join(str(item+1) for item, val in enumerate(fan_fail_list) if val == 1))) + new_pwm = 100 + as4630_54pe_set_fan_speed(new_pwm) + else: + fan_fail = 0 + + ori_state = fan_policy_state + fan_policy_state = self.get_state_from_fan_policy(temp_val, fan_policy) + + if fan_policy_state > LEVEL_TEMP_CRITICAL or fan_policy_state < LEVEL_FAN_MIN: + logging.error("Get error fan current_state\n") + return 0 + + # Decision : Decide new fan pwm percent. + if fan_fail == 0 and ori_duty_cycle != fan_policy[fan_policy_state][0]: + new_duty_cycle = fan_policy[fan_policy_state][0] + as4630_54pe_set_fan_speed(new_duty_cycle) + if test_temp == 1: + time.sleep(3) + status, output = subprocess.getstatusoutput('pddf_fanutil getspeed') + logging.debug('\n%s\n', output) + + if temp[0] >= 70000: # LM77-48 + # critical case*/ + logging.critical('Alarm for temperature critical is detected') + logging.critical("Alarm-Critical for temperature critical is detected, reset DUT") + # Update the reboot cause file to reflect that critical temperature + # has been crossed. Upon next boot, the contents of this file will + # be used to determine the cause of the previous reboot + status, output = subprocess.getstatusoutput( + 'echo "Thermal Overload: Other" > /host/reboot-cause/reboot-cause.txt') + status, output = subprocess.getstatusoutput( + 'echo "System rebooted because alarm for critical temperature (70 C) is detected [Time: $(eval date)]" >> /host/reboot-cause/reboot-cause.txt') + if status: + logging.warning('Reboot cause file not updated. {}'.format(output)) + + cmd_str = "i2cset -y -f 3 0x60 0x4 0xE4" + subprocess.getstatusoutput('sync; sync; sync') + time.sleep(3) + subprocess.getstatusoutput(cmd_str) + + logging.debug('ori_state=%d, current_state=%d, temp_val=%d\n\n', ori_state, fan_policy_state, temp_val) + + if ori_state < LEVEL_FAN_HIGH: + if fan_policy_state >= LEVEL_FAN_HIGH: + if alarm_state == 0: + logging.warning('Alarm for temperature high is detected') + alarm_state = 1 + # Add a mechanism to decrease the test_temp values + if simulate_temp_decline == 1: + logging.info('Temperature decline simulation is ON. Testing temperature will decrease now') + test_temp_revert = 1 + + if fan_policy_state < LEVEL_FAN_MID: + if alarm_state == 1: + logging.warning('Alarm for temperature high is cleared') + alarm_state = 0 + + return True + + +def main(argv): + # Check if PDDF mode is enabled + if not os.path.exists('/usr/share/sonic/platform/pddf_support'): + print("PDDF mode is not enabled") + return 0 + + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + global test_temp + global simulate_temp_decline + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv, 'hdlt:', ['lfile=']) + except getopt.GetoptError: + print('Usage: %s [-d] [-l ]' % sys.argv[0]) + return 0 + for opt, arg in opts: + if opt == '-h': + print('Usage: %s [-d] [-l ]' % sys.argv[0]) + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + + if sys.argv[1] == '-t': + if len(sys.argv) != 6: + print("temp test, need input temp decline option and three temp values") + return 0 + + i = 0 + simulate_temp_decline = int(sys.argv[2]) + for x in range(3, 6): + test_temp_list[i] = int(sys.argv[x])*1000 + i = i+1 + test_temp = 1 + log_level = logging.DEBUG + print(test_temp_list) + + global platform_chassis + platform_chassis = platform.Platform().get_chassis() + + as4630_54pe_set_fan_speed(50) + + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(10) # 10sec + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_post_device_create.sh b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_post_device_create.sh new file mode 100755 index 00000000000..d820352ac7e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_post_device_create.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "Setting LED MAC Mode.." +i2cset -y -f 3 0x60 0x2a 0xff +i2cset -y -f 3 0x60 0x2b 0xff +i2cset -y -f 3 0x60 0x86 0x89 +echo "Setting LED MAC Mode..DONE" +# Turn off STK1 and STK2 LED. Bit5:4 to 0x11 +#i2cset -y -f 3 0x60 0xb5 +stk_val=$(i2cget -y -f 3 0x60 0x31) +new_val=$((${stk_val}|0x30)) +i2cset -y -f 3 0x60 0x31 ${new_val} +echo "STK LEDs are turned off successfully" + diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_switch_svc.py new file mode 100755 index 00000000000..5a505e19f19 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/pddf_switch_svc.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa + +import commands + +def check_pddf_support(): + return True + +def stop_platform_svc(): + status, output = commands.getstatusoutput("systemctl disable as4630-54pe-platform-monitor-fan.service") + if status: + print "Disable as4630-54pe-platform-monitor-fan.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl stop as4630-54pe-platform-monitor-fan.service") + if status: + print "Stop as4630-54pe-platform-monitor-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl disable as4630-54pe-platform-monitor-psu.service") + if status: + print "Disable as4630-54pe-platform-monitor-psu.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl stop as4630-54pe-platform-monitor-psu.service") + if status: + print "Stop as4630-54pe-platform-monitor-psu.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl disable as4630-54pe-platform-monitor.service") + if status: + print "Disable as4630-54pe-platform-monitor.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl stop as4630-54pe-platform-monitor.service") + if status: + print "Stop as4630-54pe-platform-monitor.service failed %d"%status + return False + + status, output = commands.getstatusoutput("/usr/local/bin/accton_as4630_54pe_util.py clean") + if status: + print "accton_as4630_54pe_util.py clean command failed %d"%status + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service along with other platform serives failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl stop as4630-54pe-pddf-platform-monitor.service") + if status: + print "Stop as4630-54pe-pddf-platform-monitor.service along with other platform serives failed %d"%status + return False + + return True + +def start_platform_svc(): + status, output = commands.getstatusoutput("/usr/local/bin/accton_as4630_54pe_util.py install") + if status: + print "accton_as4630_54pe_util.py install command failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl enable as4630-54pe-platform-monitor-fan.service") + if status: + print "Enable as4630-54pe-platform-monitor-fan.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start as4630-54pe-platform-monitor-fan.service") + if status: + print "Start as4630-54pe-platform-monitor-fan.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl enable as4630-54pe-platform-monitor-psu.service") + if status: + print "Enable as4630-54pe-platform-monitor-psu.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start as4630-54pe-platform-monitor-psu.service") + if status: + print "Start as4630-54pe-platform-monitor-psu.service failed %d"%status + return False + + status, output = commands.getstatusoutput("systemctl enable as4630-54pe-platform-monitor.service") + if status: + print "Enable as4630-54pe-platform-monitor.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start as4630-54pe-platform-monitor.service") + if status: + print "Start as4630-54pe-platform-monitor.service failed %d"%status + return False + + return True + +def start_platform_pddf(): + status, output = commands.getstatusoutput("systemctl start pddf-platform-init.service") + if status: + print "Start pddf-platform-init.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl start as4630-54pe-pddf-platform-monitor.service") + if status: + print "Start as4630-54pe-pddf-platform-monitor.service failed %d"%status + return False + + return True + +def stop_platform_pddf(): + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print "Stop pddf-platform-init.service failed %d"%status + return False + status, output = commands.getstatusoutput("systemctl stop as4630-54pe-pddf-platform-monitor.service") + if status: + print "Stop as4630-54pe-pddf-platform-monitor.service failed %d"%status + return False + + return True + +def main(): + pass + +if __name__ == "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install new file mode 100644 index 00000000000..4ba26bed262 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.install @@ -0,0 +1 @@ +as4630-54pe/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54pe-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst new file mode 100644 index 00000000000..23bebd3b295 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54pe.postinst @@ -0,0 +1,8 @@ +# Special arrangement to make PDDF mode default +# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) +# Enable pddf-platform-monitor +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service +systemctl enable as4630-54pe-pddf-platform-monitor.service +systemctl start as4630-54pe-pddf-platform-monitor.service From 519dcde9396699b9e84f5cccdaf05edecf7acecb Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 11 Feb 2022 00:39:50 +0800 Subject: [PATCH 020/139] [AS7712-32X] Add to support PDDF (#8040) * [AS7712-32X] Add to support PDDF Signed-off-by: Jostar Yang * Fix LGTM alerts * Fix AS7712-32X xcvrd busy issue Co-authored-by: Jostar Yang --- .../pddf/pd-plugin.json | 54 + .../pddf/pddf-device.json | 1792 +++++++++++++++++ .../x86_64-accton_as7712_32x-r0/pddf_support | 0 .../pmon_daemon_control.json | 4 +- .../as7712-pddf-platform-monitor.service | 16 + .../service/pddf-platform-init.service | 1 + .../as7712-32x/sonic_platform/__init__.py | 3 + .../as7712-32x/sonic_platform/chassis.py | 59 + .../as7712-32x/sonic_platform/component.py | 115 ++ .../as7712-32x/sonic_platform/eeprom.py | 14 + .../as7712-32x/sonic_platform/event.py | 60 + .../as7712-32x/sonic_platform/fan.py | 24 + .../as7712-32x/sonic_platform/platform.py | 25 + .../as7712-32x/sonic_platform/psu.py | 51 + .../as7712-32x/sonic_platform/sfp.py | 20 + .../as7712-32x/sonic_platform/thermal.py | 17 + .../as7712-32x/sonic_platform/watchdog.py | 24 + .../as7712-32x/sonic_platform_setup.py | 25 + .../utils/accton_as7712_pddf_monitor.py | 264 +++ .../as7712-32x/utils/pddf_switch_svc.py | 70 + .../sonic-platform-accton-as7712-32x.install | 1 + .../sonic-platform-accton-as7712-32x.postinst | 8 + 22 files changed, 2645 insertions(+), 2 deletions(-) create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json create mode 100644 device/accton/x86_64-accton_as7712_32x-r0/pddf_support create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/as7712-pddf-platform-monitor.service create mode 120000 platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/pddf-platform-init.service create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/__init__.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/chassis.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/component.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/eeprom.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/event.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/platform.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/psu.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/sfp.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/watchdog.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform_setup.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_pddf_monitor.py create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/pddf_switch_svc.py create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.install create mode 100644 platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.postinst diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json new file mode 100644 index 00000000000..4d253635cc9 --- /dev/null +++ b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pd-plugin.json @@ -0,0 +1,54 @@ +{ + "PSU": + { + "psu_present": + { + "i2c": + { + "valmap": { "1":true, "0":false } + } + }, + + "psu_power_good": + { + "i2c": + { + "valmap": { "1": true, "0":false } + } + }, + + "psu_fan_dir": + { + "i2c": + { + "valmap": { "F2B":"EXHAUST", "B2F":"INTAKE" } + } + }, + + "PSU_FAN_MAX_SPEED":"18000" + }, + + "FAN": + { + "direction": + { + "i2c": + { + "valmap": {"1":"EXHAUST", "0":"INTAKE"} + } + }, + + "present": + { + "i2c": + { + "valmap": {"1":true, "0":false} + } + }, + + "duty_cycle_to_pwm": "lambda dc: ((dc*100.0)/625 - 1)", + + "pwm_to_duty_cycle": "lambda pwm: math.ceil(((pwm+1)*625.0)/100)" + } + +} diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json new file mode 100644 index 00000000000..d84e6fde2b1 --- /dev/null +++ b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json @@ -0,0 +1,1792 @@ +{ + "PLATFORM": + { + "num_psus":2, + "num_fantrays":6, + "num_fans_pertray":2, + "num_ports":32, + "num_temps": 4, + "pddf_dev_types": + { + "description":"AS7712 - Below is the list of supported PDDF device types (chip names) for various components. If any component uses some other driver, we will create the client using 'echo > /new_device' method", + "CPLD": + [ + "i2c_cpld" + ], + "PSU": + [ + "psu_eeprom", + "psu_pmbus" + ], + "FAN": + [ + "fan_ctrl", + "fan_eeprom" + ], + "PORT_MODULE": + [ + "pddf_xcvr" + ] + + }, + "std_kos": + [ + "i2c-ismt", + "i2c-i801", + "i2c_dev", + "i2c_mux_pca954x force_deselect_on_exit=1", + "optoe" + ], + "pddf_kos": + [ + "pddf_client_module", + "pddf_cpld_module", + "pddf_cpld_driver", + "pddf_mux_module", + "pddf_xcvr_module", + "pddf_xcvr_driver_module", + "pddf_psu_driver_module", + "pddf_psu_module", + "pddf_fan_driver_module", + "pddf_fan_module", + "pddf_led_module", + "pddf_sysstatus_module" + ] + }, + + "SYSTEM": + { + "dev_info": {"device_type":"CPU", "device_name":"ROOT_COMPLEX", "device_parent":null}, + "i2c": + { + "CONTROLLERS": + [ + { "dev_name":"i2c-1", "dev":"SMBUS1" }, + { "dev_name":"i2c-0", "dev":"SMBUS0" } + ] + } + }, + + "SMBUS0": + { + "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS0", "device_parent": "SYSTEM"}, + "i2c": + { + "topo_info": {"dev_addr": "0x0"}, + "DEVICES": + [ + {"dev": "EEPROM1"}, + {"dev": "MUX2"}, + {"dev": "MUX3"}, + {"dev": "MUX4"}, + {"dev": "MUX5"}, + {"dev": "MUX6"} + ] + } + }, + + "SMBUS1": + { + "dev_info": {"device_type": "SMBUS", "device_name": "SMBUS1", "device_parent": "SYSTEM"}, + "i2c": + { + "topo_info": {"dev_addr": "0x1"}, + "DEVICES": + [ + {"dev": "MUX1"} + ] + } + }, + "EEPROM1": + { + "dev_info": {"device_type": "EEPROM", "device_name": "EEPROM1", "device_parent": "SMBUS0"}, + "i2c": + { + "topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"}, + "dev_attr": {"access_mode": "BLOCK"}, + "attr_list": [ + {"attr_name": "eeprom"} + ] + } + }, + + "MUX1": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX1", "device_parent":"SMBUS1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1", "dev_addr":"0x76", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x2"}, + "channel": + [ + { "chn":"0", "dev":"FAN-CTRL" }, + { "chn":"1", "dev":"TEMP1" }, + { "chn":"1", "dev":"TEMP2" }, + { "chn":"1", "dev":"TEMP3" }, + { "chn":"1", "dev":"TEMP4" }, + { "chn":"2", "dev":"CPLD1" }, + { "chn":"3", "dev":"CPLD2" }, + { "chn":"4", "dev":"CPLD3" } + ] + } + }, + + "MUX2": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX2", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x71", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0xa"}, + "channel": + [ + { "chn":"0", "dev":"PSU2" }, + { "chn":"1", "dev":"PSU1" } + ] + } + }, + + "FAN-CTRL": + { + "dev_info": { "device_type":"FAN", "device_name":"FAN-CTRL", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2", "dev_addr":"0x66", "dev_type":"fan_ctrl"}, + "dev_attr": { "num_fantrays":"6"}, + "attr_list": + [ + { "attr_name":"fan1_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan2_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan3_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan4_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan5_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan6_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan7_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan8_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x8", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan9_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan10_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x10", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan11_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan12_present", "attr_devtype":"FAN-CTRL", "attr_offset":"0x0F", "attr_mask":"0x20", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"fan1_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan2_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x1", "attr_len":"1"}, + { "attr_name":"fan3_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan4_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x2", "attr_len":"1"}, + { "attr_name":"fan5_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan6_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x4", "attr_len":"1"}, + { "attr_name":"fan7_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan8_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x8", "attr_cmpval":"0x8", "attr_len":"1"}, + { "attr_name":"fan9_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan10_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x10", "attr_cmpval":"0x10", "attr_len":"1"}, + { "attr_name":"fan11_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"fan12_direction", "attr_devtype":"FAN-CTRL", "attr_offset":"0x10", "attr_mask":"0x20", "attr_cmpval":"0x20", "attr_len":"1"}, + { "attr_name":"fan1_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x12", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan2_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x22", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan3_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x13", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan4_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x23", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan5_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x14", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan6_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x24", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan7_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x15", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan8_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x25", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan9_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x16", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan10_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x26", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan11_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x17", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100", "attr_is_divisor":0}, + { "attr_name":"fan12_input", "attr_devtype":"FAN-CTRL", "attr_offset":"0x27", "attr_mask":"0xFF", "attr_len":"1", "attr_mult":"100" , "attr_is_divisor":0}, + { "attr_name":"fan1_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan2_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan3_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan4_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan5_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan6_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan7_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan8_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan9_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan10_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan11_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" }, + { "attr_name":"fan12_pwm", "attr_devtype":"FAN-CTRL", "attr_offset":"0x11", "attr_mask":"0x0F", "attr_len":"1" } + ] + } + }, + + "TEMP1" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP1", "device_parent":"MUX1"}, + "dev_attr": { "display_name":"Temp_1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x48", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + "TEMP2" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP2", "device_parent":"MUX1"}, + "dev_attr": { "display_name":"Temp_2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x49", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + "TEMP3" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP3", "device_parent":"MUX1"}, + "dev_attr": { "display_name":"Temp_3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x4a", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + "TEMP4" : + { + "dev_info": { "device_type":"TEMP_SENSOR", "device_name":"TEMP4", "device_parent":"MUX1"}, + "dev_attr": { "display_name":"Temp_CPU"}, + "i2c": + { + "topo_info": { "parent_bus":"0x3", "dev_addr":"0x4b", "dev_type":"lm75"}, + "attr_list": + [ + { "attr_name": "temp1_high_threshold", "drv_attr_name":"temp1_max"}, + { "attr_name": "temp1_max_hyst"}, + { "attr_name": "temp1_input"} + ] + } + }, + + "CPLD1": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD1", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x4", "dev_addr":"0x60", "dev_type":"i2c_cpld"}, + "dev_attr":{} + } + }, + + "CPLD2": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD2", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x5", "dev_addr":"0x62", "dev_type":"i2c_cpld"}, + "dev_attr": { } + } + }, + + "CPLD3": + { + "dev_info": { "device_type":"CPLD", "device_name":"CPLD3", "device_parent":"MUX1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x6", "dev_addr":"0x64", "dev_type":"i2c_cpld"}, + "dev_attr": { } + } + }, + + "SYSSTATUS": + { + "dev_info":{ "device_type":"SYSSTAT", "device_name":"SYSSTATUS"}, + "dev_attr":{ }, + "attr_list": + [ + + { "attr_name":"board_info","attr_devaddr":"0x60", "attr_offset":"0x0","attr_mask":"0xf","attr_len":"0x1"}, + { "attr_name":"cpld1_version","attr_devaddr":"0x60","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"power_module_status","attr_devaddr":"0x60","attr_offset":"0x2","attr_mask":"0x2f","attr_len":"0x1"}, + { "attr_name":"system_reset5","attr_devaddr":"0x60","attr_offset":"0x8","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"system_reset6","attr_devaddr":"0x60","attr_offset":"0x9","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"system_reset7","attr_devaddr":"0x60","attr_offset":"0xa","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"misc1","attr_devaddr":"0x60","attr_offset":"0x48","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"cpld2_version","attr_devaddr":"0x62","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"}, + { "attr_name":"cpld3_version","attr_devaddr":"0x64","attr_offset":"0x1","attr_mask":"0xff","attr_len":"0x1"} + + ] + }, + + + "PSU1": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU1", "device_parent":"MUX2"}, + "dev_attr": { "dev_idx":"1", "num_psu_fans": "1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU1-PMBUS" } + ] + + } + }, + + "PSU1-PMBUS": + { + "dev_info": { "device_type":"PSU-PMBUS", "device_name":"PSU1-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU1"}, + "i2c": + { + "topo_info":{ "parent_bus":"0xb", "dev_addr":"0x5b", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"9" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x28", "attr_cmpval":"0x28", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "PSU2": + { + "dev_info": { "device_type":"PSU", "device_name":"PSU2", "device_parent":"MUX2" }, + "dev_attr": { "dev_idx":"2", "num_psu_fans":"1"}, + "i2c": + { + "interface": + [ + { "itf":"pmbus", "dev":"PSU2-PMBUS"} + ] + } + + }, + + "PSU2-PMBUS": + { + "dev_info": {"device_type":"PSU-PMBUS", "device_name":"PSU2-PMBUS", "device_parent":"MUX2", "virt_parent":"PSU2"}, + "i2c": + { + "topo_info": { "parent_bus":"0xa", "dev_addr":"0x58", "dev_type":"psu_pmbus"}, + "attr_list": + [ + { "attr_name":"psu_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"9" }, + { "attr_name":"psu_power_good", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_offset":"0x2", "attr_mask":"0x14", "attr_cmpval":"0x14", "attr_len":"1"}, + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" }, + { "attr_name":"psu_serial_num", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9e", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"20" }, + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"}, + { "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}, + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"} + ] + } + }, + + "MUX3": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX3", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x72", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x12"}, + "channel": + [ + { "chn":"0", "dev":"PORT9" }, + { "chn":"1", "dev":"PORT10" }, + { "chn":"2", "dev":"PORT11" }, + { "chn":"3", "dev":"PORT12" }, + { "chn":"4", "dev":"PORT1" }, + { "chn":"5", "dev":"PORT2" }, + { "chn":"6", "dev":"PORT3" }, + { "chn":"7", "dev":"PORT4" } + ] + } + }, + + "MUX4": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX4", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x73", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x1a"}, + "channel": + [ + { "chn":"0", "dev":"PORT6" }, + { "chn":"1", "dev":"PORT5" }, + { "chn":"2", "dev":"PORT8" }, + { "chn":"3", "dev":"PORT7" }, + { "chn":"4", "dev":"PORT13" }, + { "chn":"5", "dev":"PORT14" }, + { "chn":"6", "dev":"PORT15" }, + { "chn":"7", "dev":"PORT16" } + ] + } + }, + + "MUX5": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX5", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x74", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x22"}, + "channel": + [ + { "chn":"0", "dev":"PORT17" }, + { "chn":"1", "dev":"PORT18" }, + { "chn":"2", "dev":"PORT19" }, + { "chn":"3", "dev":"PORT20" }, + { "chn":"4", "dev":"PORT25" }, + { "chn":"5", "dev":"PORT26" }, + { "chn":"6", "dev":"PORT27" }, + { "chn":"7", "dev":"PORT28" } + ] + } + }, + + "MUX6": + { + "dev_info": { "device_type":"MUX", "device_name":"MUX6", "device_parent":"SMBUS0"}, + "i2c": + { + "topo_info": { "parent_bus":"0x0", "dev_addr":"0x75", "dev_type":"pca9548"}, + "dev_attr": { "virt_bus":"0x2a"}, + "channel": + [ + { "chn":"0", "dev":"PORT29" }, + { "chn":"1", "dev":"PORT30" }, + { "chn":"2", "dev":"PORT31" }, + { "chn":"3", "dev":"PORT32" }, + { "chn":"4", "dev":"PORT21" }, + { "chn":"5", "dev":"PORT22" }, + { "chn":"6", "dev":"PORT23" }, + { "chn":"7", "dev":"PORT24" } + ] + } + }, + + "LOC_LED": + { + "dev_info": { "device_type":"LED", "device_name":"LOC_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_BLUE", "bits" : "7", "descr" : "", "value" : "0x0", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "7", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} + ] + } + }, + + "DIAG_LED": + { + "dev_info": { "device_type":"LED", "device_name":"DIAG_LED"}, + "dev_attr": { "index":"0"}, + "i2c" : { + "attr_list": + [ + {"attr_name":"STATUS_LED_COLOR_GREEN", "bits" : "1:0", "descr" : "", "value" : "0x2", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_RED", "bits" : "1:0", "descr" : "", "value" : "0x1", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"}, + {"attr_name":"STATUS_LED_COLOR_OFF", "bits" : "1:0", "descr" : "", "value" : "0x3", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x41"} + ] + } + + }, + + + "PORT1": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT1", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"1"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT1-EEPROM" }, + { "itf":"control", "dev":"PORT1-CTRL" } + ] + } + }, + "PORT1-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT1-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT1-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT1-CTRL", "device_parent":"MUX3", "virt_parent":"PORT1"}, + "i2c": + { + "topo_info": { "parent_bus":"0x16", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT2": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT2", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"2"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT2-EEPROM" }, + { "itf":"control", "dev":"PORT2-CTRL" } + ] + } + }, + "PORT2-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT2-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT2-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT2-CTRL", "device_parent":"MUX3", "virt_parent":"PORT2"}, + "i2c": + { + "topo_info": { "parent_bus":"0x17", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT3": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT3", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"3"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT3-EEPROM" }, + { "itf":"control", "dev":"PORT3-CTRL" } + ] + } + }, + "PORT3-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT3-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x18", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT3-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT3-CTRL", "device_parent":"MUX3", "virt_parent":"PORT3"}, + "i2c": + { + "topo_info": { "parent_bus":"0x18", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT4": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT4", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"4"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT4-EEPROM" }, + { "itf":"control", "dev":"PORT4-CTRL" } + ] + } + }, + "PORT4-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT4-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x19", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT4-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT4-CTRL", "device_parent":"MUX3", "virt_parent":"PORT4"}, + "i2c": + { + "topo_info": { "parent_bus":"0x19", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT5": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT5", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"5"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT5-EEPROM" }, + { "itf":"control", "dev":"PORT5-CTRL" } + ] + } + }, + "PORT5-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT5-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT5-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT5-CTRL", "device_parent":"MUX4", "virt_parent":"PORT5"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT6": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT6", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"6"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT6-EEPROM" }, + { "itf":"control", "dev":"PORT6-CTRL" } + ] + } + }, + "PORT6-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT6-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT6-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT6-CTRL", "device_parent":"MUX4", "virt_parent":"PORT6"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT7": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT7", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"7"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT7-EEPROM" }, + { "itf":"control", "dev":"PORT7-CTRL" } + ] + } + }, + "PORT7-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT7-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT7-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT7-CTRL", "device_parent":"MUX4", "virt_parent":"PORT7"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT8": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT8", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"8"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT8-EEPROM" }, + { "itf":"control", "dev":"PORT8-CTRL" } + ] + } + }, + "PORT8-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT8-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT8-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT8-CTRL", "device_parent":"MUX4", "virt_parent":"PORT8"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x30", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x04", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x10", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT9": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT9", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"9"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT9-EEPROM" }, + { "itf":"control", "dev":"PORT9-CTRL" } + ] + } + }, + "PORT9-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT9-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT9-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT9-CTRL", "device_parent":"MUX3", "virt_parent":"PORT9"}, + "i2c": + { + "topo_info": { "parent_bus":"0x12", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT10": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT10", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"10"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT10-EEPROM" }, + { "itf":"control", "dev":"PORT10-CTRL" } + ] + } + }, + "PORT10-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT10-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT10-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT10-CTRL", "device_parent":"MUX3", "virt_parent":"PORT10"}, + "i2c": + { + "topo_info": { "parent_bus":"0x13", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT11": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT11", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"11"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT11-EEPROM" }, + { "itf":"control", "dev":"PORT11-CTRL" } + ] + } + }, + "PORT11-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT11-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT11-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT11-CTRL", "device_parent":"MUX3", "virt_parent":"PORT11"}, + "i2c": + { + "topo_info": { "parent_bus":"0x14", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT12": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT12", "device_parent":"MUX3"}, + "dev_attr": { "dev_idx":"12"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT12-EEPROM" }, + { "itf":"control", "dev":"PORT12-CTRL" } + ] + } + }, + "PORT12-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT12-EEPROM", "device_parent":"MUX3", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT12-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT12-CTRL", "device_parent":"MUX3", "virt_parent":"PORT12"}, + "i2c": + { + "topo_info": { "parent_bus":"0x15", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT13": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT13", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"13"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT13-EEPROM" }, + { "itf":"control", "dev":"PORT13-CTRL" } + ] + } + }, + "PORT13-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT13-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT13-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT13-CTRL", "device_parent":"MUX4", "virt_parent":"PORT13"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT14": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT14", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"14"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT14-EEPROM" }, + { "itf":"control", "dev":"PORT14-CTRL" } + ] + } + }, + "PORT14-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT14-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT14-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT14-CTRL", "device_parent":"MUX4", "virt_parent":"PORT14"}, + "i2c": + { + "topo_info": { "parent_bus":"0x1f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT15": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT15", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"15"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT15-EEPROM" }, + { "itf":"control", "dev":"PORT15-CTRL" } + ] + } + }, + "PORT15-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT15-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x20", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT15-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT15-CTRL", "device_parent":"MUX4", "virt_parent":"PORT15"}, + "i2c": + { + "topo_info": { "parent_bus":"0x20", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT16": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT16", "device_parent":"MUX4"}, + "dev_attr": { "dev_idx":"16"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT16-EEPROM" }, + { "itf":"control", "dev":"PORT16-CTRL" } + ] + } + }, + "PORT16-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT16-EEPROM", "device_parent":"MUX4", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x21", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT16-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT16-CTRL", "device_parent":"MUX4", "virt_parent":"PORT16"}, + "i2c": + { + "topo_info": { "parent_bus":"0x21", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x31", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x05", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x11", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT17": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT17", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"17"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT17-EEPROM" }, + { "itf":"control", "dev":"PORT17-CTRL" } + ] + } + }, + "PORT17-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT17-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x22", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT17-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT17-CTRL", "device_parent":"MUX5", "virt_parent":"PORT17"}, + "i2c": + { + "topo_info": { "parent_bus":"0x22", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT18": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT18", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"18"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT18-EEPROM" }, + { "itf":"control", "dev":"PORT18-CTRL" } + ] + } + }, + "PORT18-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT18-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x23", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT18-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT18-CTRL", "device_parent":"MUX5", "virt_parent":"PORT18"}, + "i2c": + { + "topo_info": { "parent_bus":"0x23", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT19": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT19", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"19"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT19-EEPROM" }, + { "itf":"control", "dev":"PORT19-CTRL" } + ] + } + }, + "PORT19-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT19-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x24", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT19-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT19-CTRL", "device_parent":"MUX5", "virt_parent":"PORT19"}, + "i2c": + { + "topo_info": { "parent_bus":"0x24", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT20": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT20", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"20"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT20-EEPROM" }, + { "itf":"control", "dev":"PORT20-CTRL" } + ] + } + }, + "PORT20-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT20-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x25", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT20-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT20-CTRL", "device_parent":"MUX5", "virt_parent":"PORT20"}, + "i2c": + { + "topo_info": { "parent_bus":"0x25", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT21": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT21", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"21"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT21-EEPROM" }, + { "itf":"control", "dev":"PORT21-CTRL" } + ] + } + }, + "PORT21-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT21-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT21-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT21-CTRL", "device_parent":"MUX6", "virt_parent":"PORT21"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2e", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT22": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT22", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"22"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT22-EEPROM" }, + { "itf":"control", "dev":"PORT22-CTRL" } + ] + } + }, + "PORT22-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT22-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT22-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT22-CTRL", "device_parent":"MUX6", "virt_parent":"PORT22"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2f", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT23": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT23", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"23"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT23-EEPROM" }, + { "itf":"control", "dev":"PORT23-CTRL" } + ] + } + }, + "PORT23-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT23-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT23-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT23-CTRL", "device_parent":"MUX6", "virt_parent":"PORT23"}, + "i2c": + { + "topo_info": { "parent_bus":"0x30", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT24": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT24", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"24"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT24-EEPROM" }, + { "itf":"control", "dev":"PORT24-CTRL" } + ] + } + }, + "PORT24-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT24-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT24-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT24-CTRL", "device_parent":"MUX6", "virt_parent":"PORT24"}, + "i2c": + { + "topo_info": { "parent_bus":"0x31", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x32", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x06", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x12", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT25": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT25", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"25"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT25-EEPROM" }, + { "itf":"control", "dev":"PORT25-CTRL" } + ] + } + }, + "PORT25-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT25-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x26", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT25-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT25-CTRL", "device_parent":"MUX5", "virt_parent":"PORT25"}, + "i2c": + { + "topo_info": { "parent_bus":"0x26", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x0", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT26": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT26", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"26"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT26-EEPROM" }, + { "itf":"control", "dev":"PORT26-CTRL" } + ] + } + }, + "PORT26-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT26-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x27", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT26-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT26-CTRL", "device_parent":"MUX5", "virt_parent":"PORT26"}, + "i2c": + { + "topo_info": { "parent_bus":"0x27", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x1", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT27": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT27", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"27"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT27-EEPROM" }, + { "itf":"control", "dev":"PORT27-CTRL" } + ] + } + }, + "PORT27-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT27-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x28", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT27-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT27-CTRL", "device_parent":"MUX5", "virt_parent":"PORT27"}, + "i2c": + { + "topo_info": { "parent_bus":"0x28", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x2", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT28": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT28", "device_parent":"MUX5"}, + "dev_attr": { "dev_idx":"28"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT28-EEPROM" }, + { "itf":"control", "dev":"PORT28-CTRL" } + ] + } + }, + "PORT28-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT28-EEPROM", "device_parent":"MUX5", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x29", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT28-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT28-CTRL", "device_parent":"MUX5", "virt_parent":"PORT28"}, + "i2c": + { + "topo_info": { "parent_bus":"0x29", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x3", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT29": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT29", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"29"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT29-EEPROM" }, + { "itf":"control", "dev":"PORT29-CTRL" } + ] + } + }, + "PORT29-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT29-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT29-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT29-CTRL", "device_parent":"MUX6", "virt_parent":"PORT29"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2a", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x4", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT30": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT30", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"30"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT30-EEPROM" }, + { "itf":"control", "dev":"PORT30-CTRL" } + ] + } + }, + "PORT30-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT30-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT30-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT30-CTRL", "device_parent":"MUX6", "virt_parent":"PORT30"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2b", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x5", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT31": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT31", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"31"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT31-EEPROM" }, + { "itf":"control", "dev":"PORT31-CTRL" } + ] + } + }, + "PORT31-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT31-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT31-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT31-CTRL", "device_parent":"MUX6", "virt_parent":"PORT31"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2c", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x6", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + }, + + "PORT32": + { + "dev_info": { "device_type":"QSFP", "device_name":"PORT32", "device_parent":"MUX6"}, + "dev_attr": { "dev_idx":"32"}, + "i2c": + { + "interface": + [ + { "itf":"eeprom", "dev":"PORT32-EEPROM" }, + { "itf":"control", "dev":"PORT32-CTRL" } + ] + } + }, + "PORT32-EEPROM": + { + "dev_info": { "device_type":"", "device_name":"PORT32-EEPROM", "device_parent":"MUX6", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x50", "dev_type":"optoe1"}, + "attr_list": + [ + { "attr_name":"eeprom"} + ] + } + }, + "PORT32-CTRL": + { + "dev_info": { "device_type":"", "device_name":"PORT32-CTRL", "device_parent":"MUX6", "virt_parent":"PORT32"}, + "i2c": + { + "topo_info": { "parent_bus":"0x2d", "dev_addr":"0x53", "dev_type":"pddf_xcvr"}, + "attr_list": + [ + { "attr_name":"xcvr_present", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x33", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_reset", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x07", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"}, + { "attr_name":"xcvr_intr_status", "attr_devaddr":"0x60", "attr_devtype":"cpld", "attr_devname":"CPLD1", "attr_offset":"0x13", "attr_mask":"0x7", "attr_cmpval":"0x0", "attr_len":"1"} + ] + } + } + +} diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pddf_support b/device/accton/x86_64-accton_as7712_32x-r0/pddf_support new file mode 100644 index 00000000000..e69de29bb2d diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json index 584a14b9d94..59bdebeb4b5 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as7712_32x-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { "skip_ledd": true, - "skip_thermalctld": true + "skip_thermalctld": true, + "skip_pcied": true } - diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/as7712-pddf-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/as7712-pddf-platform-monitor.service new file mode 100644 index 00000000000..d0bd9940a34 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/as7712-pddf-platform-monitor.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS7712 Platform Monitoring service +Before=pmon.service +After=pddf-platform-init.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as7712_pddf_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/pddf-platform-init.service b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/pddf-platform-init.service new file mode 120000 index 00000000000..0fd9f25b6c5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/service/pddf-platform-init.service @@ -0,0 +1 @@ +../../../../pddf/i2c/service/pddf-platform-init.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/__init__.py new file mode 100644 index 00000000000..f0201e71779 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +# All the derived classes for PDDF +__all__ = ["platform", "chassis", "sfp", "psu", "thermal"] +from . import platform diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/chassis.py new file mode 100644 index 00000000000..d2edce41166 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/chassis.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Chassis API +# +############################################################################# + +try: + import sys + from sonic_platform_pddf_base.pddf_chassis import PddfChassis + from .event import SfpEvent +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_COMPONENT = 4 + +class Chassis(PddfChassis): + """ + PDDF Platform-specific Chassis class + """ + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) + self.__initialize_components() + self._sfpevent = SfpEvent(self.get_all_sfps()) + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_change_event(self, timeout=0): + return self._sfpevent.get_sfp_event(timeout) + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + + Returns: + An object derived from SfpBase representing the specified sfp + """ + sfp = None + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/component.py new file mode 100644 index 00000000000..148584216fc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/component.py @@ -0,0 +1,115 @@ +############################################################################# +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": ['4', '0x60'], + "CPLD2": ['5', '0x62'], + "CPLD3": ['6', '0x64'] +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System") + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + cmd = "i2cget -f -y {0} {1} 0x1".format(CPLD_ADDR_MAPPING[cpld_name][0], CPLD_ADDR_MAPPING[cpld_name][1]) + status, value = subprocess.getstatusoutput(cmd) + if not status: + cpld_version_raw = value.rstrip() + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/eeprom.py new file mode 100644 index 00000000000..a87ecc9f6fe --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/eeprom.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_eeprom import PddfEeprom +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(PddfEeprom): + + def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfEeprom.__init__(self, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/event.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/event.py new file mode 100644 index 00000000000..d5dac6d7f7e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/event.py @@ -0,0 +1,60 @@ +try: + import time + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + +POLL_INTERVAL_IN_SEC = 1 + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._sfp_list = sfp_list + self._logger = Logger() + self._sfp_change_event_data = {'present': 0} + + def get_presence_bitmap(self): + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.get_position_in_parent() - 1 + if modpres: + bitmap = bitmap | (1 << i) + return bitmap + + def get_sfp_event(self, timeout=2000): + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + cd_ms = 1000 + else: + cd_ms = timeout + + while cd_ms > 0: + bitmap = self.get_presence_bitmap() + changed_ports = self._sfp_change_event_data['present'] ^ bitmap + if changed_ports != 0: + break + time.sleep(POLL_INTERVAL_IN_SEC) + # timeout=0 means wait for event forever + if timeout != 0: + cd_ms = cd_ms - POLL_INTERVAL_IN_SEC * 1000 + + if changed_ports != 0: + for sfp in self._sfp_list: + i=sfp.get_position_in_parent() - 1 + if (changed_ports & (1 << i)): + if (bitmap & (1 << i)) == 0: + port_dict[i+1] = '0' + else: + port_dict[i+1] = '1' + + + # Update the cache dict + self._sfp_change_event_data['present'] = bitmap + return True, change_dict + else: + return True, change_dict diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan.py new file mode 100644 index 00000000000..34019ac9918 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/fan.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_fan import PddfFan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Fan(PddfFan): + """PDDF Platform-Specific Fan class""" + + def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): + # idx is 0-based + PddfFan.__init__(self, tray_idx, fan_idx, pddf_data, pddf_plugin_data, is_psu_fan, psu_index) + + # Provide the functions/variables below for which implementation is to be overwritten e.g. + #def get_name(self): + ## Since AS7712 has two fans in a tray, modifying this function to return proper name + #if self.is_psu_fan: + #return "PSU_FAN{}".format(self.fan_index) + #else: + #return "Fantray{}_{}".format(self.fantray_index, {1:'Front', 2:'Rear'}.get(self.fan_index,'none')) + diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/platform.py new file mode 100644 index 00000000000..406b1179ae1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/platform.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +############################################################################# +# PDDF +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + + +try: + from sonic_platform_pddf_base.pddf_platform import PddfPlatform +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PddfPlatform): + """ + PDDF Platform-Specific Platform Class + """ + + def __init__(self): + PddfPlatform.__init__(self) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/psu.py new file mode 100644 index 00000000000..2450957e256 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/psu.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# + + +try: + from sonic_platform_pddf_base.pddf_psu import PddfPsu +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Psu(PddfPsu): + """PDDF Platform-Specific PSU class""" + + PLATFORM_PSU_CAPACITY = 650 + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfPsu.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + return (self.PLATFORM_PSU_CAPACITY) + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + ptype = "AC" + # Currently the platform supports only AC type of PSUs + try: + import sonic_platform.platform + ch=sonic_platform.platform.Platform().get_chassis() + e=ch.sys_eeprom.read_eeprom() + ret, prod_name = ch.sys_eeprom.get_tlv_field(e,0x21) + if ret: + prod_name = prod_name[2].decode('ascii') + #print "Product name is {}".format(prod_name) + if '48V' in prod_name: + ptype = 'DC' + except Exception as e: + print("Error while trying to read syseeprom to get PSU type - {}".format(repr(e))) + + return ptype diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/sfp.py new file mode 100644 index 00000000000..c9fb07d6364 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/sfp.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +try: + from sonic_platform_pddf_base.pddf_sfp import PddfSfp +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + + +class Sfp(PddfSfp): + """ + PDDF Platform-Specific Sfp class + """ + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfSfp.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten + def get_position_in_parent(self): + """Retrieves 1-based relative physical position in parent device.""" + return self.port_index diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py new file mode 100644 index 00000000000..5b829fc26ca --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/thermal.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + + +try: + from sonic_platform_pddf_base.pddf_thermal import PddfThermal +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + + +class Thermal(PddfThermal): + """PDDF Platform-Specific Thermal class""" + + def __init__(self, index, pddf_data=None, pddf_plugin_data=None): + PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data) + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/watchdog.py new file mode 100644 index 00000000000..fe8554f6ec7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform/watchdog.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of platform specific watchdog API's +# +############################################################################# + +try: + from sonic_platform_pddf_base.pddf_watchdog import PddfWatchdog +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Watchdog(PddfWatchdog): + """ + PDDF Platform-specific Chassis class + """ + + def __init__(self): + PddfWatchdog.__init__(self) + self.timeout = 180 + + # Provide the functions/variables below for which implementation is to be overwritten diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform_setup.py new file mode 100644 index 00000000000..59dad237f3b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/sonic_platform_setup.py @@ -0,0 +1,25 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms using PDDF', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_pddf_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_pddf_monitor.py new file mode 100755 index 00000000000..34d74876d87 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_pddf_monitor.py @@ -0,0 +1,264 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2017 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 11/13/2017: Polly Hsu, Create +# ------------------------------------------------------------------ + +try: + import sys + import getopt + import logging + import logging.config + import logging.handlers + import signal + import time # this is only being used as part of the example + import subprocess + from sonic_platform import platform +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = 'accton_as7712_monitor' +DUTY_MAX = 100 + +fan_state = [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] # init state=2, insert=1, remove=0 +# For AC power Front to Back : +# If any fan fail, please fan speed register to 15 +# The max value of Fan speed register is 9 +# [LM75(48) + LM75(49) + LM75(4A)] > 174 => set Fan speed value from 4 to 5 +# [LM75(48) + LM75(49) + LM75(4A)] > 182 => set Fan speed value from 5 to 7 +# [LM75(48) + LM75(49) + LM75(4A)] > 190 => set Fan speed value from 7 to 9 +# +# [LM75(48) + LM75(49) + LM75(4A)] < 170 => set Fan speed value from 5 to 4 +# [LM75(48) + LM75(49) + LM75(4A)] < 178 => set Fan speed value from 7 to 5 +# [LM75(48) + LM75(49) + LM75(4A)] < 186 => set Fan speed value from 9 to 7 +# +# +# For AC power Back to Front : +# If any fan fail, please fan speed register to 15 +# The max value of Fan speed register is 10 +# [LM75(48) + LM75(49) + LM75(4A)] > 140 => set Fan speed value from 4 to 5 +# [LM75(48) + LM75(49) + LM75(4A)] > 150 => set Fan speed value from 5 to 7 +# [LM75(48) + LM75(49) + LM75(4A)] > 160 => set Fan speed value from 7 to 10 +# +# [LM75(48) + LM75(49) + LM75(4A)] < 135 => set Fan speed value from 5 to 4 +# [LM75(48) + LM75(49) + LM75(4A)] < 145 => set Fan speed value from 7 to 5 +# [LM75(48) + LM75(49) + LM75(4A)] < 155 => set Fan speed value from 10 to 7 +# + +# 2.If no matched fan speed is found from the policy, +# use FAN_DUTY_CYCLE_MIN as default speed +# Get current temperature +# 4.Decision 3: Decide new fan speed depend on fan direction/current fan speed/temperature + + +def as7712_set_fan_duty_cycle(dc): + # PWM register is same for all the FANs + if dc < 0 or dc > 100: + print("Error: Wrong duty cycle value %d" % (dc)) + return -1 + + platform_chassis.get_fan(0).set_speed(dc) + + return 0 + + +# Make a class we can use to capture stdout and sterr in the log +platform_chassis = None + + +class accton_as7712_monitor(object): + # static temp var + _ori_temp = 0 + _new_perc = 0 + _ori_perc = 0 + + llog = logging.getLogger("["+FUNCTION_NAME+"]") + + def __init__(self, log_console, log_file): + """Needs a logger and a logger level.""" + + formatter = logging.Formatter('%(name)s %(message)s') + sys_handler = logging.handlers.SysLogHandler(address='/dev/log') + sys_handler.setFormatter(formatter) + sys_handler.ident = 'common' + sys_handler.setLevel(logging.WARNING) # only fatal for syslog + self.llog.addHandler(sys_handler) + self.llog.setLevel(logging.DEBUG) + + if log_file: + fh = logging.FileHandler(log_file) + fh.setLevel(logging.INFO) + formatter = logging.Formatter('%(asctime)-15s %(name)s %(message)s') + fh.setFormatter(formatter) + self.llog.addHandler(fh) + + # set up logging to console + if log_console: + console = logging.StreamHandler() + console.setLevel(logging.DEBUG) # For debugging + formatter = logging.Formatter('%(asctime)-15s %(name)s %(message)s') + console.setFormatter(formatter) + self.llog.addHandler(console) + + def manage_fans(self): + fan_policy_f2b = { + 0: [32, 0, 174000], + 1: [38, 170000, 182000], + 2: [50, 178000, 190000], + 3: [63, 186000, 0], + } + fan_policy_b2f = { + 0: [32, 0, 140000], + 1: [38, 135000, 150000], + 2: [50, 145000, 160000], + 3: [69, 155000, 0], + } + + global fan_state + global platform_chassis + FAN_STATE_REMOVE = 0 + FAN_STATE_INSERT = 1 + + get_temp = 0 + for t in range(0, 3): + get_temp = get_temp + platform_chassis.get_thermal(t).get_temperature()*1000 + + cur_duty_cycle = 0 + + for x in range(platform_chassis.get_num_fans()): + fan_status = platform_chassis.get_fan(x).get_status() + fan_present = platform_chassis.get_fan(x).get_presence() + + if fan_present == 1: + if fan_state[x] != 1: + fan_state[x] = FAN_STATE_INSERT + #self.llog.debug("FAN-%d present is detected", x) + else: + if fan_state[x] != 0: + fan_state[x] = FAN_STATE_REMOVE + self.llog.warning("Alarm for FAN-%d absent is detected", x) + + if fan_status is None: + self.llog.warning('SET new_perc to %d (FAN stauts is None. fan_num:%d)', DUTY_MAX, x) + as7712_set_fan_duty_cycle(DUTY_MAX) + + if fan_status is False: + self.llog.warning('SET new_perc to %d (FAN fault. fan_num:%d)', DUTY_MAX, x) + as7712_set_fan_duty_cycle(DUTY_MAX) + + #self.llog.debug('INFO. fan_status is True (fan_num:%d)', x) + + # Determine the current fan duty cycle from a working fan + if not cur_duty_cycle: + cur_duty_cycle = platform_chassis.get_fan(x).get_speed() + + if fan_status is not None and fan_status is not False: + # Assuming all the fans have the same direction + fan_dir = platform_chassis.get_fan(0).get_direction() + if fan_dir == 1: + policy = fan_policy_f2b + else: + policy = fan_policy_b2f + + new_duty_cycle = cur_duty_cycle + + for x in range(0, 4): + if x == 4: + as7712_set_fan_duty_cycle(policy[0][0]) + break + + if get_temp > policy[x][2] and x != 3: + new_duty_cycle = policy[x+1][0] + self.llog.debug('THERMAL temp UP, temp %d > %d , new_duty_cycle=%d', + get_temp, policy[x][2], new_duty_cycle) + elif get_temp < policy[x][1]: + new_duty_cycle = policy[x-1][0] + self.llog.debug('THERMAL temp down, temp %d < %d , new_duty_cycle=%d', + get_temp, policy[x][1], new_duty_cycle) + break + + if new_duty_cycle == cur_duty_cycle: + return True + else: + if (new_duty_cycle == policy[3][0]) and (cur_duty_cycle < policy[3][0]): + self.llog.warning('Alarm for temperature high is detected') + elif (new_duty_cycle < policy[3][0]) and (cur_duty_cycle == policy[3][0]): + self.llog.warning('Alarm for temperature high is cleared') + else: + pass + + self.llog.debug('set new_duty_cycle=%d (old dc: %d)', new_duty_cycle, cur_duty_cycle) + as7712_set_fan_duty_cycle(new_duty_cycle) + + return True + + +def sig_handler(signum, frame): + logging.critical('INFO:Cause signal %d, set fan speed max.', signum) + as7712_set_fan_duty_cycle(DUTY_MAX) + sys.exit(0) + + +def main(argv): + + log_console = 0 + log_file = "" + + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv, 'hdl') + except getopt.GetoptError: + print('Usage: %s [-d] [-l]' % sys.argv[0]) + return 0 + for opt, arg in opts: + if opt == '-h': + print('Usage: %s [-d] [-l]' % sys.argv[0]) + return 0 + elif opt in ('-d'): + log_console = 1 + elif opt in ('-l'): + log_file = '%s.log' % sys.argv[0] + + signal.signal(signal.SIGINT, sig_handler) + signal.signal(signal.SIGTERM, sig_handler) + + global platform_chassis + platform_chassis = platform.Platform().get_chassis() + + # Disable the fan watchdog + status, output = subprocess.getstatusoutput('i2cset -f -y 2 0x66 0x33 0x0') + if status: + print("Error: Unable to disable fan speed watchdog") + + # Set any smaple speed of 100% + as7712_set_fan_duty_cycle(100) + + # Start the monitoring + monitor = accton_as7712_monitor(log_console, log_file) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(10) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/pddf_switch_svc.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/pddf_switch_svc.py new file mode 100755 index 00000000000..3ed3f7604e7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/pddf_switch_svc.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# Script to stop and start the respective platforms default services. +# This will be used while switching the pddf->non-pddf mode and vice versa +import commands + +def check_pddf_support(): + return True + +def stop_platform_svc(): + status, output = commands.getstatusoutput("systemctl stop as7712-platform-init.service") + if status: + print("Stop as7712-platform-init.service failed %d"%status) + return False + status, output = commands.getstatusoutput("systemctl disable as7712-platform-init.service") + if status: + print("Disable as7712-platform-init.service failed %d"%status) + return False + + status, output = commands.getstatusoutput("/usr/local/bin/accton_as7712_util.py clean") + if status: + print("accton_as7712_util.py clean command failed %d"%status) + return False + + # HACK , stop the pddf-platform-init service if it is active + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print("Stop pddf-platform-init.service along with other platform serives failed %d"%status) + return False + + return True + +def start_platform_svc(): + status, output = commands.getstatusoutput("/usr/local/bin/accton_as7712_util.py install") + if status: + print("accton_as7712_util.py install command failed %d"%status) + return False + + status, output = commands.getstatusoutput("systemctl enable as7712-platform-init.service") + if status: + print("Enable as7712-platform-init.service failed %d"%status) + return False + status, output = commands.getstatusoutput("systemctl start as7712-platform-init.service") + if status: + print("Start as7712-platform-init.service failed %d"%status) + return False + + return True + +def start_platform_pddf(): + status, output = commands.getstatusoutput("systemctl start pddf-platform-init.service") + if status: + print("Start pddf-platform-init.service failed %d"%status) + return False + + return True + +def stop_platform_pddf(): + status, output = commands.getstatusoutput("systemctl stop pddf-platform-init.service") + if status: + print("Stop pddf-platform-init.service failed %d"%status) + return False + + return True + +def main(): + pass + +if __name__ == "__main__": + main() + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.install new file mode 100644 index 00000000000..7236da0e9ae --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.install @@ -0,0 +1 @@ +as7712-32x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7712_32x-r0/pddf diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.postinst new file mode 100644 index 00000000000..4a393ec7035 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7712-32x.postinst @@ -0,0 +1,8 @@ +# Special arrangement to make PDDF mode default +# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) +# Enable pddf-platform-monitor +depmod -a +systemctl enable pddf-platform-init.service +systemctl start pddf-platform-init.service +systemctl enable as7712-pddf-platform-monitor.service +systemctl start as7712-pddf-platform-monitor.service From 62934ad4c47a0311f184a23bdc1566009cfee8a3 Mon Sep 17 00:00:00 2001 From: Travis Van Duyn Date: Thu, 10 Feb 2022 09:01:46 -0800 Subject: [PATCH 021/139] updated jinja template for snmp contact python2 vs python3 issue (#9949) --- dockers/docker-snmp/snmpd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index b83fbffda02..585fb5353e5 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -82,7 +82,7 @@ sysLocation {{ SNMP.LOCATION.Location }} sysLocation public {% endif %} {% if SNMP is defined and SNMP.CONTACT is defined %} -sysContact {{ SNMP.CONTACT.keys()[0] }} {{ SNMP.CONTACT.values()[0] }} +sysContact {{ SNMP.CONTACT.keys() | first }} {{ SNMP.CONTACT.values() | first }} {% else %} sysContact Azure Cloud Switch vteam {% endif %} From 09b0cc2ccef41bf0fbb0fa4d42bca28f37e13f59 Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Thu, 10 Feb 2022 22:46:58 +0530 Subject: [PATCH 022/139] DellEMC: Fix Z9332f thermalctld warning logs (#9943) --- .../z9264f/scripts/z9264f_platform.sh | 2 +- .../z9332f/scripts/z9332f_platform.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/scripts/z9264f_platform.sh b/platform/broadcom/sonic-platform-modules-dell/z9264f/scripts/z9264f_platform.sh index a113c5e435b..8974f174fac 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/scripts/z9264f_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/scripts/z9264f_platform.sh @@ -213,7 +213,7 @@ if [ "$1" == "init" ]; then modprobe i2c-dev modprobe i2c-mux-pca954x modprobe ipmi_devintf - modprobe ipmi_si + modprobe ipmi_si kipmid_max_busy_us=3000 modprobe i2c_ocores modprobe dell_z9264f_fpga_ocores sys_eeprom "new_device" diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh index cc109cd4642..dddca98ad08 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh @@ -181,7 +181,7 @@ if [ "$1" == "init" ]; then modprobe i2c-dev modprobe cls-i2c-mux-pca954x modprobe ipmi_devintf - modprobe ipmi_si kipmid_max_busy_us=1000 + modprobe ipmi_si kipmid_max_busy_us=2500 modprobe cls-i2c-ocore modprobe cls-switchboard modprobe mc24lc64t @@ -194,7 +194,7 @@ if [ "$1" == "init" ]; then # /usr/bin/qsfp_irq_enable.py platform_firmware_versions get_reboot_cause - echo 1000 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us + echo 2500 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us # Set the PCA9548 mux behavior echo -2 > /sys/bus/i2c/drivers/cls_pca954x/3-0070/idle_state echo -2 > /sys/bus/i2c/drivers/cls_pca954x/3-0071/idle_state From b621dafff77642db541553f5a2f8ec85e70ea695 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Thu, 10 Feb 2022 11:59:25 -0800 Subject: [PATCH 023/139] [yang] Adding not-provisioned to type field in DEVICE_METADATA table (#9951) #### Why I did it Fixing the issue https://github.com/Azure/sonic-buildimage/issues/9915 #### How I did it Added 'not-provisioned' as a supported value for type field in DEVICE_METADATA type. This value is set during initial ZTP bring up #### How to verify it Added UT to verify it. --- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 10 ++++++++++ .../yang-models/sonic-device_metadata.yang | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 500a97e35d6..8f4be4caffb 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -36,6 +36,9 @@ "DEVICE_METADATA_TYPE_CORRECT_PATTERN": { "desc": "DEVICE_METADATA correct value for Type field" }, + "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { + "desc": "DEVICE_METADATA value as not-provisioned for Type field" + }, "DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": { "desc": "DEVICE_METADATA DEFAULT VALUE FOR SYNCHRONOUS MODE.", "eStrKey" : "Verify", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index aaa2760c5fb..7e0e87f5741 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -54,6 +54,16 @@ } } }, + "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65002", + "type": "not-provisioned" + } + } + } + }, "DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 2040a24789d..eb87161c6bc 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -88,7 +88,7 @@ module sonic-device_metadata { leaf type { type string { length 1..255; - pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR"; + pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|not-provisioned"; } } From 486e9b0c759198ebd2756e21f7fb9a1c9397123d Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sun, 13 Feb 2022 11:50:37 +0800 Subject: [PATCH 024/139] Fix issue: module id got from get_change_event is wrong (#9961) Signed-off-by: Stephen Sun --- .../mellanox/mlnx-platform-api/sonic_platform/sfp_event.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py index b06dd1b7e65..06948af3286 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -360,16 +360,12 @@ def on_pmpe(self, fd_p): logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) rc = sx_api_port_device_get(self.handle, 1 , 0, port_attributes_list, port_cnt_p) port_cnt = uint32_t_p_value(port_cnt_p) - x = 0 # x is the port index within a LC for i in range(port_cnt): port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,i) if port_attributes.log_port == logical_port: - label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + x + 1 + label_port = slot_id * DeviceDataManager.get_linecard_max_port_count() + port_attributes.port_mapping.module_port break - if port_attributes.port_mapping.slot == slot_id: - x += 1 - if label_port is not None: label_port_list.append(label_port) From dd87b948a5006ff90ce573cc7a010e4991c5219d Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:55:59 +0200 Subject: [PATCH 025/139] [Mellanox][vxlan] remove old static config for VXLAN src port range feature (#9956) - Why I did it Need to remove old static configs from sai.profile files. New implementation: Azure/sonic-swss#1959 New configuration: #9658 - How I did it Remove SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 lines from files per HWSKU - How to verify it When static config is removed following test will fail (src port will be in range 0-255) py.test vxlan/test_vnet_vxlan.py --inventory "../ansible/inventory, ../ansible/veos" --host-pattern (testbed)-t0 --module-path ../ansible/library/ --testbed (testbed)-t0 --testbed_file ../ansible/testbed.csv --allow_recover --assert plain --log-cli-level info --show-capture=no -ra --showlocals --disable_loganalyzer --skip_sanity --upper_bound_udp_port 65535 --lower_bound_udp_port 64128 --- .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile | 1 - .../x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile | 1 - .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile | 1 - .../Mellanox-SN4600C-D100C12S2/sai.profile | 1 - .../x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile | 1 - 5 files changed, 5 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile index 5543225b55f..2d6c6ad4acc 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile @@ -1,2 +1 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_2x10g_100x50g_12x100g.xml -SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile index 8e672b95e23..181ced0f126 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile @@ -1,4 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_112x50g_8x100g.xml -SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile index a9835c51dc3..33f195e4a17 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile @@ -1,4 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml -SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile index c05c9ac6a1d..2b992912310 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile @@ -1,4 +1,3 @@ -SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_100x50g_12x100g_2x10g.xml SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile index 8719655c1cc..c255886841b 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile @@ -1,4 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_48x50g_40x100g.xml SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps SAI_DUMP_STORE_AMOUNT=10 -SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 From 129e9d1b25480b6189003ca8d5223eafe7f23693 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 13 Feb 2022 21:01:09 +0800 Subject: [PATCH 026/139] fix MSN4410 chassis name in platform_components.json (#9939) - Why I did it The chassis name in MSN4410 platform_components.json is not correct - How I did it Fix the chassis name - How to verify it Run relevant platform API test Signed-off-by: Kebo Liu --- device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json b/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json index bb1afce8016..dac126d0b69 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json @@ -1,6 +1,6 @@ { "chassis": { - "x86_64-mlnx_msn4410-r0": { + "MSN4410": { "component": { "ONIE": { }, "SSD": { }, From 7af5fcf80e5d49b6050f4c98027b1ef99570d649 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Sun, 13 Feb 2022 21:01:40 +0800 Subject: [PATCH 027/139] update sonic-snmpagent submodule (#9935) Update the sonic-snmpagemt submodule to pick up new changes: Fix RFC2737 with update xcvr vendor version key name Azure/sonic-snmpagent@4ee573c Fix Queue stat unavailable error seen during SNMP service start Azure/sonic-snmpagent@3013597 Modify path of python wheels to be installed Azure/sonic-snmpagent@b8ea609 [Voq][Inband] Support the Ethernet-IB port Azure/sonic-snmpagent@df615c4 Signed-off-by: Kebo Liu --- src/sonic-snmpagent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index a07da536186..4ee573cddc4 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit a07da536186a9d9698ec63ec3b1e75bef097ae00 +Subproject commit 4ee573cddc4e356b589bcf29c19cedc4562a8b34 From 675bceba4d86e92d84dadfbf32910fd329262eb1 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Sun, 13 Feb 2022 10:13:48 -0500 Subject: [PATCH 028/139] [submodule] Update linux-kernel submodule pointer (#9937) Updates include the following changes in order to support new Mellanox platforms and drivers (Azure/sonic-linux-kernel#259) 10ef390 Update kconfig to support / enable newly backported mellanox patches. 6a949e1 Add backported patches for Mellanox hw-mgmt V.7.0020.1300 e1913f7 Rename and reformat patch headers --- src/sonic-linux-kernel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-linux-kernel b/src/sonic-linux-kernel index 6aa8d00afd1..10ef3904d94 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit 6aa8d00afd1277629e9fa4ad84dd380e57f79b58 +Subproject commit 10ef3904d9401954b66915b7f5466e3f7591e7fb From 4d203fbf918461636288e698158170778743029e Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 14 Feb 2022 07:21:10 +0800 Subject: [PATCH 029/139] [Build]: Fix hundreds of thousands lines of logs printed in marvell-armhf (#9980) [Build]: Fix hundreds of thousands lines of logs printed in marvell-armhf It is caused by the bad format of the marvell sai package mrvllibsai_armhf_1.7.1-6.deb, increasing the waiting time to reduce the logs, and reduce the waste of the CPU. --- slave.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/slave.mk b/slave.mk index 53997e7ed10..04a2675f83a 100644 --- a/slave.mk +++ b/slave.mk @@ -609,6 +609,7 @@ $(SONIC_INSTALL_DEBS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && sudo lsof /var/lib/dpkg/lock-frontend && ps aux && exit 1 ; } fi + sleep 10 done $(FOOTER) From aad27615e905c3d44ecfb23c0fca10c7f58f0f93 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:18:39 -0500 Subject: [PATCH 030/139] Update Nokia sonic-platform submodule (#9963) ded0344 Return both 'vendor_rev' and 'hardware_rev' keys from get_transceiver_info to support both earlier and later versions of xcvrd b3442cc Change log_error to log_info when transceiver module is transitioned 3d3a73c Fix problem introduced with new SFP caching paradigm 2915746 Add script to reboot all IMMs 17ad221 Fix the position_in_parent for the psu entity 207e731 No longer force read pages at SFP init time b387921 Fixed the voltage and power with rounding to 2 digit decimals Signed-off-by: mlok --- platform/broadcom/sonic-platform-modules-nokia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-nokia b/platform/broadcom/sonic-platform-modules-nokia index edbfbf92902..ded0344a681 160000 --- a/platform/broadcom/sonic-platform-modules-nokia +++ b/platform/broadcom/sonic-platform-modules-nokia @@ -1 +1 @@ -Subproject commit edbfbf92902f9e48c5f759cb11f09da3ea50ddd5 +Subproject commit ded0344a68197363c8c0eefff87b1be0a4591f87 From 7e89fad5d1001ffae30d91f7c0f3df3dde234bed Mon Sep 17 00:00:00 2001 From: SeanWu <81406250+seanwu-ec@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:29:26 +0800 Subject: [PATCH 031/139] [AS4630-54TE] Fixes to sfp.py for sfputil usage (#8985) * Fix KeyError exception while sfputil show eeprom. * Implement reset/lpmode related APIs, which need PR8115's sysfs. * Fix EEPROM byte offset in several APIs * Fix typos * Implement get_position_in_parent() and is_replaceable() Signed-off-by: Sean Wu --- .../sonic_platform/sfp.py | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py index 67df4aad49b..4529c2f0ac8 100644 --- a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py @@ -74,6 +74,7 @@ QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 QSFP_POWEROVERRIDE_OFFSET = 93 QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_PAGE03_OFFSET = 384 QSFP_MODULE_THRESHOLD_OFFSET = 128 QSFP_MODULE_THRESHOLD_WIDTH = 24 QSFP_CHANNEL_THRESHOLD_OFFSET = 176 @@ -152,7 +153,8 @@ def __init__(self, sfp_index=0): self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) self.info_dict_keys = ['type', 'vendor_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', - 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui'] + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', + 'application_advertisement', 'type_abbrv_name'] self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] @@ -247,6 +249,7 @@ def get_transceiver_info(self): specification_compliance |1*255VCHAR |specification compliance vendor_date |1*255VCHAR |vendor date vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement ======================================================================== """ # check present status @@ -442,7 +445,7 @@ def get_transceiver_bulk_status(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return None @@ -598,10 +601,11 @@ def get_transceiver_threshold_info(self): if not self.get_presence() or not sfpd_obj: return {} + offset = QSFP_PAGE03_OFFSET transceiver_dom_threshold_dict = dict.fromkeys( self.threshold_dict_keys, 'N/A') dom_thres_raw = self.__read_eeprom_specific_bytes( - QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + offset + QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None if dom_thres_raw: module_threshold_values = sfpd_obj.parse_module_threshold_values( @@ -618,7 +622,7 @@ def get_transceiver_threshold_info(self): transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] dom_thres_raw = self.__read_eeprom_specific_bytes( - QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + offset + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None channel_threshold_values = sfpd_obj.parse_channel_threshold_values( dom_thres_raw, 0) channel_threshold_data = channel_threshold_values.get('data') @@ -648,11 +652,16 @@ def get_reset_status(self): Returns: A Boolean, True if reset enabled, False if disabled """ - if self.port_num < 49: #Copper port, no sysfs + if self.port_num < 53: # non-QSFP ports don't support it. return False - return False # CPLD port doesn't support this feature + reset_path="{}{}{}".format(CPLD_I2C_PATH , "module_reset_" , str(self.port_num)) + val = self._api_helper.read_txt_file(reset_path) + if val is not None: + return int(val, 10) == 1 + else: + return False def get_rx_los(self): """ @@ -827,7 +836,7 @@ def get_power_set(self): return False dom_control_raw = self.__read_eeprom_specific_bytes( - QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None if dom_control_raw is not None: dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) power_set = ( @@ -852,7 +861,7 @@ def get_power_override(self): return False dom_control_raw = self.__read_eeprom_specific_bytes( - QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None if dom_control_raw is not None: dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) power_override = ( @@ -939,23 +948,19 @@ def reset(self): A boolean, True if successful, False if not """ # Check for invalid port_num - if self.port_num < 49: #Copper port, no sysfs + if self.port_num < 53: # non-QSFP ports don't support it. return False - ''' reset_path = "{}{}{}".format(CPLD_I2C_PATH, 'module_reset_', self.port_num) - ret = self.__write_txt_file(reset_path, 1) + ret = self._api_helper.write_txt_file(reset_path, 1) if ret is not True: return ret - + time.sleep(0.01) - ret = self.__write_txt_file(reset_path, 0) + ret = self._api_helper.write_txt_file(reset_path, 0) time.sleep(0.2) - - return ret - ''' - return False #CPLD doens't support this feature + return ret def tx_disable(self, tx_disable): """ @@ -1167,3 +1172,20 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ return self.get_presence() and self.get_transceiver_bulk_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.port_num + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True From 155220be9b73aa8b66017aae20e4fda88458fcc3 Mon Sep 17 00:00:00 2001 From: byu343 Date: Sun, 13 Feb 2022 22:45:24 -0800 Subject: [PATCH 032/139] Support multi-asic on macsec container (#9921) This change enables the support of running multiple macsec containers, each for one ASIC. --- files/build_templates/macsec.service.j2 | 19 ------------------ .../per_namespace/macsec.service.j2 | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) delete mode 100644 files/build_templates/macsec.service.j2 create mode 100644 files/build_templates/per_namespace/macsec.service.j2 diff --git a/files/build_templates/macsec.service.j2 b/files/build_templates/macsec.service.j2 deleted file mode 100644 index b8ffbafcbd2..00000000000 --- a/files/build_templates/macsec.service.j2 +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=MACsec container -Requires=swss.service -After=swss.service syncd.service -BindsTo=sonic.target -After=sonic.target -StartLimitIntervalSec=1200 -StartLimitBurst=3 - -[Service] -User=root -ExecStartPre=/usr/bin/macsec.sh start -ExecStart=/usr/bin/macsec.sh wait -ExecStop=/usr/bin/macsec.sh stop -Restart=always -RestartSec=30 - -[Install] -WantedBy=sonic.target \ No newline at end of file diff --git a/files/build_templates/per_namespace/macsec.service.j2 b/files/build_templates/per_namespace/macsec.service.j2 new file mode 100644 index 00000000000..fc862241f33 --- /dev/null +++ b/files/build_templates/per_namespace/macsec.service.j2 @@ -0,0 +1,20 @@ +[Unit] +Description=MACsec container +Requires=swss{% if multi_instance == 'true' %}@%i{% endif %}.service +After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service +After=syncd{% if multi_instance == 'true' %}@%i{% endif %}.service +BindsTo=sonic.target +After=sonic.target +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User={{ sonicadmin_user }} +ExecStartPre=/usr/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} +ExecStart=/usr/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} +ExecStop=/usr/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} +Restart=always +RestartSec=30 + +[Install] +WantedBy=sonic.target From cf1bc8dc655ee2b72c022d3b6b9c7dcdc187237d Mon Sep 17 00:00:00 2001 From: Dror Prital <76714716+dprital@users.noreply.github.com> Date: Mon, 14 Feb 2022 10:39:47 +0200 Subject: [PATCH 033/139] [Mellanox] Upgrade ASIC FW tool to 4.18.1-16 (#9981) - Why I did it Update MFT to version 4.18.1-16 for bugs fixes and new SN2201 support - How I did it Advance to MFT tool version to 4.18.1-16 - How to verify it Manually tested on all Mellanox platforms (ASIC FW Upgrade, link debug tools, CPLD upgrade, etc.) --- platform/mellanox/mft.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index f068520d2b9..3a3d95c8ca8 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -16,8 +16,8 @@ # # Mellanox SAI -MFT_VERSION = 4.17.2 -MFT_REVISION = 12 +MFT_VERSION = 4.18.1 +MFT_REVISION = 16 export MFT_VERSION MFT_REVISION From 0b59f0b6419eefe4a6632f0e68d32a9f7ee1549e Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 14 Feb 2022 13:00:58 -0800 Subject: [PATCH 034/139] [yang]YANG model for policer table (#9948) #### Why I did it Added yang model for policer table Fixes https://github.com/Azure/sonic-buildimage/issues/9742 and https://github.com/Azure/sonic-buildimage/issues/9743 #### How I did it Creating yang model for policer #### How to verify it Added UT to verify the yang model The configuration schema for policer is added in the pull request https://github.com/Azure/sonic-swss/pull/2144 --- src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 11 + .../tests/mirror_session.json | 47 ++-- .../tests/yang_model_tests/tests/policer.json | 61 +++++ .../tests_config/mirror_session.json | 51 ++++ .../tests_config/policer.json | 220 ++++++++++++++++++ .../yang-models/sonic-copp.yang | 16 +- .../yang-models/sonic-mirror-session.yang | 12 + .../yang-templates/sonic-policer.yang.j2 | 129 ++++++++++ .../yang-templates/sonic-types.yang.j2 | 18 +- 10 files changed, 536 insertions(+), 31 deletions(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/policer.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/policer.json create mode 100644 src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index fb8734e571b..1f9b51b0c56 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -110,6 +110,7 @@ def run(self): './yang-models/sonic-nat.yang', './yang-models/sonic-pbh.yang', './yang-models/sonic-port.yang', + './yang-models/sonic-policer.yang', './yang-models/sonic-portchannel.yang', './yang-models/sonic-pfcwd.yang', './yang-models/sonic-route-common.yang', @@ -165,6 +166,7 @@ def run(self): './cvlyang-models/sonic-ntp.yang', './cvlyang-models/sonic-nat.yang', './cvlyang-models/sonic-pbh.yang', + './cvlyang-models/sonic-policer.yang', './cvlyang-models/sonic-port.yang', './cvlyang-models/sonic-portchannel.yang', './cvlyang-models/sonic-pfcwd.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e8bbc59bcdb..e64b241349b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1570,6 +1570,7 @@ "queue": "0", "src_ip": "10.1.1.1", "ttl": "10", + "policer": "everflow_static_policer", "type": "ERSPAN" }, "span": { @@ -1582,6 +1583,16 @@ ] } + }, + "POLICER": { + "everflow_static_policer": { + "meter_type": "bytes", + "mode": "sr_tcm", + "cir": "12500000", + "cbs": "12500000", + "color": "aware", + "red_packet_action": "drop" + } } }, "SAMPLE_CONFIG_DB_UNKNOWN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json index 9c94deb343c..6d53b0e9cff 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mirror_session.json @@ -3,79 +3,86 @@ "desc": "Configuring ERSPAN entry with valid values." }, "MIRROR_ERSPAN_ENTRY_WRONG_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid type", + "desc": "Configuring ERSPAN entry with invalid type", "eStrKey": "InvalidValue" }, "MIRROR_ERSPAN_ENTRY_WRONG_DST_IP": { - "desc": "Configurinng ERSPAN entry with invalid dst_ip", + "desc": "Configuring ERSPAN entry with invalid dst_ip", "eStrKey" : "Pattern" }, "MIRROR_ERSPAN_ENTRY_WRONG_DST_IP_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid dst_ip", + "desc": "Configuring ERSPAN entry with invalid dst_ip", "eStrKey" : "When" }, "MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP": { - "desc": "Configurinng ERSPAN entry with invalid src_ip", + "desc": "Configuring ERSPAN entry with invalid src_ip", "eStrKey" : "Pattern" }, "MIRROR_ERSPAN_ENTRY_WRONG_SRC_IP_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid src_ip", + "desc": "Configuring ERSPAN entry with invalid src_ip", "eStrKey" : "When" }, "MIRROR_ERSPAN_ENTRY_WRONG_GRE_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid GRE type", + "desc": "Configuring ERSPAN entry with invalid GRE type", "eStrKey" : "Pattern" }, "MIRROR_ERSPAN_ENTRY_GRE_WRONG_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid GRE type", + "desc": "Configuring ERSPAN entry with invalid GRE type", "eStrKey" : "When" }, "MIRROR_ERSPAN_ENTRY_WRONG_DSCP": { - "desc": "Configurinng ERSPAN entry with invalid dscp", + "desc": "Configuring ERSPAN entry with invalid dscp", "eStr" : "Invalid dscp value" }, "MIRROR_ERSPAN_ENTRY_WRONG_DSCP_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid dscp", + "desc": "Configuring ERSPAN entry with invalid dscp", "eStrKey" : "When" }, "MIRROR_ERSPAN_ENTRY_WRONG_TTL": { - "desc": "Configurinng ERSPAN entry with invalid ttl", + "desc": "Configuring ERSPAN entry with invalid ttl", "eStr": "Invalid TTL value" }, "MIRROR_ERSPAN_ENTRY_WRONG_TTL_TYPE": { - "desc": "Configurinng ERSPAN entry with invalid ttl", + "desc": "Configuring ERSPAN entry with invalid ttl", "eStrKey" : "When" }, "MIRROR_ERSPAN_ENTRY_VALID_SRC_PORT": { - "desc": "Configurinng ERSPAN entry with valid source port" + "desc": "Configuring ERSPAN entry with valid source port" }, "MIRROR_ERSPAN_ENTRY_VALID_SRC_PORTCHANNEL": { - "desc": "Configurinng ERSPAN entry with valid source portchannel" + "desc": "Configuring ERSPAN entry with valid source portchannel" }, "MIRROR_ERSPAN_ENTRY_INVALID_SRC_PORT": { - "desc": "Configurinng ERSPAN entry with invalid source port", + "desc": "Configuring ERSPAN entry with invalid source port", "eStrKey" : "InvalidValue" }, "MIRROR_SPAN_ENTRY_WITH_VALID_VALUES": { - "desc": "Configurinng SPAN entry with valid source and destination ports" + "desc": "Configuring SPAN entry with valid source and destination ports" }, "MIRROR_SPAN_ENTRY_INVALID_DST_PORT": { - "desc": "Configurinng SPAN entry with invalid destination ports", + "desc": "Configuring SPAN entry with invalid destination ports", "eStrKey" : "InvalidValue" }, "MIRROR_SPAN_ENTRY_INVALID_DST_PORT_TYPE": { - "desc": "Configurinng SPAN entry with invalid destination ports", + "desc": "Configuring SPAN entry with invalid destination ports", "eStrKey" : "When" }, "MIRROR_SPAN_ENTRY_VALID_DST_PORT_CPU": { - "desc": "Configurinng SPAN entry with valid destination port CPU" + "desc": "Configuring SPAN entry with valid destination port CPU" }, "MIRROR_SPAN_ENTRY_INVALID_SRC_PORT": { - "desc": "Configurinng SPAN entry with invalid destination ports", + "desc": "Configuring SPAN entry with invalid destination ports", "eStrKey" : "InvalidValue" }, "MIRROR_SPAN_ENTRY_INVALID_DIRECTION": { - "desc": "Configurinng SPAN entry with invalid direction", + "desc": "Configuring SPAN entry with invalid direction", "eStrKey": "InvalidValue" + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_POLICER": { + "desc": "Configuring SPAN entry with valid policer" + }, + "MIRROR_ERSPAN_ENTRY_WITH_INVALID_POLICER": { + "desc": "Configuring SPAN entry with invalid policer", + "eStrKey": "LeafRef" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/policer.json b/src/sonic-yang-models/tests/yang_model_tests/tests/policer.json new file mode 100644 index 00000000000..80f2534b8cc --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/policer.json @@ -0,0 +1,61 @@ +{ + "POLICER_TABLE": { + "desc": "Configure policer with all fields." + }, + "POLICER_MANDATORY_MODE": { + "desc": "Configure policer with no mode.", + "eStrKey" : "Mandatory" + }, + "POLICER_MANDATORY_METER_TYPE": { + "desc": "Configure policer with no meter type.", + "eStrKey" : "Mandatory" + }, + "POLICER_UNKNOWN_METER_TYPE": { + "desc": "Configure policer with unknown meter type.", + "eStrKey" : "InvalidValue", + "eStr" : ["meter_type"] + }, + "POLICER_UNKNOWN_MODE": { + "desc": "Configure policer with unknown mode.", + "eStrKey" : "InvalidValue", + "eStr" : ["mode"] + }, + "POLICER_UNKNOWN_ACTION": { + "desc": "Configure policer with unknown action.", + "eStrKey" : "InvalidValue", + "eStr" : ["red_packet_action"] + }, + "POLICER_UNKNOWN_COLOR": { + "desc": "Configure policer with unknown color awareness.", + "eStrKey" : "InvalidValue", + "eStr" : ["color"] + }, + "POLICER_CBS_WITHOUT_CIR": { + "desc": "Configure policer with cbs but without cir.", + "eStr": ["cbs can't be configured without cir."] + }, + "POLICER_CBS_LESS_THAN_CIR": { + "desc": "Configure policer with cbs less than cir.", + "eStr": ["cbs must be greater than or equal to cir"] + }, + "POLICER_PIR_LESS_THAN_CIR": { + "desc": "Configure policer with pir less than cir.", + "eStr": ["pir must be greater than or equal to cir"] + }, + "POLICER_PBS_WITH_STORM": { + "desc": "Configure policer with pbs configured in storm mode.", + "eStrKey" : "When" + }, + "POLICER_PBS_LESS_THAN_CBS": { + "desc": "Configure policer with pbs less than cbs.", + "eStr": ["pbs must be greater than or equal to cbs"] + }, + "POLICER_PIR_WITHOUT_CIR": { + "desc": "Configure policer with pir but without cir.", + "eStr": ["pir can't be configured without cir."] + }, + "POLICER_WHEN_SRTCM_WITH_PIR": { + "desc": "Configure policer with pir configured in sr_tcm mode.", + "eStrKey" : "When" + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json index 8f0580bbafd..ddf956c79f8 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mirror_session.json @@ -442,5 +442,56 @@ ] } } + }, + "MIRROR_ERSPAN_ENTRY_WITH_VALID_POLICER": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [ + { + "name": "erspan_policer", + "meter_type":"packets", + "mode":"tr_tcm", + "color": "aware", + "cir":"5000", + "cbs":"5000", + "pir":"15000", + "pbs":"15000", + "red_packet_action":"drop" + } + ] + } + }, + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "0x1234", + "dscp": "10", + "policer": "erspan_policer" + } + ] + } + } + }, + "MIRROR_ERSPAN_ENTRY_WITH_INVALID_POLICER": { + "sonic-mirror-session:sonic-mirror-session": { + "MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name": "erspan", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "0x1234", + "dscp": "10", + "policer": "erspan_policer2" + } + ] + } + } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/policer.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/policer.json new file mode 100644 index 00000000000..b952e970592 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/policer.json @@ -0,0 +1,220 @@ +{ + "POLICER_TABLE": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session1_policer", + "meter_type":"packets", + "mode":"tr_tcm", + "color": "aware", + "cir":"5000", + "cbs":"5000", + "pir":"15000", + "pbs":"15000", + "yellow_packet_action":"forward", + "green_packet_action":"forward" + }] + } + } + }, + + "POLICER_MANDATORY_MODE": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session1_policer", + "meter_type":"packets", + "cir":"5000", + "cbs":"5000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_MANDATORY_METER_TYPE": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session2_policer", + "mode":"sr_tcm", + "cir":"5000", + "cbs":"5000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_UNKNOWN_METER_TYPE": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session4_policer", + "mode":"sr_tcm", + "meter_type":"bits", + "cir":"5000", + "cbs":"5000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_UNKNOWN_MODE": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session5_policer", + "mode":"srtcm", + "meter_type":"bytes", + "cir":"5000", + "cbs":"5000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_UNKNOWN_ACTION": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session6_policer", + "mode":"storm", + "meter_type":"bytes", + "cir":"5000", + "cbs":"5000", + "color":"aware", + "red_packet_action":"act" + }] + } + } + }, + + "POLICER_UNKNOWN_COLOR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "everflow_session7_policer", + "mode":"sr_tcm", + "meter_type":"bytes", + "cir":"5000", + "cbs":"5000", + "red_packet_action":"drop", + "color":"yes" + }] + } + } + }, + + "POLICER_CBS_WITHOUT_CIR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "p5", + "meter_type":"bytes", + "mode":"tr_tcm", + "cbs":"5000", + "pir":"4000", + "pbs":"4000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_CBS_LESS_THAN_CIR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "policer5", + "meter_type":"bytes", + "mode":"sr_tcm", + "cbs":"5000", + "cir":"6000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_PIR_LESS_THAN_CIR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "e3_policer", + "meter_type":"bytes", + "mode":"tr_tcm", + "cir":"5000", + "cbs":"5000", + "pir":"4000", + "pbs":"4000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_PBS_WITH_STORM": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "e1policer", + "meter_type":"bytes", + "mode":"storm", + "cir":"5000", + "cbs":"5000", + "pbs":"6000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_PBS_LESS_THAN_CBS": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "e2policer", + "meter_type":"bytes", + "mode":"tr_tcm", + "cir":"5000", + "cbs":"5000", + "pbs":"2000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_PIR_WITHOUT_CIR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "e3policer", + "meter_type":"bytes", + "mode":"tr_tcm", + "pir":"2000", + "red_packet_action":"drop" + }] + } + } + }, + + "POLICER_WHEN_SRTCM_WITH_PIR": { + "sonic-policer:sonic-policer": { + "sonic-policer:POLICER": { + "POLICER_LIST": [{ + "name": "policer1", + "meter_type":"packets", + "mode":"sr_tcm", + "cir":"6000", + "cbs":"6000", + "pir":"6000", + "red_packet_action":"drop" + }] + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-copp.yang b/src/sonic-yang-models/yang-models/sonic-copp.yang index c869b439faa..d735150a5c4 100644 --- a/src/sonic-yang-models/yang-models/sonic-copp.yang +++ b/src/sonic-yang-models/yang-models/sonic-copp.yang @@ -40,7 +40,7 @@ module sonic-copp { leaf trap_action { mandatory true; - type stypes:copp_packet_action; + type stypes:policer_packet_action; description "Trap action"; } @@ -61,12 +61,8 @@ module sonic-copp { } leaf color { - type enumeration { - enum blind; - enum color; - } - default "color"; - description "Policer color source"; + type stypes:policer_color_source; + description "Policer color Source"; } leaf cir { @@ -120,20 +116,20 @@ module sonic-copp { } leaf green_action { - type stypes:copp_packet_action; + type stypes:policer_packet_action; default "forward"; description "Green action"; } leaf yellow_action { when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))"; - type stypes:copp_packet_action; + type stypes:policer_packet_action; default "forward"; description "Yellow action"; } leaf red_action { - type stypes:copp_packet_action; + type stypes:policer_packet_action; default "forward"; description "Red action"; } diff --git a/src/sonic-yang-models/yang-models/sonic-mirror-session.yang b/src/sonic-yang-models/yang-models/sonic-mirror-session.yang index 7a9afcd1ae4..ba8a1e13c7d 100644 --- a/src/sonic-yang-models/yang-models/sonic-mirror-session.yang +++ b/src/sonic-yang-models/yang-models/sonic-mirror-session.yang @@ -17,6 +17,10 @@ module sonic-mirror-session { prefix lag; } + import sonic-policer { + prefix policer; + } + description "SONiC Mirror session yang model"; @@ -174,6 +178,14 @@ module sonic-mirror-session { TX: Captures frames egressing on source port. BOTH: Captures frames ingressing or egressing on source port."; } + + leaf policer { + type leafref { + path "/policer:sonic-policer/policer:POLICER/policer:POLICER_LIST/policer:name"; + } + description + "Policer to be applied for the mirrored traffic."; + } } } } diff --git a/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 new file mode 100644 index 00000000000..a8c6f1445a4 --- /dev/null +++ b/src/sonic-yang-models/yang-templates/sonic-policer.yang.j2 @@ -0,0 +1,129 @@ +{% if yang_model_type == "cvl" %} +/* this is sonic cvl yang model */ +{% else %} +/* this is sonic py yang model */ +{% endif %} +module sonic-policer { + + yang-version 1.1; + + namespace "http://github.com/Azure/sonic-policer"; + prefix policer; + + import sonic-types { + prefix stypes; + } + + description "Policer YANG Module for SONiC OS"; + + revision 2022-02-03 { + description + "First Revision"; + } + + container sonic-policer { + container POLICER { + list POLICER_LIST { + key name; + + leaf name { + type string; + description "Policer name"; + } + + leaf meter_type { + mandatory true; + type stypes:meter_type; + description "Policer meter type"; + } + + leaf mode { + mandatory true; + type stypes:policer_mode; + description "Policer mode"; + } + + leaf color { + type stypes:policer_color_source; + description "Policer color Source"; + } + + leaf cir { + type uint64; + default 0; + description + "Committed information rate for the dual-rate token + bucket policer. This value represents the rate at which + tokens are added to the primary bucket. Unit is bytes/sec + or packets/sec based on meter_type"; + } + + leaf cbs { + must "((current()/../cir) and (current()/../cir > 0))" { + error-message "cbs can't be configured without cir."; + } + must "(current() >= current()/../cir)" { + error-message "cbs must be greater than or equal to cir"; + } + type uint64; + default 0; + description + "Committed burst size for the dual-rate token bucket + policer. This value represents the depth of the token + bucket. Unit is bytes or packets based on meter_type"; + } + + leaf pir { + when "current()/../mode = 'tr_tcm'"; + must "((current()/../cir) and (current()/../cir > 0))" { + error-message "pir can't be configured without cir."; + } + must "(current() >= current()/../cir)" { + error-message "pir must be greater than or equal to cir"; + } + type uint64; + description + "Peak information rate for the dual-rate token bucket + policer. This value represents the rate at which tokens + are added to the secondary bucket. Unit is bytes/sec or + packets/sec based on meter_type"; + } + + leaf pbs { + when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))"; + must "((not(current()/../cbs)) or (current() >= current()/../cbs))" { + error-message "pbs must be greater than or equal to cbs"; + } + type uint64; + description + "Excess burst size for the dual-rate token bucket policer. + This value represents the depth of the secondary bucket. Unit + is bytes or packets based on meter_type"; + } + + leaf green_packet_action { + type stypes:policer_packet_action; + default "forward"; + description "Green action"; + } + + leaf yellow_packet_action { + when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))"; + type stypes:policer_packet_action; + default "forward"; + description "Yellow action"; + } + + leaf red_packet_action { + type stypes:policer_packet_action; + default "forward"; + description "Red action"; + } + } + /* end of list POLICER_LIST */ + } + /* end of container POLICER */ + } + /* end of top level container */ +} +/* end of module sonic-policer */ diff --git a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 index 2388b487e0e..da043fa8761 100644 --- a/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-types.yang.j2 @@ -205,7 +205,23 @@ module sonic-types { } } - typedef copp_packet_action { + typedef policer_mode { + type enumeration { + enum sr_tcm; + enum tr_tcm; + enum storm; + } + } + + typedef policer_color_source { + type enumeration { + enum aware; + enum blind; + } + } + + + typedef policer_packet_action { type enumeration { enum drop; enum forward; From 1223a7babae294e0edb289fe93c760ff9343c24d Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Mon, 14 Feb 2022 13:55:40 -0800 Subject: [PATCH 035/139] Update template pull_request_template.md (#9888) Updating template description to include link to configuration schema for YANG module changes. #### Why I did it Updating template description to include link to configuration schema for YANG module changes. When reviewing yang models it becomes difficult to know the entire schema for the table for which yang is defined. Besides providing a clear picture, it will also help to document the config_db schema which is not upto date. #### How I did it Updating template file --- .github/pull_request_template.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c93809fc67c..c02d193fbeb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -30,6 +30,7 @@ - [ ] 202006 - [ ] 202012 - [ ] 202106 +- [ ] 202111 #### Description for the changelog +#### Link to config_db schema for YANG module changes + #### A picture of a cute animal (not mandatory but encouraged) From 9677401f4a9713599c4a93dafaf5915622778cd0 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Tue, 15 Feb 2022 03:51:24 -0500 Subject: [PATCH 036/139] [pmon] Fix chassis_db_init exit not being expected (#9858) - Why I did it Error log was shown on switches during boot pmon#supervisord 2021-12-22 04:27:16,709 INFO exited: chassis_db_init (exit status 0; not expected) - How I did it Add exit code zero as an expected exit code and also disable autorestart. - How to verify it Boot the switch and ensure the above log line does not appear. --- .../docker-platform-monitor/docker-pmon.supervisord.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 5652bd17d6b..795714f6881 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -46,7 +46,8 @@ dependent_startup_wait_for=rsyslogd:running command=/usr/local/bin/chassis_db_init priority=3 autostart=false -autorestart=unexpected +autorestart=false +exitcodes=0 stdout_logfile=syslog stderr_logfile=syslog startsecs=10 From 125fe9907a537c1df7f4b4303d7201317ef0eb15 Mon Sep 17 00:00:00 2001 From: Myron Sosyak Date: Tue, 15 Feb 2022 16:39:47 -0800 Subject: [PATCH 037/139] Bump Thrift version from 0.13.0 to 0.14.1 (#9881) #### Why I did it To bump the Thrift version to 0.14.1 - To avoid [CVE-2020-13949](https://nvd.nist.gov/vuln/detail/CVE-2020-13949) - to fix some dependencies issues #### How I did it - rename `src/thrfit_0_13_0` to `src/thrift_2` to remove version number in the path. (`src/thrift` contains rules to build thrift 0.11.0 ) - Add thrift sources as submodule as there are no prepared debian packages for version >0.13.0 on [debian.org](https://packages.debian.org/search?searchon=sourcenames&keywords=thrift) - Added patches with fixes for original thrift debian rules:(remove unneeded packages, fix multi job build) #### How to verify it ``` BLDENV=buster make -f Makefile.work target/debs/buster/libthrift-dev_0.14.1_amd64.deb ``` --- .gitmodules | 5 +- platform/broadcom/libsaithrift-dev.mk | 4 +- rules/thrift_0_13_0.dep | 8 - rules/thrift_0_13_0.mk | 17 -- rules/thrift_0_14_1.dep | 8 + rules/thrift_0_14_1.mk | 20 +++ src/thrift_0_13_0/.gitignore | 1 - src/thrift_0_13_0/Makefile | 32 ---- .../patch/0001-Remove-unneeded-packages.patch | 85 --------- src/thrift_0_14_1/thrift | 1 + .../0001-Remove-unneeded-packages.patch | 118 +++++++++++++ .../thrift.patch/0002-Fix-build-rules.patch | 167 ++++++++++++++++++ src/thrift_0_14_1/thrift.patch/series | 2 + 13 files changed, 322 insertions(+), 146 deletions(-) delete mode 100644 rules/thrift_0_13_0.dep delete mode 100644 rules/thrift_0_13_0.mk create mode 100644 rules/thrift_0_14_1.dep create mode 100644 rules/thrift_0_14_1.mk delete mode 100644 src/thrift_0_13_0/.gitignore delete mode 100644 src/thrift_0_13_0/Makefile delete mode 100644 src/thrift_0_13_0/patch/0001-Remove-unneeded-packages.patch create mode 160000 src/thrift_0_14_1/thrift create mode 100644 src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch create mode 100644 src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch create mode 100644 src/thrift_0_14_1/thrift.patch/series diff --git a/.gitmodules b/.gitmodules index b9cc221936c..f79031a7d22 100644 --- a/.gitmodules +++ b/.gitmodules @@ -99,4 +99,7 @@ url = https://github.com/Azure/sonic-linkmgrd.git [submodule "src/sonic-p4rt/sonic-pins"] path = src/sonic-p4rt/sonic-pins - url = https://github.com/Azure/sonic-pins.git \ No newline at end of file + url = https://github.com/Azure/sonic-pins.git +[submodule "src/thrift_0_14_1/thrift"] + path = src/thrift_0_14_1/thrift + url = https://github.com/apache/thrift.git diff --git a/platform/broadcom/libsaithrift-dev.mk b/platform/broadcom/libsaithrift-dev.mk index 0d32a08a276..1e4d0da13bb 100644 --- a/platform/broadcom/libsaithrift-dev.mk +++ b/platform/broadcom/libsaithrift-dev.mk @@ -6,8 +6,8 @@ LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI #Support two different versions of thrift ifeq ($(SAITHRIFT_V2),y) -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_13_0) $(LIBTHRIFT_DEV_0_13_0) $(PYTHON3_THRIFT_0_13_0) $(THRIFT_COMPILER_0_13_0) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_13_0) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_DEV_0_14_1) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_COMPILER_0_14_1) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 else $(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) diff --git a/rules/thrift_0_13_0.dep b/rules/thrift_0_13_0.dep deleted file mode 100644 index 52d8b6a525f..00000000000 --- a/rules/thrift_0_13_0.dep +++ /dev/null @@ -1,8 +0,0 @@ -SPATH := $($(LIBTHRIFT_0_13_0)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/thrift_0_13_0.mk rules/thrift_0_13_0.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) - -$(LIBTHRIFT_0_13_0)_CACHE_MODE := GIT_CONTENT_SHA -$(LIBTHRIFT_0_13_0)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(LIBTHRIFT_0_13_0)_DEP_FILES := $(DEP_FILES) diff --git a/rules/thrift_0_13_0.mk b/rules/thrift_0_13_0.mk deleted file mode 100644 index 18d33391090..00000000000 --- a/rules/thrift_0_13_0.mk +++ /dev/null @@ -1,17 +0,0 @@ -# thrift package - -THRIFT_VERSION_0_13_0 = 0.13.0 -THRIFT_VERSION_0_13_0_FULL = $(THRIFT_VERSION_0_13_0)-6 - -LIBTHRIFT_0_13_0 = libthrift-$(THRIFT_VERSION_0_13_0)_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb -$(LIBTHRIFT_0_13_0)_SRC_PATH = $(SRC_PATH)/thrift_0_13_0 -SONIC_MAKE_DEBS += $(LIBTHRIFT_0_13_0) - -LIBTHRIFT_DEV_0_13_0 = libthrift-dev_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(LIBTHRIFT_DEV_0_13_0))) - -PYTHON3_THRIFT_0_13_0 = python3-thrift_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(PYTHON3_THRIFT_0_13_0))) - -THRIFT_COMPILER_0_13_0 = thrift-compiler_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(THRIFT_COMPILER_0_13_0))) diff --git a/rules/thrift_0_14_1.dep b/rules/thrift_0_14_1.dep new file mode 100644 index 00000000000..2fb1ba5666a --- /dev/null +++ b/rules/thrift_0_14_1.dep @@ -0,0 +1,8 @@ +SPATH := $($(LIBTHRIFT_0_14_1)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/thrift_0_14_1.mk rules/thrift_0_14_1.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(LIBTHRIFT_0_14_1)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBTHRIFT_0_14_1)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBTHRIFT_0_14_1)_DEP_FILES := $(DEP_FILES) diff --git a/rules/thrift_0_14_1.mk b/rules/thrift_0_14_1.mk new file mode 100644 index 00000000000..b986e0a4dce --- /dev/null +++ b/rules/thrift_0_14_1.mk @@ -0,0 +1,20 @@ +# thrift package + +THRIFT_0_14_1_VERSION = 0.14.1 +THRIFT_0_14_1_VERSION_FULL = $(THRIFT_0_14_1_VERSION) + +LIBTHRIFT_0_14_1 = libthrift0_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb +$(LIBTHRIFT_0_14_1)_SRC_PATH = $(SRC_PATH)/thrift_0_14_1/thrift +SONIC_DPKG_DEBS += $(LIBTHRIFT_0_14_1) + +LIBTHRIFT_0_14_1_DEV = libthrift-dev_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(LIBTHRIFT_0_14_1_DEV))) + +PYTHON3_THRIFT_0_14_1 = python3-thrift_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(PYTHON3_THRIFT_0_14_1))) + +PYTHON_THRIFT_0_14_1 = python-thrift_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(PYTHON_THRIFT_0_14_1))) + +THRIFT_0_14_1_COMPILER = thrift-compiler_$(THRIFT_0_14_1_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_14_1),$(THRIFT_0_14_1_COMPILER))) diff --git a/src/thrift_0_13_0/.gitignore b/src/thrift_0_13_0/.gitignore deleted file mode 100644 index dc29c136793..00000000000 --- a/src/thrift_0_13_0/.gitignore +++ /dev/null @@ -1 +0,0 @@ -thrift* \ No newline at end of file diff --git a/src/thrift_0_13_0/Makefile b/src/thrift_0_13_0/Makefile deleted file mode 100644 index 55cb4d9212e..00000000000 --- a/src/thrift_0_13_0/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -SHELL = /bin/bash -.ONESHELL: -.SHELLFLAGS += -e -x - -THRIFT_VERSION = 0.13.0 -THRIFT_VERSION_FULL = $(THRIFT_VERSION)-6 - -MAIN_TARGET = libthrift-$(THRIFT_VERSION)_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = libthrift-dev_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ - python3-thrift_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb \ - thrift-compiler_$(THRIFT_VERSION_FULL)_$(CONFIGURED_ARCH).deb - -THRIFT_LINK_PRE = http://deb.debian.org/debian/pool/main/t/thrift/ - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - rm -rf thrift-$(THRIFT_VERSION) - - wget -O "thrift_$(THRIFT_VERSION_FULL).debian.tar.xz" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION_FULL).debian.tar.xz" - wget -O "thrift_$(THRIFT_VERSION).orig.tar.gz" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION).orig.tar.gz" - wget -O "thrift_$(THRIFT_VERSION_FULL).dsc" "$(THRIFT_LINK_PRE)/thrift_$(THRIFT_VERSION_FULL).dsc" - - dpkg-source -x thrift_$(THRIFT_VERSION_FULL).dsc - pushd thrift-$(THRIFT_VERSION) - - # Disable php perl and few other packages as they need additional packages to be installed - patch -p1 < ../patch/0001-Remove-unneeded-packages.patch - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -d -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) - popd - - mv $(DERIVED_TARGETS) $* $(DEST)/ - -$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/thrift_0_13_0/patch/0001-Remove-unneeded-packages.patch b/src/thrift_0_13_0/patch/0001-Remove-unneeded-packages.patch deleted file mode 100644 index f1565408a72..00000000000 --- a/src/thrift_0_13_0/patch/0001-Remove-unneeded-packages.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 7a8d588fa0425550cfd42c3300c8c0a643137190 Mon Sep 17 00:00:00 2001 -From: Myron Sosyak -Date: Fri, 13 Aug 2021 11:26:13 +0000 -Subject: [PATCH] Remove-unneeded-packages - ---- - debian/control | 28 ---------------------------- - debian/rules | 7 +++---- - 2 files changed, 3 insertions(+), 32 deletions(-) - -diff --git a/debian/control b/debian/control -index 5126e47..3f3028c 100644 ---- a/debian/control -+++ b/debian/control -@@ -13,8 +13,6 @@ Build-Depends: debhelper-compat (= 11), dh-python, - python3-all-dev, - python3-six, - golang-go, golang-github-golang-mock-dev, -- pkg-php-tools (>= 1.14~), php-dev, phpunit, php-codesniffer, -- perl (>= 5.22), libbit-vector-perl, libclass-accessor-perl, - # openjdk-11-jdk, javahelper, maven-debian-helper (>= 1.5), ant (>= 1.7), ant-optional, - # libhttpclient-java, libslf4j-java, libservlet3.1-java (>= 8), - # nodejs, npm, -@@ -175,32 +173,6 @@ Description: Python library for Thrift (debug symbols) - # . - # This package contains Javadoc HTML documentation for libthrift-java . - # --Package: php-thrift --Architecture: any --Section: php --Depends: ${phpcomposer:Debian-require}, ${shlibs:Depends}, ${misc:Depends} --Provides: ${php:Provides} --Conflicts: php7.0-thrift, php7.2-thrift --Replaces: php7.0-thrift, php7.2-thrift --Description: PHP language support for Thrift -- Thrift is a software framework for the development of reliable and -- performant communication and data serialization. It combines a software -- stack with code generation to build services that operate seamlessly -- across a number of different development languages. -- . -- This package provides the PHP5 language support for Thrift. -- --Package: libthrift-perl --Section: perl --Architecture: all --Depends: ${perl:Depends}, ${misc:Depends} --Description: Perl language support for Thrift -- Thrift is a software framework for the development of reliable and -- performant communication and data serialization. It combines a software -- stack with code generation to build services that operate seamlessly -- across a number of different development languages. -- . -- This package provides the Perl language support for Thrift. - - Package: golang-thrift-dev - Architecture: amd64 arm64 armel armhf i386 ppc64el -diff --git a/debian/rules b/debian/rules -index ba63e6f..8217796 100755 ---- a/debian/rules -+++ b/debian/rules -@@ -47,7 +47,6 @@ override_dh_auto_clean: - $(CURDIR)/lib/go/test/gopath/src/golang.org/x/net \ - $(CURDIR)/lib/go/test/gopath/src/github.com/golang/mock - [ ! -f Makefile ] || $(MAKE) clean -- cd $(CURDIR)/lib/php/src/ext/thrift_protocol/ && phpize --clean - find $(CURDIR) \( -name Makefile -o -name Makefile.in \) -exec rm {} \; - find $(CURDIR) -name .dirstamp -exec rm {} \; - $(RM) aclocal.m4 config.h config.log config.status configure \ -@@ -65,10 +64,10 @@ override_dh_auto_clean: - - override_dh_auto_configure: - dh_auto_configure -- \ -- --with-cpp --with-c_glib --with-php --with-php_extension \ -- --with-perl --without-python --with-py3 --without-java \ -+ --with-cpp --with-c_glib --without-php --without-php_extension \ -+ --without-perl --without-python --with-py3 --without-java \ - --without-nodejs --without-erlang --without-lua \ -- --with-go --with-ruby \ -+ --without-go --without-ruby \ - --with-qt4=no --with-qt5=yes \ - --without-rust \ - --disable-tutorial --- -2.17.1 - diff --git a/src/thrift_0_14_1/thrift b/src/thrift_0_14_1/thrift new file mode 160000 index 00000000000..f6fa1794539 --- /dev/null +++ b/src/thrift_0_14_1/thrift @@ -0,0 +1 @@ +Subproject commit f6fa1794539e68ac294038ac388d6bde40a6c237 diff --git a/src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch b/src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch new file mode 100644 index 00000000000..bafc81664c8 --- /dev/null +++ b/src/thrift_0_14_1/thrift.patch/0001-Remove-unneeded-packages.patch @@ -0,0 +1,118 @@ +From e9e789bdeb4eb3ae5bf905f83171c66558f29551 Mon Sep 17 00:00:00 2001 +From: Myron sosyak +Date: Fri, 28 Jan 2022 15:01:35 +0000 +Subject: [PATCH 1/2] Remove unneeded packages + +--- + debian/control | 83 +++----------------------------------------------- + 1 file changed, 5 insertions(+), 78 deletions(-) + +diff --git a/debian/control b/debian/control +index a9e934f17..752076582 100644 +--- a/debian/control ++++ b/debian/control +@@ -1,14 +1,12 @@ + Source: thrift + Section: devel + Priority: extra +-Build-Depends: dotnet-runtime-3.1, dotnet-sdk-3.1, debhelper (>= 9), build-essential, python-dev, ant, +- erlang-base, ruby-dev | ruby1.9.1-dev, ruby-bundler ,autoconf, automake, +- pkg-config, libtool, bison, flex, libboost-dev | libboost1.56-dev | libboost1.63-all-dev, +- python-all, python-setuptools, python-all-dev, python-all-dbg, ++Build-Depends: debhelper (>= 9), build-essential, python-dev, ++ autoconf, automake, ++ pkg-config, libtool, ++ python-all, python-setuptools, python-all-dev, + python3-all, python3-setuptools, python3-all-dev, python3-all-dbg, +- openjdk-8-jdk | openjdk-8-jdk-headless | openjdk-11-jdk | openjdk-11-jdk-headless | default-jdk, +- libboost-test-dev | libboost-test1.56-dev | libboost-test1.63-dev, libevent-dev, libssl-dev, perl (>= 5.8.0-7), +- php (>= 5), php-dev (>= 5), libglib2.0-dev, qtchooser, qtbase5-dev-tools ++ libevent-dev, libssl-dev, libglib2.0-dev + Maintainer: Thrift Developer's + Homepage: http://thrift.apache.org/ + Vcs-Git: https://github.com/apache/thrift.git +@@ -95,65 +93,6 @@ Description: Python bindings for Thrift (debug version) + definition to Python classes, and then the modules in this package will allow + you to use those classes in your programs. + +-Package: ruby-thrift +-Architecture: all +-Section: libs +-Depends: ruby | ruby-interpreter, ${shlibs:Depends}, ${misc:Depends} +-Provides: libthrift-ruby +-Replaces: libthrift-ruby +-Breaks: libthrift-ruby +-Description: Ruby bindings for Thrift +- Thrift is a software framework for scalable cross-language services +- development. It combines a software stack with a code generation engine to +- build services that work efficiently and seamlessly. +- . +- This package contains the Ruby bindings for Thrift. You will need the thrift +- tool (in the thrift-compiler package) to compile your definition to Ruby +- classes, and then the modules in this package will allow you to use those +- classes in your programs. +- +-Package: libthrift-java +-Architecture: all +-Section: java +-Depends: ${misc:Depends} +-Description: Java bindings for Thrift +- Thrift is a software framework for scalable cross-language services +- development. It combines a software stack with a code generation engine to +- build services that work efficiently and seamlessly. +- . +- This package contains the Java bindings for Thrift. You will need the thrift +- tool (in the thrift-compiler package) to compile your definition to Java +- classes, and then the modules in this package will allow you to use those +- classes in your programs. +- +-Package: libthrift-netstd +-Architecture: all +-Section: netstd +-Depends: dotnet-runtime-3.1, ${misc:Depends} +-Description: NET Standard bindings for Thrift +- Thrift is a software framework for scalable cross-language services +- development. It combines a software stack with a code generation engine to +- build services that work efficiently and seamlessly. +- . +- This package contains the NET Standard bindings for Thrift. You will need the thrift +- tool (in the thrift-compiler package) to compile your definition to C# +- classes, and then the modules in this package will allow you to use those +- classes in your programs. +- +-Package: libthrift-perl +-Architecture: all +-Section: perl +-Depends: perl (>= 5.8.0-7), ${misc:Depends} +-Description: Perl bindings for Thrift +- Thrift is a software framework for scalable cross-language services +- development. It combines a software stack with a code generation engine to +- build services that work efficiently and seamlessly. +- . +- This package contains the Perl bindings for Thrift. You will need the thrift +- tool (in the thrift-compiler package) to compile your definition to Perl +- classes, and then the modules in this package will allow you to use those +- classes in your programs. +- + Package: libthrift0 + Architecture: any + Depends: ${shlibs:Depends}, ${misc:Depends} +@@ -187,15 +126,3 @@ Description: Thrift C++ library (development headers) + . + This package contains the development libraries required for writing C++ + applications using Thrift. +- +-Package: php5-thrift +-Architecture: any +-Section: php +-Depends: ${php:Depends}, ${shlibs:Depends}, ${misc:Depends} +-Provides: ${php:Provides} +-Description: PHP bindings for Thrift +- Thrift is a software framework for scalable cross-language services +- development. It combines a software stack with a code generation engine to +- build services that work efficiently and seamlessly. +- . +- This package contains the PHP bindings for Thrift. +-- +2.17.1 + diff --git a/src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch b/src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch new file mode 100644 index 00000000000..77ab9c2b404 --- /dev/null +++ b/src/thrift_0_14_1/thrift.patch/0002-Fix-build-rules.patch @@ -0,0 +1,167 @@ +From 99e50d2dbc9e855e457c03e19c4c3b894ffcaa7a Mon Sep 17 00:00:00 2001 +From: Myron sosyak +Date: Fri, 28 Jan 2022 15:02:16 +0000 +Subject: [PATCH 2/2] Fix build rules + +--- + debian/libthrift0.install | 1 - + debian/rules | 83 +++++++++++---------------------------- + 2 files changed, 24 insertions(+), 60 deletions(-) + +diff --git a/debian/libthrift0.install b/debian/libthrift0.install +index ec74efc5c..d4ca21e5e 100644 +--- a/debian/libthrift0.install ++++ b/debian/libthrift0.install +@@ -1,5 +1,4 @@ + usr/lib/libthrift.so* + usr/lib/libthrift-*.so* + usr/lib/libthriftnb*.so* +-usr/lib/libthriftqt*.so* + usr/lib/libthriftz*.so* +diff --git a/debian/rules b/debian/rules +index d0de50872..3a50319ee 100755 +--- a/debian/rules ++++ b/debian/rules +@@ -16,7 +16,7 @@ + # This has to be exported to make some magic below work. + export DH_OPTIONS + +-PYVERS := $(shell pyversions -r) ++PYVERS := python2 python3 + + export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) + export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) +@@ -29,7 +29,13 @@ configure-stamp: + + # Add here commands to configure the package. + if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi +- $(CURDIR)/configure --prefix=/usr --enable-plugin=no ++ $(CURDIR)/configure --prefix=/usr --enable-plugin=no \ ++ --with-cpp --with-c_glib --with-py3 --with-python \ ++ --without-php_extension --without-perl \ ++ --without-php --without-java \ ++ --without-nodejs --without-erlang --without-lua \ ++ --without-go --without-ruby --with-qt4=no \ ++ --with-qt5=no --without-rust --disable-tutorial + + touch configure-stamp + +@@ -40,16 +46,7 @@ build: build-arch build-indep + # $(MAKE) -C test check + + build-arch: build-arch-stamp +-$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp +- +- # Compile compiler +- $(MAKE) -C $(CURDIR)/compiler/cpp +- +- # Compile C++ library +- $(MAKE) -C $(CURDIR)/lib/cpp +- +- # Compile C (glib) library +- $(MAKE) -C $(CURDIR)/lib/c_glib ++$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp build-libcpp-stamp build-libc-stamp build-compiler-stamp + + # Python library + cd $(CURDIR)/lib/py && \ +@@ -58,11 +55,22 @@ $(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp + $$py-dbg setup.py build; \ + done + +- # PHP +- cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \ +- phpize && \ +- ./configure && $(MAKE) ++ touch $@ + ++build-compiler-stamp: configure-stamp ++ # Compile compiler ++ $(MAKE) -C $(CURDIR)/compiler/cpp ++ touch $@ ++ ++ ++build-libcpp-stamp: configure-stamp build-compiler-stamp ++ # Compile C++ library ++ $(MAKE) -C $(CURDIR)/lib/cpp ++ touch $@ ++ ++build-libc-stamp: configure-stamp build-compiler-stamp ++ # Compile C (glib) library ++ $(MAKE) -C $(CURDIR)/lib/c_glib + touch $@ + + build-indep: build-indep-stamp +@@ -71,19 +79,6 @@ build-indep-stamp: configure-stamp $(CURDIR)/compiler/cpp/thrift + # Add here commands to compile the indep part of the package. + #$(MAKE) doc + +- # Java +- cd $(CURDIR)/lib/java && \ +- ./gradlew --no-daemon -Prelease=true jar +- +- # C# +- $(MAKE) -C $(CURDIR)/lib/netstd +- +- # Ruby +- $(MAKE) -C $(CURDIR)/lib/rb +- +- # Perl +- $(MAKE) -C $(CURDIR)/lib/perl INSTALLDIRS=vendor +- + touch $@ + + clean: +@@ -109,30 +104,6 @@ install-indep: + # debian/-doc. + #INSTALLDOC# + +- # Java +- mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \ +- cp $(CURDIR)/lib/java/build/libs/libthrift*.jar \ +- $(CURDIR)/debian/libthrift-java/usr/share/java/ +- +- # Ruby +- mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \ +- cp $(CURDIR)/lib/rb/lib/thrift.rb \ +- $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 +- cp -r $(CURDIR)/lib/rb/lib/thrift \ +- $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 +- +- # C# +- mkdir -p $(CURDIR)/debian/libthrift-netstd/usr/lib/cli/thrift/ && \ +- cp $(CURDIR)/lib/netstd/Thrift/bin/Release/netstandard2.0/Thrift.dll \ +- $(CURDIR)/debian/libthrift-netstd/usr/lib/cli/thrift/Thrift.dll +- +- # Perl +- $(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl +- mkdir -p $(CURDIR)/debian/libthrift-perl/usr/share +- mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 $(CURDIR)/debian/libthrift-perl/usr/share +- rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib +- rmdir $(CURDIR)/debian/libthrift-perl/usr/local +- + dh_install -i + + install-arch: +@@ -154,7 +125,6 @@ install-arch: + # Python + cd $(CURDIR)/lib/py && \ + python2 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift && \ +- python2-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg && \ + python3 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift && \ + python3-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift-dbg + +@@ -174,11 +144,6 @@ install-arch: + find $(CURDIR)/debian/python3-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf + find $(CURDIR)/debian/python3-thrift-dbg -depth -type d -empty -exec rmdir {} \; + +- # PHP +- mkdir -p $(CURDIR)/debian/php5-thrift +- cd $(CURDIR)/lib/php && \ +- $(MAKE) DESTDIR=$(CURDIR)/debian/php5-thrift install +- + # C++ and C (glib) + mkdir -p $(CURDIR)/debian/tmp; \ + cd $(CURDIR)/lib/cpp && \ +-- +2.17.1 + diff --git a/src/thrift_0_14_1/thrift.patch/series b/src/thrift_0_14_1/thrift.patch/series new file mode 100644 index 00000000000..b95ae481e04 --- /dev/null +++ b/src/thrift_0_14_1/thrift.patch/series @@ -0,0 +1,2 @@ +0001-Remove-unneeded-packages.patch +0002-Fix-build-rules.patch From b023c29a1e2fdc19eebf0abfa4a5ef8212271a05 Mon Sep 17 00:00:00 2001 From: Jason Lyu Date: Wed, 16 Feb 2022 08:43:01 +0800 Subject: [PATCH 038/139] [redis] Upgrade redis version (#9757) #### Why I did it The current redis version of SONiC is `6.0.6`, which contains many high-risky security issues like CVEs that are fixed in the latest version. The Redis release notes also highly recommend to upgrade with SECURITY urgency. ``` ================================================================================ Redis 6.0.16 Released Mon Oct 4 12:00:00 IDT 2021 ================================================================================ Upgrade urgency: SECURITY, contains fixes to security issues. Security Fixes: * (CVE-2021-41099) Integer to heap buffer overflow handling certain string commands and network payloads, when proto-max-bulk-len is manually configured to a non-default, very large value [reported by yiyuaner]. * (CVE-2021-32762) Integer to heap buffer overflow issue in redis-cli and redis-sentinel parsing large multi-bulk replies on some older and less common platforms [reported by Microsoft Vulnerability Research]. * (CVE-2021-32687) Integer to heap buffer overflow with intsets, when set-max-intset-entries is manually configured to a non-default, very large value [reported by Pawel Wieczorkiewicz, AWS]. * (CVE-2021-32675) Denial Of Service when processing RESP request payloads with a large number of elements on many connections. * (CVE-2021-32672) Random heap reading issue with Lua Debugger [reported by Meir Shpilraien]. * (CVE-2021-32628) Integer to heap buffer overflow handling ziplist-encoded data types, when configuring a large, non-default value for hash-max-ziplist-entries, hash-max-ziplist-value, zset-max-ziplist-entries or zset-max-ziplist-value [reported by sundb]. * (CVE-2021-32627) Integer to heap buffer overflow issue with streams, when configuring a non-default, large value for proto-max-bulk-len and client-query-buffer-limit [reported by sundb]. * (CVE-2021-32626) Specially crafted Lua scripts may result with Heap buffer overflow [reported by Meir Shpilraien]. Other bug fixes: * Fix appendfsync to always guarantee fsync before reply, on MacOS and FreeBSD (kqueue) (#9416) * Fix the wrong mis-detection of sync_file_range system call, affecting performance (#9371) * Fix replication issues when repl-diskless-load is used (#9280) ``` #### How I did it Edit `Dockerfile.j2` file #### How to verify it Check redis version #### Description for the changelog This PR will upgrade redis-server version to `6.0.16`. --- dockers/docker-database/Dockerfile.j2 | 19 ++----------------- rules/docker-database.mk | 9 +++------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/dockers/docker-database/Dockerfile.j2 b/dockers/docker-database/Dockerfile.j2 index aef22e24379..f75d258222a 100644 --- a/dockers/docker-database/Dockerfile.j2 +++ b/dockers/docker-database/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-buster +FROM docker-config-engine-bullseye ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -11,22 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update # Install redis-server -{% if CONFIGURED_ARCH == "armhf" %} -RUN curl -k -o redis-tools_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r" -RUN curl -k -o redis-server_6.0.6-1~bpo10+1_armhf.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=xTdayvm0RBguxi9suyv855jKRjU%2FmKQ8nHuct4WSX%2FA%3D&se=2030-10-24T04%3A22%3A05Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_armhf.deb redis-server_6.0.6-1~bpo10+1_armhf.deb -{% elif CONFIGURED_ARCH == "arm64" %} -RUN curl -o redis-tools_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r" -RUN curl -o redis-server_6.0.6-1~bpo10+1_arm64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=622w2KzIKIjAaaA0Bz12MzU%2BUBzY2AiXFIFfuKNoKSk%3D&se=2030-10-24T04%3A21%3A44Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_arm64.deb redis-server_6.0.6-1~bpo10+1_arm64.deb -{% else %} -RUN curl -o redis-tools_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r" -RUN curl -o redis-server_6.0.6-1~bpo10+1_amd64.deb "https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=2Ketg7BmkZEaTxR%2FgvAFVmhjn7ywdmkc7l2T2rsL57o%3D&se=2030-09-06T19%3A45%3A20Z&sp=r" -RUN dpkg -i redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb || apt-get install -f -RUN rm redis-tools_6.0.6-1~bpo10+1_amd64.deb redis-server_6.0.6-1~bpo10+1_amd64.deb -{% endif %} +RUN apt-get install -y redis-tools redis-server {% if docker_database_debs.strip() -%} # Copy locally-built Debian package dependencies diff --git a/rules/docker-database.mk b/rules/docker-database.mk index d7ce311110e..707adc2d64c 100644 --- a/rules/docker-database.mk +++ b/rules/docker-database.mk @@ -6,11 +6,11 @@ DOCKER_DATABASE_DBG = $(DOCKER_DATABASE_STEM)-$(DBG_IMAGE_MARK).gz $(DOCKER_DATABASE)_PATH = $(DOCKERS_PATH)/$(DOCKER_DATABASE_STEM) -$(DOCKER_DATABASE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) +$(DOCKER_DATABASE)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_DEPENDS) -$(DOCKER_DATABASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) +$(DOCKER_DATABASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BULLSEYE)_DBG_IMAGE_PACKAGES) -$(DOCKER_DATABASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) +$(DOCKER_DATABASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BULLSEYE) $(DOCKER_DATABASE)_VERSION = 1.0.0 $(DOCKER_DATABASE)_PACKAGE_NAME = database @@ -28,6 +28,3 @@ $(DOCKER_DATABASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_DATABASE)_BASE_IMAGE_FILES += redis-cli:/usr/bin/redis-cli $(DOCKER_DATABASE)_FILES += $(SYSCTL_NET_CONFIG) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_DATABASE)_FILES += $(UPDATE_CHASSISDB_CONFIG_SCRIPT) - -SONIC_BUSTER_DOCKERS += $(DOCKER_DATABASE) -SONIC_BUSTER_DBG_DOCKERS += $(DOCKER_DATABASE_DBG) From b7ae4f2e67f47dfb58cea582e118305a6ddf2ae8 Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Wed, 16 Feb 2022 13:39:05 +0530 Subject: [PATCH 039/139] Dell S6100: Addition of 10G ports (#9988) --- .../Force10-S6100/port_config.ini | 2 ++ .../tests/sample_output/py2/buffers-dell6100.json | 8 +++++--- .../tests/sample_output/py3/buffers-dell6100.json | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini index 1922a3e04b5..54809b2c957 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini @@ -63,3 +63,5 @@ Ethernet60 81,82 fortyGigE1/4/13 60 40000 Ethernet61 83,84 fortyGigE1/4/14 61 40000 Ethernet62 85,86 fortyGigE1/4/15 62 40000 Ethernet63 87,88 fortyGigE1/4/16 63 40000 +Ethernet64 129 tenGigE1/1 64 10000 +Ethernet65 131 tenGigE1/2 65 10000 diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json index 90cf104ff47..90ad5f795ca 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json @@ -13,10 +13,11 @@ "Ethernet4": "5m", "Ethernet5": "5m", "Ethernet46": "5m", - "Ethernet34": "5m", + "Ethernet29": "5m", "Ethernet22": "5m", "Ethernet58": "5m", "Ethernet59": "5m", + "Ethernet28": "5m", "Ethernet50": "5m", "Ethernet51": "5m", "Ethernet52": "5m", @@ -41,6 +42,7 @@ "Ethernet32": "5m", "Ethernet33": "5m", "Ethernet30": "5m", + "Ethernet34": "5m", "Ethernet31": "5m", "Ethernet49": "5m", "Ethernet48": "5m", @@ -52,8 +54,8 @@ "Ethernet42": "5m", "Ethernet41": "5m", "Ethernet40": "5m", - "Ethernet29": "5m", - "Ethernet28": "5m", + "Ethernet65": "5m", + "Ethernet64": "5m", "Ethernet61": "5m", "Ethernet60": "5m", "Ethernet63": "5m", diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json index 17a691a2ffa..7c06ed93f38 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json @@ -65,7 +65,9 @@ "Ethernet60": "5m", "Ethernet61": "5m", "Ethernet62": "5m", - "Ethernet63": "5m" + "Ethernet63": "5m", + "Ethernet64": "5m", + "Ethernet65": "5m" } }, From f136c53d199502ddfb9d19eff5ddcafca99c0668 Mon Sep 17 00:00:00 2001 From: kellyyeh <42761586+kellyyeh@users.noreply.github.com> Date: Wed, 16 Feb 2022 22:17:26 +0000 Subject: [PATCH 040/139] [radv] Support multiple ipv6 prefixes per vlan interface (#9934) Why I did it Radvd.conf.j2 template creates two copies of the vlan interface when there are more than one ipv6 address assigned to a single vlan interface. Changed the format to add prefixes under the same vlan interface block. How I did it Modifies radvd.conf.j2 and added unit tests How to verify it Configure multiple ipv6 address to the same vlan, start radvd Unit test will check if radvd.conf with multiple ipv6 addresses is formed correctly --- .../docker-router-advertiser/radvd.conf.j2 | 20 +- .../tests/radv-test-sample-graph.xml | 579 ++++++++++++++++++ .../tests/sample_output/py2/radvd.conf | 35 ++ .../tests/sample_output/py3/radvd.conf | 35 ++ src/sonic-config-engine/tests/test_j2files.py | 10 +- 5 files changed, 674 insertions(+), 5 deletions(-) create mode 100644 src/sonic-config-engine/tests/radv-test-sample-graph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py2/radvd.conf create mode 100644 src/sonic-config-engine/tests/sample_output/py3/radvd.conf diff --git a/dockers/docker-router-advertiser/radvd.conf.j2 b/dockers/docker-router-advertiser/radvd.conf.j2 index 1d1e9e952f1..3880ef96076 100644 --- a/dockers/docker-router-advertiser/radvd.conf.j2 +++ b/dockers/docker-router-advertiser/radvd.conf.j2 @@ -10,9 +10,21 @@ {# If our configuration has VLAN interfaces... #} {% if VLAN_INTERFACE %} -{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} -{# If this VLAN has an IPv6 address... #} +{% set vlan_list = dict() %} +{% for (name,prefix) in VLAN_INTERFACE|pfx_filter %} +{% if name is not in vlan_list and prefix | ipv6 %} +{% set prefix_list = [] %} +{% set _ = vlan_list.update({name: prefix_list}) %} +{% endif %} {% if prefix | ipv6 %} +{# If our configuration has VLAN interfaces... #} +{% set prefix_list = vlan_list.get(name) %} +{% set _ = prefix_list.append(prefix) %} +{% set _ = vlan_list.update({name: prefix_list}) %} +{% endif %} +{% endfor %} +{% endif %} +{% for name, prefixes in vlan_list.items() %} interface {{ name }} { IgnoreIfMissing on; @@ -23,6 +35,7 @@ interface {{ name }} AdvOtherConfigFlag off; AdvLinkMTU 9100; AdvHomeAgentFlag off; +{% for prefix in prefixes %} prefix {{ prefix | network }}/{{ prefix | prefixlen }} { AdvOnLink on; AdvAutonomous off; @@ -30,8 +43,7 @@ interface {{ name }} AdvValidLifetime infinity; AdvPreferredLifetime infinity; }; +{% endfor %} }; -{% endif %} {% endfor %} -{% endif %} diff --git a/src/sonic-config-engine/tests/radv-test-sample-graph.xml b/src/sonic-config-engine/tests/radv-test-sample-graph.xml new file mode 100644 index 00000000000..6945c8e175d --- /dev/null +++ b/src/sonic-config-engine/tests/radv-test-sample-graph.xml @@ -0,0 +1,579 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 180 + 60 + + + switch-t0 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 180 + 60 + + + switch-t0 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 180 + 60 + + + + + 0 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + LoopbackIP1 + Loopback1 + + 10.10.0.99/32 + + 10.10.0.99/32 + + + LoopbackIP2 + Loopback2 + + 10.21.0.64/32 + + 10.21.0.64/32 + + + LoopbackIP3 + Loopback3 + + 10.21.64.2/32 + + 10.21.64.2/32 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + HostIP + eth0 + + 2603:10e2:0:2902::8/64 + + 2603:10e2:0:2902::8/64 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/112 + + + + PortChannel02 + fortyGigE0/116 + + + + PortChannel03 + fortyGigE0/120 + + + + PortChannel04 + fortyGigE0/124 + + + + + + Vlan1000 + fortyGigE0/4;fortyGigE0/8;fortyGigE0/12;fortyGigE0/16;fortyGigE0/20;fortyGigE0/24;fortyGigE0/28;fortyGigE0/32;fortyGigE0/36;fortyGigE0/40;fortyGigE0/44;fortyGigE0/48;fortyGigE0/52;fortyGigE0/56;fortyGigE0/60;fortyGigE0/64;fortyGigE0/68;fortyGigE0/72;fortyGigE0/76;fortyGigE0/80;fortyGigE0/84;fortyGigE0/88;fortyGigE0/92;fortyGigE0/96 + False + 0.0.0.0/0 + + + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + + + + + Vlan2000 + fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + False + 0.0.0.0/0 + + + + 2000 + 2000 + 192.168.200.0/27 + + + + + Vlan99 + fortyGigE0/100 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 99 + 99 + + + + + + Vlan98 + fortyGigE0/100;PortChannel01;PortChannel03 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 98 + 98 + + + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + PortChannel02 + 10.0.0.58/31 + + + + PortChannel02 + FC00::75/126 + + + + PortChannel03 + 10.0.0.60/31 + + + + PortChannel03 + FC00::79/126 + + + + PortChannel04 + 10.0.0.62/31 + + + + PortChannel04 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/27 + + + + Vlan1000 + fc02:1000::1/64 + + + + Vlan2000 + 192.168.200.1/27 + + + + Vlan1000 + fc02:2000::1/64 + + + + + + ERSPAN + everflow + Everflow + + + ERSPANv6 + everflowV6 + Everflow + + + EGRESS_ERSPAN + everflow_egress + Everflow + + + PortChannel01;PortChannel02;PortChannel03;PortChannel04 + DataAclIngress + DataPlane + + + PortChannel01;PortChannel02;Vlan98 + DataAclEgress + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + NTP + NTP_ACL + NTP + + + SSH + SSH_ACL + SSH + + + SSH + ROUTER-PROTECT + SSH + + + SNMP + ROUTER-PROTECT + SNMP + + + NTP + NTP_ACL + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1/1 + switch-t0 + fortyGigE0/112 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1/1 + switch-t0 + fortyGigE0/116 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1/1 + switch-t0 + fortyGigE0/120 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1/1 + switch-t0 + fortyGigE0/124 + 100000 + + + DeviceInterfaceLink + 100000 + switch-t0 + fortyGigE0/4 + true + ARISTA05T1 + Ethernet1/33 + true + + + DeviceInterfaceLink + Servers0 + eth0 + switch-t0 + fortyGigE0/4 + + + DeviceInterfaceLink + Servers100 + eth0 + switch-t0 + fortyGigE0/100 + + + + + switch-t0 + Force10-S6000 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + switch-t0 + + + ErspanDestinationIpv4 + + 2.2.2.2 + + + + + + + + + + + + + AutoNegotiation + + True + + + FECDisabled + + True + + + ARISTA05T1:Ethernet1/33;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + False + + + FECDisabled + + True + + + ARISTA06T1:Ethernet1/34;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/radvd.conf b/src/sonic-config-engine/tests/sample_output/py2/radvd.conf new file mode 100644 index 00000000000..9e716b7144b --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/radvd.conf @@ -0,0 +1,35 @@ +# =========== Managed by sonic-cfggen -- DO NOT edit manually! ==================== +# Generated by /usr/share/sonic/templates/radvd.conf.j2 using config DB data +# File: /etc/radvd.conf +# +# Config file for radvd, the router advertisement daemon +# See man page for radvd.conf for descriptions of all available options +# + +interface Vlan1000 +{ + IgnoreIfMissing on; + AdvSendAdvert on; + MinRtrAdvInterval 60; + MaxRtrAdvInterval 180; + AdvManagedFlag on; + AdvOtherConfigFlag off; + AdvLinkMTU 9100; + AdvHomeAgentFlag off; + prefix fc02:2000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; + prefix fc02:1000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; +}; + + diff --git a/src/sonic-config-engine/tests/sample_output/py3/radvd.conf b/src/sonic-config-engine/tests/sample_output/py3/radvd.conf new file mode 100644 index 00000000000..43de8b84775 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/radvd.conf @@ -0,0 +1,35 @@ +# =========== Managed by sonic-cfggen -- DO NOT edit manually! ==================== +# Generated by /usr/share/sonic/templates/radvd.conf.j2 using config DB data +# File: /etc/radvd.conf +# +# Config file for radvd, the router advertisement daemon +# See man page for radvd.conf for descriptions of all available options +# + +interface Vlan1000 +{ + IgnoreIfMissing on; + AdvSendAdvert on; + MinRtrAdvInterval 60; + MaxRtrAdvInterval 180; + AdvManagedFlag on; + AdvOtherConfigFlag off; + AdvLinkMTU 9100; + AdvHomeAgentFlag off; + prefix fc02:1000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; + prefix fc02:2000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; +}; + + diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index d9878c2d9cf..851f45098fd 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -25,6 +25,7 @@ def setUp(self): self.arista7050_t0_minigraph = os.path.join(self.test_dir, 'sample-arista-7050-t0-minigraph.xml') self.multi_asic_minigraph = os.path.join(self.test_dir, 'multi_npu_data', 'sample-minigraph.xml') self.multi_asic_port_config = os.path.join(self.test_dir, 'multi_npu_data', 'sample_port_config-0.ini') + self.radv_test_minigraph = os.path.join(self.test_dir, 'radv-test-sample-graph.xml') self.output_file = os.path.join(self.test_dir, 'output') os.environ["CFGGEN_UNIT_TESTING"] = "2" @@ -67,7 +68,14 @@ def test_dhcp_relay(self): template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file)) + self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file), self.output_file) + + def test_radv(self): + # Test generation of radvd.conf with multiple ipv6 prefixes + template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-router-advertiser', 'radvd.conf.j2') + argument = '-m ' + self.radv_test_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file + self.run_script(argument) + self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'radvd.conf'), self.output_file)) def test_lldp(self): lldpd_conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-lldp', 'lldpd.conf.j2') From fb752a4ae54e7475d30251b004a0e1822a4b6dfe Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Thu, 17 Feb 2022 10:16:44 +0200 Subject: [PATCH 041/139] [rsyslog.j2] fix typo in VAR_LOG_SIZE_KB (#9954) This issue causes negative threshold value and thus deleting log files even when there is enough space. This issue causes negative threshold value and thus deleting log files even when there is enough space. - Why I did it To fix an issue when log files get deleted even if there is enough space. - How I did it Fixed an typo. - How to verify it Run the portion of the script that calculates threshold, see that the threshold is calculated correctly. Signed-off-by: Stepan Blyschak --- files/image_config/logrotate/rsyslog.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/image_config/logrotate/rsyslog.j2 b/files/image_config/logrotate/rsyslog.j2 index dd360dc8608..1a5c92c3382 100644 --- a/files/image_config/logrotate/rsyslog.j2 +++ b/files/image_config/logrotate/rsyslog.j2 @@ -57,7 +57,7 @@ # should be disabled, just in case they get created and rotated RESERVED_SPACE_KB=4096 - VARL_LOG_SIZE_KB={{var_log_kb}} + VAR_LOG_SIZE_KB={{var_log_kb}} # Limit usable space to 90% of the partition minus the reserved space for other logs USABLE_SPACE_KB=$(( (VAR_LOG_SIZE_KB * 90 / 100) - RESERVED_SPACE_KB)) From 5ce75acfa5a5a32f7cb5f987f3ba72262f85413f Mon Sep 17 00:00:00 2001 From: Vadym Hlushko <62022266+vadymhlushko-mlnx@users.noreply.github.com> Date: Thu, 17 Feb 2022 12:06:01 +0200 Subject: [PATCH 042/139] [nvgre] Added YANG model and tests (#9136) - Why I did it NVGRE Tunnel feature extends the Config DB with new tables. These tables require a new YANG model. - How I did it Added a new YANG model sonic-nvgre-tunnel.yang - How to verify it Added YANG test cases. Signed-off-by: Vadym Hlushko --- src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 21 ++- .../tests/yang_model_tests/tests/nvgre.json | 25 ++++ .../yang_model_tests/tests_config/nvgre.json | 125 ++++++++++++++++++ .../yang-models/sonic-nvgre-tunnel.yang | 114 ++++++++++++++++ 5 files changed, 285 insertions(+), 2 deletions(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json create mode 100644 src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 1f9b51b0c56..17dcdeeaa5b 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -108,6 +108,7 @@ def run(self): './yang-models/sonic-mirror-session.yang', './yang-models/sonic-ntp.yang', './yang-models/sonic-nat.yang', + './yang-models/sonic-nvgre-tunnel.yang', './yang-models/sonic-pbh.yang', './yang-models/sonic-port.yang', './yang-models/sonic-policer.yang', @@ -165,6 +166,7 @@ def run(self): './cvlyang-models/sonic-mgmt_vrf.yang', './cvlyang-models/sonic-ntp.yang', './cvlyang-models/sonic-nat.yang', + './cvlyang-models/sonic-nvgre-tunnel.yang', './cvlyang-models/sonic-pbh.yang', './cvlyang-models/sonic-policer.yang', './cvlyang-models/sonic-port.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e64b241349b..6c27047c9bc 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1540,7 +1540,7 @@ } }, - + "MCLAG_DOMAIN": { "123": { "source_ip": "12.1.1.1", @@ -1584,6 +1584,8 @@ } }, + + "POLICER": { "everflow_static_policer": { "meter_type": "bytes", @@ -1592,8 +1594,23 @@ "cbs": "12500000", "color": "aware", "red_packet_action": "drop" - } + } + }, + + + "NVGRE_TUNNEL": { + "tunnel_1": { + "src_ip": "10.0.0.1" + } + }, + "NVGRE_TUNNEL_MAP": { + "tunnel_1|Vlan111": { + "vlan_id": "111", + "vsid": "5000" + } } + + }, "SAMPLE_CONFIG_DB_UNKNOWN": { "UNKNOWN_TABLE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json new file mode 100644 index 00000000000..e776b0d9064 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json @@ -0,0 +1,25 @@ +{ + "NVGRE_TUNNEL_AND_TUNNEL_MAP": { + "desc": "NVGRE_TUNNEL with NVGRE_TUNNEL_MAP" + }, + + "NVGRE_TUNNEL_INVALID_SRC_IP": { + "desc": "INVALID src_ip value for NVGRE_TUNNEL", + "eStrKey": "InvalidValue" + }, + + "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { + "desc": "Unexisting NVGRE_TUNNEL", + "eStrKey": "LeafRef" + }, + + "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { + "desc": "Invalid VLAN ID", + "eStrKey": "Pattern" + }, + + "NVGRE_TUNNEL_MAP_INVALID_VSID": { + "desc": "INVALID VSID value for NVGRE_TUNNEL_MAP", + "eStrKey": "Pattern" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json new file mode 100644 index 00000000000..8c2588fa7d3 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json @@ -0,0 +1,125 @@ +{ + "NVGRE_TUNNEL_AND_TUNNEL_MAP": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_INVALID_SRC_IP": { + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "INVALID" + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "INVALID", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 5000, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_INVALID_VSID": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 999999999 + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang b/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang new file mode 100644 index 00000000000..42ab3921a4a --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang @@ -0,0 +1,114 @@ +module sonic-nvgre-tunnel { + + yang-version 1.1; + + namespace "http://github.com/Azure/sonic-nvgre-tunnel"; + prefix nvgre; + + import ietf-inet-types { + prefix inet; + } + + import sonic-vlan { + prefix vlan; + } + + + organization + "SONiC"; + + contact + "SONiC"; + + description + "NVGRE Tunnel YANG Module for SONiC OS"; + + revision 2021-10-31 { + description + "First Revision"; + } + + container sonic-nvgre-tunnel { + + container NVGRE_TUNNEL { + + description "NVGRE_TUNNEL part of config_db.json"; + + list NVGRE_TUNNEL_LIST { + + key "tunnel_name"; + + leaf tunnel_name { + description "NVGRE Tunnel name"; + + type string { + length 1..255; + } + } + + leaf src_ip { + description "Source IP address"; + + mandatory true; + type inet:ip-address; + } + + } + /* end of NVGRE_TUNNEL_LIST */ + + } + /* end of container NVGRE_TUNNEL */ + + container NVGRE_TUNNEL_MAP { + + description "NVGRE_TUNNEL_MAP part of config_db.json"; + + list NVGRE_TUNNEL_MAP_LIST { + + key "tunnel_name tunnel_map_name"; + + leaf tunnel_name { + description "NVGRE Tunnel name"; + + type leafref { + path /nvgre:sonic-nvgre-tunnel/nvgre:NVGRE_TUNNEL/nvgre:NVGRE_TUNNEL_LIST/nvgre:tunnel_name; + } + } + + leaf tunnel_map_name { + description "NVGRE Tunnel map name"; + + type string { + length 1..255; + } + } + + leaf vlan_id { + description "VLAN identifier"; + + mandatory true; + type uint16 { + range 1..4094; + } + } + + leaf vsid { + description "Virtual Subnet Identifier"; + + mandatory true; + type uint32 { + range 0..16777214; + } + } + + } + /* end of NVGRE_TUNNEL_MAP_LIST */ + + } + /* end of container NVGRE_TUNNEL_MAP */ + + } + /* end of container sonic-nvgre-tunnel */ + +} +/* end of module sonic-nvgre-tunnel */ From d5404928345ba2690d8f6cce0095f57d0a89c671 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Fri, 18 Feb 2022 00:04:59 +0100 Subject: [PATCH 043/139] caclmgrd: remove permit source port 179 (#9827) [Caclmgrd] Remove insecure opening of source port 179 Signed-off-by: Christian Svensson --- src/sonic-host-services/scripts/caclmgrd | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sonic-host-services/scripts/caclmgrd b/src/sonic-host-services/scripts/caclmgrd index 77bcd2e4ee7..a65f05a3452 100755 --- a/src/sonic-host-services/scripts/caclmgrd +++ b/src/sonic-host-services/scripts/caclmgrd @@ -501,9 +501,7 @@ class ControlPlaneAclManager(daemon_base.DaemonBase): # Add iptables/ip6tables commands to allow all incoming BGP traffic # TODO: Determine BGP ACLs based on configured device sessions, and remove this blanket acceptance iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp --dport 179 -j ACCEPT") - iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp --sport 179 -j ACCEPT") iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p tcp --dport 179 -j ACCEPT") - iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p tcp --sport 179 -j ACCEPT") # Get current ACL tables and rules from Config DB self._tables_db_info = self.config_db_map[namespace].get_table(self.ACL_TABLE) From bec35267cbf187c3a1238d5eeb2a6827074db4ab Mon Sep 17 00:00:00 2001 From: Myron Sosyak Date: Fri, 18 Feb 2022 01:44:42 -0800 Subject: [PATCH 044/139] [BFN] syncd-rpc build with thrift 0.14.1 (#9884) --- platform/barefoot/docker-syncd-bfn-rpc.mk | 2 +- platform/barefoot/libsaithrift-dev.mk | 22 ++++-- platform/barefoot/rules.mk | 3 +- ...eplace-unions-with-structs-in-thrift.patch | 70 +++++++++++++++++++ ...-Use-std-shared_ptr-instead-of-boost.patch | 25 +++++++ .../0003-include-algorithm.patch | 24 +++++++ ...0004-Fix-Thrift-0.14.1-compatibility.patch | 47 +++++++++++++ platform/barefoot/saithrift-patches/Makefile | 19 +++++ platform/barefoot/saithrift-patches/series | 4 ++ slave.mk | 1 + 10 files changed, 209 insertions(+), 8 deletions(-) create mode 100644 platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch create mode 100644 platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch create mode 100644 platform/barefoot/saithrift-patches/0003-include-algorithm.patch create mode 100644 platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch create mode 100644 platform/barefoot/saithrift-patches/Makefile create mode 100644 platform/barefoot/saithrift-patches/series diff --git a/platform/barefoot/docker-syncd-bfn-rpc.mk b/platform/barefoot/docker-syncd-bfn-rpc.mk index fe1f498d5ad..a2a741cea1e 100644 --- a/platform/barefoot/docker-syncd-bfn-rpc.mk +++ b/platform/barefoot/docker-syncd-bfn-rpc.mk @@ -2,7 +2,7 @@ DOCKER_SYNCD_BFN_RPC = docker-syncd-bfn-rpc.gz $(DOCKER_SYNCD_BFN_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-bfn-rpc -$(DOCKER_SYNCD_BFN_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF) +$(DOCKER_SYNCD_BFN_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT_0_14_1) $(PTF) $(DOCKER_SYNCD_BFN_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) ifeq ($(INSTALL_DEBUG_TOOLS), y) $(DOCKER_SYNCD_BFN_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ diff --git a/platform/barefoot/libsaithrift-dev.mk b/platform/barefoot/libsaithrift-dev.mk index 0289a41b291..40cd5554653 100644 --- a/platform/barefoot/libsaithrift-dev.mk +++ b/platform/barefoot/libsaithrift-dev.mk @@ -1,18 +1,28 @@ -# libsaithrift-dev package +SAITHRIFT_PATCHES = saithrift-patches +$(SAITHRIFT_PATCHES)_SRC_PATH = $(PLATFORM_PATH)/saithrift-patches +SONIC_MAKE_FILES += $(SAITHRIFT_PATCHES) +# libsaithrift-dev package SAI_VER = 0.9.4 - -LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb +LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(BFN_SAI) $(BFN_SAI_DEV) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(BFN_SAI) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) \ + $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER) \ + $(BFN_SAI) + +#$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) + +# $(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=v +$(LIBSAITHRIFT_DEV)_AFTER_FILES = $(SAITHRIFT_PATCHES) + +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(BFN_SAI) SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) SAISERVER = saiserver_$(SAI_VER)_amd64.deb -$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) +$(SAISERVER)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(BFN_SAI) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index 98dcef0f7b8..416d8ac0110 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -24,7 +24,8 @@ $(SYNCD)_DEPENDS += $(BFN_SAI) $(BFN_INGRASYS_PLATFORM) $(BFN_PLATFORM) $(SYNCD)_UNINSTALLS += $(BFN_SAI) ifeq ($(ENABLE_SYNCD_RPC),y) -$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV) +$(SYNCD)_DEPENDS := $(filter-out $(LIBTHRIFT_DEV),$($(SYNCD)_DEPENDS)) +$(SYNCD)_DEPENDS += $(LIBSAITHRIFT_DEV) $(LIBTHRIFT_0_14_1_DEV) endif # Runtime dependency on sai is set only for syncd diff --git a/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch b/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch new file mode 100644 index 00000000000..762c72c7560 --- /dev/null +++ b/platform/barefoot/saithrift-patches/0001-Replace-unions-with-structs-in-thrift.patch @@ -0,0 +1,70 @@ +From 6f0188ad82845ac56729d3db621b2d10bea94ddd Mon Sep 17 00:00:00 2001 +From: Myron Sosyak +Date: Thu, 27 Jan 2022 17:25:42 +0000 +Subject: [PATCH 1/4] Replace unions with structs in thrift + +--- + test/saithrift/src/switch_sai.thrift | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/test/saithrift/src/switch_sai.thrift b/test/saithrift/src/switch_sai.thrift +index a9e1d28..0c24b71 100644 +--- a/test/saithrift/src/switch_sai.thrift ++++ b/test/saithrift/src/switch_sai.thrift +@@ -48,7 +48,7 @@ struct sai_thrift_vlan_port_t { + 2: sai_thrift_vlan_tagging_mode_t tagging_mode; + } + +-union sai_thrift_ip_t { ++struct sai_thrift_ip_t { + 1: sai_thrift_ip4_t ip4; + 2: sai_thrift_ip6_t ip6; + } +@@ -79,7 +79,7 @@ struct sai_thrift_s32_list_t { + 2: list s32list; + } + +-union sai_thrift_acl_mask_t { ++struct sai_thrift_acl_mask_t { + 1: byte u8; + 2: byte s8; + 3: i16 u16; +@@ -91,7 +91,7 @@ union sai_thrift_acl_mask_t { + 9: sai_thrift_ip6_t ip6; + } + +-union sai_thrift_acl_data_t { ++struct sai_thrift_acl_data_t { + 1: byte u8; + 2: byte s8; + 3: i16 u16; +@@ -112,7 +112,7 @@ struct sai_thrift_acl_field_data_t + 3: sai_thrift_acl_data_t data; + } + +-union sai_thrift_acl_parameter_t { ++struct sai_thrift_acl_parameter_t { + 1: byte u8; + 2: byte s8; + 3: i16 u16; +@@ -161,7 +161,7 @@ struct sai_thrift_fdb_values_t { + 2: sai_thrift_fdb_entry_t thrift_fdb_entry; + } + +-union sai_thrift_attribute_value_t { ++struct sai_thrift_attribute_value_t { + 1: bool booldata; + 2: string chardata; + 3: byte u8; +@@ -207,7 +207,7 @@ struct sai_thrift_attribute_list_t { + 2: i32 attr_count; // redundant + } + +-union sai_thrift_result_data_t { ++struct sai_thrift_result_data_t { + 1: sai_thrift_object_list_t objlist; + 2: sai_thrift_object_id_t oid; + 3: i16 u16; +-- +2.20.1 + diff --git a/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch b/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch new file mode 100644 index 00000000000..93602dc4e99 --- /dev/null +++ b/platform/barefoot/saithrift-patches/0002-Use-std-shared_ptr-instead-of-boost.patch @@ -0,0 +1,25 @@ +From 6605dbe4906173b78f428f42f749674c2722361a Mon Sep 17 00:00:00 2001 +From: Myron Sosyak +Date: Thu, 27 Jan 2022 17:26:08 +0000 +Subject: [PATCH 2/4] Use std::shared_ptr instead of boost + +--- + test/saithrift/src/switch_sai_rpc_server.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/saithrift/src/switch_sai_rpc_server.cpp b/test/saithrift/src/switch_sai_rpc_server.cpp +index 0df9b3d..e990c50 100644 +--- a/test/saithrift/src/switch_sai_rpc_server.cpp ++++ b/test/saithrift/src/switch_sai_rpc_server.cpp +@@ -74,7 +74,7 @@ using namespace ::apache::thrift::protocol; + using namespace ::apache::thrift::transport; + using namespace ::apache::thrift::server; + +-using boost::shared_ptr; ++using std::shared_ptr; + + using namespace ::switch_sai; + +-- +2.20.1 + diff --git a/platform/barefoot/saithrift-patches/0003-include-algorithm.patch b/platform/barefoot/saithrift-patches/0003-include-algorithm.patch new file mode 100644 index 00000000000..22471adc380 --- /dev/null +++ b/platform/barefoot/saithrift-patches/0003-include-algorithm.patch @@ -0,0 +1,24 @@ +From b468a7aa00843be9c5ead478bd074784c04b4ba2 Mon Sep 17 00:00:00 2001 +From: Myron Sosyak +Date: Thu, 27 Jan 2022 17:26:40 +0000 +Subject: [PATCH 3/4] include algorithm + +--- + test/saithrift/src/saiserver.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/saithrift/src/saiserver.cpp b/test/saithrift/src/saiserver.cpp +index 846c3f1..7120b26 100644 +--- a/test/saithrift/src/saiserver.cpp ++++ b/test/saithrift/src/saiserver.cpp +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + #include + #include + #include +-- +2.20.1 + diff --git a/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch b/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch new file mode 100644 index 00000000000..19e619aa5be --- /dev/null +++ b/platform/barefoot/saithrift-patches/0004-Fix-Thrift-0.14.1-compatibility.patch @@ -0,0 +1,47 @@ +From 58d5e21378d3fd5dd3a48adb24423c1bb9ff6f7a Mon Sep 17 00:00:00 2001 +From: Myron Sosyak +Date: Thu, 27 Jan 2022 17:28:05 +0000 +Subject: [PATCH 4/4] Fix Thrift 0.14.1 compatibility + +--- + test/saithrift/Makefile | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/test/saithrift/Makefile b/test/saithrift/Makefile +index cbe6f48..3734ee7 100644 +--- a/test/saithrift/Makefile ++++ b/test/saithrift/Makefile +@@ -21,8 +21,8 @@ CDEFS = -DBRCMSAI + endif + endif + endif +-DEPS = switch_sai_constants.h switch_sai_rpc.h switch_sai_types.h +-OBJS = switch_sai_constants.o switch_sai_rpc.o switch_sai_types.o ++DEPS = switch_sai_rpc.h switch_sai_types.h ++OBJS = switch_sai_rpc.o switch_sai_types.o + + ODIR = ./src/obj + SAIDIR = ./include +@@ -42,8 +42,6 @@ endif + SAI_LIBRARY_DIR ?= $(SAI_PREFIX)/lib + LDFLAGS = -L$(SAI_LIBRARY_DIR) -Wl,-rpath=$(SAI_LIBRARY_DIR) + CPP_SOURCES = \ +- src/gen-cpp/switch_sai_constants.cpp \ +- src/gen-cpp/switch_sai_constants.h \ + src/gen-cpp/switch_sai_rpc.cpp \ + src/gen-cpp/switch_sai_rpc.h \ + src/gen-cpp/switch_sai_types.cpp \ +@@ -89,8 +87,8 @@ $(ODIR)/switch_sai_rpc_server.o: src/switch_sai_rpc_server.cpp + $(ODIR)/saiserver.o: src/saiserver.cpp + $(CXX) $(CFLAGS) -c $^ -o $@ $(CFLAGS) $(CDEFS) -I$(SRC)/gen-cpp -I$(SRC) + +-$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o +- ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_constants.o $(ODIR)/switch_sai_rpc_server.o ++$(ODIR)/librpcserver.a: $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o ++ ar rcs $(ODIR)/librpcserver.a $(ODIR)/switch_sai_rpc.o $(ODIR)/switch_sai_types.o $(ODIR)/switch_sai_rpc_server.o + + saiserver: $(ODIR)/saiserver.o $(ODIR)/librpcserver.a + $(CXX) $(LDFLAGS) $(ODIR)/switch_sai_rpc_server.o $(ODIR)/saiserver.o -o $@ \ +-- +2.20.1 + diff --git a/platform/barefoot/saithrift-patches/Makefile b/platform/barefoot/saithrift-patches/Makefile new file mode 100644 index 00000000000..625317dcb5f --- /dev/null +++ b/platform/barefoot/saithrift-patches/Makefile @@ -0,0 +1,19 @@ +SHELL = /bin/bash +.ONESHELL: +.SHELLFLAGS += -e + +MAIN_TARGET = saithrift-patches + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : +# To add some BFN specific patches to SAI under sonic-sairedis while sai is not updated +SRC_DIR = ../saithrift-patches +DST_DIR = ../../../src/sonic-sairedis/SAI.patch/ + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # copy patches to SAI + mkdir -p $(DST_DIR) + cp -f $(SRC_DIR)/* $(DST_DIR) + + touch $(DEST)/saithrift-patches + + diff --git a/platform/barefoot/saithrift-patches/series b/platform/barefoot/saithrift-patches/series new file mode 100644 index 00000000000..fe26c2102c2 --- /dev/null +++ b/platform/barefoot/saithrift-patches/series @@ -0,0 +1,4 @@ +0001-Replace-unions-with-structs-in-thrift.patch +0002-Use-std-shared_ptr-instead-of-boost.patch +0003-include-algorithm.patch +0004-Fix-Thrift-0.14.1-compatibility.patch diff --git a/slave.mk b/slave.mk index 04a2675f83a..1b879350b73 100644 --- a/slave.mk +++ b/slave.mk @@ -521,6 +521,7 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) # SONIC_DPKG_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ $$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \ + $$(addprefix $(FILES_PATH)/,$$($$*_AFTER_FILES)) \ $(call dpkg_depend,$(DEBS_PATH)/%.dep ) $(HEADER) From 2210c82ef8657225c3929b9a3841c8dfeb285d6e Mon Sep 17 00:00:00 2001 From: "Richard.Yu" Date: Fri, 18 Feb 2022 17:48:50 +0800 Subject: [PATCH 045/139] [PTF-SAIv2]Add ptf docker for sai-ptf (saiv2) (#9729) * [PTF-SAIv2]Add ptf dockre for sai-ptf (saiv2) Base on current ptf docker create a new docker for sai-ptf(saiv2) upgrade related package use the latest ptf and install it test done: NOJESSIE=1 NOSTRETCH=1 NOBULLSEYE=1 ENABLE_SYNCD_RPC=y make target/docker-ptf-sai.gz BLDENV=buster make -f Makefile.work target/docker-ptf-sai.gz * upgrade the thrift to 014 --- dockers/docker-ptf-sai/Dockerfile.j2 | 40 ++++++++++++++++++++++++++++ platform/vs/docker-ptf-sai.dep | 8 ++++++ platform/vs/docker-ptf-sai.mk | 9 +++++++ platform/vs/rules.dep | 1 + platform/vs/rules.mk | 1 + 5 files changed, 59 insertions(+) create mode 100644 dockers/docker-ptf-sai/Dockerfile.j2 create mode 100644 platform/vs/docker-ptf-sai.dep create mode 100644 platform/vs/docker-ptf-sai.mk diff --git a/dockers/docker-ptf-sai/Dockerfile.j2 b/dockers/docker-ptf-sai/Dockerfile.j2 new file mode 100644 index 00000000000..f42d04c1cd0 --- /dev/null +++ b/dockers/docker-ptf-sai/Dockerfile.j2 @@ -0,0 +1,40 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-ptf + +# Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +# Set the apt source, update package cache and install necessary packages +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get dist-upgrade -y \ + && apt-get install -y \ + python3-pip + +RUN pip3 install crc16 \ + netifaces \ + getmac \ + packet_helper \ + psutil \ + scapy==2.4.4 \ + scapy_helper \ + pysubnettree + +COPY \ +{% for deb in docker_ptf_sai_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_ptf_sai_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +# Remove old ptf package +RUN dpkg -r python-ptf + +# Install new ptf package +RUN git clone https://github.com/p4lang/ptf.git \ + && cd ptf \ + && python3.7 setup.py install --single-version-externally-managed --record /tmp/ptf_install.txt diff --git a/platform/vs/docker-ptf-sai.dep b/platform/vs/docker-ptf-sai.dep new file mode 100644 index 00000000000..697dc3b3cdc --- /dev/null +++ b/platform/vs/docker-ptf-sai.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_PTF_SAI)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-ptf-sai.mk platform/vs/docker-ptf-sai.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_PTF_SAI)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_PTF_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_PTF_SAI)_DEP_FILES := $(DEP_FILES) diff --git a/platform/vs/docker-ptf-sai.mk b/platform/vs/docker-ptf-sai.mk new file mode 100644 index 00000000000..d3463c5a093 --- /dev/null +++ b/platform/vs/docker-ptf-sai.mk @@ -0,0 +1,9 @@ +# docker image for docker-ptf-sai + +DOCKER_PTF_SAI = docker-ptf-sai.gz +DOCKER_PTF_BASE = docker-ptf.gz +$(DOCKER_PTF_SAI)_PATH = $(DOCKERS_PATH)/docker-ptf-sai +$(DOCKER_PTF_SAI)_DEPENDS += $(LIBTHRIFT_2) $(PYTHON3_THRIFT_2) +$(DOCKER_PTF_SAI)_LOAD_DOCKERS += $(DOCKER_PTF_BASE) +SONIC_DOCKER_IMAGES += $(DOCKER_PTF_SAI) +SONIC_BUSTER_DOCKERS += $(DOCKER_PTF_SAI) diff --git a/platform/vs/rules.dep b/platform/vs/rules.dep index 0d485e8004d..44c86361299 100644 --- a/platform/vs/rules.dep +++ b/platform/vs/rules.dep @@ -4,6 +4,7 @@ include $(PLATFORM_PATH)/docker-sonic-vs.dep include $(PLATFORM_PATH)/docker-syncd-vs.dep include $(PLATFORM_PATH)/docker-gbsyncd-vs.dep include $(PLATFORM_PATH)/docker-ptf.dep +include $(PLATFORM_PATH)/docker-ptf-sai.dep include $(PLATFORM_PATH)/libsaithrift-dev.dep include $(PLATFORM_PATH)/one-image.dep include $(PLATFORM_PATH)/onie.dep diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index cbb52847edf..461c3f84dd0 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -4,6 +4,7 @@ include $(PLATFORM_PATH)/docker-sonic-vs.mk include $(PLATFORM_PATH)/docker-syncd-vs.mk include $(PLATFORM_PATH)/docker-gbsyncd-vs.mk include $(PLATFORM_PATH)/docker-ptf.mk +include $(PLATFORM_PATH)/docker-ptf-sai.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/onie.mk From d2f6fe746337a8c4d662b82160744cef0b690d0b Mon Sep 17 00:00:00 2001 From: alvinkaiwei <92364092+alvinkaiwei@users.noreply.github.com> Date: Fri, 18 Feb 2022 17:51:14 +0800 Subject: [PATCH 046/139] Add support for Accton wedge100bf_32qs platform to SONiC master (#9257) * Add support for Accton wedge100bf_32qs platform This pull request is based on wedge100bf_32x. The components on the mainboard are the same as wedge100bf_32x, except for tofino 32Q and COMe models, so it refers to wedge100bf_32x to create new model: wedge100bf_32qs. Signed-off-by: alvin_feng * Fix lgtm alerts issues Signed-off-by: alvin_feng * Modify some file permissions and use symlink to link wedge100bf-32qs/sonic_platform Signed-off-by: alvin_feng * Remove switch-sai.conf file Signed-off-by: alvin_feng * Modify platform.json to avoid platform TCs issues and changes for correct generating BUFFER_QUEUE values in DB. Signed-off-by: alvin_feng * Fix error name in platform.json --- .../default_sku | 1 + .../installer.conf | 1 + .../montara/buffers.json.j2 | 2 + .../montara/buffers_defaults_t0.j2 | 79 +++ .../montara/buffers_defaults_t1.j2 | 79 +++ .../montara/hwsku.json | 164 ++++++ .../montara/pg_profile_lookup.ini | 17 + .../montara/port_config.ini | 33 ++ .../montara/qos.json.j2 | 10 + .../montara/sai.profile | 3 + .../montara/switch-tna-sai.conf | 40 ++ .../pcie.yaml | 412 +++++++++++++++ .../platform.json | 499 ++++++++++++++++++ .../platform_asic | 1 + .../platform_components.json | 8 + .../pmon_daemon_control.json | 9 + platform/barefoot/one-image.mk | 1 + platform/barefoot/platform-modules-accton.mk | 11 + platform/barefoot/rules.mk | 1 + .../debian/changelog | 11 + .../debian/compat | 1 + .../debian/control | 12 + .../debian/rules | 110 ++++ ...ic-platform-accton-wedge100bf-32qs.install | 2 + .../wedge100bf-32qs/LICENSE | 15 + .../wedge100bf-32qs/MAINTAINERS | 3 + .../wedge100bf-32qs/README.md | 2 + .../wedge100bf-32qs/classes/__init__.py | 0 .../wedge100bf-32qs/conf/usb0 | 5 + .../wedge100bf-32qs/modules/Makefile | 0 .../wedge100bf-32qs/setup.py | 14 + .../wedge100bf-32qs/sonic_platform | 1 + .../wedge100bf-32qs/sonic_platform_setup.py | 32 ++ .../wedge100bf-32qs/utils/bf-fancontrol | 3 + .../wedge100bf-32qs/utils/sensors | 11 + 35 files changed, 1593 insertions(+) create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/default_sku create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/installer.conf create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers.json.j2 create mode 100755 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t0.j2 create mode 100755 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t1.j2 create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/hwsku.json create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/pg_profile_lookup.ini create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/port_config.ini create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/qos.json.j2 create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/sai.profile create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/pcie.yaml create mode 100755 device/accton/x86_64-accton_wedge100bf_32qs-r0/platform.json create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_asic create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_components.json create mode 100644 device/accton/x86_64-accton_wedge100bf_32qs-r0/pmon_daemon_control.json create mode 100644 platform/barefoot/platform-modules-accton.mk create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/changelog create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/compat create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/control create mode 100755 platform/barefoot/sonic-platform-modules-accton/debian/rules create mode 100644 platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py create mode 120000 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform create mode 100644 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol create mode 100755 platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/default_sku b/device/accton/x86_64-accton_wedge100bf_32qs-r0/default_sku new file mode 100644 index 00000000000..e2f0630cc57 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/default_sku @@ -0,0 +1 @@ +montara t1 diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/installer.conf b/device/accton/x86_64-accton_wedge100bf_32qs-r0/installer.conf new file mode 100644 index 00000000000..3714ff053bb --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/installer.conf @@ -0,0 +1 @@ +CONSOLE_SPEED=57600 diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers.json.j2 b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers.json.j2 new file mode 100644 index 00000000000..1083a6210fc --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t0.j2 b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t0.j2 new file mode 100755 index 00000000000..31fb9fa9ad7 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t0.j2 @@ -0,0 +1,79 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '4194304' %} +{% set ingress_lossy_pool_size = '7340032' %} +{% set egress_lossless_pool_size = '16777152' %} +{% set egress_lossy_pool_size = '7340032' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"4096", + "dynamic_th":"0" + }, + "ingress_lossy_profile": { + "pool":"ingress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"4096", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|0-1": { + "profile" : "q_lossy_profile" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +{%- endmacro %} \ No newline at end of file diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t1.j2 b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t1.j2 new file mode 100755 index 00000000000..0d4224f7f3b --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/buffers_defaults_t1.j2 @@ -0,0 +1,79 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '2097152' %} +{% set ingress_lossy_pool_size = '5242880' %} +{% set egress_lossless_pool_size = '16777152' %} +{% set egress_lossy_pool_size = '5242880' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "{{ ingress_lossy_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"ingress_lossless_pool", + "size":"4096", + "dynamic_th":"0" + }, + "ingress_lossy_profile": { + "pool":"ingress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"egress_lossless_pool", + "size":"4096", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + }, + "q_lossy_profile": { + "pool":"egress_lossy_pool", + "size":"4096", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|0-1": { + "profile" : "q_lossy_profile" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "egress_lossless_profile" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +{%- endmacro %} \ No newline at end of file diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/hwsku.json b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/hwsku.json new file mode 100644 index 00000000000..203aa5a3404 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/hwsku.json @@ -0,0 +1,164 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "off", + "fec": "rs" + } + } +} diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/pg_profile_lookup.ini b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/pg_profile_lookup.ini new file mode 100644 index 00000000000..b66b129fe43 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 34816 18432 16384 0 + 25000 5m 34816 18432 16384 0 + 40000 5m 34816 18432 16384 0 + 50000 5m 34816 18432 16384 0 + 100000 5m 36864 18432 18432 0 + 10000 40m 36864 18432 18432 0 + 25000 40m 39936 18432 21504 0 + 40000 40m 41984 18432 23552 0 + 50000 40m 41984 18432 23552 0 + 100000 40m 54272 18432 35840 0 + 10000 300m 49152 18432 30720 0 + 25000 300m 71680 18432 53248 0 + 40000 300m 94208 18432 75776 0 + 50000 300m 94208 18432 75776 0 + 100000 300m 184320 18432 165888 0 diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/port_config.ini b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/port_config.ini new file mode 100644 index 00000000000..4035147f583 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias index speed autoneg fec +Ethernet0 0,1,2,3 Ethernet0 1 100000 off rs +Ethernet4 4,5,6,7 Ethernet4 2 100000 off rs +Ethernet8 8,9,10,11 Ethernet8 3 100000 off rs +Ethernet12 12,13,14,15 Ethernet12 4 100000 off rs +Ethernet16 16,17,18,19 Ethernet16 5 100000 off rs +Ethernet20 20,21,22,23 Ethernet20 6 100000 off rs +Ethernet24 24,25,26,27 Ethernet24 7 100000 off rs +Ethernet28 28,29,30,31 Ethernet28 8 100000 off rs +Ethernet32 32,33,34,35 Ethernet32 9 100000 off rs +Ethernet36 36,37,38,39 Ethernet36 10 100000 off rs +Ethernet40 40,41,42,43 Ethernet40 11 100000 off rs +Ethernet44 44,45,46,47 Ethernet44 12 100000 off rs +Ethernet48 48,49,50,51 Ethernet48 13 100000 off rs +Ethernet52 52,53,54,55 Ethernet52 14 100000 off rs +Ethernet56 56,57,58,59 Ethernet56 15 100000 off rs +Ethernet60 60,61,62,63 Ethernet60 16 100000 off rs +Ethernet64 64,65,66,67 Ethernet64 17 100000 off rs +Ethernet68 68,69,70,71 Ethernet68 18 100000 off rs +Ethernet72 72,73,74,75 Ethernet72 19 100000 off rs +Ethernet76 76,77,78,79 Ethernet76 20 100000 off rs +Ethernet80 80,81,82,83 Ethernet80 21 100000 off rs +Ethernet84 84,85,86,87 Ethernet84 22 100000 off rs +Ethernet88 88,89,90,91 Ethernet88 23 100000 off rs +Ethernet92 92,93,94,95 Ethernet92 24 100000 off rs +Ethernet96 96,97,98,99 Ethernet96 25 100000 off rs +Ethernet100 100,101,102,103 Ethernet100 26 100000 off rs +Ethernet104 104,105,106,107 Ethernet104 27 100000 off rs +Ethernet108 108,109,110,111 Ethernet108 28 100000 off rs +Ethernet112 112,113,114,115 Ethernet112 29 100000 off rs +Ethernet116 116,117,118,119 Ethernet116 30 100000 off rs +Ethernet120 120,121,122,123 Ethernet120 31 100000 off rs +Ethernet124 124,125,126,127 Ethernet124 32 100000 off rs diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/qos.json.j2 b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/qos.json.j2 new file mode 100644 index 00000000000..a685277448f --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/qos.json.j2 @@ -0,0 +1,10 @@ +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/sai.profile b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/sai.profile new file mode 100644 index 00000000000..037b5c13537 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/sai.profile @@ -0,0 +1,3 @@ +SAI_KEY_WARM_BOOT_WRITE_FILE=/var/warmboot/sai-warmboot.bin +SAI_KEY_WARM_BOOT_READ_FILE=/var/warmboot/sai-warmboot.bin + diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf new file mode 100644 index 00000000000..4a4d41f3806 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf @@ -0,0 +1,40 @@ +{ + "instance": 0, + "chip_list": [ + { + "id": "asic-0", + "chip_family": "Tofino", + "instance": 0, + "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", + "pcie_domain": 0, + "pcie_bus": 5, + "pcie_fn": 0, + "pcie_dev": 0, + "pcie_int_mode": 1, + "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + } + ], + "p4_devices": [ + { + "device-id": 0, + "agent0": "lib/platform/x86_64-accton_wedge100bf_32qs-r0/libpltfm_mgr.so", + "p4_programs": [ + { + "p4_pipelines": [ + { + "p4_pipeline_name": "pipe", + "config": "share/switch/pipe/tofino.bin", + "context": "share/switch/pipe/context.json" + } + ], + "program-name": "switch", + "sai": "lib/libsai.so", + "bfrt-config": "share/switch/bf-rt.json", + "model_json_path" : "share/switch/aug_model.json", + "switchapi_port_add": false, + "non_default_port_ppgs": 5 + } + ] + } + ] +} diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/pcie.yaml b/device/accton/x86_64-accton_wedge100bf_32qs-r0/pcie.yaml new file mode 100644 index 00000000000..ab38096c974 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/pcie.yaml @@ -0,0 +1,412 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '00' + dev: 1f + fn: '6' + id: 8c24 + name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal + Management Controller (rev 05)' +- bus: '02' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 10a6 + name: 'Unassigned class [ff00]: Intel Corporation 82599EB 10-Gigabit Dummy Function' +- bus: '05' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform.json b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform.json new file mode 100755 index 00000000000..9f5658141f7 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform.json @@ -0,0 +1,499 @@ +{ + "chassis": { + "name": "Wedge100BF-32QS-O-AC-F-BF", + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + } + ], + "fan_drawers": [ + { + "name": "fantray-1", + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + } + ] + } + ], + "psus": [ + { + "name": "psu-1" + }, + { + "name": "psu-2" + } + ], + "thermals": [ + { + "name": "com_e_driver-i2c-4-33:memory-temp" + }, + { + "name": "com_e_driver-i2c-4-33:cpu-temp" + }, + { + "name": "pfe1100-i2c-7-59:temp1" + }, + { + "name": "pfe1100-i2c-7-59:temp2" + }, + { + "name": "pfe1100-i2c-7-5a:temp1" + }, + { + "name": "pfe1100-i2c-7-5a:temp2" + }, + { + "name": "tmp75-i2c-3-48:outlet-middle-temp" + }, + { + "name": "tmp75-i2c-3-49:inlet-middle-temp" + }, + { + "name": "tmp75-i2c-3-4a:inlet-left-temp" + }, + { + "name": "tmp75-i2c-3-4b:switch-temp" + }, + { + "name": "tmp75-i2c-3-4c:inlet-right-temp" + }, + { + "name": "tmp75-i2c-8-48:outlet-right-temp" + }, + { + "name": "tmp75-i2c-8-49:outlet-left-temp" + }, + { + "name": "coretemp-isa-0000:package-id-0" + }, + { + "name": "coretemp-isa-0000:core-0" + }, + { + "name": "coretemp-isa-0000:core-1" + }, + { + "name": "coretemp-isa-0000:core-2" + }, + { + "name": "coretemp-isa-0000:core-3" + }, + { + "name": "pch_haswell-virtual-0:temp1" + } + ], + "sfps": [ + { + "name": "sfp1" + }, + { + "name": "sfp2" + }, + { + "name": "sfp3" + }, + { + "name": "sfp4" + }, + { + "name": "sfp5" + }, + { + "name": "sfp6" + }, + { + "name": "sfp7" + }, + { + "name": "sfp8" + }, + { + "name": "sfp9" + }, + { + "name": "sfp10" + }, + { + "name": "sfp11" + }, + { + "name": "sfp12" + }, + { + "name": "sfp13" + }, + { + "name": "sfp14" + }, + { + "name": "sfp15" + }, + { + "name": "sfp16" + }, + { + "name": "sfp17" + }, + { + "name": "sfp18" + }, + { + "name": "sfp19" + }, + { + "name": "sfp20" + }, + { + "name": "sfp21" + }, + { + "name": "sfp22" + }, + { + "name": "sfp23" + }, + { + "name": "sfp24" + }, + { + "name": "sfp25" + }, + { + "name": "sfp26" + }, + { + "name": "sfp27" + }, + { + "name": "sfp28" + }, + { + "name": "sfp29" + }, + { + "name": "sfp30" + }, + { + "name": "sfp31" + }, + { + "name": "sfp32" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1", + "lanes": "0,1,2,3", + "breakout_modes": { + "1x100G[40G]": ["Ethernet0"], + "2x50G": ["Ethernet0", "Ethernet2"], + "4x25G[10G]": ["Ethernet0", "Ethernet1", "Ethernet2", "Ethernet3"] + } + }, + "Ethernet4": { + "index": "2,2,2,2", + "lanes": "4,5,6,7", + "breakout_modes": { + "1x100G[40G]": ["Ethernet4"], + "2x50G": ["Ethernet4", "Ethernet6"], + "4x25G[10G]": ["Ethernet4", "Ethernet5", "Ethernet6", "Ethernet7"] + } + }, + "Ethernet8": { + "index": "3,3,3,3", + "lanes": "8,9,10,11", + "breakout_modes": { + "1x100G[40G]": ["Ethernet8"], + "2x50G": ["Ethernet8", "Ethernet10"], + "4x25G[10G]": ["Ethernet8", "Ethernet9", "Ethernet10", "Ethernet11"] + } + }, + "Ethernet12": { + "index": "4,4,4,4", + "lanes": "12,13,14,15", + "breakout_modes": { + "1x100G[40G]": ["Ethernet12"], + "2x50G": ["Ethernet12", "Ethernet14"], + "4x25G[10G]": ["Ethernet12", "Ethernet13", "Ethernet14", "Ethernet15"] + } + }, + "Ethernet16": { + "index": "5,5,5,5", + "lanes": "16,17,18,19", + "breakout_modes": { + "1x100G[40G]": ["Ethernet16"], + "2x50G": ["Ethernet16", "Ethernet18"], + "4x25G[10G]": ["Ethernet16", "Ethernet17", "Ethernet18", "Ethernet19"] + } + }, + "Ethernet20": { + "index": "6,6,6,6", + "lanes": "20,21,22,23", + "breakout_modes": { + "1x100G[40G]": ["Ethernet20"], + "2x50G": ["Ethernet20", "Ethernet22"], + "4x25G[10G]": ["Ethernet20", "Ethernet21", "Ethernet22", "Ethernet23"] + } + }, + "Ethernet24": { + "index": "7,7,7,7", + "lanes": "24,25,26,27", + "breakout_modes": { + "1x100G[40G]": ["Ethernet24"], + "2x50G": ["Ethernet24", "Ethernet26"], + "4x25G[10G]": ["Ethernet24", "Ethernet25", "Ethernet26", "Ethernet27"] + } + }, + "Ethernet28": { + "index": "8,8,8,8", + "lanes": "28,29,30,31", + "breakout_modes": { + "1x100G[40G]": ["Ethernet28"], + "2x50G": ["Ethernet28", "Ethernet30"], + "4x25G[10G]": ["Ethernet28", "Ethernet29", "Ethernet30", "Ethernet31"] + } + }, + "Ethernet32": { + "index": "9,9,9,9", + "lanes": "32,33,34,35", + "breakout_modes": { + "1x100G[40G]": ["Ethernet32"], + "2x50G": ["Ethernet32", "Ethernet34"], + "4x25G[10G]": ["Ethernet32", "Ethernet33", "Ethernet34", "Ethernet35"] + } + }, + "Ethernet36": { + "index": "10,10,10,10", + "lanes": "36,37,38,39", + "breakout_modes": { + "1x100G[40G]": ["Ethernet36"], + "2x50G": ["Ethernet36", "Ethernet38"], + "4x25G[10G]": ["Ethernet36", "Ethernet37", "Ethernet38", "Ethernet39"] + } + }, + "Ethernet40": { + "index": "11,11,11,11", + "lanes": "40,41,42,43", + "breakout_modes": { + "1x100G[40G]": ["Ethernet40"], + "2x50G": ["Ethernet40", "Ethernet42"], + "4x25G[10G]": ["Ethernet40", "Ethernet41", "Ethernet42", "Ethernet43"] + } + }, + "Ethernet44": { + "index": "12,12,12,12", + "lanes": "44,45,46,47", + "breakout_modes": { + "1x100G[40G]": ["Ethernet44"], + "2x50G": ["Ethernet44", "Ethernet46"], + "4x25G[10G]": ["Ethernet44", "Ethernet45", "Ethernet46", "Ethernet47"] + } + }, + "Ethernet48": { + "index": "13,13,13,13", + "lanes": "48,49,50,51", + "breakout_modes": { + "1x100G[40G]": ["Ethernet48"], + "2x50G": ["Ethernet48", "Ethernet50"], + "4x25G[10G]": ["Ethernet48", "Ethernet49", "Ethernet50", "Ethernet51"] + } + }, + "Ethernet52": { + "index": "14,14,14,14", + "lanes": "52,53,54,55", + "breakout_modes": { + "1x100G[40G]": ["Ethernet52"], + "2x50G": ["Ethernet52", "Ethernet54"], + "4x25G[10G]": ["Ethernet52", "Ethernet53", "Ethernet54", "Ethernet55"] + } + }, + "Ethernet56": { + "index": "15,15,15,15", + "lanes": "56,57,58,59", + "breakout_modes": { + "1x100G[40G]": ["Ethernet56"], + "2x50G": ["Ethernet56", "Ethernet58"], + "4x25G[10G]": ["Ethernet56", "Ethernet57", "Ethernet58", "Ethernet59"] + } + }, + "Ethernet60": { + "index": "16,16,16,16", + "lanes": "60,61,62,63", + "breakout_modes": { + "1x100G[40G]": ["Ethernet60"], + "2x50G": ["Ethernet60", "Ethernet62"], + "4x25G[10G]": ["Ethernet60", "Ethernet61", "Ethernet62", "Ethernet63"] + } + }, + "Ethernet64": { + "index": "17,17,17,17", + "lanes": "64,65,66,67", + "breakout_modes": { + "1x100G[40G]": ["Ethernet64"], + "2x50G": ["Ethernet64", "Ethernet66"], + "4x25G[10G]": ["Ethernet64", "Ethernet65", "Ethernet66", "Ethernet67"] + } + }, + "Ethernet68": { + "index": "18,18,18,18", + "lanes": "68,69,70,71", + "breakout_modes": { + "1x100G[40G]": ["Ethernet68"], + "2x50G": ["Ethernet68", "Ethernet70"], + "4x25G[10G]": ["Ethernet68", "Ethernet69", "Ethernet70", "Ethernet71"] + } + }, + "Ethernet72": { + "index": "19,19,19,19", + "lanes": "72,73,74,75", + "breakout_modes": { + "1x100G[40G]": ["Ethernet72"], + "2x50G": ["Ethernet72", "Ethernet74"], + "4x25G[10G]": ["Ethernet72", "Ethernet73", "Ethernet74", "Ethernet75"] + } + }, + "Ethernet76": { + "index": "20,20,20,20", + "lanes": "76,77,78,79", + "breakout_modes": { + "1x100G[40G]": ["Ethernet76"], + "2x50G": ["Ethernet76", "Ethernet78"], + "4x25G[10G]": ["Ethernet76", "Ethernet77", "Ethernet78", "Ethernet79"] + } + }, + "Ethernet80": { + "index": "21,21,21,21", + "lanes": "80,81,82,83", + "breakout_modes": { + "1x100G[40G]": ["Ethernet80"], + "2x50G": ["Ethernet80", "Ethernet82"], + "4x25G[10G]": ["Ethernet80", "Ethernet81", "Ethernet82", "Ethernet83"] + } + }, + "Ethernet84": { + "index": "22,22,22,22", + "lanes": "84,85,86,87", + "breakout_modes": { + "1x100G[40G]": ["Ethernet84"], + "2x50G": ["Ethernet84", "Ethernet86"], + "4x25G[10G]": ["Ethernet84", "Ethernet85", "Ethernet86", "Ethernet87"] + } + }, + "Ethernet88": { + "index": "23,23,23,23", + "lanes": "88,89,90,91", + "breakout_modes": { + "1x100G[40G]": ["Ethernet88"], + "2x50G": ["Ethernet88", "Ethernet90"], + "4x25G[10G]": ["Ethernet88", "Ethernet89", "Ethernet90", "Ethernet91"] + } + }, + "Ethernet92": { + "index": "24,24,24,24", + "lanes": "92,93,94,95", + "breakout_modes": { + "1x100G[40G]": ["Ethernet92"], + "2x50G": ["Ethernet92", "Ethernet94"], + "4x25G[10G]": ["Ethernet92", "Ethernet93", "Ethernet94", "Ethernet95"] + } + }, + "Ethernet96": { + "index": "25,25,25,25", + "lanes": "96,97,98,99", + "breakout_modes": { + "1x100G[40G]": ["Ethernet96"], + "2x50G": ["Ethernet96", "Ethernet98"], + "4x25G[10G]": ["Ethernet96", "Ethernet97", "Ethernet98", "Ethernet99"] + } + }, + "Ethernet100": { + "index": "26,26,26,26", + "lanes": "100,101,102,103", + "breakout_modes": { + "1x100G[40G]": ["Ethernet100"], + "2x50G": ["Ethernet100", "Ethernet102"], + "4x25G[10G]": ["Ethernet100", "Ethernet101", "Ethernet102", "Ethernet103"] + } + }, + "Ethernet104": { + "index": "27,27,27,27", + "lanes": "104,105,106,107", + "breakout_modes": { + "1x100G[40G]": ["Ethernet104"], + "2x50G": ["Ethernet104", "Ethernet106"], + "4x25G[10G]": ["Ethernet104", "Ethernet105", "Ethernet106", "Ethernet107"] + } + }, + "Ethernet108": { + "index": "28,28,28,28", + "lanes": "108,109,110,111", + "breakout_modes": { + "1x100G[40G]": ["Ethernet108"], + "2x50G": ["Ethernet108", "Ethernet110"], + "4x25G[10G]": ["Ethernet108", "Ethernet109", "Ethernet110", "Ethernet111"] + } + }, + "Ethernet112": { + "index": "29,29,29,29", + "lanes": "112,113,114,115", + "breakout_modes": { + "1x100G[40G]": ["Ethernet112"], + "2x50G": ["Ethernet112", "Ethernet114"], + "4x25G[10G]": ["Ethernet112", "Ethernet113", "Ethernet112", "Ethernet113"] + } + }, + "Ethernet116": { + "index": "30,30,30,30", + "lanes": "116,117,118,119", + "breakout_modes": { + "1x100G[40G]": ["Ethernet116"], + "2x50G": ["Ethernet116", "Ethernet118"], + "4x25G[10G]": ["Ethernet116", "Ethernet117", "Ethernet118", "Ethernet119"] + } + }, + "Ethernet120": { + "index": "31,31,31,31", + "lanes": "120,121,122,123", + "breakout_modes": { + "1x100G[40G]": ["Ethernet120"], + "2x50G": ["Ethernet120", "Ethernet122"], + "4x25G[10G]": ["Ethernet120", "Ethernet121", "Ethernet122", "Ethernet123"] + } + }, + "Ethernet124": { + "index": "32,32,32,32", + "lanes": "124,125,126,127", + "breakout_modes": { + "1x100G[40G]": ["Ethernet124"], + "2x50G": ["Ethernet124", "Ethernet126"], + "4x25G[10G]": ["Ethernet124", "Ethernet125", "Ethernet126", "Ethernet127"] + } + } + } +} diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_asic b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_asic new file mode 100644 index 00000000000..88d88117928 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_asic @@ -0,0 +1 @@ +barefoot diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_components.json b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_components.json new file mode 100644 index 00000000000..086861cba55 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/platform_components.json @@ -0,0 +1,8 @@ +{ + "chassis": { + "Wedge100BF-32QS-O-AC-F": { + "component": { + } + } + } +} \ No newline at end of file diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_wedge100bf_32qs-r0/pmon_daemon_control.json new file mode 100644 index 00000000000..b58e59ba000 --- /dev/null +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/pmon_daemon_control.json @@ -0,0 +1,9 @@ +{ + "skip_pcied": false, + "skip_fancontrol": true, + "skip_thermalctld": false, + "skip_ledd": true, + "skip_xcvrd": false, + "skip_psud": false, + "skip_syseepromd": false +} diff --git a/platform/barefoot/one-image.mk b/platform/barefoot/one-image.mk index 8ed212c6f7a..a4565b47916 100644 --- a/platform/barefoot/one-image.mk +++ b/platform/barefoot/one-image.mk @@ -12,6 +12,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_NEWPORT_BF_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9180_32X_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9280_64X_PLATFORM_MODULE) +$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_QS_PLATFORM_MODULE) ifeq ($(INSTALL_DEBUG_TOOLS),y) $(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) $(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) diff --git a/platform/barefoot/platform-modules-accton.mk b/platform/barefoot/platform-modules-accton.mk new file mode 100644 index 00000000000..077c23d7bfd --- /dev/null +++ b/platform/barefoot/platform-modules-accton.mk @@ -0,0 +1,11 @@ +# BFN Platform modules + +BFN_MONTARA_QS_PLATFORM_MODULE_VERSION = 1.1 + +export BFN_MONTARA_QS_PLATFORM_MODULE_VERSION + +BFN_MONTARA_QS_PLATFORM_MODULE = sonic-platform-accton-wedge100bf-32qs_$(BFN_MONTARA_QS_PLATFORM_MODULE_VERSION)_amd64.deb +$(BFN_MONTARA_QS_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton +$(BFN_MONTARA_QS_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(BFN_MONTARA_QS_PLATFORM_MODULE)_PLATFORM = x86_64-accton_wedge100bf_32qs-r0 +SONIC_DPKG_DEBS += $(BFN_MONTARA_QS_PLATFORM_MODULE) diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index 416d8ac0110..8e717ba49ec 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -1,6 +1,7 @@ include $(PLATFORM_PATH)/platform-modules-arista.mk include $(PLATFORM_PATH)/platform-modules-bfn.mk include $(PLATFORM_PATH)/platform-modules-bfn-montara.mk +include $(PLATFORM_PATH)/platform-modules-accton.mk include $(PLATFORM_PATH)/platform-modules-bfn-newport.mk include $(PLATFORM_PATH)/platform-modules-wnc-osw1800.mk include $(PLATFORM_PATH)/platform-modules-ingrasys.mk diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/changelog b/platform/barefoot/sonic-platform-modules-accton/debian/changelog new file mode 100644 index 00000000000..8cbad8e1f55 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/changelog @@ -0,0 +1,11 @@ +sonic-accton-platform-modules (1.1) unstable; urgency=low + + * Remove bfn asic kernel modules from platform package + + -- Support Mon, 22 Oct 2018 15:40:00 -0800 + +sonic-accton-platform-modules (1.0) unstable; urgency=low + + * Initial release + + -- Support Mon, 11 Nov 2015 11:11:11 -0800 diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/compat b/platform/barefoot/sonic-platform-modules-accton/debian/compat new file mode 100644 index 00000000000..ec635144f60 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/control b/platform/barefoot/sonic-platform-modules-accton/debian/control new file mode 100644 index 00000000000..ba76bc7cfa3 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/control @@ -0,0 +1,12 @@ +Source: sonic-accton-platform-modules +Section: main +Priority: extra +Maintainer: Support +Build-Depends: debhelper (>= 9.0.0), bzip2 +Standards-Version: 3.9.3 + +Package: sonic-platform-accton-wedge100bf-32qs +Architecture: amd64 +Depends: linux-image-4.19.0-12-2-amd64-unsigned +Description: kernel modules for platform devices such as fan, led, sfp + diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/rules b/platform/barefoot/sonic-platform-modules-accton/debian/rules new file mode 100755 index 00000000000..35fdb0d5bdb --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/rules @@ -0,0 +1,110 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +include /usr/share/dpkg/pkg-info.mk + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +export INSTALL_MOD_DIR:=extra + +PYTHON ?= python2 +PYTHON3 ?= python3 + +PACKAGE_PRE_NAME := sonic-platform-accton +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIRS := wedge100bf-32qs +MODULE_DIR := modules +UTILS_DIR := utils +SERVICE_DIR := service +CONF_DIR := conf + +%: + dh $@ --with systemd,python2,python3 --buildsystem=pybuild + +clean: + dh_testdir + dh_testroot + dh_clean + +build: + #make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC) + (for mod in $(MODULE_DIRS); do \ + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ + $(PYTHON) $${mod}/setup.py build; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + if [ -f sonic_platform_setup.py ]; then \ + $(PYTHON3) sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ + echo "Finished makig whl package for $$mod"; \ + fi; \ + cd $(MOD_SRC_DIR); \ + done) + +binary: binary-arch binary-indep + # Nothing to do + +binary-arch: + # Nothing to do + +#install: build + #dh_testdir + #dh_testroot + #dh_clean -k + #dh_installdirs + +binary-indep: + dh_testdir + dh_installdirs + + # Custom package commands + (for mod in $(MODULE_DIRS); do \ + if [ -d $${mod}/$(MODULE_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ + fi; \ + if [ -d $${mod}/$(UTILS_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /usr/local/bin; \ + cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ + fi; \ + if [ -d $${mod}/$(SERVICE_DIR) ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /lib/systemd/system; \ + cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ + fi; \ + if [ -f $${mod}/setup.py ]; then \ + $(PYTHON) $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ + fi; \ + if [ -f $${mod}/sonic_platform_setup.py ]; then \ + cd $(MOD_SRC_DIR)/$${mod}; \ + $(PYTHON3) sonic_platform_setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ + echo "Insalled whl package for $$mod"; \ + cd $(MOD_SRC_DIR); \ + fi; \ + if [ $$mod = "wedge100bf-32qs" ]; then \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} etc/network/interfaces.d; \ + cp $(MOD_SRC_DIR)/$${mod}/$(CONF_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/etc/network/interfaces.d; \ + fi; \ + done) + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +.PHONY: build binary binary-arch binary-indep clean \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install b/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install new file mode 100644 index 00000000000..8a5e4a4bd64 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/debian/sonic-platform-accton-wedge100bf-32qs.install @@ -0,0 +1,2 @@ +wedge100bf-32qs/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_wedge100bf_32qs-r0 + diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE new file mode 100644 index 00000000000..676cdeec726 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/LICENSE @@ -0,0 +1,15 @@ +Copyright (C) 2016 Microsoft, Inc + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS new file mode 100644 index 00000000000..3e69704ff6d --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/MAINTAINERS @@ -0,0 +1,3 @@ +# This file describes the maintainers for wedge100bf-32qs +# See the SONiC project governance document for more information +Mailinglist = sonicproject@googlegroups.com diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md new file mode 100644 index 00000000000..17d59593fbf --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/README.md @@ -0,0 +1,2 @@ +# wedge100bf-32qs +Device drivers for support of BFN platform for the SONiC project diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/classes/__init__.py new file mode 100755 index 00000000000..e69de29bb2d diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 new file mode 100644 index 00000000000..f1dd054cc6f --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/conf/usb0 @@ -0,0 +1,5 @@ +# BMC interface +auto usb0 +allow-hotplug usb0 +iface usb0 inet6 +up ifconfig usb0 txqueuelen 64 diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/modules/Makefile new file mode 100644 index 00000000000..e69de29bb2d diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py new file mode 100755 index 00000000000..2c151a8a7bd --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/setup.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='wedge100bf-32qs', + version='1.0', + description='Module to initialize Accton wedge100bf-32qs platforms', + + packages=['wedge100bf-32qs'], + package_dir={'wedge100bf-32qs': 'wedge100bf-32qs/classes'}, +) diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform new file mode 120000 index 00000000000..7d33d95d18b --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform @@ -0,0 +1 @@ +../../sonic-platform-modules-bfn-montara/sonic_platform/ \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py new file mode 100644 index 00000000000..14e1bb6b6c0 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/sonic_platform_setup.py @@ -0,0 +1,32 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation', + license='Apache 2.0', + author='SONiC Team', + author_email='', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Barefoot', + maintainer_email='', + packages=[ + 'sonic_platform', + 'sonic_platform/pltfm_mgr_rpc', + 'sonic_platform/bfn_extensions', + ], + package_data = {'sonic_platform':['logging.conf']}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 2.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol new file mode 100755 index 00000000000..7407c2d7241 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/bf-fancontrol @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 -m sonic_platform.bfn_extensions.platform_fancontrol "$@" diff --git a/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors new file mode 100755 index 00000000000..5f06a9c99b0 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-accton/wedge100bf-32qs/utils/sensors @@ -0,0 +1,11 @@ +#!/bin/bash + +DOCKER_EXEC_FLAGS="i" + +# Determine whether stdout is on a terminal +if [ -t 1 ] ; then + DOCKER_EXEC_FLAGS+="t" +fi + +python3 -m sonic_platform.bfn_extensions.platform_sensors "$@" +docker exec -$DOCKER_EXEC_FLAGS pmon sensors "$@" From a7f613038338093964a1d5299eb3e4f4fcbd0f0b Mon Sep 17 00:00:00 2001 From: "thomas.cappleman@metaswitch.com" Date: Fri, 18 Feb 2022 21:24:04 +0000 Subject: [PATCH 047/139] [submodule] swss-common and py-swssdk updates (#9777) sonic-swss-common: [ci] Set diff coverage threshold to 50% (#567) Added NVGRE tunnel related tables (#549) Add option to suppress logging (#566) [TableBase] Make channel name from both table name and database ID (#568) Revert "[TableBase] Make channel name from both table name and database ID (#568)" (#574) sonic-py-swsssdk: Add option to suppress warnings when querying Redis (#115) --- src/sonic-py-swsssdk | 2 +- src/sonic-swss-common | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 2cd6236849d..7cd7e0c1580 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 2cd6236849d194625c014d1c2c370f6d2513eb76 +Subproject commit 7cd7e0c1580d15c341160c68b73fd7d948e9fd24 diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 405f1df3d49..14f068e8163 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 405f1df3d49f17f39b149668ae9383b38730d7a8 +Subproject commit 14f068e81630de186e631ff4f3e39d4f40d9abbb From f65a071410706ad2d4661a249ff09d16bfe4d827 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 19 Feb 2022 12:16:50 +0800 Subject: [PATCH 048/139] [Build]: Fix marvell sai package version parsing issue Fix marvell sai package version parsing issue (#10009) --- platform/marvell-armhf/sai.mk | 3 ++- platform/marvell-armhf/sai/Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/marvell-armhf/sai.mk b/platform/marvell-armhf/sai.mk index 1e6df16f87e..3672cc70dba 100644 --- a/platform/marvell-armhf/sai.mk +++ b/platform/marvell-armhf/sai.mk @@ -1,7 +1,8 @@ # Marvell SAI export MRVL_SAI_VERSION = 1.9.1-1 -export MRVL_SAI = mrvllibsai_$(PLATFORM_ARCH)_$(MRVL_SAI_VERSION).deb +export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb +export MRVL_SAI_PACKAGE = mrvllibsai_$(PLATFORM_ARCH)_$(MRVL_SAI_VERSION).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai $(eval $(call add_conflict_package,$(MRVL_SAI),$(LIBSAIVS_DEV))) diff --git a/platform/marvell-armhf/sai/Makefile b/platform/marvell-armhf/sai/Makefile index cf78504388c..a6199f59544 100644 --- a/platform/marvell-armhf/sai/Makefile +++ b/platform/marvell-armhf/sai/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/$(MRVL_SAI) +MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/$(MRVL_SAI_PACKAGE) $(addprefix $(DEST)/, $(MRVL_SAI)): $(DEST)/% : # get deb package From f21a45b68aa09e088d4149b63e3836246540dc30 Mon Sep 17 00:00:00 2001 From: Mohamed Ghoneim Date: Mon, 21 Feb 2022 11:07:29 -0800 Subject: [PATCH 049/139] [build] fix build exception and revert #9136 (#10037) #### Why I did it 1. Fix Build exception [example](https://dev.azure.com/mssonic/build/_build/results?buildId=73911&view=logs&jobId=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&j=cef3d8a9-152e-5193-620b-567dc18af272&t=ac3bce9f-b126-5a26-3fee-28ce0ec1679d) ``` 2022-02-19T01:54:23.4200556Z ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py) ``` This is because Jinja2 uses MarkupSafe without specifying an upper limit to the version, MarkupSafe version that was released today removed 'soft_unicode'. So now Jinja2 is complaining. Related issues: https://github.com/pallets/jinja/issues/1591 https://github.com/aws/aws-sam-cli/issues/3661 2. Reverts #9136 Fixing build failures in SONiC utils [example](https://dev.azure.com/mssonic/build/_build/results?buildId=73784&view=logs&jobId=83516c17-6666-5250-abde-63983ce72a49&j=83516c17-6666-5250-abde-63983ce72a49&t=6177235f-d4f1-5f72-835a-90ebb93a1784) One of the errors: ``` TestPathAddressing.test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths self = def test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths(self): # Arrange path = "/PORT/Ethernet0" expected = [ "/ACL_TABLE/NO-NSW-PACL-V4/ports/0", "/VLAN_MEMBER/Vlan1000|Ethernet0", ] # Act actual = self.path_addressing.find_ref_paths(path, Files.CROPPED_CONFIG_DB_AS_JSON) # Assert > self.assertEqual(expected, actual) E AssertionError: Lists differ: ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0'] != ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0'] E E First list contains 1 additional elements. E First extra element 1: E '/VLAN_MEMBER/Vlan1000|Ethernet0' E E - ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0'] E + ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0'] ``` The VLAN_MEMBER backlink (can be called referrer link or ref link) is not found. Issue introduced by https://github.com/Azure/sonic-buildimage/pull/9136 I don't know how this PR passed the build system, it should have failed. Known YANG issue https://github.com/Azure/sonic-buildimage/issues/9312 #### How I did it The import to `sonic-vlan` is breaking the build ``` import sonic-vlan { prefix vlan; } ``` I am not sure if that's the only issue, so I think reverting the whole PR should be the safer option. #### How to verify it Ran sonic-utils tests locally. --- .../azure-pipelines-image-template.yml | 1 + src/sonic-yang-models/setup.py | 2 - .../tests/files/sample_config_db.json | 21 +-- .../tests/yang_model_tests/tests/nvgre.json | 25 ---- .../yang_model_tests/tests_config/nvgre.json | 125 ------------------ .../yang-models/sonic-nvgre-tunnel.yang | 114 ---------------- 6 files changed, 3 insertions(+), 285 deletions(-) delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json delete mode 100644 src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 0a83c334074..70c40d64b6a 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -43,6 +43,7 @@ jobs: [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" git checkout -b $BRANCH_NAME sudo modprobe overlay + pip3 install MarkupSafe==2.0.1 --force-reinstall sudo apt-get install -y acl sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 17dcdeeaa5b..1f9b51b0c56 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -108,7 +108,6 @@ def run(self): './yang-models/sonic-mirror-session.yang', './yang-models/sonic-ntp.yang', './yang-models/sonic-nat.yang', - './yang-models/sonic-nvgre-tunnel.yang', './yang-models/sonic-pbh.yang', './yang-models/sonic-port.yang', './yang-models/sonic-policer.yang', @@ -166,7 +165,6 @@ def run(self): './cvlyang-models/sonic-mgmt_vrf.yang', './cvlyang-models/sonic-ntp.yang', './cvlyang-models/sonic-nat.yang', - './cvlyang-models/sonic-nvgre-tunnel.yang', './cvlyang-models/sonic-pbh.yang', './cvlyang-models/sonic-policer.yang', './cvlyang-models/sonic-port.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 6c27047c9bc..e64b241349b 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1540,7 +1540,7 @@ } }, - + "MCLAG_DOMAIN": { "123": { "source_ip": "12.1.1.1", @@ -1584,8 +1584,6 @@ } }, - - "POLICER": { "everflow_static_policer": { "meter_type": "bytes", @@ -1594,23 +1592,8 @@ "cbs": "12500000", "color": "aware", "red_packet_action": "drop" - } - }, - - - "NVGRE_TUNNEL": { - "tunnel_1": { - "src_ip": "10.0.0.1" - } - }, - "NVGRE_TUNNEL_MAP": { - "tunnel_1|Vlan111": { - "vlan_id": "111", - "vsid": "5000" - } + } } - - }, "SAMPLE_CONFIG_DB_UNKNOWN": { "UNKNOWN_TABLE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json deleted file mode 100644 index e776b0d9064..00000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "NVGRE_TUNNEL_AND_TUNNEL_MAP": { - "desc": "NVGRE_TUNNEL with NVGRE_TUNNEL_MAP" - }, - - "NVGRE_TUNNEL_INVALID_SRC_IP": { - "desc": "INVALID src_ip value for NVGRE_TUNNEL", - "eStrKey": "InvalidValue" - }, - - "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { - "desc": "Unexisting NVGRE_TUNNEL", - "eStrKey": "LeafRef" - }, - - "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { - "desc": "Invalid VLAN ID", - "eStrKey": "Pattern" - }, - - "NVGRE_TUNNEL_MAP_INVALID_VSID": { - "desc": "INVALID VSID value for NVGRE_TUNNEL_MAP", - "eStrKey": "Pattern" - } -} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json deleted file mode 100644 index 8c2588fa7d3..00000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "NVGRE_TUNNEL_AND_TUNNEL_MAP": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan200" - } - ] - } - }, - "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { - "sonic-nvgre-tunnel:NVGRE_TUNNEL": { - "NVGRE_TUNNEL_LIST": [ - { - "tunnel_name": "tunnel_1", - "src_ip": "10.0.0.1" - } - ] - }, - "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { - "NVGRE_TUNNEL_MAP_LIST": [ - { - "tunnel_name": "tunnel_1", - "tunnel_map_name": "Vlan200", - "vlan_id": 200, - "vsid": 5000 - } - ] - } - } - }, - - "NVGRE_TUNNEL_INVALID_SRC_IP": { - "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { - "sonic-nvgre-tunnel:NVGRE_TUNNEL": { - "NVGRE_TUNNEL_LIST": [ - { - "tunnel_name": "tunnel_1", - "src_ip": "INVALID" - } - ] - } - } - }, - - "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan200" - } - ] - } - }, - "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { - "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { - "NVGRE_TUNNEL_MAP_LIST": [ - { - "tunnel_name": "INVALID", - "tunnel_map_name": "Vlan200", - "vlan_id": 200, - "vsid": 5000 - } - ] - } - } - }, - - "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { - "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { - "sonic-nvgre-tunnel:NVGRE_TUNNEL": { - "NVGRE_TUNNEL_LIST": [ - { - "tunnel_name": "tunnel_1", - "src_ip": "10.0.0.1" - } - ] - }, - "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { - "NVGRE_TUNNEL_MAP_LIST": [ - { - "tunnel_name": "tunnel_1", - "tunnel_map_name": "Vlan200", - "vlan_id": 5000, - "vsid": 5000 - } - ] - } - } - }, - - "NVGRE_TUNNEL_MAP_INVALID_VSID": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan200" - } - ] - } - }, - "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { - "sonic-nvgre-tunnel:NVGRE_TUNNEL": { - "NVGRE_TUNNEL_LIST": [ - { - "tunnel_name": "tunnel_1", - "src_ip": "10.0.0.1" - } - ] - }, - "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { - "NVGRE_TUNNEL_MAP_LIST": [ - { - "tunnel_name": "tunnel_1", - "tunnel_map_name": "Vlan200", - "vlan_id": 200, - "vsid": 999999999 - } - ] - } - } - } -} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang b/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang deleted file mode 100644 index 42ab3921a4a..00000000000 --- a/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang +++ /dev/null @@ -1,114 +0,0 @@ -module sonic-nvgre-tunnel { - - yang-version 1.1; - - namespace "http://github.com/Azure/sonic-nvgre-tunnel"; - prefix nvgre; - - import ietf-inet-types { - prefix inet; - } - - import sonic-vlan { - prefix vlan; - } - - - organization - "SONiC"; - - contact - "SONiC"; - - description - "NVGRE Tunnel YANG Module for SONiC OS"; - - revision 2021-10-31 { - description - "First Revision"; - } - - container sonic-nvgre-tunnel { - - container NVGRE_TUNNEL { - - description "NVGRE_TUNNEL part of config_db.json"; - - list NVGRE_TUNNEL_LIST { - - key "tunnel_name"; - - leaf tunnel_name { - description "NVGRE Tunnel name"; - - type string { - length 1..255; - } - } - - leaf src_ip { - description "Source IP address"; - - mandatory true; - type inet:ip-address; - } - - } - /* end of NVGRE_TUNNEL_LIST */ - - } - /* end of container NVGRE_TUNNEL */ - - container NVGRE_TUNNEL_MAP { - - description "NVGRE_TUNNEL_MAP part of config_db.json"; - - list NVGRE_TUNNEL_MAP_LIST { - - key "tunnel_name tunnel_map_name"; - - leaf tunnel_name { - description "NVGRE Tunnel name"; - - type leafref { - path /nvgre:sonic-nvgre-tunnel/nvgre:NVGRE_TUNNEL/nvgre:NVGRE_TUNNEL_LIST/nvgre:tunnel_name; - } - } - - leaf tunnel_map_name { - description "NVGRE Tunnel map name"; - - type string { - length 1..255; - } - } - - leaf vlan_id { - description "VLAN identifier"; - - mandatory true; - type uint16 { - range 1..4094; - } - } - - leaf vsid { - description "Virtual Subnet Identifier"; - - mandatory true; - type uint32 { - range 0..16777214; - } - } - - } - /* end of NVGRE_TUNNEL_MAP_LIST */ - - } - /* end of container NVGRE_TUNNEL_MAP */ - - } - /* end of container sonic-nvgre-tunnel */ - -} -/* end of module sonic-nvgre-tunnel */ From 3bbe562bcaeb3e16fec86f27c185d30b5b44cf6e Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 22 Feb 2022 13:42:27 +0800 Subject: [PATCH 050/139] [build] Increase vs platform kvm disk size (#10001) #### Why I did it Info: Attempting file://dev/vdb/onie-installer ... Info: Attempting file://dev/vdb/onie-installer.bin ... cp: write error: No space left on device Failure: local_fs_run():/dev/vdb Unable to copy /tmp/tmp.CPY0ad/onie-installer.bin to tmpfs vs image is failing. Increase kvm device space. --- scripts/build_kvm_image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_kvm_image.sh b/scripts/build_kvm_image.sh index cfaba6521ed..6e5fd7dec74 100755 --- a/scripts/build_kvm_image.sh +++ b/scripts/build_kvm_image.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0 -MEM=4096 +MEM=8192 DISK=$1 ONIE_RECOVERY_ISO=$2 INSTALLER=$3 From 55e7a14f043a444a6080423109ffef28bb0d3934 Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Wed, 23 Feb 2022 01:32:57 +0200 Subject: [PATCH 051/139] [submodule]: Advance sonic-utilities. (#10058) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` Commits on Jan 31, 2022 [sonic-package-manager] implement blocking feature state change (#2035) Commits on Feb 12, 2022 [ci] pipeline fixes for VS test (#2059) Commits on Feb 14, 2022 [ci] allow download partially succeeded suilds for sonic-swss-pytests… [build] allowPartiallySucceededBuilds true in the step of download so… Commits on Feb 16, 2022 [config] Fix snmpagentaddress doesn't support the uppercase letters f… Commits on Feb 17, 2022 [ci] Fix pipeline on build_and_install_module (#2074) Enable diff coverage and set the threshold to 50% (#2061) Commits on Feb 18, 2022 check for adding default vlan attempt added (#2075) [GCU] Adding unit-test where path and ref paths are under the same YA… [GCU] Turning port admin down before some critical port changes (#1998) Commits on Feb 20, 2022 show_platfom_info not run for simx (#2042) [aclshow] fix aclshow when clear is called before counters are popula… ``` --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b6ca76b4821..a9bbaf22731 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b6ca76b4821453171d9607383b808385968eeeeb +Subproject commit a9bbaf2273169ed9f4c764cc39e97708995e0fa3 From 4a2a0df6078595eb8c88cee69b2411277a3ba036 Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Wed, 23 Feb 2022 09:18:05 +0800 Subject: [PATCH 052/139] [submodule]: Update sonic-swss (#9978) * Update sonic-swss Signed-off-by: Ze Gan * update swss Signed-off-by: Ze Gan * Update submodule update-swss Signed-off-by: Ze Gan --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 53c630b82d4..7d2942f7ef4 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 53c630b82d429db892bf288dd9f323c5a8370cd5 +Subproject commit 7d2942f7ef4ac01209582c02d142bd131208b2a4 From 2489727c46261e57212231af95c3bfc7f2a9efcc Mon Sep 17 00:00:00 2001 From: "Richard.Yu" Date: Wed, 23 Feb 2022 10:33:16 +0800 Subject: [PATCH 053/139] Generate sai.profile from j2 tempalte when saiserver start (#10022) Generate the sai.profile base on the brcm j2 file if the sai.profile is not existing in the dut mounted folder. Change the supervisor service configuration accordingly. Testing done: Add the script and config in dut saiservice server can start automatically with [systemctl start saiserver] Signed-off-by: richardyu-ms --- .../broadcom/docker-saiserver-brcm/start.sh | 27 +++++++++++++++++++ .../docker-saiserver-brcm/supervisord.conf | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/platform/broadcom/docker-saiserver-brcm/start.sh b/platform/broadcom/docker-saiserver-brcm/start.sh index 494c0e9126c..81813b57ff9 100755 --- a/platform/broadcom/docker-saiserver-brcm/start.sh +++ b/platform/broadcom/docker-saiserver-brcm/start.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +HWSKU_DIR=/usr/share/sonic/hwsku start_bcm() { @@ -7,11 +8,37 @@ start_bcm() [ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0 } +generate_profile() +{ + # There are two ways to specify the contents of the SAI_INIT_CONFIG_FILE and they are mutually exclusive + # via current method (sai.profile.j2) or new method (config.bcm.j2) + # If delta is large, use sai.profile.j2 which basically require the user to select which config file to use + # If delta is small, use config.bcm.j2 where additional SAI INIT config properties are added + # based on specific device metadata requirement + # in this case sai.profile should have been modified to use the path /etc/sai.d/config.bcm + # There is also a possibility that both sai.profile.j2 and config.bcm.j2 are absent. in that cacse just copy + # sai.profile to the new /etc/said directory. + + # Create/Copy the sai.profile to /etc/sai.d/sai.profile + mkdir -p /etc/sai.d/ + + if [ -f $HWSKU_DIR/sai.profile.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile + else + if [ -f $HWSKU_DIR/config.bcm.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/config.bcm.j2 > /etc/sai.d/config.bcm + fi + if [ -f $HWSKU_DIR/sai.profile ]; then + cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile + fi + fi +} rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd +generate_profile start_bcm supervisorctl start saiserver diff --git a/platform/broadcom/docker-saiserver-brcm/supervisord.conf b/platform/broadcom/docker-saiserver-brcm/supervisord.conf index ccb107b3d1f..3574cd782b7 100644 --- a/platform/broadcom/docker-saiserver-brcm/supervisord.conf +++ b/platform/broadcom/docker-saiserver-brcm/supervisord.conf @@ -20,7 +20,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:saiserver] -command=/usr/sbin/saiserver -p /usr/share/sonic/hwsku/sai.profile -f /usr/share/sonic/hwsku/port_config.ini +command=/usr/sbin/saiserver -p /etc/sai.d/sai.profile -f /usr/share/sonic/hwsku/port_config.ini priority=3 autostart=false autorestart=false From 9fe128c8e8bb44fa9959c482116541ce64b87486 Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Wed, 23 Feb 2022 10:33:34 +0800 Subject: [PATCH 054/139] Fix issue of parsing syseeprom value with whitespace in middle (#10021) Fixes #10020 Why I did it The platform api for parsing syseeprom information read from STATE DB has issue with parsing the value part that has whitespace in the middle. The current code assumes that the value part does not have whitespace. So everything after the whitespace will be ignored. The syseeprom values returned from platform API do not match the output of "show platform syseeprom". How I did it This change improved the regular expression for parsing syseeprom values to accommodate whitespaces in the value. How to verify it Locally updated the code on a dx010 device. Call the platform API: ``` >>> import sonic_platform >>> platform = sonic_platform.platform.Platform() >>> chassis = platform.get_chassis() >>> chassis.get_system_eeprom_info() {'0x21': 'DX010', '0x22': 'R0872-F0020-02', '0x23': 'DX010B2F030A27BY200002', '0x24': '00:E0:EC:E7:71:0F', '0x25': '11/03/2020 21:22:56', '0x26': '3', '0x27': 'Seastone', '0x28': 'RANGELEY', '0x29': '2014.08', '0x2A': '131', '0x2B': 'CELESTICA', '0x2C': 'THA', '0x2D': 'Celestica', '0x2E': '1.0.5', '0x2F': 'LB', '0xFD': '', '0xFE': '0xAAB39BDB'} ``` Signed-off-by: Xin Wang --- .../services/platform_api/sonic_platform/eeprom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py index 7756c0f2f83..1e06e7b80e6 100644 --- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py @@ -45,7 +45,7 @@ def _parse_output(self, decode_output): for line in lines: try: match = re.search( - '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)(.*$)', line) if match is not None: idx = match.group(1) value = match.group(3).rstrip('\0') From 937ffbdb0566f93730465110248d51c9a4d696ae Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Wed, 23 Feb 2022 19:31:41 +0800 Subject: [PATCH 055/139] [submodule]: Update sonic-sairedis (#10061) Signed-off-by: Ze Gan b9337dc (HEAD, origin/master, origin/HEAD) [vslib]: Fix MACsec bug in SCI and XPN (#1003) edbceb9 [syncd][vslib] Keep new warm boot discovered SERDES objects (#985) af5c156 Fix build issues on gcc-10 (#999) 1445cd5 update SAI submoule (#1001) 48fe704 [ci] pipeline fixes for VS test (#1002) f484cf9 Enable SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL attribute (#975) 5d0b22d Enable SAI_SWITCH_ATTR_UNINIT_DATA_PLANE_ON_REMOVAL attribute (#975) 1b8ce97 (origin/202111) [pipeline] Download swss common artifact in a separated directory (#995) 7a2e096 Change sonic-buildimage.vs artifact source from CI build to official build. (#992) --- src/sonic-sairedis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-sairedis b/src/sonic-sairedis index d5866a3dccf..b9337dc5787 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit d5866a3dccfb3bc50853d740d54203b5cae61eed +Subproject commit b9337dc5787aadf71eee9d676d6b7f1181ac0787 From bc1dfea6197551e1b475bd48f18144bdf375d81f Mon Sep 17 00:00:00 2001 From: vmittal-msft <46945843+vmittal-msft@users.noreply.github.com> Date: Wed, 23 Feb 2022 17:22:41 -0800 Subject: [PATCH 056/139] Updated traffic scheduler settings for HWSKUs : DellEMC-Z9332f-O32 and DellEMC-Z9332f-M-O16C64 (#9828) --- files/build_templates/qos_config.j2 | 27 + .../tests/sample-dell-9332-t1-minigraph.xml | 2023 +++++++++++++++++ .../tests/sample_output/py2/qos-dell9332.json | 1101 +++++++++ .../tests/sample_output/py3/qos-dell9332.json | 1101 +++++++++ src/sonic-config-engine/tests/test_j2files.py | 20 + 5 files changed, 4272 insertions(+) create mode 100644 src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index cdfb721a45e..6748cd99be9 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -30,6 +30,7 @@ {%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} {%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%} +{%- set apollo_resource_types = ['DL-NPU-Apollo'] -%} { @@ -156,6 +157,22 @@ } }, {% endif %} +{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, +{% else %} "SCHEDULER": { "scheduler.0": { "type" : "DWRR", @@ -166,6 +183,7 @@ "weight": "15" } }, +{% endif %} {% if asic_type in pfc_to_pg_map_supported_asics %} "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { "AZURE": { @@ -221,12 +239,21 @@ "wred_profile": "AZURE_LOSSLESS" }, {% endfor %} +{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} +{% for port in PORT_ACTIVE %} + "{{ port }}|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, +{% endfor %} +{% else %} {% for port in PORT_ACTIVE %} "{{ port }}|4": { "scheduler" : "scheduler.1", "wred_profile": "AZURE_LOSSLESS" }, {% endfor %} +{% endif %} {% for port in PORT_ACTIVE %} "{{ port }}|0": { "scheduler": "scheduler.0" diff --git a/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml new file mode 100644 index 00000000000..460238486b4 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml @@ -0,0 +1,2023 @@ + + + + + + false + str2-z9332f-01 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::9 + ARISTA03T2 + FC00::A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::11 + ARISTA05T2 + FC00::12 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::19 + ARISTA07T2 + FC00::1A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.16 + ARISTA09T2 + 10.0.0.17 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::21 + ARISTA09T2 + FC00::22 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.20 + ARISTA11T2 + 10.0.0.21 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::29 + ARISTA11T2 + FC00::2A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.24 + ARISTA13T2 + 10.0.0.25 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::31 + ARISTA13T2 + FC00::32 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.28 + ARISTA15T2 + 10.0.0.29 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::39 + ARISTA15T2 + FC00::3A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-z9332f-01 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.17
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.21
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.25
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.29
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 65200 + ARISTA09T2 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 65200 + ARISTA11T2 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 65200 + ARISTA13T2 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 65200 + ARISTA15T2 + + + + 64016 + ARISTA16T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.3.146.248/23 + + 10.3.146.248/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-z9332f-01 + + + PortChannel102 + etp1;etp2 + + + + PortChannel105 + etp3;etp4 + + + + PortChannel108 + etp5;etp6 + + + + PortChannel1011 + etp7;etp8 + + + + PortChannel1014 + etp9;etp10 + + + + PortChannel1017 + etp11;etp12 + + + + PortChannel1020 + etp13;etp14 + + + + PortChannel1023 + etp15;etp16 + + + + + + + + + etp17 + 10.0.0.32/31 + + + + etp17 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + etp18 + 10.0.0.34/31 + + + + etp18 + FC00::45/126 + + + + etp19 + 10.0.0.36/31 + + + + etp19 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::9/126 + + + + etp20 + 10.0.0.38/31 + + + + etp20 + FC00::4D/126 + + + + etp21 + 10.0.0.40/31 + + + + etp21 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::11/126 + + + + etp22 + 10.0.0.42/31 + + + + etp22 + FC00::55/126 + + + + etp23 + 10.0.0.44/31 + + + + etp23 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::19/126 + + + + etp24 + 10.0.0.46/31 + + + + etp24 + FC00::5D/126 + + + + etp25 + 10.0.0.48/31 + + + + etp25 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.16/31 + + + + PortChannel1014 + FC00::21/126 + + + + etp26 + 10.0.0.50/31 + + + + etp26 + FC00::65/126 + + + + etp27 + 10.0.0.52/31 + + + + etp27 + FC00::69/126 + + + + PortChannel1017 + 10.0.0.20/31 + + + + PortChannel1017 + FC00::29/126 + + + + etp28 + 10.0.0.54/31 + + + + etp28 + FC00::6D/126 + + + + etp29 + 10.0.0.56/31 + + + + etp29 + FC00::71/126 + + + + PortChannel1020 + 10.0.0.24/31 + + + + PortChannel1020 + FC00::31/126 + + + + etp30 + 10.0.0.58/31 + + + + etp30 + FC00::75/126 + + + + etp31 + 10.0.0.60/31 + + + + etp31 + FC00::79/126 + + + + PortChannel1023 + 10.0.0.28/31 + + + + PortChannel1023 + FC00::39/126 + + + + etp32 + 10.0.0.62/31 + + + + etp32 + FC00::7D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + str2-z9332f-01 + etp17 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + str2-z9332f-01 + etp1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + str2-z9332f-01 + etp2 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + str2-z9332f-01 + etp18 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + str2-z9332f-01 + etp19 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + str2-z9332f-01 + etp3 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + str2-z9332f-01 + etp4 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + str2-z9332f-01 + etp20 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + str2-z9332f-01 + etp21 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + str2-z9332f-01 + etp5 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + str2-z9332f-01 + etp6 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + str2-z9332f-01 + etp22 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + str2-z9332f-01 + etp23 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + str2-z9332f-01 + etp7 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + str2-z9332f-01 + etp8 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + str2-z9332f-01 + etp24 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + str2-z9332f-01 + etp25 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet1 + str2-z9332f-01 + etp9 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet2 + str2-z9332f-01 + etp10 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + str2-z9332f-01 + etp26 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + str2-z9332f-01 + etp27 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet1 + str2-z9332f-01 + etp11 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet2 + str2-z9332f-01 + etp12 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + str2-z9332f-01 + etp28 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + str2-z9332f-01 + etp29 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet1 + str2-z9332f-01 + etp13 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet2 + str2-z9332f-01 + etp14 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + str2-z9332f-01 + etp30 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + str2-z9332f-01 + etp31 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet1 + str2-z9332f-01 + etp15 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet2 + str2-z9332f-01 + etp16 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + str2-z9332f-01 + etp32 + + + + + str2-z9332f-01 + DellEMC-Z9332f-O32 + + 10.3.146.248 + + + + ARISTA16T0 + + 172.16.142.111 + + Arista-VM + + + ARISTA11T0 + + 172.16.142.106 + + Arista-VM + + + ARISTA10T0 + + 172.16.142.105 + + Arista-VM + + + ARISTA11T2 + + 172.16.142.93 + + Arista-VM + + + ARISTA09T2 + + 172.16.142.92 + + Arista-VM + + + ARISTA09T0 + + 172.16.142.104 + + Arista-VM + + + ARISTA06T0 + + 172.16.142.101 + + Arista-VM + + + ARISTA08T0 + + 172.16.142.103 + + Arista-VM + + + ARISTA07T0 + + 172.16.142.102 + + Arista-VM + + + ARISTA07T2 + + 172.16.142.91 + + Arista-VM + + + ARISTA01T2 + + 172.16.142.88 + + Arista-VM + + + ARISTA01T0 + + 172.16.142.96 + + Arista-VM + + + ARISTA05T2 + + 172.16.142.90 + + Arista-VM + + + ARISTA05T0 + + 172.16.142.100 + + Arista-VM + + + ARISTA02T0 + + 172.16.142.97 + + Arista-VM + + + ARISTA03T0 + + 172.16.142.98 + + Arista-VM + + + ARISTA03T2 + + 172.16.142.89 + + Arista-VM + + + ARISTA04T0 + + 172.16.142.99 + + Arista-VM + + + ARISTA15T0 + + 172.16.142.110 + + Arista-VM + + + ARISTA15T2 + + 172.16.142.95 + + Arista-VM + + + ARISTA14T0 + + 172.16.142.109 + + Arista-VM + + + ARISTA12T0 + + 172.16.142.107 + + Arista-VM + + + ARISTA13T2 + + 172.16.142.94 + + Arista-VM + + + ARISTA13T0 + + 172.16.142.108 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + etp1 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp2 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp3 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp4 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp5 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp6 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp7 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp8 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp9 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp10 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp11 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp12 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp13 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp14 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp15 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp16 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp17 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp18 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp19 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp20 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp21 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp22 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp23 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp24 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp25 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp26 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp27 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp28 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp29 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp30 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp31 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp32 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp33 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + etp34 + + false + 0 + 0 + 10000 + + + true + 0 + DellEMC-Z9332f-O32 + + + + + + + str2-z9332f-01 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ResourceType + + DL-NPU-Apollo + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str2-z9332f-01 + DellEMC-Z9332f-O32 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json new file mode 100644 index 00000000000..39f4b26e837 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json @@ -0,0 +1,1101 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet128|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet160|0": { + "scheduler": "scheduler.0" + }, + "Ethernet168|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet192|0": { + "scheduler": "scheduler.0" + }, + "Ethernet200|0": { + "scheduler": "scheduler.0" + }, + "Ethernet208|0": { + "scheduler": "scheduler.0" + }, + "Ethernet216|0": { + "scheduler": "scheduler.0" + }, + "Ethernet224|0": { + "scheduler": "scheduler.0" + }, + "Ethernet232|0": { + "scheduler": "scheduler.0" + }, + "Ethernet240|0": { + "scheduler": "scheduler.0" + }, + "Ethernet248|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet128|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet160|1": { + "scheduler": "scheduler.0" + }, + "Ethernet168|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet192|1": { + "scheduler": "scheduler.0" + }, + "Ethernet200|1": { + "scheduler": "scheduler.0" + }, + "Ethernet208|1": { + "scheduler": "scheduler.0" + }, + "Ethernet216|1": { + "scheduler": "scheduler.0" + }, + "Ethernet224|1": { + "scheduler": "scheduler.0" + }, + "Ethernet232|1": { + "scheduler": "scheduler.0" + }, + "Ethernet240|1": { + "scheduler": "scheduler.0" + }, + "Ethernet248|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler": "scheduler.0" + }, + "Ethernet32|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet128|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler": "scheduler.0" + }, + "Ethernet144|2": { + "scheduler": "scheduler.0" + }, + "Ethernet152|2": { + "scheduler": "scheduler.0" + }, + "Ethernet160|2": { + "scheduler": "scheduler.0" + }, + "Ethernet168|2": { + "scheduler": "scheduler.0" + }, + "Ethernet176|2": { + "scheduler": "scheduler.0" + }, + "Ethernet184|2": { + "scheduler": "scheduler.0" + }, + "Ethernet192|2": { + "scheduler": "scheduler.0" + }, + "Ethernet200|2": { + "scheduler": "scheduler.0" + }, + "Ethernet208|2": { + "scheduler": "scheduler.0" + }, + "Ethernet216|2": { + "scheduler": "scheduler.0" + }, + "Ethernet224|2": { + "scheduler": "scheduler.0" + }, + "Ethernet232|2": { + "scheduler": "scheduler.0" + }, + "Ethernet240|2": { + "scheduler": "scheduler.0" + }, + "Ethernet248|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet128|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet160|5": { + "scheduler": "scheduler.0" + }, + "Ethernet168|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet192|5": { + "scheduler": "scheduler.0" + }, + "Ethernet200|5": { + "scheduler": "scheduler.0" + }, + "Ethernet208|5": { + "scheduler": "scheduler.0" + }, + "Ethernet216|5": { + "scheduler": "scheduler.0" + }, + "Ethernet224|5": { + "scheduler": "scheduler.0" + }, + "Ethernet232|5": { + "scheduler": "scheduler.0" + }, + "Ethernet240|5": { + "scheduler": "scheduler.0" + }, + "Ethernet248|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler": "scheduler.0" + }, + "Ethernet32|6": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet128|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler": "scheduler.0" + }, + "Ethernet144|6": { + "scheduler": "scheduler.0" + }, + "Ethernet152|6": { + "scheduler": "scheduler.0" + }, + "Ethernet160|6": { + "scheduler": "scheduler.0" + }, + "Ethernet168|6": { + "scheduler": "scheduler.0" + }, + "Ethernet176|6": { + "scheduler": "scheduler.0" + }, + "Ethernet184|6": { + "scheduler": "scheduler.0" + }, + "Ethernet192|6": { + "scheduler": "scheduler.0" + }, + "Ethernet200|6": { + "scheduler": "scheduler.0" + }, + "Ethernet208|6": { + "scheduler": "scheduler.0" + }, + "Ethernet216|6": { + "scheduler": "scheduler.0" + }, + "Ethernet224|6": { + "scheduler": "scheduler.0" + }, + "Ethernet232|6": { + "scheduler": "scheduler.0" + }, + "Ethernet240|6": { + "scheduler": "scheduler.0" + }, + "Ethernet248|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json new file mode 100644 index 00000000000..39f4b26e837 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json @@ -0,0 +1,1101 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet160|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet168|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet192|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet200|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet208|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet216|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet224|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet232|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet240|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet248|4": { + "scheduler" : "scheduler.2", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet128|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet160|0": { + "scheduler": "scheduler.0" + }, + "Ethernet168|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet192|0": { + "scheduler": "scheduler.0" + }, + "Ethernet200|0": { + "scheduler": "scheduler.0" + }, + "Ethernet208|0": { + "scheduler": "scheduler.0" + }, + "Ethernet216|0": { + "scheduler": "scheduler.0" + }, + "Ethernet224|0": { + "scheduler": "scheduler.0" + }, + "Ethernet232|0": { + "scheduler": "scheduler.0" + }, + "Ethernet240|0": { + "scheduler": "scheduler.0" + }, + "Ethernet248|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet128|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet160|1": { + "scheduler": "scheduler.0" + }, + "Ethernet168|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet192|1": { + "scheduler": "scheduler.0" + }, + "Ethernet200|1": { + "scheduler": "scheduler.0" + }, + "Ethernet208|1": { + "scheduler": "scheduler.0" + }, + "Ethernet216|1": { + "scheduler": "scheduler.0" + }, + "Ethernet224|1": { + "scheduler": "scheduler.0" + }, + "Ethernet232|1": { + "scheduler": "scheduler.0" + }, + "Ethernet240|1": { + "scheduler": "scheduler.0" + }, + "Ethernet248|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler": "scheduler.0" + }, + "Ethernet32|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet128|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler": "scheduler.0" + }, + "Ethernet144|2": { + "scheduler": "scheduler.0" + }, + "Ethernet152|2": { + "scheduler": "scheduler.0" + }, + "Ethernet160|2": { + "scheduler": "scheduler.0" + }, + "Ethernet168|2": { + "scheduler": "scheduler.0" + }, + "Ethernet176|2": { + "scheduler": "scheduler.0" + }, + "Ethernet184|2": { + "scheduler": "scheduler.0" + }, + "Ethernet192|2": { + "scheduler": "scheduler.0" + }, + "Ethernet200|2": { + "scheduler": "scheduler.0" + }, + "Ethernet208|2": { + "scheduler": "scheduler.0" + }, + "Ethernet216|2": { + "scheduler": "scheduler.0" + }, + "Ethernet224|2": { + "scheduler": "scheduler.0" + }, + "Ethernet232|2": { + "scheduler": "scheduler.0" + }, + "Ethernet240|2": { + "scheduler": "scheduler.0" + }, + "Ethernet248|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet128|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet160|5": { + "scheduler": "scheduler.0" + }, + "Ethernet168|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet192|5": { + "scheduler": "scheduler.0" + }, + "Ethernet200|5": { + "scheduler": "scheduler.0" + }, + "Ethernet208|5": { + "scheduler": "scheduler.0" + }, + "Ethernet216|5": { + "scheduler": "scheduler.0" + }, + "Ethernet224|5": { + "scheduler": "scheduler.0" + }, + "Ethernet232|5": { + "scheduler": "scheduler.0" + }, + "Ethernet240|5": { + "scheduler": "scheduler.0" + }, + "Ethernet248|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler": "scheduler.0" + }, + "Ethernet32|6": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet128|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler": "scheduler.0" + }, + "Ethernet144|6": { + "scheduler": "scheduler.0" + }, + "Ethernet152|6": { + "scheduler": "scheduler.0" + }, + "Ethernet160|6": { + "scheduler": "scheduler.0" + }, + "Ethernet168|6": { + "scheduler": "scheduler.0" + }, + "Ethernet176|6": { + "scheduler": "scheduler.0" + }, + "Ethernet184|6": { + "scheduler": "scheduler.0" + }, + "Ethernet192|6": { + "scheduler": "scheduler.0" + }, + "Ethernet200|6": { + "scheduler": "scheduler.0" + }, + "Ethernet208|6": { + "scheduler": "scheduler.0" + }, + "Ethernet216|6": { + "scheduler": "scheduler.0" + }, + "Ethernet224|6": { + "scheduler": "scheduler.0" + }, + "Ethernet232|6": { + "scheduler": "scheduler.0" + }, + "Ethernet240|6": { + "scheduler": "scheduler.0" + }, + "Ethernet248|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 851f45098fd..5e782ce2fa1 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -25,6 +25,7 @@ def setUp(self): self.arista7050_t0_minigraph = os.path.join(self.test_dir, 'sample-arista-7050-t0-minigraph.xml') self.multi_asic_minigraph = os.path.join(self.test_dir, 'multi_npu_data', 'sample-minigraph.xml') self.multi_asic_port_config = os.path.join(self.test_dir, 'multi_npu_data', 'sample_port_config-0.ini') + self.dell9332_t1_minigraph = os.path.join(self.test_dir, 'sample-dell-9332-t1-minigraph.xml') self.radv_test_minigraph = os.path.join(self.test_dir, 'radv-test-sample-graph.xml') self.output_file = os.path.join(self.test_dir, 'output') os.environ["CFGGEN_UNIT_TESTING"] = "2" @@ -211,6 +212,25 @@ def test_qos_arista7050_render_template(self): sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') assert filecmp.cmp(sample_output_file, self.output_file) + def test_qos_dell9332_render_template(self): + dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32') + qos_file = os.path.join(dell_dir_path, 'qos.json.j2') + port_config_ini_file = os.path.join(dell_dir_path, 'port_config.ini') + + # copy qos_config.j2 to the Dell Z9332 directory to have all templates in one directory + qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') + shutil.copy2(qos_config_file, dell_dir_path) + + argument = '-m ' + self.dell9332_t1_minigraph + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + self.output_file + self.run_script(argument) + + # cleanup + qos_config_file_new = os.path.join(dell_dir_path, 'qos_config.j2') + os.remove(qos_config_file_new) + + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell9332.json') + assert filecmp.cmp(sample_output_file, self.output_file) + def test_qos_dell6100_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') qos_file = os.path.join(dell_dir_path, 'qos.json.j2') From 72477bcac869a11671b69fb40683b4bc59672187 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:55:37 +0800 Subject: [PATCH 057/139] [submodule] Update submodule for sonic-swss-common (#10012) *9eac0ae Add support for route flow counter (#576) *2262c01 [VS] Increase test timout to 360min (#582) *a2b8161 [ci] pipeline fixes for VS test (#581) --- src/sonic-swss-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss-common b/src/sonic-swss-common index 14f068e8163..9eac0ae7809 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit 14f068e81630de186e631ff4f3e39d4f40d9abbb +Subproject commit 9eac0ae7809350f38650ebb29456fe41a93bbf35 From 2d0b063191e20d2f1e394cf60a9a53025edc4b5b Mon Sep 17 00:00:00 2001 From: wenyiz2021 <91497961+wenyiz2021@users.noreply.github.com> Date: Wed, 23 Feb 2022 18:06:30 -0800 Subject: [PATCH 058/139] Update container_checker for multi-asic devices when state is 'always_enabled' (#10067) * Update container_checker for multi-asic devices Update container_checker for multi-asic devices to add database containers in always_running_containers. Previous change was made for single-asic, and that database containers were not considered as feature when writing to state_db. * Update container_checker Update an indent --- files/image_config/monit/container_checker | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index 2a000d1e6bb..63bd7b3e182 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -41,7 +41,7 @@ def get_expected_running_containers(): expected_running_containers = set() always_running_containers = set() - + for container_name in feature_table.keys(): if feature_table[container_name]["state"] not in ["disabled", "always_disabled"]: if multi_asic.is_multi_asic(): @@ -51,14 +51,20 @@ def get_expected_running_containers(): num_asics = multi_asic.get_num_asics() for asic_id in range(num_asics): expected_running_containers.add(container_name + str(asic_id)) - elif feature_table[container_name]["state"] == 'always_enabled': - always_running_containers.add(container_name) else: expected_running_containers.add(container_name) - + if feature_table[container_name]["state"] == 'always_enabled': + if multi_asic.is_multi_asic(): + if feature_table[container_name]["has_global_scope"] == "True": + always_running_containers.add(container_name) + if feature_table[container_name]["has_per_asic_scope"] == "True": + num_asics = multi_asic.get_num_asics() + for asic_id in range(num_asics): + always_running_containers.add(container_name + str(asic_id)) + else: + always_running_containers.add(container_name) return expected_running_containers, always_running_containers - def get_current_running_from_DB(always_running_containers): """ @summary: This function will get the current running container list From 44028723ef76385958af1555ad7f7150f53f44ee Mon Sep 17 00:00:00 2001 From: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com> Date: Wed, 23 Feb 2022 18:20:24 -0800 Subject: [PATCH 059/139] Split kvmtest t0 job into two jobs and run in parallel (#10044) Why I did it Introduce 2 sub jobs for kvmtest t0 job in sonic-mgmt repo in PR Azure/sonic-mgmt#4861 But in sonic-buildimage repo, because section parameter is null, it always run the part 2 test scripts in kvmtest t0 job. It missed the part 1 test scripts in kvmtest.sh. How I did it Split kvmtest t0 job into two sub jobs such as sonic-mgmt repo and run them in parallel to save time. How to verify it Submit PR will trigger the pipeline to run. Signed-off-by: Zhaohui Sun --- .azure-pipelines/run-test-template.yml | 11 ++++--- azure-pipelines.yml | 41 ++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/run-test-template.yml b/.azure-pipelines/run-test-template.yml index d490873d15e..2ab707287c7 100644 --- a/.azure-pipelines/run-test-template.yml +++ b/.azure-pipelines/run-test-template.yml @@ -7,6 +7,9 @@ parameters: type: string - name: ptf_name type: string +- name: section + type: string + default: '' - name: image type: string default: sonic-vs.img.gz @@ -43,7 +46,7 @@ steps: - script: | rm -rf $(Build.ArtifactStagingDirectory)/* - docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }}" + docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }} ${{ parameters.section }}" displayName: "Run tests" - script: | @@ -75,17 +78,17 @@ steps: condition: succeededOrFailed() - publish: $(Build.ArtifactStagingDirectory)/kvmdump - artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}.memdump@$(System.JobAttempt) + artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}${{ parameters.section }}.memdump@$(System.JobAttempt) displayName: "Archive sonic kvm memdump" condition: failed() - publish: $(Build.ArtifactStagingDirectory)/logs - artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}.log@$(System.JobAttempt) + artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}${{ parameters.section }}.log@$(System.JobAttempt) displayName: "Archive sonic kvm logs" condition: succeededOrFailed() - task: PublishTestResults@2 inputs: testResultsFiles: '$(Build.ArtifactStagingDirectory)/logs/**/*.xml' - testRunTitle: kvmtest.${{ parameters.tbtype }} + testRunTitle: kvmtest.${{ parameters.tbtype }}${{ parameters.section }} condition: succeededOrFailed() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6bf2370b1d8..b96deeefb37 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -104,9 +104,9 @@ stages: testResultsFiles: '**/tr.xml' testRunTitle: vstest - - job: + - job: t0_part1 pool: sonictest - displayName: "kvmtest-t0" + displayName: "kvmtest-t0-part1" timeoutInMinutes: 360 steps: @@ -116,6 +116,43 @@ stages: tbname: vms-kvm-t0 ptf_name: ptf_vms6-1 tbtype: t0 + section: part-1 + + - job: t0_part2 + pool: sonictest + displayName: "kvmtest-t0-part2" + timeoutInMinutes: 360 + + steps: + - template: .azure-pipelines/run-test-template.yml + parameters: + dut: vlab-01 + tbname: vms-kvm-t0 + ptf_name: ptf_vms6-1 + tbtype: t0 + section: part-2 + + - job: + pool: sonictest + displayName: "kvmtest-t0" + timeoutInMinutes: 360 + dependsOn: + - t0_part1 + - t0_part2 + condition: always() + variables: + resultOfPart1: $[ dependencies.t0_part1.result ] + resultOfPart2: $[ dependencies.t0_part2.result ] + + steps: + - script: | + if [ $(resultOfPart1) == "Succeeded" ] && [ $(resultOfPart2) == "Succeeded" ]; then + echo "Both job kvmtest-t0-part1 and kvmtest-t0-part2 are passed." + exit 0 + else + echo "Either job kvmtest-t0-part1 or job kvmtest-t0-part2 failed! Please check the detailed information." + exit 1 + fi - job: pool: sonictest-t1-lag From d82eafd8ae303570584e6484ffc34dfc6968e377 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 24 Feb 2022 17:29:59 +0800 Subject: [PATCH 060/139] [system-health] Fix file handle leak (#10059) - Why I did it swsscommon.ConfigDBConnector does not automatically close connection when the instance is recycled by python. So, it should not create this instance each time calling check_services. It will cause error like Failed to read from file /var/run/hw-management/led/led_status_capability - OSError(24, 'Too many open files') - How I did it Only connect DB once in init - How to verify it Manual test --- src/system-health/health_checker/service_checker.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index fa47e1e50c6..6918da0b9f0 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -51,6 +51,8 @@ def __init__(self): self.need_save_cache = False + self.config_db = None + self.load_critical_process_cache() def get_expected_running_containers(self, feature_table): @@ -248,9 +250,10 @@ def check_services(self, config): Args: config (config.Config): Health checker configuration. """ - config_db = swsscommon.ConfigDBConnector() - config_db.connect() - feature_table = config_db.get_table("FEATURE") + if not self.config_db: + self.config_db = swsscommon.ConfigDBConnector() + self.config_db.connect() + feature_table = self.config_db.get_table("FEATURE") expected_running_containers, self.container_feature_dict = self.get_expected_running_containers(feature_table) current_running_containers = self.get_current_running_containers() From fe59e0f2c0a6e6882bbafb6decdb6c9ddee05dfa Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Thu, 24 Feb 2022 18:05:56 +0800 Subject: [PATCH 061/139] [Mellanox] Fix issue: thermal zone threshold value 0 causes fan speed stuck at 100% (#10057) - Why I did it In SONiC thermal control algorithm, it compares thermal zone temperature with thermal zone threshold. Previously, a thermal zone with no thermal sensor can still get its threshold. However, a recently driver patch changes this behavior: a thermal zone with no thermal sensor will return 0 for threshold. We need to ignore such thermal zone. - How I did it Ignore thermal zones whose temperature is 0. - How to verify it Added unit test case and Manual test --- .../sonic_platform/thermal.py | 7 ++++- .../mlnx-platform-api/tests/test_thermal.py | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index e4d22575450..22cf5a51352 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -400,9 +400,14 @@ def get_min_allowed_cooling_level_by_thermal_zone(cls): thermal_zone_present = False try: for thermal_zone_folder in glob.iglob(THERMAL_ZONE_FOLDER_WILDCARD): + current = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_TEMP_FILE)) + if current == 0: + # Temperature value 0 means that this thermal zone has no + # sensor and it should be ignored in this loop + continue + thermal_zone_present = True normal_thresh = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_NORMAL_THRESHOLD)) - current = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_TEMP_FILE)) if current < normal_thresh - THERMAL_ZONE_HYSTERESIS: continue diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py index 216b5cd316c..89c940d8926 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal.py @@ -238,6 +238,32 @@ def mock_read_int_from_file(file_path, default=0, raise_exception=False): mock_file_content[os.path.join('thermal_zone1', THERMAL_ZONE_TEMP_FILE)] = 81000 assert Thermal.get_min_allowed_cooling_level_by_thermal_zone() is None + @mock.patch('glob.iglob', mock.MagicMock(return_value=['thermal_zone1', 'thermal_zone2'])) + @mock.patch('sonic_platform.utils.read_int_from_file') + def test_no_sensor_thermal_zone(self, mock_read_file): + from sonic_platform.thermal import Thermal, THERMAL_ZONE_TEMP_FILE, THERMAL_ZONE_HIGH_THRESHOLD, THERMAL_ZONE_NORMAL_THRESHOLD, MIN_COOLING_LEVEL_FOR_HIGH, MIN_COOLING_LEVEL_FOR_NORMAL + + mock_file_content = {} + def mock_read_int_from_file(file_path, **kwargs): + return mock_file_content[file_path] + + mock_read_file.side_effect = mock_read_int_from_file + mock_file_content[os.path.join('thermal_zone1', THERMAL_ZONE_NORMAL_THRESHOLD)] = 0 + mock_file_content[os.path.join('thermal_zone1', THERMAL_ZONE_HIGH_THRESHOLD)] = 0 + mock_file_content[os.path.join('thermal_zone1', THERMAL_ZONE_TEMP_FILE)] = 0 + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_NORMAL_THRESHOLD)] = 75000 + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_HIGH_THRESHOLD)] = 85000 + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_TEMP_FILE)] = 24000 + assert Thermal.get_min_allowed_cooling_level_by_thermal_zone() == MIN_COOLING_LEVEL_FOR_NORMAL + + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_TEMP_FILE)] = 71000 + assert Thermal.get_min_allowed_cooling_level_by_thermal_zone() == MIN_COOLING_LEVEL_FOR_HIGH + + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_TEMP_FILE)] = 79000 + assert Thermal.get_min_allowed_cooling_level_by_thermal_zone() == MIN_COOLING_LEVEL_FOR_HIGH + + mock_file_content[os.path.join('thermal_zone2', THERMAL_ZONE_TEMP_FILE)] = 81000 + assert Thermal.get_min_allowed_cooling_level_by_thermal_zone() is None def test_check_module_temperature_trustable(self): from sonic_platform.thermal import Thermal From 2bfad16ae1f9879e4355b213a3746feebd748044 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 24 Feb 2022 10:06:43 -0800 Subject: [PATCH 062/139] Fix Headroom value for 7260C64 SKU (#10075) Updated the Headroom value for (100G,5m) in 7260C64 SKU. --- .../Arista-7260CX3-C64/pg_profile_lookup.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini index cbc06c81806..0e71479fc2c 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini @@ -1,6 +1,6 @@ # PG lossless profiles. # speed cable size xon xoff threshold xon_offset - 100000 5m 1248 1248 96928 -3 2496 + 100000 5m 1248 1248 54080 -3 2496 100000 40m 1248 1248 59696 -3 2496 100000 300m 1248 1248 101088 -3 2496 40000 5m 1248 1248 29536 -3 2496 From fd22635de0ea6376b0142a2451b081efdbaa2303 Mon Sep 17 00:00:00 2001 From: arlakshm <55814491+arlakshm@users.noreply.github.com> Date: Thu, 24 Feb 2022 11:21:26 -0800 Subject: [PATCH 063/139] [chassis][bgp] create v4 and v6 peer group for VoQ internal neighbors (#9693) Why I did it In the recent minigraph changes we add separate BGP session configuration for V4 and V6 internal VoQ neighbors. This PR is adding different Peer groups for V4 and V6 neighbors How I did it Add VOQ_CHASSIS_V4_PEER and VOQ_CHASSIS_V6_PEER groups Add extra Unit tests How to verify it Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan --- .../templates/voq_chassis/instance.conf.j2 | 6 ++++- .../templates/voq_chassis/peer-group.conf.j2 | 23 ++++++++++------- .../templates/voq_chassis/policies.conf.j2 | 11 ++++++++ .../{param_all.json => param_all_v4.json} | 0 .../instance.conf/param_all_v6.json | 22 ++++++++++++++++ .../{param_base.json => param_base_v4.json} | 0 .../instance.conf/param_base_v6.json | 17 +++++++++++++ ...utdown_1.json => param_shutdown_v4_1.json} | 0 ...utdown_2.json => param_shutdown_v4_2.json} | 0 .../instance.conf/param_shutdown_v6_1.json | 19 ++++++++++++++ .../instance.conf/param_shutdown_v6_2.json | 19 ++++++++++++++ ...m_timers_1.json => param_timers_v4_1.json} | 0 ...m_timers_2.json => param_timers_v4_2.json} | 0 .../instance.conf/param_timers_v6_1.json | 18 +++++++++++++ .../instance.conf/param_timers_v6_2.json | 18 +++++++++++++ .../{result_all.conf => result_all_v4.conf} | 3 ++- .../instance.conf/result_all_v6.conf | 25 +++++++++++++++++++ ...sult_timers_1.conf => result_base_v4.conf} | 2 +- .../instance.conf/result_base_v6.conf | 23 +++++++++++++++++ ...tdown_1.conf => result_shutdown_v4_1.conf} | 3 ++- ...lt_base.conf => result_shutdown_v4_2.conf} | 2 +- .../instance.conf/result_shutdown_v6_1.conf | 25 +++++++++++++++++++ .../instance.conf/result_shutdown_v6_2.conf | 23 +++++++++++++++++ ..._timers_2.conf => result_timers_v4_1.conf} | 2 +- ...hutdown_2.conf => result_timers_v4_2.conf} | 2 +- .../instance.conf/result_timers_v6_1.conf | 23 +++++++++++++++++ .../instance.conf/result_timers_v6_2.conf | 23 +++++++++++++++++ .../peer-group.conf/result_all.conf | 23 ++++++++++------- .../peer-group.conf/result_base.conf | 19 ++++++++------ .../policies.conf/result_base.conf | 11 ++++++++ 30 files changed, 330 insertions(+), 32 deletions(-) rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_all.json => param_all_v4.json} (100%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v6.json rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_base.json => param_base_v4.json} (100%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v6.json rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_shutdown_1.json => param_shutdown_v4_1.json} (100%) rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_shutdown_2.json => param_shutdown_v4_2.json} (100%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_1.json create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_2.json rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_timers_1.json => param_timers_v4_1.json} (100%) rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{param_timers_2.json => param_timers_v4_2.json} (100%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_1.json create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_2.json rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_all.conf => result_all_v4.conf} (90%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v6.conf rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_timers_1.conf => result_base_v4.conf} (90%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v6.conf rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_shutdown_1.conf => result_shutdown_v4_1.conf} (90%) rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_base.conf => result_shutdown_v4_2.conf} (90%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_1.conf create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_2.conf rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_timers_2.conf => result_timers_v4_1.conf} (90%) rename src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/{result_shutdown_2.conf => result_timers_v4_2.conf} (90%) create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_1.conf create mode 100644 src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_2.conf diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/instance.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/instance.conf.j2 index 1783b875ad2..4f7bde5ddf1 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/instance.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/instance.conf.j2 @@ -4,7 +4,11 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor {{ neighbor_addr }} peer-group VOQ_CHASSIS_PEER +{% if neighbor_addr | ipv4 %} + neighbor {{ neighbor_addr }} peer-group VOQ_CHASSIS_V4_PEER +{% elif neighbor_addr | ipv6 %} + neighbor {{ neighbor_addr }} peer-group VOQ_CHASSIS_V6_PEER +{% endif %} neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} neighbor {{ neighbor_addr }} timers 3 10 diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/peer-group.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/peer-group.conf.j2 index 8266c0c82d7..ec563b380cc 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/peer-group.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/peer-group.conf.j2 @@ -1,22 +1,27 @@ ! ! template: bgpd/templates/voq_chassis/peer-group.conf.j2 ! - neighbor VOQ_CHASSIS_PEER peer-group + neighbor VOQ_CHASSIS_V4_PEER peer-group + neighbor VOQ_CHASSIS_V6_PEER peer-group address-family ipv4 {% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} - neighbor VOQ_CHASSIS_PEER allowas-in 1 + neighbor VOQ_CHASSIS_V4_PEER allowas-in 1 {% endif %} - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER activate + neighbor VOQ_CHASSIS_V4_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V4_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V4_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V4_PEER out exit-address-family address-family ipv6 {% if CONFIG_DB__DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} - neighbor VOQ_CHASSIS_PEER allowas-in 1 + neighbor VOQ_CHASSIS_V6_PEER allowas-in 1 {% endif %} - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V6_PEER activate + neighbor VOQ_CHASSIS_V6_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V6_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V6_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V6_PEER out exit-address-family ! ! end of template: bgpd/templates/voq_chassis/peer-group.conf.j2 diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 index 4c853d4f322..c26db7bde24 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/voq_chassis/policies.conf.j2 @@ -1,7 +1,18 @@ ! ! template: bgpd/templates/voq_chassis/policies.conf.j2 ! +route-map FROM_VOQ_CHASSIS_V4_PEER permit 100 ! +route-map TO_VOQ_CHASSIS_V4_PEER permit 100 +! +! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 1 + set ipv6 next-hop prefer-global + on-match next +! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 100 +! +route-map TO_VOQ_CHASSIS_V6_PEER permit 100 ! ! end of template: bgpd/templates/voq_chassis/policies.conf.j2 ! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v4.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v4.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v6.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v6.json new file mode 100644 index 00000000000..d78af6c7588 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_all_v6.json @@ -0,0 +1,22 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": {} + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1", + "keepalive": "5", + "holdtime": "30", + "admin_status": "down" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true", + "ipv4": "32", + "ipv6": "24" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v4.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v4.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v6.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v6.json new file mode 100644 index 00000000000..4b9b884fcf2 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_base_v6.json @@ -0,0 +1,17 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": {} + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_1.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v4_1.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_1.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v4_1.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_2.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v4_2.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_2.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v4_2.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_1.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_1.json new file mode 100644 index 00000000000..3ceeb3f0033 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_1.json @@ -0,0 +1,19 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "default_bgp_status": "down" + } + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_2.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_2.json new file mode 100644 index 00000000000..8f2881b75f3 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_shutdown_v6_2.json @@ -0,0 +1,19 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": { + "default_bgp_status": "up" + } + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_1.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v4_1.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_1.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v4_1.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_2.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v4_2.json similarity index 100% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_2.json rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v4_2.json diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_1.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_1.json new file mode 100644 index 00000000000..e236b791ef0 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_1.json @@ -0,0 +1,18 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": {} + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1", + "keepalive": "5" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_2.json b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_2.json new file mode 100644 index 00000000000..ce077e5bc6d --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/param_timers_v6_2.json @@ -0,0 +1,18 @@ +{ + "CONFIG_DB__DEVICE_METADATA": { + "localhost": {} + }, + "neighbor_addr": "fc00::01", + "bgp_session": { + "asn": "555", + "name": "internal1", + "holdtime": "240" + }, + "constants": { + "bgp": { + "maximum_paths": { + "enabled": "true" + } + } + } +} diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v4.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v4.conf index 7d2cc541362..604af65d5e6 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v4.conf @@ -4,12 +4,13 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 neighbor 10.10.10.10 timers connect 10 neighbor 10.10.10.10 shutdown +! address-family ipv4 maximum-paths ibgp 32 ! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v6.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v6.conf new file mode 100644 index 00000000000..793473c2e20 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_all_v6.conf @@ -0,0 +1,25 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + neighbor fc00::01 shutdown +! + address-family ipv4 + maximum-paths ibgp 32 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 24 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_1.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v4.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_1.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v4.conf index c5f2385192d..23bf5841f9c 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_1.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v4.conf @@ -4,7 +4,7 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v6.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v6.conf new file mode 100644 index 00000000000..a0bd9379c8b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base_v6.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + address-family ipv4 + maximum-paths ibgp 64 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 64 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_1.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_1.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_1.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_1.conf index 91f405cea9d..f26f0d6d3d0 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_1.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_1.conf @@ -4,12 +4,13 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 neighbor 10.10.10.10 timers connect 10 neighbor 10.10.10.10 shutdown +! address-family ipv4 maximum-paths ibgp 64 ! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_2.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_2.conf index c5f2385192d..23bf5841f9c 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_base.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v4_2.conf @@ -4,7 +4,7 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_1.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_1.conf new file mode 100644 index 00000000000..4057147d5d5 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_1.conf @@ -0,0 +1,25 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + neighbor fc00::01 shutdown +! + address-family ipv4 + maximum-paths ibgp 64 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 64 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_2.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_2.conf new file mode 100644 index 00000000000..a0bd9379c8b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_v6_2.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + address-family ipv4 + maximum-paths ibgp 64 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 64 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_2.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_1.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_2.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_1.conf index c5f2385192d..23bf5841f9c 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_2.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_1.conf @@ -4,7 +4,7 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_2.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_2.conf similarity index 90% rename from src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_2.conf rename to src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_2.conf index c5f2385192d..23bf5841f9c 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_shutdown_2.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v4_2.conf @@ -4,7 +4,7 @@ bgp bestpath as-path multipath-relax bgp bestpath peer-type multipath-relax ! - neighbor 10.10.10.10 peer-group VOQ_CHASSIS_PEER + neighbor 10.10.10.10 peer-group VOQ_CHASSIS_V4_PEER neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description internal1 neighbor 10.10.10.10 timers 3 10 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_1.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_1.conf new file mode 100644 index 00000000000..a0bd9379c8b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_1.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + address-family ipv4 + maximum-paths ibgp 64 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 64 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_2.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_2.conf new file mode 100644 index 00000000000..a0bd9379c8b --- /dev/null +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/instance.conf/result_timers_v6_2.conf @@ -0,0 +1,23 @@ +! +! template: bgpd/templates/voq_chassis/instance.conf.j2 +! + bgp bestpath as-path multipath-relax + bgp bestpath peer-type multipath-relax +! + neighbor fc00::01 peer-group VOQ_CHASSIS_V6_PEER + neighbor fc00::01 remote-as 555 + neighbor fc00::01 description internal1 + neighbor fc00::01 timers 3 10 + neighbor fc00::01 timers connect 10 + address-family ipv4 + maximum-paths ibgp 64 +! + exit-address-family +! + address-family ipv6 + maximum-paths ibgp 64 +! + exit-address-family +! +! end of template: bgpd/templates/voq_chassis/instance.conf.j2 +! diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_all.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_all.conf index 031884499aa..1ec1cffed95 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_all.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_all.conf @@ -1,18 +1,23 @@ ! ! template: bgpd/templates/voq_chassis/peer-group.conf.j2 ! - neighbor VOQ_CHASSIS_PEER peer-group + neighbor VOQ_CHASSIS_V4_PEER peer-group + neighbor VOQ_CHASSIS_V6_PEER peer-group address-family ipv4 - neighbor VOQ_CHASSIS_PEER allowas-in 1 - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER allowas-in 1 + neighbor VOQ_CHASSIS_V4_PEER activate + neighbor VOQ_CHASSIS_V4_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V4_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V4_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V4_PEER out exit-address-family address-family ipv6 - neighbor VOQ_CHASSIS_PEER allowas-in 1 - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V6_PEER allowas-in 1 + neighbor VOQ_CHASSIS_V6_PEER activate + neighbor VOQ_CHASSIS_V6_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V6_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V6_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V6_PEER out exit-address-family ! ! end of template: bgpd/templates/voq_chassis/peer-group.conf.j2 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_base.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_base.conf index d4a6f381a22..a8f7a0eea52 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_base.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/peer-group.conf/result_base.conf @@ -1,16 +1,21 @@ ! ! template: bgpd/templates/voq_chassis/peer-group.conf.j2 ! - neighbor VOQ_CHASSIS_PEER peer-group + neighbor VOQ_CHASSIS_V4_PEER peer-group + neighbor VOQ_CHASSIS_V6_PEER peer-group address-family ipv4 - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER activate + neighbor VOQ_CHASSIS_V4_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V4_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V4_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V4_PEER out exit-address-family address-family ipv6 - neighbor VOQ_CHASSIS_PEER activate - neighbor VOQ_CHASSIS_PEER addpath-tx-all-paths - neighbor VOQ_CHASSIS_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V6_PEER activate + neighbor VOQ_CHASSIS_V6_PEER addpath-tx-all-paths + neighbor VOQ_CHASSIS_V6_PEER soft-reconfiguration inbound + neighbor VOQ_CHASSIS_V4_PEER route-map FROM_VOQ_CHASSIS_V6_PEER in + neighbor VOQ_CHASSIS_V4_PEER route-map TO_VOQ_CHASSIS_V6_PEER out exit-address-family ! ! end of template: bgpd/templates/voq_chassis/peer-group.conf.j2 diff --git a/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf b/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf index 4c853d4f322..c26db7bde24 100644 --- a/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf +++ b/src/sonic-bgpcfgd/tests/data/voq_chassis/policies.conf/result_base.conf @@ -1,7 +1,18 @@ ! ! template: bgpd/templates/voq_chassis/policies.conf.j2 ! +route-map FROM_VOQ_CHASSIS_V4_PEER permit 100 ! +route-map TO_VOQ_CHASSIS_V4_PEER permit 100 +! +! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 1 + set ipv6 next-hop prefer-global + on-match next +! +route-map FROM_VOQ_CHASSIS_V6_PEER permit 100 +! +route-map TO_VOQ_CHASSIS_V6_PEER permit 100 ! ! end of template: bgpd/templates/voq_chassis/policies.conf.j2 ! From a50d1f1fc862e23e268ebd99d1f59fb9fd7b9e8f Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 24 Feb 2022 14:55:45 -0800 Subject: [PATCH 064/139] [write_standby]: Increase timeout to 60s (#10065) - Avoid scenarios where script times out before orchagent can establish IPinIP tunnel Signed-off-by: Lawrence Lee --- files/scripts/write_standby.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/scripts/write_standby.py b/files/scripts/write_standby.py index 4c5455803fa..53cf5265ecd 100755 --- a/files/scripts/write_standby.py +++ b/files/scripts/write_standby.py @@ -91,7 +91,7 @@ def tunnel_exists(self): tunnel_key_pattern = 'ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:*' return len(self.asic_db.keys('ASIC_DB', tunnel_key_pattern)) > 0 - def wait_for_tunnel(self, interval=1, timeout=30): + def wait_for_tunnel(self, interval=1, timeout=60): """ Waits until the IP-in-IP tunnel has been created From b101b023d3eccbc998ead608bf62929045892800 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 25 Feb 2022 08:59:57 +0800 Subject: [PATCH 065/139] [Security]: Upgrade urllib3 to fix CVE-2021-33503 See https://security.archlinux.org/CVE-2021-33503 --- dockers/docker-sonic-mgmt-framework/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index a9a9beaa758..d727ac449d4 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -15,7 +15,7 @@ RUN pip3 install connexion==2.7.0 \ certifi==2017.4.17 \ python-dateutil==2.6.0 \ six==1.11.0 \ - urllib3==1.21.1 + urllib3==1.26.5 COPY \ {% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%} From c9cf4d9ff0432679a25108456d9509104ace9815 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Thu, 24 Feb 2022 17:00:13 -0800 Subject: [PATCH 066/139] sonic-slave-buster pins the versions of Jinja2 and MarkupSafe in py3 (#10043) #### Why I did it Upstream breaking change, ref discussion https://github.com/pallets/markupsafe/issues/282 --- .azure-pipelines/azure-pipelines-image-template.yml | 1 - sonic-slave-buster/Dockerfile.j2 | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 70c40d64b6a..0a83c334074 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -43,7 +43,6 @@ jobs: [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" git checkout -b $BRANCH_NAME sudo modprobe overlay - pip3 install MarkupSafe==2.0.1 --force-reinstall sudo apt-get install -y acl sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 8189338071e..0f5c6414a19 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -465,6 +465,11 @@ RUN pip3 uninstall -y enum34 # For templating RUN pip2 install j2cli==0.3.10 +# Note: Jinja2 depends on MarkupSafe, however markupsafe 2.1.0 breaks Jinja2 2.10 +# Debian buster dist-packages include python3-markupsafe (1.1.0-1) and python3-jinja2 (2.10-2) +# If not pinning the versions, any requirement like `MarkupSafe>=2.0` will pull latest into site-packages and mess up. +RUN pip3 install MarkupSafe==2.0.1 +RUN pip3 install Jinja2==3.0.3 # For sonic-mgmt-framework RUN pip2 install "PyYAML==5.4.1" From 91204879dfe8399e61ebff4c184b8df4c1da3109 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Thu, 24 Feb 2022 17:54:45 -0800 Subject: [PATCH 067/139] [swss]: Wait for vlan intf to start ndppd (#10036) - Use the `wait_for_link.sh` script to delay ndppd start until after the VLAN interface is ready - Avoids issue where ndppd tries to change interface attributes before the interface is ready Signed-off-by: Lawrence Lee --- dockers/docker-orchagent/Dockerfile.j2 | 1 - dockers/docker-orchagent/docker-init.j2 | 1 + dockers/docker-orchagent/ndppd.conf | 9 ------ dockers/docker-orchagent/supervisord.conf.j2 | 25 ++++++++++++++++ dockers/docker-orchagent/wait_for_link.sh.j2 | 30 ++++++++++++++++++++ 5 files changed, 56 insertions(+), 10 deletions(-) delete mode 100644 dockers/docker-orchagent/ndppd.conf create mode 100644 dockers/docker-orchagent/wait_for_link.sh.j2 diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 5e403213c1d..3c04ff7c135 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -68,7 +68,6 @@ RUN apt-get purge -y \ COPY ["files/arp_update", "/usr/bin"] COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"] -COPY ["ndppd.conf", "/usr/share/sonic/templates/"] COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"] COPY ["orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index ff543c23490..52a1c4717cc 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -18,6 +18,7 @@ CFGGEN_PARAMS=" \ -t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \ -t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \ -t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf + -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) diff --git a/dockers/docker-orchagent/ndppd.conf b/dockers/docker-orchagent/ndppd.conf deleted file mode 100644 index b9dbc293ed2..00000000000 --- a/dockers/docker-orchagent/ndppd.conf +++ /dev/null @@ -1,9 +0,0 @@ -[program:ndppd] -command=/usr/sbin/ndppd -priority=7 -autostart=false -autorestart=unexpected -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=vlanmgrd:running diff --git a/dockers/docker-orchagent/supervisord.conf.j2 b/dockers/docker-orchagent/supervisord.conf.j2 index 7cd31a11322..7954fa7fa6b 100644 --- a/dockers/docker-orchagent/supervisord.conf.j2 +++ b/dockers/docker-orchagent/supervisord.conf.j2 @@ -299,3 +299,28 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {%- endif %} + +{% if is_fabric_asic == 0 %} +[program:ndppd] +command=/usr/sbin/ndppd +priority=7 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=wait_for_link:exited +{%- endif %} + +{% if is_fabric_asic == 0 %} +[program:wait_for_link] +command=/usr/bin/wait_for_link.sh +priority=7 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited +{%- endif %} diff --git a/dockers/docker-orchagent/wait_for_link.sh.j2 b/dockers/docker-orchagent/wait_for_link.sh.j2 new file mode 100644 index 00000000000..980b472b3e0 --- /dev/null +++ b/dockers/docker-orchagent/wait_for_link.sh.j2 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +VLAN_TABLE_PREFIX="VLAN_TABLE" + +function wait_until_iface_ready +{ + TABLE_PREFIX=$1 + IFACE=$2 + + echo "Waiting until interface $IFACE is ready..." + + # Wait for the interface to come up + # (i.e., interface is present in STATE_DB and state is "ok") + while true; do + RESULT=$(sonic-db-cli STATE_DB HGET "${TABLE_PREFIX}|${IFACE}" "state" 2> /dev/null) + if [ x"$RESULT" == x"ok" ]; then + break + fi + + sleep 1 + done + + echo "Interface ${IFACE} is ready!" +} + + +# Wait for all interfaces to be up and ready +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} +{% endfor %} From 8dc00ef4e1f5428f51834577e0cbb64913bc5998 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Fri, 25 Feb 2022 08:03:35 -0500 Subject: [PATCH 068/139] [mellanox] Fix DPB supported breakout modes (#10072) --- .../Mellanox-SN2700-D40C8S8/hwsku.json | 178 --------- .../x86_64-mlnx_msn2700-r0/platform.json | 6 +- .../Mellanox-SN3800-D100C12S2/hwsku.json | 346 ----------------- .../Mellanox-SN3800-D112C8/hwsku.json | 364 ------------------ .../Mellanox-SN3800-D24C52/hwsku.json | 232 ----------- .../Mellanox-SN3800-D28C49S1/hwsku.json | 238 ------------ .../Mellanox-SN3800-D28C50/hwsku.json | 238 ------------ .../x86_64-mlnx_msn3800-r0/platform.json | 192 +++------ .../x86_64-mlnx_msn4600-r0/platform.json | 192 +++------ 9 files changed, 130 insertions(+), 1856 deletions(-) delete mode 100644 device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/hwsku.json delete mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/hwsku.json delete mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/hwsku.json delete mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/hwsku.json delete mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/hwsku.json delete mode 100644 device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/hwsku.json diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/hwsku.json b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/hwsku.json deleted file mode 100644 index 63a3005ad59..00000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/hwsku.json +++ /dev/null @@ -1,178 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet1": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet2": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet3": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet4": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet9": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet10": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet11": { - "default_brkout_mode": "4x10G[25G]" - }, - "Ethernet12": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet18": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet22": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet50": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet54": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet58": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet62": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet66": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet70": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet74": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet78": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet82": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet86": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet114": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet118": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet122": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet126": { - "default_brkout_mode": "2x50G[25G,10G]" - } - } -} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json index fab5ea6bf11..063a211e785 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json @@ -381,8 +381,7 @@ "lanes": "0,1,2,3", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp1"], - "2x50G[25G,10G]": ["etp1a", "etp1b"], - "4x10G[25G]": ["etp1a", "etp1b", "etp1c", "etp1d"] + "2x50G[25G,10G]": ["etp1a", "etp1b"] } }, "Ethernet4": { @@ -398,8 +397,7 @@ "lanes": "8,9,10,11", "breakout_modes": { "1x100G[50G,40G,25G,10G]": ["etp3"], - "2x50G[25G,10G]": ["etp3a", "etp3b"], - "4x10G[25G]": ["etp3a", "etp3b", "etp3c", "etp3d"] + "2x50G[25G,10G]": ["etp3a", "etp3b"] } }, "Ethernet12": { diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/hwsku.json b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/hwsku.json deleted file mode 100644 index 2b1d5d32228..00000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/hwsku.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet2": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet4": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet6": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet10": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet12": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet14": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet18": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet22": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet26": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet30": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet34": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet38": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet50": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet54": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet58": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet62": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet66": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet70": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet74": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet78": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet82": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet86": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet90": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet94": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet98": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet102": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet114": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet118": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet122": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet126": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet128": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet130": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet132": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet134": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet136": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet138": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet140": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet142": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet144": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet146": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet148": { - "default_brkout_mode": "1x10G[100G,50G,40G,25G]" - }, - "Ethernet152": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet154": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet156": { - "default_brkout_mode": "1x10G[100G,50G,40G,25G]" - }, - "Ethernet160": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet162": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet164": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet166": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet168": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet170": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet172": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet174": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet176": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet178": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet180": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet182": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet184": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet186": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet188": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet190": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet192": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet194": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet196": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet198": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet200": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet202": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet204": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet206": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet208": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet212": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet216": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet220": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet224": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet228": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet232": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet236": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet240": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet244": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet248": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet252": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/hwsku.json b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/hwsku.json deleted file mode 100644 index 5bc784192c8..00000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/hwsku.json +++ /dev/null @@ -1,364 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet2": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet4": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet6": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet10": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet12": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet14": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet18": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet22": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet26": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet30": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet34": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet38": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet50": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet54": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet58": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet62": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet66": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet70": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet74": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet78": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet82": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet86": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet90": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet94": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet122": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet126": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet128": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet132": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet136": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet138": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet140": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet142": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet144": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet148": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet152": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet154": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet156": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet158": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet160": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet162": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet164": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet166": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet168": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet170": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet172": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet174": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet176": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet178": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet180": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet182": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet184": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet186": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet188": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet190": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet192": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet194": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet196": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet198": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet200": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet202": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet204": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet206": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet208": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet210": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet212": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet214": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet216": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet218": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet220": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet222": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet224": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet226": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet228": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet230": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet232": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet234": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet236": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet238": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet240": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet242": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet244": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet246": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet248": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet250": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet252": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet254": { - "default_brkout_mode": "2x50G[25G,10G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/hwsku.json b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/hwsku.json deleted file mode 100644 index 04826b7f557..00000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/hwsku.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet4": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet12": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet34": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet38": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet128": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet132": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet136": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet140": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet144": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet148": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet152": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet156": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet160": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet164": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet168": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet172": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet176": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet178": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet180": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet182": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet184": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet186": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet188": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet190": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet192": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet196": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet200": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet204": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet208": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet212": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet216": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet220": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet224": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet228": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet232": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet236": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet240": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet242": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet244": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet246": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet248": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet252": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/hwsku.json b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/hwsku.json deleted file mode 100644 index 83c69052a64..00000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/hwsku.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet4": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet12": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet34": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet38": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet128": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet132": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet136": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet140": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet144": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet148": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet152": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet156": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet160": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet164": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet166": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet168": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet172": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet176": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet178": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet180": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet182": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet184": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet186": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet188": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet190": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet192": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet196": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet200": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet204": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet208": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet212": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet216": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet220": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet224": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet228": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet232": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet236": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet240": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet242": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet244": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet246": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet248": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet250": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet252": { - "default_brkout_mode": "1x10G[100G,50G,40G,25G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/hwsku.json b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/hwsku.json deleted file mode 100644 index f7334a858bf..00000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/hwsku.json +++ /dev/null @@ -1,238 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet4": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet8": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet12": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet16": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet20": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet28": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet32": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet34": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet36": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet38": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet40": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet42": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet44": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet46": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet48": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet52": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet56": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet60": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet64": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet68": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet72": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet76": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet80": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet84": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet92": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet104": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet106": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet108": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet110": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet116": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet120": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet124": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet128": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet132": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet136": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet140": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet144": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet148": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet152": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet156": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet160": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet164": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet168": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet172": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet176": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet178": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet180": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet182": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet184": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet186": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet188": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet190": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet192": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet196": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet200": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet204": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet208": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet212": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet216": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet220": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet224": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet228": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet232": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet236": { - "default_brkout_mode": "1x100G[50G,40G,25G,10G]" - }, - "Ethernet240": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet242": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet244": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet246": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet248": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet250": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet252": { - "default_brkout_mode": "2x50G[25G,10G]" - }, - "Ethernet254": { - "default_brkout_mode": "2x50G[25G,10G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json index db273059482..fa50c885084 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json @@ -724,512 +724,448 @@ "index": "1,1,1,1", "lanes": "0,1,2,3", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp1"], - "2x50G[25G,10G]": ["etp1a", "etp1b"] + "1x100G[50G,40G,25G,10G]": ["etp1"] } }, "Ethernet4": { "index": "2,2,2,2", "lanes": "4,5,6,7", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp2"], - "2x50G[25G,10G]": ["etp2a", "etp2b"] + "1x100G[50G,40G,25G,10G]": ["etp2"] } }, "Ethernet8": { "index": "3,3,3,3", "lanes": "8,9,10,11", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp3"], - "2x50G[25G,10G]": ["etp3a", "etp3b"] + "1x100G[50G,40G,25G,10G]": ["etp3"] } }, "Ethernet12": { "index": "4,4,4,4", "lanes": "12,13,14,15", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp4"], - "2x50G[25G,10G]": ["etp4a", "etp4b"] + "1x100G[50G,40G,25G,10G]": ["etp4"] } }, "Ethernet16": { "index": "5,5,5,5", "lanes": "16,17,18,19", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp5"], - "2x50G[25G,10G]": ["etp5a", "etp5b"] + "1x100G[50G,40G,25G,10G]": ["etp5"] } }, "Ethernet20": { "index": "6,6,6,6", "lanes": "20,21,22,23", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp6"], - "2x50G[25G,10G]": ["etp6a", "etp6b"] + "1x100G[50G,40G,25G,10G]": ["etp6"] } }, "Ethernet24": { "index": "7,7,7,7", "lanes": "24,25,26,27", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp7"], - "2x50G[25G,10G]": ["etp7a", "etp7b"] + "1x100G[50G,40G,25G,10G]": ["etp7"] } }, "Ethernet28": { "index": "8,8,8,8", "lanes": "28,29,30,31", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp8"], - "2x50G[25G,10G]": ["etp8a", "etp8b"] + "1x100G[50G,40G,25G,10G]": ["etp8"] } }, "Ethernet32": { "index": "9,9,9,9", "lanes": "32,33,34,35", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp9"], - "2x50G[25G,10G]": ["etp9a", "etp9b"] + "1x100G[50G,40G,25G,10G]": ["etp9"] } }, "Ethernet36": { "index": "10,10,10,10", "lanes": "36,37,38,39", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp10"], - "2x50G[25G,10G]": ["etp10a", "etp10b"] + "1x100G[50G,40G,25G,10G]": ["etp10"] } }, "Ethernet40": { "index": "11,11,11,11", "lanes": "40,41,42,43", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp11"], - "2x50G[25G,10G]": ["etp11a", "etp11b"] + "1x100G[50G,40G,25G,10G]": ["etp11"] } }, "Ethernet44": { "index": "12,12,12,12", "lanes": "44,45,46,47", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp12"], - "2x50G[25G,10G]": ["etp12a", "etp12b"] + "1x100G[50G,40G,25G,10G]": ["etp12"] } }, "Ethernet48": { "index": "13,13,13,13", "lanes": "48,49,50,51", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp13"], - "2x50G[25G,10G]": ["etp13a", "etp13b"] + "1x100G[50G,40G,25G,10G]": ["etp13"] } }, "Ethernet52": { "index": "14,14,14,14", "lanes": "52,53,54,55", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp14"], - "2x50G[25G,10G]": ["etp14a", "etp14b"] + "1x100G[50G,40G,25G,10G]": ["etp14"] } }, "Ethernet56": { "index": "15,15,15,15", "lanes": "56,57,58,59", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp15"], - "2x50G[25G,10G]": ["etp15a", "etp15b"] + "1x100G[50G,40G,25G,10G]": ["etp15"] } }, "Ethernet60": { "index": "16,16,16,16", "lanes": "60,61,62,63", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp16"], - "2x50G[25G,10G]": ["etp16a", "etp16b"] + "1x100G[50G,40G,25G,10G]": ["etp16"] } }, "Ethernet64": { "index": "17,17,17,17", "lanes": "64,65,66,67", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp17"], - "2x50G[25G,10G]": ["etp17a", "etp17b"] + "1x100G[50G,40G,25G,10G]": ["etp17"] } }, "Ethernet68": { "index": "18,18,18,18", "lanes": "68,69,70,71", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp18"], - "2x50G[25G,10G]": ["etp18a", "etp18b"] + "1x100G[50G,40G,25G,10G]": ["etp18"] } }, "Ethernet72": { "index": "19,19,19,19", "lanes": "72,73,74,75", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp19"], - "2x50G[25G,10G]": ["etp19a", "etp19b"] + "1x100G[50G,40G,25G,10G]": ["etp19"] } }, "Ethernet76": { "index": "20,20,20,20", "lanes": "76,77,78,79", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp20"], - "2x50G[25G,10G]": ["etp20a", "etp20b"] + "1x100G[50G,40G,25G,10G]": ["etp20"] } }, "Ethernet80": { "index": "21,21,21,21", "lanes": "80,81,82,83", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp21"], - "2x50G[25G,10G]": ["etp21a", "etp21b"] + "1x100G[50G,40G,25G,10G]": ["etp21"] } }, "Ethernet84": { "index": "22,22,22,22", "lanes": "84,85,86,87", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp22"], - "2x50G[25G,10G]": ["etp22a", "etp22b"] + "1x100G[50G,40G,25G,10G]": ["etp22"] } }, "Ethernet88": { "index": "23,23,23,23", "lanes": "88,89,90,91", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp23"], - "2x50G[25G,10G]": ["etp23a", "etp23b"] + "1x100G[50G,40G,25G,10G]": ["etp23"] } }, "Ethernet92": { "index": "24,24,24,24", "lanes": "92,93,94,95", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp24"], - "2x50G[25G,10G]": ["etp24a", "etp24b"] + "1x100G[50G,40G,25G,10G]": ["etp24"] } }, "Ethernet96": { "index": "25,25,25,25", "lanes": "96,97,98,99", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp25"], - "2x50G[25G,10G]": ["etp25a", "etp25b"] + "1x100G[50G,40G,25G,10G]": ["etp25"] } }, "Ethernet100": { "index": "26,26,26,26", "lanes": "100,101,102,103", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp26"], - "2x50G[25G,10G]": ["etp26a", "etp26b"] + "1x100G[50G,40G,25G,10G]": ["etp26"] } }, "Ethernet104": { "index": "27,27,27,27", "lanes": "104,105,106,107", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp27"], - "2x50G[25G,10G]": ["etp27a", "etp27b"] + "1x100G[50G,40G,25G,10G]": ["etp27"] } }, "Ethernet108": { "index": "28,28,28,28", "lanes": "108,109,110,111", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp28"], - "2x50G[25G,10G]": ["etp28a", "etp28b"] + "1x100G[50G,40G,25G,10G]": ["etp28"] } }, "Ethernet112": { "index": "29,29,29,29", "lanes": "112,113,114,115", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp29"], - "2x50G[25G,10G]": ["etp29a", "etp29b"] + "1x100G[50G,40G,25G,10G]": ["etp29"] } }, "Ethernet116": { "index": "30,30,30,30", "lanes": "116,117,118,119", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp30"], - "2x50G[25G,10G]": ["etp30a", "etp30b"] + "1x100G[50G,40G,25G,10G]": ["etp30"] } }, "Ethernet120": { "index": "31,31,31,31", "lanes": "120,121,122,123", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp31"], - "2x50G[25G,10G]": ["etp31a", "etp31b"] + "1x100G[50G,40G,25G,10G]": ["etp31"] } }, "Ethernet124": { "index": "32,32,32,32", "lanes": "124,125,126,127", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp32"], - "2x50G[25G,10G]": ["etp32a", "etp32b"] + "1x100G[50G,40G,25G,10G]": ["etp32"] } }, "Ethernet128": { "index": "33,33,33,33", "lanes": "128,129,130,131", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp33"], - "2x50G[25G,10G]": ["etp33a", "etp33b"] + "1x100G[50G,40G,25G,10G]": ["etp33"] } }, "Ethernet132": { "index": "34,34,34,34", "lanes": "132,133,134,135", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp34"], - "2x50G[25G,10G]": ["etp34a", "etp34b"] + "1x100G[50G,40G,25G,10G]": ["etp34"] } }, "Ethernet136": { "index": "35,35,35,35", "lanes": "136,137,138,139", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp35"], - "2x50G[25G,10G]": ["etp35a", "etp35b"] + "1x100G[50G,40G,25G,10G]": ["etp35"] } }, "Ethernet140": { "index": "36,36,36,36", "lanes": "140,141,142,143", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp36"], - "2x50G[25G,10G]": ["etp36a", "etp36b"] + "1x100G[50G,40G,25G,10G]": ["etp36"] } }, "Ethernet144": { "index": "37,37,37,37", "lanes": "144,145,146,147", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp37"], - "2x50G[25G,10G]": ["etp37a", "etp37b"] + "1x100G[50G,40G,25G,10G]": ["etp37"] } }, "Ethernet148": { "index": "38,38,38,38", "lanes": "148,149,150,151", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp38"], - "2x50G[25G,10G]": ["etp38a", "etp38b"] + "1x100G[50G,40G,25G,10G]": ["etp38"] } }, "Ethernet152": { "index": "39,39,39,39", "lanes": "152,153,154,155", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp39"], - "2x50G[25G,10G]": ["etp39a", "etp39b"] + "1x100G[50G,40G,25G,10G]": ["etp39"] } }, "Ethernet156": { "index": "40,40,40,40", "lanes": "156,157,158,159", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp40"], - "2x50G[25G,10G]": ["etp40a", "etp40b"] + "1x100G[50G,40G,25G,10G]": ["etp40"] } }, "Ethernet160": { "index": "41,41,41,41", "lanes": "160,161,162,163", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp41"], - "2x50G[25G,10G]": ["etp41a", "etp41b"] + "1x100G[50G,40G,25G,10G]": ["etp41"] } }, "Ethernet164": { "index": "42,42,42,42", "lanes": "164,165,166,167", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp42"], - "2x50G[25G,10G]": ["etp42a", "etp42b"] + "1x100G[50G,40G,25G,10G]": ["etp42"] } }, "Ethernet168": { "index": "43,43,43,43", "lanes": "168,169,170,171", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp43"], - "2x50G[25G,10G]": ["etp43a", "etp43b"] + "1x100G[50G,40G,25G,10G]": ["etp43"] } }, "Ethernet172": { "index": "44,44,44,44", "lanes": "172,173,174,175", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp44"], - "2x50G[25G,10G]": ["etp44a", "etp44b"] + "1x100G[50G,40G,25G,10G]": ["etp44"] } }, "Ethernet176": { "index": "45,45,45,45", "lanes": "176,177,178,179", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp45"], - "2x50G[25G,10G]": ["etp45a", "etp45b"] + "1x100G[50G,40G,25G,10G]": ["etp45"] } }, "Ethernet180": { "index": "46,46,46,46", "lanes": "180,181,182,183", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp46"], - "2x50G[25G,10G]": ["etp46a", "etp46b"] + "1x100G[50G,40G,25G,10G]": ["etp46"] } }, "Ethernet184": { "index": "47,47,47,47", "lanes": "184,185,186,187", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp47"], - "2x50G[25G,10G]": ["etp47a", "etp47b"] + "1x100G[50G,40G,25G,10G]": ["etp47"] } }, "Ethernet188": { "index": "48,48,48,48", "lanes": "188,189,190,191", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp48"], - "2x50G[25G,10G]": ["etp48a", "etp48b"] + "1x100G[50G,40G,25G,10G]": ["etp48"] } }, "Ethernet192": { "index": "49,49,49,49", "lanes": "192,193,194,195", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp49"], - "2x50G[25G,10G]": ["etp49a", "etp49b"] + "1x100G[50G,40G,25G,10G]": ["etp49"] } }, "Ethernet196": { "index": "50,50,50,50", "lanes": "196,197,198,199", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp50"], - "2x50G[25G,10G]": ["etp50a", "etp50b"] + "1x100G[50G,40G,25G,10G]": ["etp50"] } }, "Ethernet200": { "index": "51,51,51,51", "lanes": "200,201,202,203", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp51"], - "2x50G[25G,10G]": ["etp51a", "etp51b"] + "1x100G[50G,40G,25G,10G]": ["etp51"] } }, "Ethernet204": { "index": "52,52,52,52", "lanes": "204,205,206,207", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp52"], - "2x50G[25G,10G]": ["etp52a", "etp52b"] + "1x100G[50G,40G,25G,10G]": ["etp52"] } }, "Ethernet208": { "index": "53,53,53,53", "lanes": "208,209,210,211", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp53"], - "2x50G[25G,10G]": ["etp53a", "etp53b"] + "1x100G[50G,40G,25G,10G]": ["etp53"] } }, "Ethernet212": { "index": "54,54,54,54", "lanes": "212,213,214,215", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp54"], - "2x50G[25G,10G]": ["etp54a", "etp54b"] + "1x100G[50G,40G,25G,10G]": ["etp54"] } }, "Ethernet216": { "index": "55,55,55,55", "lanes": "216,217,218,219", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp55"], - "2x50G[25G,10G]": ["etp55a", "etp55b"] + "1x100G[50G,40G,25G,10G]": ["etp55"] } }, "Ethernet220": { "index": "56,56,56,56", "lanes": "220,221,222,223", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp56"], - "2x50G[25G,10G]": ["etp56a", "etp56b"] + "1x100G[50G,40G,25G,10G]": ["etp56"] } }, "Ethernet224": { "index": "57,57,57,57", "lanes": "224,225,226,227", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp57"], - "2x50G[25G,10G]": ["etp57a", "etp57b"] + "1x100G[50G,40G,25G,10G]": ["etp57"] } }, "Ethernet228": { "index": "58,58,58,58", "lanes": "228,229,230,231", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp58"], - "2x50G[25G,10G]": ["etp58a", "etp58b"] + "1x100G[50G,40G,25G,10G]": ["etp58"] } }, "Ethernet232": { "index": "59,59,59,59", "lanes": "232,233,234,235", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp59"], - "2x50G[25G,10G]": ["etp59a", "etp59b"] + "1x100G[50G,40G,25G,10G]": ["etp59"] } }, "Ethernet236": { "index": "60,60,60,60", "lanes": "236,237,238,239", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp60"], - "2x50G[25G,10G]": ["etp60a", "etp60b"] + "1x100G[50G,40G,25G,10G]": ["etp60"] } }, "Ethernet240": { "index": "61,61,61,61", "lanes": "240,241,242,243", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp61"], - "2x50G[25G,10G]": ["etp61a", "etp61b"] + "1x100G[50G,40G,25G,10G]": ["etp61"] } }, "Ethernet244": { "index": "62,62,62,62", "lanes": "244,245,246,247", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp62"], - "2x50G[25G,10G]": ["etp62a", "etp62b"] + "1x100G[50G,40G,25G,10G]": ["etp62"] } }, "Ethernet248": { "index": "63,63,63,63", "lanes": "248,249,250,251", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp63"], - "2x50G[25G,10G]": ["etp63a", "etp63b"] + "1x100G[50G,40G,25G,10G]": ["etp63"] } }, "Ethernet252": { "index": "64,64,64,64", "lanes": "252,253,254,255", "breakout_modes": { - "1x100G[50G,40G,25G,10G]": ["etp64"], - "2x50G[25G,10G]": ["etp64a", "etp64b"] + "1x100G[50G,40G,25G,10G]": ["etp64"] } } } diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json index a16b210d90e..e4f4845dfe3 100644 --- a/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json @@ -626,8 +626,7 @@ "lanes": "0,1,2,3", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp1"], - "2x100G[50G,25G,10G,1G]": ["etp1a", "etp1b"], - "4x50G[25G,10G,1G]": ["etp1a", "etp1b", "etp1c", "etp1d"] + "2x100G[50G,25G,10G,1G]": ["etp1a", "etp1b"] } }, "Ethernet4": { @@ -635,8 +634,7 @@ "lanes": "8,9,10,11", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp2"], - "2x100G[50G,25G,10G,1G]": ["etp2a", "etp2b"], - "4x50G[25G,10G,1G]": ["etp2a", "etp2b", "etp2c", "etp2d"] + "2x100G[50G,25G,10G,1G]": ["etp2a", "etp2b"] } }, "Ethernet8": { @@ -644,8 +642,7 @@ "lanes": "16,17,18,19", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp3"], - "2x100G[50G,25G,10G,1G]": ["etp3a", "etp3b"], - "4x50G[25G,10G,1G]": ["etp3a", "etp3b", "etp3c", "etp3d"] + "2x100G[50G,25G,10G,1G]": ["etp3a", "etp3b"] } }, "Ethernet12": { @@ -653,8 +650,7 @@ "lanes": "24,25,26,27", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp4"], - "2x100G[50G,25G,10G,1G]": ["etp4a", "etp4b"], - "4x50G[25G,10G,1G]": ["etp4a", "etp4b", "etp4c", "etp4d"] + "2x100G[50G,25G,10G,1G]": ["etp4a", "etp4b"] } }, "Ethernet16": { @@ -662,8 +658,7 @@ "lanes": "32,33,34,35", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp5"], - "2x100G[50G,25G,10G,1G]": ["etp5a", "etp5b"], - "4x50G[25G,10G,1G]": ["etp5a", "etp5b", "etp5c", "etp5d"] + "2x100G[50G,25G,10G,1G]": ["etp5a", "etp5b"] } }, "Ethernet20": { @@ -671,8 +666,7 @@ "lanes": "40,41,42,43", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp6"], - "2x100G[50G,25G,10G,1G]": ["etp6a", "etp6b"], - "4x50G[25G,10G,1G]": ["etp6a", "etp6b", "etp6c", "etp6d"] + "2x100G[50G,25G,10G,1G]": ["etp6a", "etp6b"] } }, "Ethernet24": { @@ -680,8 +674,7 @@ "lanes": "48,49,50,51", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp7"], - "2x100G[50G,25G,10G,1G]": ["etp7a", "etp7b"], - "4x50G[25G,10G,1G]": ["etp7a", "etp7b", "etp7c", "etp7d"] + "2x100G[50G,25G,10G,1G]": ["etp7a", "etp7b"] } }, "Ethernet28": { @@ -689,8 +682,7 @@ "lanes": "56,57,58,59", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp8"], - "2x100G[50G,25G,10G,1G]": ["etp8a", "etp8b"], - "4x50G[25G,10G,1G]": ["etp8a", "etp8b", "etp8c", "etp8d"] + "2x100G[50G,25G,10G,1G]": ["etp8a", "etp8b"] } }, "Ethernet32": { @@ -698,8 +690,7 @@ "lanes": "64,65,66,67", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp9"], - "2x100G[50G,25G,10G,1G]": ["etp9a", "etp9b"], - "4x50G[25G,10G,1G]": ["etp9a", "etp9b", "etp9c", "etp9d"] + "2x100G[50G,25G,10G,1G]": ["etp9a", "etp9b"] } }, "Ethernet36": { @@ -707,8 +698,7 @@ "lanes": "72,73,74,75", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp10"], - "2x100G[50G,25G,10G,1G]": ["etp10a", "etp10b"], - "4x50G[25G,10G,1G]": ["etp10a", "etp10b", "etp10c", "etp10d"] + "2x100G[50G,25G,10G,1G]": ["etp10a", "etp10b"] } }, "Ethernet40": { @@ -716,8 +706,7 @@ "lanes": "80,81,82,83", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp11"], - "2x100G[50G,25G,10G,1G]": ["etp11a", "etp11b"], - "4x50G[25G,10G,1G]": ["etp11a", "etp11b", "etp11c", "etp11d"] + "2x100G[50G,25G,10G,1G]": ["etp11a", "etp11b"] } }, "Ethernet44": { @@ -725,8 +714,7 @@ "lanes": "88,89,90,91", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp12"], - "2x100G[50G,25G,10G,1G]": ["etp12a", "etp12b"], - "4x50G[25G,10G,1G]": ["etp12a", "etp12b", "etp12c", "etp12d"] + "2x100G[50G,25G,10G,1G]": ["etp12a", "etp12b"] } }, "Ethernet48": { @@ -734,8 +722,7 @@ "lanes": "96,97,98,99", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp13"], - "2x100G[50G,25G,10G,1G]": ["etp13a", "etp13b"], - "4x50G[25G,10G,1G]": ["etp13a", "etp13b", "etp13c", "etp13d"] + "2x100G[50G,25G,10G,1G]": ["etp13a", "etp13b"] } }, "Ethernet52": { @@ -743,8 +730,7 @@ "lanes": "104,105,106,107", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp14"], - "2x100G[50G,25G,10G,1G]": ["etp14a", "etp14b"], - "4x50G[25G,10G,1G]": ["etp14a", "etp14b", "etp14c", "etp14d"] + "2x100G[50G,25G,10G,1G]": ["etp14a", "etp14b"] } }, "Ethernet56": { @@ -752,8 +738,7 @@ "lanes": "112,113,114,115", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp15"], - "2x100G[50G,25G,10G,1G]": ["etp15a", "etp15b"], - "4x50G[25G,10G,1G]": ["etp15a", "etp15b", "etp15c", "etp15d"] + "2x100G[50G,25G,10G,1G]": ["etp15a", "etp15b"] } }, "Ethernet60": { @@ -761,8 +746,7 @@ "lanes": "120,121,122,123", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp16"], - "2x100G[50G,25G,10G,1G]": ["etp16a", "etp16b"], - "4x50G[25G,10G,1G]": ["etp16a", "etp16b", "etp16c", "etp16d"] + "2x100G[50G,25G,10G,1G]": ["etp16a", "etp16b"] } }, "Ethernet64": { @@ -770,8 +754,7 @@ "lanes": "128,129,130,131", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp17"], - "2x100G[50G,25G,10G,1G]": ["etp17a", "etp17b"], - "4x50G[25G,10G,1G]": ["etp17a", "etp17b", "etp17c", "etp17d"] + "2x100G[50G,25G,10G,1G]": ["etp17a", "etp17b"] } }, "Ethernet68": { @@ -779,8 +762,7 @@ "lanes": "136,137,138,139", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp18"], - "2x100G[50G,25G,10G,1G]": ["etp18a", "etp18b"], - "4x50G[25G,10G,1G]": ["etp18a", "etp18b", "etp18c", "etp18d"] + "2x100G[50G,25G,10G,1G]": ["etp18a", "etp18b"] } }, "Ethernet72": { @@ -788,8 +770,7 @@ "lanes": "144,145,146,147", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp19"], - "2x100G[50G,25G,10G,1G]": ["etp19a", "etp19b"], - "4x50G[25G,10G,1G]": ["etp19a", "etp19b", "etp19c", "etp19d"] + "2x100G[50G,25G,10G,1G]": ["etp19a", "etp19b"] } }, "Ethernet76": { @@ -797,8 +778,7 @@ "lanes": "152,153,154,155", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp20"], - "2x100G[50G,25G,10G,1G]": ["etp20a", "etp20b"], - "4x50G[25G,10G,1G]": ["etp20a", "etp20b", "etp20c", "etp20d"] + "2x100G[50G,25G,10G,1G]": ["etp20a", "etp20b"] } }, "Ethernet80": { @@ -806,8 +786,7 @@ "lanes": "160,161,162,163", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp21"], - "2x100G[50G,25G,10G,1G]": ["etp21a", "etp21b"], - "4x50G[25G,10G,1G]": ["etp21a", "etp21b", "etp21c", "etp21d"] + "2x100G[50G,25G,10G,1G]": ["etp21a", "etp21b"] } }, "Ethernet84": { @@ -815,8 +794,7 @@ "lanes": "168,169,170,171", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp22"], - "2x100G[50G,25G,10G,1G]": ["etp22a", "etp22b"], - "4x50G[25G,10G,1G]": ["etp22a", "etp22b", "etp22c", "etp22d"] + "2x100G[50G,25G,10G,1G]": ["etp22a", "etp22b"] } }, "Ethernet88": { @@ -824,8 +802,7 @@ "lanes": "176,177,178,179", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp23"], - "2x100G[50G,25G,10G,1G]": ["etp23a", "etp23b"], - "4x50G[25G,10G,1G]": ["etp23a", "etp23b", "etp23c", "etp23d"] + "2x100G[50G,25G,10G,1G]": ["etp23a", "etp23b"] } }, "Ethernet92": { @@ -833,8 +810,7 @@ "lanes": "184,185,186,187", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp24"], - "2x100G[50G,25G,10G,1G]": ["etp24a", "etp24b"], - "4x50G[25G,10G,1G]": ["etp24a", "etp24b", "etp24c", "etp24d"] + "2x100G[50G,25G,10G,1G]": ["etp24a", "etp24b"] } }, "Ethernet96": { @@ -842,8 +818,7 @@ "lanes": "192,193,194,195", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp25"], - "2x100G[50G,25G,10G,1G]": ["etp25a", "etp25b"], - "4x50G[25G,10G,1G]": ["etp25a", "etp25b", "etp25c", "etp25d"] + "2x100G[50G,25G,10G,1G]": ["etp25a", "etp25b"] } }, "Ethernet100": { @@ -851,8 +826,7 @@ "lanes": "200,201,202,203", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp26"], - "2x100G[50G,25G,10G,1G]": ["etp26a", "etp26b"], - "4x50G[25G,10G,1G]": ["etp26a", "etp26b", "etp26c", "etp26d"] + "2x100G[50G,25G,10G,1G]": ["etp26a", "etp26b"] } }, "Ethernet104": { @@ -860,8 +834,7 @@ "lanes": "208,209,210,211", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp27"], - "2x100G[50G,25G,10G,1G]": ["etp27a", "etp27b"], - "4x50G[25G,10G,1G]": ["etp27a", "etp27b", "etp27c", "etp27d"] + "2x100G[50G,25G,10G,1G]": ["etp27a", "etp27b"] } }, "Ethernet108": { @@ -869,8 +842,7 @@ "lanes": "216,217,218,219", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp28"], - "2x100G[50G,25G,10G,1G]": ["etp28a", "etp28b"], - "4x50G[25G,10G,1G]": ["etp28a", "etp28b", "etp28c", "etp28d"] + "2x100G[50G,25G,10G,1G]": ["etp28a", "etp28b"] } }, "Ethernet112": { @@ -878,16 +850,14 @@ "lanes": "224,225,226,227", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp29"], - "2x100G[50G,25G,10G,1G]": ["etp29a", "etp29b"], - "4x50G[25G,10G,1G]": ["etp29a", "etp29b", "etp29c", "etp29d"] + "2x100G[50G,25G,10G,1G]": ["etp29a", "etp29b"] } }, "Ethernet116": { "index": "30,30,30,30", "lanes": "232,233,234,235", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp30"], - "2x100G[50G,25G,10G,1G]": ["etp30a", "etp30b"], - "4x50G[25G,10G,1G]": ["etp30a", "etp30b", "etp30c", "etp30d"] + "2x100G[50G,25G,10G,1G]": ["etp30a", "etp30b"] } }, "Ethernet120": { @@ -895,8 +865,7 @@ "lanes": "240,241,242,243", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp31"], - "2x100G[50G,25G,10G,1G]": ["etp31a", "etp31b"], - "4x50G[25G,10G,1G]": ["etp31a", "etp31b", "etp31c", "etp31d"] + "2x100G[50G,25G,10G,1G]": ["etp31a", "etp31b"] } }, "Ethernet124": { @@ -904,8 +873,7 @@ "lanes": "248,249,250,251", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp32"], - "2x100G[50G,25G,10G,1G]": ["etp32a", "etp32b"], - "4x50G[25G,10G,1G]": ["etp32a", "etp32b", "etp32c", "etp32d"] + "2x100G[50G,25G,10G,1G]": ["etp32a", "etp32b"] } }, "Ethernet128": { @@ -913,8 +881,7 @@ "lanes": "256,257,258,259", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp33"], - "2x100G[50G,25G,10G,1G]": ["etp33a", "etp33b"], - "4x50G[25G,10G,1G]": ["etp33a", "etp33b", "etp33c", "etp33d"] + "2x100G[50G,25G,10G,1G]": ["etp33a", "etp33b"] } }, "Ethernet132": { @@ -922,8 +889,7 @@ "lanes": "264,265,266,267", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp34"], - "2x100G[50G,25G,10G,1G]": ["etp34a", "etp34b"], - "4x50G[25G,10G,1G]": ["etp34a", "etp34b", "etp34c", "etp34d"] + "2x100G[50G,25G,10G,1G]": ["etp34a", "etp34b"] } }, "Ethernet136": { @@ -931,8 +897,7 @@ "lanes": "272,273,274,275", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp35"], - "2x100G[50G,25G,10G,1G]": ["etp35a", "etp35b"], - "4x50G[25G,10G,1G]": ["etp35a", "etp35b", "etp35c", "etp35d"] + "2x100G[50G,25G,10G,1G]": ["etp35a", "etp35b"] } }, "Ethernet140": { @@ -940,8 +905,7 @@ "lanes": "280,281,282,283", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp36"], - "2x100G[50G,25G,10G,1G]": ["etp36a", "etp36b"], - "4x50G[25G,10G,1G]": ["etp36a", "etp36b", "etp36c", "etp36d"] + "2x100G[50G,25G,10G,1G]": ["etp36a", "etp36b"] } }, "Ethernet144": { @@ -949,8 +913,7 @@ "lanes": "288,289,290,291", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp37"], - "2x100G[50G,25G,10G,1G]": ["etp37a", "etp37b"], - "4x50G[25G,10G,1G]": ["etp37a", "etp37b", "etp37c", "etp37d"] + "2x100G[50G,25G,10G,1G]": ["etp37a", "etp37b"] } }, "Ethernet148": { @@ -958,8 +921,7 @@ "lanes": "296,297,298,299", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp38"], - "2x100G[50G,25G,10G,1G]": ["etp38a", "etp38b"], - "4x50G[25G,10G,1G]": ["etp38a", "etp38b", "etp38c", "etp38d"] + "2x100G[50G,25G,10G,1G]": ["etp38a", "etp38b"] } }, "Ethernet152": { @@ -967,8 +929,7 @@ "lanes": "304,305,306,307", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp39"], - "2x100G[50G,25G,10G,1G]": ["etp39a", "etp39b"], - "4x50G[25G,10G,1G]": ["etp39a", "etp39b", "etp39c", "etp39d"] + "2x100G[50G,25G,10G,1G]": ["etp39a", "etp39b"] } }, "Ethernet156": { @@ -976,8 +937,7 @@ "lanes": "312,313,314,315", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp40"], - "2x100G[50G,25G,10G,1G]": ["etp40a", "etp40b"], - "4x50G[25G,10G,1G]": ["etp40a", "etp40b", "etp40c", "etp40d"] + "2x100G[50G,25G,10G,1G]": ["etp40a", "etp40b"] } }, "Ethernet160": { @@ -985,8 +945,7 @@ "lanes": "320,321,322,323", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp41"], - "2x100G[50G,25G,10G,1G]": ["etp41a", "etp41b"], - "4x50G[25G,10G,1G]": ["etp41a", "etp41b", "etp41c", "etp41d"] + "2x100G[50G,25G,10G,1G]": ["etp41a", "etp41b"] } }, "Ethernet164": { @@ -994,8 +953,7 @@ "lanes": "328,329,330,331", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp42"], - "2x100G[50G,25G,10G,1G]": ["etp42a", "etp42b"], - "4x50G[25G,10G,1G]": ["etp42a", "etp42b", "etp42c", "etp42d"] + "2x100G[50G,25G,10G,1G]": ["etp42a", "etp42b"] } }, "Ethernet168": { @@ -1003,8 +961,7 @@ "lanes": "336,337,338,339", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp43"], - "2x100G[50G,25G,10G,1G]": ["etp43a", "etp43b"], - "4x50G[25G,10G,1G]": ["etp43a", "etp43b", "etp43c", "etp43d"] + "2x100G[50G,25G,10G,1G]": ["etp43a", "etp43b"] } }, "Ethernet172": { @@ -1012,8 +969,7 @@ "lanes": "344,345,346,347", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp44"], - "2x100G[50G,25G,10G,1G]": ["etp44a", "etp44b"], - "4x50G[25G,10G,1G]": ["etp44a", "etp44b", "etp44c", "etp44d"] + "2x100G[50G,25G,10G,1G]": ["etp44a", "etp44b"] } }, "Ethernet176": { @@ -1021,8 +977,7 @@ "lanes": "352,353,354,355", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp45"], - "2x100G[50G,25G,10G,1G]": ["etp45a", "etp45b"], - "4x50G[25G,10G,1G]": ["etp45a", "etp45b", "etp45c", "etp45d"] + "2x100G[50G,25G,10G,1G]": ["etp45a", "etp45b"] } }, "Ethernet180": { @@ -1030,8 +985,7 @@ "lanes": "360,361,362,363", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp46"], - "2x100G[50G,25G,10G,1G]": ["etp46a", "etp46b"], - "4x50G[25G,10G,1G]": ["etp46a", "etp46b", "etp46c", "etp46d"] + "2x100G[50G,25G,10G,1G]": ["etp46a", "etp46b"] } }, "Ethernet184": { @@ -1039,8 +993,7 @@ "lanes": "368,369,370,371", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp47"], - "2x100G[50G,25G,10G,1G]": ["etp47a", "etp47b"], - "4x50G[25G,10G,1G]": ["etp47a", "etp47b", "etp47c", "etp47d"] + "2x100G[50G,25G,10G,1G]": ["etp47a", "etp47b"] } }, "Ethernet188": { @@ -1048,8 +1001,7 @@ "lanes": "376,377,378,379", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp48"], - "2x100G[50G,25G,10G,1G]": ["etp48a", "etp48b"], - "4x50G[25G,10G,1G]": ["etp48a", "etp48b", "etp48c", "etp48d"] + "2x100G[50G,25G,10G,1G]": ["etp48a", "etp48b"] } }, "Ethernet192": { @@ -1057,8 +1009,7 @@ "lanes": "384,385,386,387", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp49"], - "2x100G[50G,25G,10G,1G]": ["etp49a", "etp49b"], - "4x50G[25G,10G,1G]": ["etp49a", "etp49b", "etp49c", "etp49d"] + "2x100G[50G,25G,10G,1G]": ["etp49a", "etp49b"] } }, "Ethernet196": { @@ -1066,8 +1017,7 @@ "lanes": "392,393,394,395", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp50"], - "2x100G[50G,25G,10G,1G]": ["etp50a", "etp50b"], - "4x50G[25G,10G,1G]": ["etp50a", "etp50b", "etp50c", "etp50d"] + "2x100G[50G,25G,10G,1G]": ["etp50a", "etp50b"] } }, "Ethernet200": { @@ -1075,8 +1025,7 @@ "lanes": "400,401,402,403", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp51"], - "2x100G[50G,25G,10G,1G]": ["etp51a", "etp51b"], - "4x50G[25G,10G,1G]": ["etp51a", "etp51b", "etp51c", "etp51d"] + "2x100G[50G,25G,10G,1G]": ["etp51a", "etp51b"] } }, "Ethernet204": { @@ -1084,8 +1033,7 @@ "lanes": "408,409,410,411", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp52"], - "2x100G[50G,25G,10G,1G]": ["etp52a", "etp52b"], - "4x50G[25G,10G,1G]": ["etp52a", "etp52b", "etp52c", "etp52d"] + "2x100G[50G,25G,10G,1G]": ["etp52a", "etp52b"] } }, "Ethernet208": { @@ -1093,8 +1041,7 @@ "lanes": "416,417,418,419", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp53"], - "2x100G[50G,25G,10G,1G]": ["etp53a", "etp53b"], - "4x50G[25G,10G,1G]": ["etp53a", "etp53b", "etp53c", "etp53d"] + "2x100G[50G,25G,10G,1G]": ["etp53a", "etp53b"] } }, "Ethernet212": { @@ -1102,8 +1049,7 @@ "lanes": "424,425,426,427", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp54"], - "2x100G[50G,25G,10G,1G]": ["etp54a", "etp54b"], - "4x50G[25G,10G,1G]": ["etp54a", "etp54b", "etp54c", "etp54d"] + "2x100G[50G,25G,10G,1G]": ["etp54a", "etp54b"] } }, "Ethernet216": { @@ -1111,8 +1057,7 @@ "lanes": "432,433,434,435", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp55"], - "2x100G[50G,25G,10G,1G]": ["etp55a", "etp55b"], - "4x50G[25G,10G,1G]": ["etp55a", "etp55b", "etp55c", "etp55d"] + "2x100G[50G,25G,10G,1G]": ["etp55a", "etp55b"] } }, "Ethernet220": { @@ -1120,8 +1065,7 @@ "lanes": "440,441,442,443", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp56"], - "2x100G[50G,25G,10G,1G]": ["etp56a", "etp56b"], - "4x50G[25G,10G,1G]": ["etp56a", "etp56b", "etp56c", "etp56d"] + "2x100G[50G,25G,10G,1G]": ["etp56a", "etp56b"] } }, "Ethernet224": { @@ -1129,8 +1073,7 @@ "lanes": "448,449,450,451", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp57"], - "2x100G[50G,25G,10G,1G]": ["etp57a", "etp57b"], - "4x50G[25G,10G,1G]": ["etp57a", "etp57b", "etp57c", "etp57d"] + "2x100G[50G,25G,10G,1G]": ["etp57a", "etp57b"] } }, "Ethernet228": { @@ -1138,8 +1081,7 @@ "lanes": "456,457,458,459", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp58"], - "2x100G[50G,25G,10G,1G]": ["etp58a", "etp58b"], - "4x50G[25G,10G,1G]": ["etp58a", "etp58b", "etp58c", "etp58d"] + "2x100G[50G,25G,10G,1G]": ["etp58a", "etp58b"] } }, "Ethernet232": { @@ -1147,8 +1089,7 @@ "lanes": "464,465,466,467", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp59"], - "2x100G[50G,25G,10G,1G]": ["etp59a", "etp59b"], - "4x50G[25G,10G,1G]": ["etp59a", "etp59b", "etp59c", "etp59d"] + "2x100G[50G,25G,10G,1G]": ["etp59a", "etp59b"] } }, "Ethernet236": { @@ -1156,8 +1097,7 @@ "lanes": "472,473,474,475", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp60"], - "2x100G[50G,25G,10G,1G]": ["etp60a", "etp60b"], - "4x50G[25G,10G,1G]": ["etp60a", "etp60b", "etp60c", "etp60d"] + "2x100G[50G,25G,10G,1G]": ["etp60a", "etp60b"] } }, "Ethernet240": { @@ -1165,8 +1105,7 @@ "lanes": "480,481,482,483", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp61"], - "2x100G[50G,25G,10G,1G]": ["etp61a", "etp61b"], - "4x50G[25G,10G,1G]": ["etp61a", "etp61b", "etp61c", "etp61d"] + "2x100G[50G,25G,10G,1G]": ["etp61a", "etp61b"] } }, "Ethernet244": { @@ -1174,8 +1113,7 @@ "lanes": "488,489,490,491", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp62"], - "2x100G[50G,25G,10G,1G]": ["etp62a", "etp62b"], - "4x50G[25G,10G,1G]": ["etp62a", "etp62b", "etp62c", "etp62d"] + "2x100G[50G,25G,10G,1G]": ["etp62a", "etp62b"] } }, "Ethernet248": { @@ -1183,8 +1121,7 @@ "lanes": "496,497,498,499", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp63"], - "2x100G[50G,25G,10G,1G]": ["etp63a", "etp63b"], - "4x50G[25G,10G,1G]": ["etp63a", "etp63b", "etp63c", "etp63d"] + "2x100G[50G,25G,10G,1G]": ["etp63a", "etp63b"] } }, "Ethernet252": { @@ -1192,8 +1129,7 @@ "lanes": "504,505,506,507", "breakout_modes": { "1x200G[100G,50G,40G,25G,10G,1G]": ["etp64"], - "2x100G[50G,25G,10G,1G]": ["etp64a", "etp64b"], - "4x50G[25G,10G,1G]": ["etp64a", "etp64b", "etp64c", "etp64d"] + "2x100G[50G,25G,10G,1G]": ["etp64a", "etp64b"] } } } From 5e1acf0225e94368a8d61f178cae8f72a4e17049 Mon Sep 17 00:00:00 2001 From: saksarav-nokia Date: Fri, 25 Feb 2022 22:57:38 -0500 Subject: [PATCH 069/139] [Nokia][platform]Modify BCM config & platform_reboot for Nokia-IXR7250E-36x400G (#9990) Signed-off-by: Sakthivadivu Saravanaraj --- .../Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm | 3 +-- .../Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm | 3 +-- device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm index 5611903647e..ecaae10276a 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm @@ -2048,5 +2048,4 @@ dpp_db_path=/usr/share/bcm/db sai_recycle_port_lane_base=96 appl_param_nof_ports_per_modid=64 udh_exists=1 - - +modreg IPS_FORCE_LOCAL_OR_FABRIC FORCE_FABRIC=1 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm index f5fcdb200b6..142a718e080 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm @@ -2050,5 +2050,4 @@ dpp_db_path=/usr/share/bcm/db sai_recycle_port_lane_base=96 appl_param_nof_ports_per_modid=64 udh_exists=1 - - +modreg IPS_FORCE_LOCAL_OR_FABRIC FORCE_FABRIC=1 diff --git a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot index d128455d40f..c5ff45d1848 100755 --- a/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot +++ b/device/nokia/x86_64-nokia_ixr7250e_sup-r0/platform_reboot @@ -7,4 +7,6 @@ kick_date=`date -u` echo "last watchdog kick $kick_date" > /var/log/nokia-watchdog-last.log rm -f /sys/firmware/efi/efivars/dump-* sync +echo "Rebooting all Linecards" +python3 -c 'import sonic_platform.platform; platform_chassis = sonic_platform.platform.Platform().get_chassis(); platform_chassis.reboot_imms()' /sbin/reboot From 47870cecfc4c8a561cd0b3842f902eff94155ac6 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Sun, 27 Feb 2022 17:47:15 +0800 Subject: [PATCH 070/139] Stop PMON before swss during warm reboot (#10046) - Why I did it Stopping swss and syncd causes some driver module unloading. Those driver modules are depended by PMON. This could trigger ERROR logs in syslog. - How I did it Adjust warmboot shutdown order in make file - How to verify it Manual test --- rules/docker-platform-monitor.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index 0a0efa435f8..21babbcb49f 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -38,6 +38,10 @@ $(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE_BUSTER) $(DOCKER_PLATFORM_MONITOR)_VERSION = 1.0.0 $(DOCKER_PLATFORM_MONITOR)_PACKAGE_NAME = pmon +ifeq ($(CONFIGURED_PLATFORM),mellanox) +$(DOCKER_PLATFORM_MONITOR)_WARM_SHUTDOWN_BEFORE = swss +endif + SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR) From b8fa5e0d8dd4f3005aa4d9447e8330b8057612b6 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 28 Feb 2022 11:21:04 +0800 Subject: [PATCH 071/139] install xmlrunner python3 version (#10086) --- dockers/docker-ptf-sai/Dockerfile.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockers/docker-ptf-sai/Dockerfile.j2 b/dockers/docker-ptf-sai/Dockerfile.j2 index f42d04c1cd0..1e284bd368e 100644 --- a/dockers/docker-ptf-sai/Dockerfile.j2 +++ b/dockers/docker-ptf-sai/Dockerfile.j2 @@ -18,7 +18,8 @@ RUN pip3 install crc16 \ psutil \ scapy==2.4.4 \ scapy_helper \ - pysubnettree + pysubnettree \ + xmlrunner COPY \ {% for deb in docker_ptf_sai_debs.split(' ') -%} From 5daf482a95219443da731818df8d743edb483924 Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Mon, 28 Feb 2022 11:10:58 +0530 Subject: [PATCH 072/139] [Marevell] Fix armhf build failure (#9875) Signed-off-by: Rajkumar Pennadam Ramamoorthy --- platform/marvell-armhf/sonic-platform-et6448m/entropy.py | 7 +++++-- platform/marvell-armhf/sonic-platform-nokia/entropy.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py index 338e2ad9bce..a2131cdc17f 100644 --- a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py +++ b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py @@ -6,8 +6,11 @@ RNDADDENTROPY=0x40085203 def avail(): - with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: - return int(avail.read()) + if path.exists("/proc/sys/kernel/random/entropy_avail"): + with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: + return int(avail.read()) + else: + return int(2048) if path.exists("/proc/sys/kernel/random/entropy_avail"): while 1: diff --git a/platform/marvell-armhf/sonic-platform-nokia/entropy.py b/platform/marvell-armhf/sonic-platform-nokia/entropy.py index 338e2ad9bce..a2131cdc17f 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/entropy.py +++ b/platform/marvell-armhf/sonic-platform-nokia/entropy.py @@ -6,8 +6,11 @@ RNDADDENTROPY=0x40085203 def avail(): - with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: - return int(avail.read()) + if path.exists("/proc/sys/kernel/random/entropy_avail"): + with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: + return int(avail.read()) + else: + return int(2048) if path.exists("/proc/sys/kernel/random/entropy_avail"): while 1: From 7c4fbf0455709dca3de61c3a51c33c7e1d4fff3e Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Mon, 28 Feb 2022 01:08:19 -0500 Subject: [PATCH 073/139] [Mellanox] Add patch to hw-mgmt to prevent loading of non-existent kernel modules (#10073) - Why I did it The latest upgrade of Mellanox hw-mgmt V7.0020.1300 introduced a couple new kernel modules for new Mellanox platforms that have yet to be upstreamed to the linux kernel. As these new platforms do not have SONiC support we elected not to upstream these new drivers to sonic-linux-kernel but hw-mgmt expects them to exist which is causing a non-functional error on switch boot. Feb 15 00:09:55.374130 r-leopard-simx-74 ERR systemd-modules-load[269]: Failed to find module 'emc2305' Feb 15 00:09:55.374141 r-leopard-simx-74 ERR systemd-modules-load[269]: Failed to find module 'ads1015' To resolve this we can patch hw-mgmt to no longer attempt to load these modules by default. - How I did it Added a SONiC patch to Mellanox hw-mgmt in order to remove the unused kernel modules which were not upstreamed to sonic-linux-kernel - How to verify it Boot switch and verify there are no error logs regarding kernel modules failing to load. --- ...on-upstream-kernel-modules-from-load.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch diff --git a/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch b/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch new file mode 100644 index 00000000000..fb114224494 --- /dev/null +++ b/platform/mellanox/hw-management/0003-Remove-unused-non-upstream-kernel-modules-from-load.patch @@ -0,0 +1,25 @@ +From 14b06a12802fc0e15116a64f419d002d0d21d695 Mon Sep 17 00:00:00 2001 +From: Alexander Allen +Date: Thu, 17 Feb 2022 04:19:50 +0000 +Subject: [PATCH] Remove unused non-upstream kernel modules from load + +--- + usr/etc/modules-load.d/05-hw-management-modules.conf | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/usr/etc/modules-load.d/05-hw-management-modules.conf b/usr/etc/modules-load.d/05-hw-management-modules.conf +index 39f621e..c0980bc 100644 +--- a/usr/etc/modules-load.d/05-hw-management-modules.conf ++++ b/usr/etc/modules-load.d/05-hw-management-modules.conf +@@ -15,8 +15,6 @@ xdpe12284 + mp2975 + mp2888 + i2c-mux-pca954x +-emc2305 +-ads1015 + powr1220 + gpio-pca953x + pmbus +-- +2.17.1 + From afa18e2856815b25631df9658013e0b3bf6ff196 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 28 Feb 2022 11:46:50 -0800 Subject: [PATCH 074/139] [build_debian.sh]: Fix /var/log having 0750 permissions instead of 0755 (#10031) PR #9481 changed auditd's log directory to be /var/log instead of /var/log/audit, because SONiC mounts a disk image at /var/log during runtime, and so the /var/log/audit directory might not exist (since it would've been created during package installation, mounting another partition at /var/log will hide it). However, for security reasons, auditd changes the log directory to have 0750 permissions, so that not everyone knows about the audit logs or read them. To fix this, revert the change to auditd's log directory, and tell systemd to create the audit log directory at runtime if it doesn't exist. Because the disk image gets mounted during initramfs (before systemd starts), systemd will make sure that the /var/log/audit directory will exist. Fixes #9548 and #10015 Signed-off-by: Saikrishna Arcot --- build_debian.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 61f6912829e..73984cb6cc5 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -328,8 +328,13 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in jq \ auditd -# Change auditd log file path to fix auditd can't startup issue. -sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "sudo sed -i 's/^\s*log_file\s*=.*/log_file = \/var\/log\/audit.log/g' /etc/audit/auditd.conf" +# Have systemd create the auditd log directory +sudo mkdir -p ${FILESYSTEM_ROOT}/etc/systemd/system/auditd.service.d +sudo tee ${FILESYSTEM_ROOT}/etc/systemd/system/auditd.service.d/log-directory.conf >/dev/null < Date: Tue, 1 Mar 2022 02:43:52 +0530 Subject: [PATCH 075/139] Dell: S6100 fix xcvrd crash (#10062) --- .../s6100/sonic_platform/chassis.py | 10 ++++++++++ .../s6100/sonic_platform/sfp.py | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py index c9342088663..47e63f52a17 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py @@ -20,6 +20,7 @@ from sonic_platform.psu import Psu from sonic_platform.thermal import Thermal from sonic_platform.watchdog import Watchdog, WatchdogTCO + from sonic_platform.sfp import Sfp except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -76,6 +77,15 @@ def __init__(self): self._module_list.append(module) self._sfp_list.extend(module._sfp_list) + #SFP ports + sfp_port = 11 + for index in range(64,66): + eeprom_path = "/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom".format(sfp_port) + sfp_control = "" + sfp_node = Sfp(index, 'SFP', eeprom_path, sfp_control, index) + self._sfp_list.append(sfp_node) + sfp_port = sfp_port + 1 + for i in range(MAX_S6100_FANTRAY): fandrawer = FanDrawer(i) self._fan_drawer_list.append(fandrawer) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py index 1a0c9cc8417..fa8e4d9a05c 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py @@ -10,6 +10,7 @@ try: import os + import syslog import time from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase except ImportError as e: @@ -42,6 +43,9 @@ def get_presence(self): """ Retrieves the presence of the sfp """ + if self.index > 64: + return False + presence_ctrl = self.sfp_control + 'qsfp_modprs' try: reg_file = open(presence_ctrl) @@ -69,6 +73,9 @@ def get_reset_status(self): """ Retrieves the reset status of SFP """ + if self.index > 64: + return False + reset_status = None reset_ctrl = self.sfp_control + 'qsfp_reset' try: @@ -100,6 +107,9 @@ def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP """ + if self.index > 64: + return False + lpmode_ctrl = self.sfp_control + 'qsfp_lpmode' try: reg_file = open(lpmode_ctrl, "r+") @@ -133,6 +143,9 @@ def reset(self): """ Reset SFP and return all user module settings to their default srate. """ + if self.index > 64: + return False + reset_ctrl = self.sfp_control + 'qsfp_reset' try: # Open reset_ctrl in both read & write mode @@ -178,6 +191,9 @@ def set_lpmode(self, lpmode): """ Sets the lpmode (low power mode) of SFP """ + if self.index > 64: + return False + lpmode_ctrl = self.sfp_control + 'qsfp_lpmode' try: reg_file = open(lpmode_ctrl, "r+") From 47d9b26063b43186614df5588c125363e4a01cf1 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Mon, 28 Feb 2022 15:42:02 -0800 Subject: [PATCH 076/139] Revert "[swss]: Wait for vlan intf to start ndppd (#10036)" (#10085) This reverts commit 91204879dfe8399e61ebff4c184b8df4c1da3109. #10036 breaks ndppd functionality --- dockers/docker-orchagent/Dockerfile.j2 | 1 + dockers/docker-orchagent/docker-init.j2 | 1 - dockers/docker-orchagent/ndppd.conf | 9 ++++++ dockers/docker-orchagent/supervisord.conf.j2 | 25 ---------------- dockers/docker-orchagent/wait_for_link.sh.j2 | 30 -------------------- 5 files changed, 10 insertions(+), 56 deletions(-) create mode 100644 dockers/docker-orchagent/ndppd.conf delete mode 100644 dockers/docker-orchagent/wait_for_link.sh.j2 diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 3c04ff7c135..5e403213c1d 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -68,6 +68,7 @@ RUN apt-get purge -y \ COPY ["files/arp_update", "/usr/bin"] COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"] +COPY ["ndppd.conf", "/usr/share/sonic/templates/"] COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"] COPY ["orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index 52a1c4717cc..ff543c23490 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -18,7 +18,6 @@ CFGGEN_PARAMS=" \ -t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \ -t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \ -t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf - -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) diff --git a/dockers/docker-orchagent/ndppd.conf b/dockers/docker-orchagent/ndppd.conf new file mode 100644 index 00000000000..b9dbc293ed2 --- /dev/null +++ b/dockers/docker-orchagent/ndppd.conf @@ -0,0 +1,9 @@ +[program:ndppd] +command=/usr/sbin/ndppd +priority=7 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=vlanmgrd:running diff --git a/dockers/docker-orchagent/supervisord.conf.j2 b/dockers/docker-orchagent/supervisord.conf.j2 index 7954fa7fa6b..7cd31a11322 100644 --- a/dockers/docker-orchagent/supervisord.conf.j2 +++ b/dockers/docker-orchagent/supervisord.conf.j2 @@ -299,28 +299,3 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited {%- endif %} - -{% if is_fabric_asic == 0 %} -[program:ndppd] -command=/usr/sbin/ndppd -priority=7 -autostart=false -autorestart=unexpected -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=wait_for_link:exited -{%- endif %} - -{% if is_fabric_asic == 0 %} -[program:wait_for_link] -command=/usr/bin/wait_for_link.sh -priority=7 -autostart=false -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=swssconfig:exited -{%- endif %} diff --git a/dockers/docker-orchagent/wait_for_link.sh.j2 b/dockers/docker-orchagent/wait_for_link.sh.j2 deleted file mode 100644 index 980b472b3e0..00000000000 --- a/dockers/docker-orchagent/wait_for_link.sh.j2 +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -VLAN_TABLE_PREFIX="VLAN_TABLE" - -function wait_until_iface_ready -{ - TABLE_PREFIX=$1 - IFACE=$2 - - echo "Waiting until interface $IFACE is ready..." - - # Wait for the interface to come up - # (i.e., interface is present in STATE_DB and state is "ok") - while true; do - RESULT=$(sonic-db-cli STATE_DB HGET "${TABLE_PREFIX}|${IFACE}" "state" 2> /dev/null) - if [ x"$RESULT" == x"ok" ]; then - break - fi - - sleep 1 - done - - echo "Interface ${IFACE} is ready!" -} - - -# Wait for all interfaces to be up and ready -{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} -wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} -{% endfor %} From b617ffd88c245b811fd809bb564ff1c06b96ab78 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 2 Mar 2022 05:08:03 +0800 Subject: [PATCH 077/139] [AS9716-32d] Modify check eeprom via pre_pddf sh (#7827) Modify to use pre_pddf_init.sh to check eeprom is 0x57 or 0x56. Signed-off-by: Jostar Yang --- .../as9716-32d/modules/Makefile | 5 +- .../as9716-32d/modules/pddf_custom_psu.c | 14 +----- .../utils/pddf_post_driver_install.sh | 46 +++++++++++++++++++ .../as9716-32d/utils/pre_pddf_init.sh | 22 +++++++++ .../sonic-platform-accton-as9716-32d.postinst | 19 +------- 5 files changed, 74 insertions(+), 32 deletions(-) create mode 100755 platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pre_pddf_init.sh diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/Makefile index 7bb532a1f53..6ac9d418a3d 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/Makefile @@ -1,8 +1,11 @@ ifneq ($(KERNELRELEASE),) obj-m:= accton_as9716_32d_cpld.o accton_as9716_32d_fan.o \ accton_as9716_32d_leds.o accton_as9716_32d_psu.o accton_i2c_psu.o \ - pddf_custom_psu.o + pddf_custom_psu.o +CFLAGS_pddf_custom_psu.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF + else ifeq (,$(KERNEL_SRC)) #$(error KERNEL_SRC is not defined) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/pddf_custom_psu.c b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/pddf_custom_psu.c index 9c4dd7f6613..05f27f6fed9 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/pddf_custom_psu.c +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/modules/pddf_custom_psu.c @@ -9,7 +9,7 @@ #include #include #include -#include "../../../../pddf/i2c/modules/include/pddf_psu_defs.h" +#include "pddf_psu_defs.h" ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf); extern PSU_SYSFS_ATTR_DATA access_psu_v_out; @@ -22,13 +22,9 @@ extern PSU_SYSFS_ATTR_DATA access_psu_serial_num; #define MAX_SERIAL_NUMBER 19 enum psu_type { - PSU_TYPE_AC_110V, - PSU_TYPE_DC_48V, - PSU_TYPE_DC_12V, PSU_TYPE_AC_ACBEL_FSF019, PSU_TYPE_AC_ACBEL_FSH082, PSU_TYPE_YESM1300 - }; struct model_name_info { @@ -48,23 +44,15 @@ struct serial_number_info { }; struct model_name_info models[] = { -{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"}, -{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"}, -{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"}, {PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"}, {PSU_TYPE_AC_ACBEL_FSH082, 0x20, 10, 7, "FSH082-"}, {PSU_TYPE_YESM1300, 0x20, 11, 8, "YESM1300"}, - }; struct serial_number_info serials[] = { -{PSU_TYPE_AC_110V, 0x2e, 18, 18, "YM-2651Y"}, -{PSU_TYPE_DC_48V, 0x2e, 18, 18, "YM-2651V"}, -{PSU_TYPE_DC_12V, 0x2e, 18, 18, "PSU-12V-750"}, {PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF019-"}, {PSU_TYPE_AC_ACBEL_FSH082, 0x35, 18, 18, "FSH082-"}, {PSU_TYPE_YESM1300, 0x35, 20, 19, "YESM1300"}, - }; struct pddf_psu_data { diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh index 7fbd7f97d03..484a5f039c0 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pddf_post_driver_install.sh @@ -18,6 +18,52 @@ ir3570_check() fi } +# Some initializations +#============================================================ +# cpld_reset_stop +#i2cset -y 0 0x65 0x3 0x0 + +# Select the mux channels +i2cset -y 0 0x77 0x1 +i2cset -y 0 0x76 0x4 + +# Diag LED: Boot successfully (SOLID GREEN) --- DO THIS STEP IN POST DEVICE CREATION +# i2cset -y 0 0x60 0x64 4 + +# 10G Merlin Ports +# SetModeXFI() +echo "Set Mux(retimer) to 2x10G XFI." +i2cset -y 0 0x76 0x20 +i2cset -y 0 0x18 0x7 0x3 +i2cset -y 0 0x19 0x7 0x3 +i2cset -y 0 0x1a 0x7 0x3 +i2cset -y 0 0x1b 0x7 0x3 + + +# SetVOD() +#set channel B +i2cset -y 0 0x18 0xff 0x05 +i2cset -y 0 0x19 0xff 0x05 +#write output voltage to 800mV +i2cset -y 0 0x18 0x2d 0x82 +i2cset -y 0 0x19 0x2d 0x82 +#write de-emphasis to -3.5dB +i2cset -y 0 0x18 0x15 0x12 +i2cset -y 0 0x19 0x15 0x12 +#read output voltage +#i2cget -y 0 0x18 0x2d +#i2cget -y 0 0x19 0x2d +#read de-emphasis +#i2cget -y 0 0x18 0x15 +#i2cget -y 0 0x19 0x15 +#clr channel B +i2cset -y 0 0x18 0xff 0x00 +i2cset -y 0 0x19 0xff 0x00 + +# De-select the mux channels which were selected for above configs +i2cset -y 0 0x76 0x0 +i2cset -y 0 0x77 0x0 + ir3570_check echo "AS9716 post PDDF driver install completed" diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pre_pddf_init.sh b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pre_pddf_init.sh new file mode 100755 index 00000000000..7fe01e294f0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/pre_pddf_init.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Steps to check syseeprom i2c address +modprobe i2c-i801 +modprobe i2c-dev +use_57_eeprom=false +(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1 +if [ $? -eq 0 ]; then + use_57_eeprom=true +fi + +if $use_57_eeprom ; then + echo "The board has system EEPROM at I2C address 0x57" + if [ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf_support ] && \ + [ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json ]; then + # syseeprom is at the i2c address 0x57. Change the PDDF JSON file + sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\ + "topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \ + /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json + sync + fi +fi diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9716-32d.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9716-32d.postinst index 7c3d8822693..e0905718a84 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9716-32d.postinst +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9716-32d.postinst @@ -2,25 +2,8 @@ # Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) # Enable pddf-platform-monitor -# Steps to check syseeprom i2c address -modprobe i2c-i801 -modprobe i2c-dev -use_57_eeprom=false -(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1 -if [ $? -eq 0 ]; then - use_57_eeprom=true -fi - -if $use_57_eeprom ; then - echo "The board has system EEPROM at I2C address 0x57" - # syseeprom is at the i2c address 0x57. Change the PDDF JSON file - sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\ - "topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \ - /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json - sync -fi - depmod -a +#systemctl daemon-reload systemctl enable pddf-platform-init.service systemctl start pddf-platform-init.service systemctl enable as9716-32d-pddf-platform-monitor.service From 74e790c89f5e8ba238267ba23ff8eac1a9083b23 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 2 Mar 2022 05:09:17 +0800 Subject: [PATCH 078/139] [as7816-64x]Modify to check specific DUT (#7826) AS7816 support AT or non-AT DUT. They use different pmbus i2c bus. So use "pre_pddf_init.sh" to check this case. Signed-off-by: Jostar Yang --- .../as7816-64x/modules/Makefile | 6 +- .../as7816-64x/modules/pddf_custom_fan.c | 4 +- .../as7816-64x/utils/pre_pddf_init.sh | 151 ++++++++++++++++++ .../sonic-platform-accton-as7816-64x.postinst | 147 ----------------- 4 files changed, 158 insertions(+), 150 deletions(-) create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pre_pddf_init.sh diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/Makefile index 906b595883f..3e3a9ac38a3 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/Makefile @@ -1,2 +1,6 @@ -obj-m:=x86-64-accton-as7816-64x-fan.o x86-64-accton-as7816-64x-sfp.o x86-64-accton-as7816-64x-leds.o \ +obj-m:=x86-64-accton-as7816-64x-fan.o x86-64-accton-as7816-64x-leds.o \ x86-64-accton-as7816-64x-psu.o accton_i2c_cpld.o ym2651y.o pddf_custom_fan.o + +CFLAGS_pddf_custom_fan.o := -I$(M)/../../../../pddf/i2c/modules/include +KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF + diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/pddf_custom_fan.c b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/pddf_custom_fan.c index 2e738d685d7..accd79e1c8a 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/pddf_custom_fan.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/pddf_custom_fan.c @@ -9,8 +9,8 @@ #include #include #include -#include "../../../../pddf/i2c/modules/include/pddf_fan_defs.h" -#include "../../../../pddf/i2c/modules/include/pddf_fan_driver.h" +#include "pddf_fan_defs.h" +#include "pddf_fan_driver.h" extern FAN_SYSFS_ATTR_DATA data_fan1_input; extern FAN_SYSFS_ATTR_DATA data_fan2_input; diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pre_pddf_init.sh b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pre_pddf_init.sh new file mode 100755 index 00000000000..b13c90f8478 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/pre_pddf_init.sh @@ -0,0 +1,151 @@ +#!/bin/bash + +# Steps to check syseeprom i2c address +modprobe i2c-i801 +modprobe i2c-dev +at_id=false + +(i2cset -y -f 0 0x77 0x1) > /dev/null 2>&1 +(i2cset -y -f 0 0x76 0x4) > /dev/null 2>&1 + + +(i2cget -y -f 0 0x60 0xfd) > /dev/null 2>&1 +if [ $? -eq 0 ]; then + echo "get at_id" + + at_1=$(i2cget -y -f 0 0x60 0xfd) + + if [[ ${at_1} -eq 0x41 ]]; then + echo "get at_1 is 0x41" + at_2=$(i2cget -y -f 0 0x60 0xfe) + + if [[ ${at_2} -eq 0x54 ]]; then + echo "get at_2 is 0x54" + at_id=true + fi + else + cpld_id=$(i2cget -y -f 0 0x60 0x1) #This CPD version that not support to record at_id + if [[ ${cpld_id} -eq 0x5 ]]; then + at_id=true + fi + + fi +fi + +if $at_id ; then + echo "This CPLD is for AT used PSU" + echo "PSU-1 pmbus use parent_bus:0x9, dev_addr:0x58" + echo "PSU-1 eeprom use parent_bus:0x9, dev_addr:0x50" + echo "PSU-2 pmbus use parent_bus:0xa, dev_addr:0x5b" + echo "PSU-2 eeprom use parent_bus:0xa, dev_addr:0x53" + + if [ -f /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf_support ] && \ + [ -f /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json ]; then + #Change the PDDF JSON file + sed -i 's@{ "chn":"0", "dev":"PSU2"},@\ + { "chn":"0", "dev":"PSU1" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "chn":"1", "dev":"PSU1"}@\ + { "chn":"1", "dev":"PSU2" }@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + sed -i 's@"topo_info":{ "parent_bus":"0xa", "dev_addr":"0x5b", "dev_type":"psu_pmbus"},@\ + "topo_info": {"parent_bus":"0x9", "dev_addr":"0x58" , "dev_type": "psu_pmbus" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ + { "attr_name":"psu_model_name", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"},@\ + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_v_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_i_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_p_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}@\ + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" }@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + sed -i 's@"topo_info":{ "parent_bus":"0xa", "dev_addr":"0x53", "dev_type":"psu_eeprom"},@\ + "topo_info": {"parent_bus":"0x9", "dev_addr":"0x50" , "dev_type": "psu_eeprom" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + + sed -i 's@"topo_info": { "parent_bus":"0x9", "dev_addr":"0x58", "dev_type":"psu_pmbus"},@\ + "topo_info": {"parent_bus":"0xa", "dev_addr":"0x5b", "dev_type": "psu_pmbus" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + sed -i 's@{ "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ + { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + sed -i 's@{ "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ + { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"},@\ + { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ + { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + sed -i 's@{ "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}@\ + { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" }@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + + sed -i 's@"topo_info":{ "parent_bus":"0x9", "dev_addr":"0x50", "dev_type":"psu_eeprom"},@\ + "topo_info": {"parent_bus":"0xa", "dev_addr":"0x53", "dev_type": "psu_eeprom" },@g' \ + /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json + sync + fi +fi + +(i2cset -y -f 0 0x76 0x0) > /dev/null 2>&1 +(i2cset -y -f 0 0x77 0x0) > /dev/null 2>&1 +echo "Pre PDDF init steps completed successully" + +#For others, psu i2c bus use below, +#PSU-1 pmbus use "parent_bus":"0xa", "dev_addr":"0x5b" +#PSU-1 eeprom use "parent_bus":"0xa", "dev_addr":"0x53" +#PSU-2 pmbus use "parent_bus":"0x9", "dev_addr":"0x58" +#PSU-2 eeprom use "parent_bus":"0x9", "dev_addr":"0x50" diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.postinst index 4757a3cce27..872ef60f26f 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.postinst +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7816-64x.postinst @@ -2,153 +2,6 @@ # Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) # Enable pddf-platform-monitor -# Steps to check syseeprom i2c address -modprobe i2c-i801 -modprobe i2c-dev -at_id=false - -(i2cset -y -f 0 0x77 0x1) > /dev/null 2>&1 -(i2cset -y -f 0 0x76 0x4) > /dev/null 2>&1 - - -(i2cget -y -f 0 0x60 0xfd) > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "get at_id" - - at_1=$(i2cget -y -f 0 0x60 0xfd) - - if [ ${at_1} = '0x41' ]; then - echo "get at_1 is 0x41" - at_2=$(i2cget -y -f 0 0x60 0xfe) - - if [ ${at_2} = '0x54' ]; then - echo "get at_2 is 0x54" - at_id=true - fi - fi - -else - cpld_id=$(i2cget -y -f 1 0x60 0x1) #This CPD version that not support to record at_id - if [ ${cpld_id} = '0x5' ]; then - at_id=true - fi -fi - -if $at_id ; then - echo "This CPLD is for AT used PSU" - echo "PSU-1 pmbus use parent_bus:0x9, dev_addr:0x58" - echo "PSU-1 eeprom use parent_bus:0x9, dev_addr:0x50" - echo "PSU-2 pmbus use parent_bus:0xa, dev_addr:0x5b" - echo "PSU-2 eeprom use parent_bus:0xa, dev_addr:0x53" - - #Change the PDDF JSON file - sed -i 's@{ "chn":"0", "dev":"PSU2"},@\ - { "chn":"0", "dev":"PSU1" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "chn":"1", "dev":"PSU1"}@\ - { "chn":"1", "dev":"PSU2" }@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - sed -i 's@"topo_info":{ "parent_bus":"0xa", "dev_addr":"0x5b", "dev_type":"psu_pmbus"},@\ - "topo_info": {"parent_bus":"0x9", "dev_addr":"0x58" , "dev_type": "psu_pmbus" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ - { "attr_name":"psu_model_name", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"},@\ - { "attr_name":"psu_fan_dir", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_v_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_i_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_p_out", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}@\ - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x58" , "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" }@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - sed -i 's@"topo_info":{ "parent_bus":"0xa", "dev_addr":"0x53", "dev_type":"psu_eeprom"},@\ - "topo_info": {"parent_bus":"0x9", "dev_addr":"0x50" , "dev_type": "psu_pmbus" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - - sed -i 's@"topo_info": { "parent_bus":"0x9", "dev_addr":"0x58", "dev_type":"psu_pmbus"},@\ - "topo_info": {"parent_bus":"0xa", "dev_addr":"0x5b", "dev_type": "psu_pmbus" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - sed -i 's@{ "attr_name":"psu_model_name", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ - { "attr_name":"psu_model_name", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x9a", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - sed -i 's@{ "attr_name":"psu_mfr_id", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10"},@\ - { "attr_name":"psu_mfr_id", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0X99", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"10" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_fan_dir", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5"},@\ - { "attr_name":"psu_fan_dir", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0xc3", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"5" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_v_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_v_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8b", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_i_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_i_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8c", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_p_out", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_p_out", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x96", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"},@\ - { "attr_name":"psu_fan1_speed_rpm", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x90", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - sed -i 's@{ "attr_name":"psu_temp1_input", "attr_devaddr":"0x58", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2"}@\ - { "attr_name":"psu_temp1_input", "attr_devaddr":"0x5b", "attr_devtype":"pmbus", "attr_offset":"0x8d", "attr_mask":"0x0", "attr_cmpval":"0xff", "attr_len":"2" }@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync - - sed -i 's@"topo_info":{ "parent_bus":"0x9", "dev_addr":"0x50", "dev_type":"psu_eeprom"},@\ - "topo_info": {"parent_bus":"0xa", "dev_addr":"0x53", "dev_type": "psu_pmbus" },@g' \ - /usr/share/sonic/device/x86_64-accton_as7816_64x-r0/pddf/pddf-device.json - sync -fi - -(i2cset -y -f 0 0x76 0x0) > /dev/null 2>&1 -(i2cset -y -f 0 0x77 0x0) > /dev/null 2>&1 - - -#For other CPLD that use below -#PSU-1 pmbus use "parent_bus":"0x21", "dev_addr":"0x5b" -#PSU-1 eeprom use "parent_bus":"0x21", "dev_addr":"0x53" -#PSU-2 pmbus use "parent_bus":"0x20", "dev_addr":"0x58" -#PSU-2 eeprom use "parent_bus":"0x20", "dev_addr":"0x50" - depmod -a systemctl enable pddf-platform-init.service systemctl start pddf-platform-init.service From 76363cfa16f995a318184c59038dcaef91e948fa Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Wed, 2 Mar 2022 05:33:42 +0800 Subject: [PATCH 079/139] [AS7326-5X] Fix code bug for led drv (#8555) Signed-off-by: Jostar Yang --- .../as7326-56x/modules/accton_as7326_56x_leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c index 7214ae55d3f..ed98daf2011 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/modules/accton_as7326_56x_leds.c @@ -146,7 +146,7 @@ static int accton_getLedReg(enum led_type type, u8 *reg) int i; for (i = 0; i < ARRAY_SIZE(led_reg_map); i++) { - if(led_reg_map[i].types ==type)) { + if(led_reg_map[i].types ==type) { *reg = led_reg_map[i].reg_addr; return 0; } From 3bb87c03a18162fcffdeff92169a7e57d7c54c03 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Wed, 2 Mar 2022 10:09:41 +0800 Subject: [PATCH 080/139] [yang]: Add yang models for BGP_PEER_RANGE table (#10082) Why I did it end2end test is blocked by Yang model for BGP_PEER_RANGE. How I did it Add new yang models. How to verify it Run UT for sonc-yang-models. Signed-off-by: Gang Lv ganglv@microsoft.com --- src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 18 ++++++ .../tests/yang_model_tests/tests/bgp.json | 3 + .../yang_model_tests/tests_config/bgp.json | 18 ++++++ .../yang-models/sonic-bgp-peerrange.yang | 64 +++++++++++++++++++ 5 files changed, 105 insertions(+) create mode 100644 src/sonic-yang-models/yang-models/sonic-bgp-peerrange.yang diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 1f9b51b0c56..e0bacac194e 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -84,6 +84,7 @@ def run(self): './yang-models/sonic-bgp-monitor.yang', './yang-models/sonic-bgp-neighbor.yang', './yang-models/sonic-bgp-peergroup.yang', + './yang-models/sonic-bgp-peerrange.yang', './yang-models/sonic-breakout_cfg.yang', './yang-models/sonic-buffer-pg.yang', './yang-models/sonic-buffer-pool.yang', @@ -150,6 +151,7 @@ def run(self): './cvlyang-models/sonic-bgp-monitor.yang', './cvlyang-models/sonic-bgp-neighbor.yang', './cvlyang-models/sonic-bgp-peergroup.yang', + './cvlyang-models/sonic-bgp-peerrange.yang', './cvlyang-models/sonic-breakout_cfg.yang', './cvlyang-models/sonic-copp.yang', './cvlyang-models/sonic-crm.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e64b241349b..e46d0acc1ff 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1147,6 +1147,24 @@ "default|ipv4_unicast|21.0.0.0/8": { } }, + "BGP_PEER_RANGE": { + "BGPSLBPassive": { + "ip_range": [ + "10.255.0.0/25" + ], + "name": "BGPSLBPassive", + "src_address": "10.1.0.32" + }, + "BGPVac": { + "ip_range": [ + "192.168.0.0/21", + "192.169.0.0/21", + "192.170.0.0/21" + ], + "name": "BGPVac", + "src_address": "10.1.0.32" + } + }, "BGP_MONITORS": { "5.6.7.8": { "admin_status": "up", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json index a8b003c3b9a..8f92f2d9052 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json @@ -154,6 +154,9 @@ "BGP_MONITORS_NEG_INVALID_ASN": { "desc": "Invalid local AS number.", "eStrKey" : "InvalidValue" + }, + "BGP_PEERRANGE_ALL_VALID": { + "desc": "Configure BGP peer range table." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json index 3fec22eb46f..62bfdc4269e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json @@ -1402,6 +1402,24 @@ ] } } + }, + + "BGP_PEERRANGE_ALL_VALID": { + "sonic-bgp-peerrange:sonic-bgp-peerrange": { + "sonic-bgp-peerrange:BGP_PEER_RANGE": { + "BGP_PEER_RANGE_LIST": [ + { + "peer_range_name": "BGPSLBPassive", + "name": "BGPSLBPassive", + "src_address": "10.1.0.32", + "peer_asn": "65200", + "ip_range": [ + "10.255.0.0/25" + ] + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-peerrange.yang b/src/sonic-yang-models/yang-models/sonic-bgp-peerrange.yang new file mode 100644 index 00000000000..88d39d82d68 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-bgp-peerrange.yang @@ -0,0 +1,64 @@ +module sonic-bgp-peerrange { + namespace "http://github.com/Azure/sonic-bgp-peerrange"; + prefix pr; + yang-version 1.1; + + import ietf-inet-types { + prefix inet; + } + + import sonic-types { + prefix stypes; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC BGP Peer Range YANG"; + + revision 2022-02-24 { + description + "Initial revision."; + } + + container sonic-bgp-peerrange { + container BGP_PEER_RANGE { + list BGP_PEER_RANGE_LIST { + key "peer_range_name"; + + leaf peer_range_name { + type string; + description "Peer range name"; + } + + leaf name { + type string; + must "(current() = current()/../peer_range_name)" { + error-message "Invalid name"; + } + } + + leaf src_address { + type inet:ip-address; + description "Source address to use for connection"; + } + + leaf peer_asn { + type uint32 { + range "1..4294967295"; + } + description "Peer AS number"; + } + + leaf-list ip_range { + type stypes:sonic-ip-prefix; + description "A range of addresses"; + } + } + } + } +} From 7891760fd0828ee469bb911a85896aa3197374fe Mon Sep 17 00:00:00 2001 From: Maxime Lorrillere Date: Wed, 2 Mar 2022 00:10:04 -0800 Subject: [PATCH 081/139] [yang-models] Add chassis fields to device_metadata (#10006) This change is adding asic_name, switch_id, switch_type and max_cores to sonic-device_metadata.yang This should fix issue #9575 Co-authored-by: Maxime Lorrillere --- .../tests/files/sample_config_db.json | 6 ++++- .../tests/device_metadata.json | 9 ++++++- .../tests_config/device_metadata.json | 24 ++++++++++++++++++ .../yang-models/sonic-device_metadata.yang | 25 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e46d0acc1ff..3a888986665 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -293,7 +293,11 @@ "hwsku": "Stone", "buffer_model": "dynamic", "cloudtype": "Public", - "region": "usfoo" + "region": "usfoo", + "asic_name": "Asic0", + "switch_id": "2", + "switch_type": "voq", + "max_cores": "8" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 8f4be4caffb..ca26e24cd32 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -93,6 +93,13 @@ "DEVICE_METADATA_INVALID_STORAGE_DEVICE": { "desc": "Verifying invalid storage device value", "eStrKey": "InvalidValue" - } + }, + "DEVICE_METADATA_INCORRECT_VOQ_CONFIG": { + "desc": "Verifying incorrect switch_type configuration.", + "eStrKey": "Pattern" + }, + "DEVICE_METADATA_CORRECT_VOQ_CONFIG": { + "desc": "Verifying VOQ configuration." + } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index 7e0e87f5741..bfc9c080b75 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -250,5 +250,29 @@ } } } + }, + "DEVICE_METADATA_INCORRECT_VOQ_CONFIG": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "asic_name": "Asic0", + "switch_id": "2", + "switch_type": "incorrect_pattern", + "max_cores": "8" + } + } + } + }, + "DEVICE_METADATA_CORRECT_VOQ_CONFIG": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "asic_name": "Asic0", + "switch_id": "2", + "switch_type": "voq", + "max_cores": "8" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index eb87161c6bc..0dc88f436d8 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -153,6 +153,31 @@ module sonic-device_metadata { leaf storage_device { type boolean; } + + leaf asic_name { + type string; + description "On a VoQ switch, the ASIC Name is used as a qualifier in global + database keys to create a system wide unique key."; + } + + leaf switch_id { + type uint16; + description "Vendor specific switch ID. Identifies switch chip."; + } + + leaf switch_type { + type string { + pattern "chassis-packet|fabric|npu|voq"; + } + description "Type of switch. Default is NPU, on a VOQ switch voq is used for a regular + switching device while fabric is used for a fabric device. + chassis-packet is used for chassis in packet mode."; + } + + leaf max_cores { + type uint8; + description "Maximum number of cores in a VoQ Switch (chassis)."; + } } /* end of container localhost */ } From 1740beb1f284d01c19387ad2d891f3042d3e8929 Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Thu, 3 Mar 2022 02:36:20 +0530 Subject: [PATCH 082/139] [sonic-cfggen]: Fix sonic-cfggen build failures for armhf (#10132) Why I did it amrhf build fails while building sonic-config-engine whl package https://dev.azure.com/mssonic/be1b070f-be15-4154-aade-b1d3bfb17054/_apis/build/builds/77089/logs/9 The reason for the failure is due to the fact that there is a new line generated at the top of the file in buffer config test cases while building for broadcom based platform and this issue is not seen in Marvell based platforms. How I did it Removed the new line for all the buffer test cases as there is no need to add it and accordingly changed the buffer_config.j2 where the new line is generated. --- files/build_templates/buffers_config.j2 | 1 - .../tests/sample_output/py2/buffers-dell6100.json | 1 - .../tests/sample_output/py2/buffers-mellanox2410-dynamic.json | 1 - .../tests/sample_output/py2/buffers-mellanox2410.json | 1 - .../tests/sample_output/py2/buffers-mellanox2700.json | 1 - .../tests/sample_output/py3/buffers-dell6100.json | 1 - .../tests/sample_output/py3/buffers-mellanox2410-dynamic.json | 1 - .../tests/sample_output/py3/buffers-mellanox2410.json | 1 - .../tests/sample_output/py3/buffers-mellanox2700.json | 1 - 9 files changed, 9 deletions(-) diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index d0ff3ade107..cb64cd3d433 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -131,7 +131,6 @@ def {%- if port_names_list_inactive.append(port) %}{%- endif %} {%- endfor %} {%- set port_names_inactive = port_names_list_inactive | join(',') %} - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json index 90ad5f795ca..be6292366e7 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410-dynamic.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410-dynamic.json index a09e15eecc1..1cb60747fc3 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410-dynamic.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410-dynamic.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json index 7ebd39c36c8..39cebfcdf8a 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json index 221a9b89b83..ea9fe0c9ea8 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json index 7c06ed93f38..08f238bcc40 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410-dynamic.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410-dynamic.json index 215fa85cf2d..109389c9504 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410-dynamic.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410-dynamic.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json index c212061af4b..eaf119ab0ac 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json index 2aaef20598d..49da9b064af 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json @@ -1,4 +1,3 @@ - { "CABLE_LENGTH": { "AZURE": { From 4d2a55d373265ea4b5053fe6d9dd8b4acea62346 Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Wed, 2 Mar 2022 16:23:56 -0800 Subject: [PATCH 083/139] [swss]: Wait for vlan intf to start ndppd (#10119) - Use the `wait_for_link.sh` script to delay ndppd start until after the VLAN interface is ready - Avoids issue where ndppd tries to change interface attributes before the interface is ready --- dockers/docker-orchagent/docker-init.j2 | 3 ++ dockers/docker-orchagent/ndppd.conf | 13 ++++++++- dockers/docker-orchagent/wait_for_link.sh.j2 | 30 ++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 dockers/docker-orchagent/wait_for_link.sh.j2 diff --git a/dockers/docker-orchagent/docker-init.j2 b/dockers/docker-orchagent/docker-init.j2 index ff543c23490..5b3850613da 100755 --- a/dockers/docker-orchagent/docker-init.j2 +++ b/dockers/docker-orchagent/docker-init.j2 @@ -18,9 +18,12 @@ CFGGEN_PARAMS=" \ -t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \ -t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \ -t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf + -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) +chmod +x /usr/bin/wait_for_link.sh + # Executed platform specific initialization tasks. if [ -x /usr/share/sonic/platform/platform-init ]; then /usr/share/sonic/platform/platform-init diff --git a/dockers/docker-orchagent/ndppd.conf b/dockers/docker-orchagent/ndppd.conf index b9dbc293ed2..86297de94a4 100644 --- a/dockers/docker-orchagent/ndppd.conf +++ b/dockers/docker-orchagent/ndppd.conf @@ -6,4 +6,15 @@ autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -dependent_startup_wait_for=vlanmgrd:running +dependent_startup_wait_for=wait_for_link:exited + +[program:wait_for_link] +command=/usr/bin/wait_for_link.sh +priority=7 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited \ No newline at end of file diff --git a/dockers/docker-orchagent/wait_for_link.sh.j2 b/dockers/docker-orchagent/wait_for_link.sh.j2 new file mode 100644 index 00000000000..980b472b3e0 --- /dev/null +++ b/dockers/docker-orchagent/wait_for_link.sh.j2 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +VLAN_TABLE_PREFIX="VLAN_TABLE" + +function wait_until_iface_ready +{ + TABLE_PREFIX=$1 + IFACE=$2 + + echo "Waiting until interface $IFACE is ready..." + + # Wait for the interface to come up + # (i.e., interface is present in STATE_DB and state is "ok") + while true; do + RESULT=$(sonic-db-cli STATE_DB HGET "${TABLE_PREFIX}|${IFACE}" "state" 2> /dev/null) + if [ x"$RESULT" == x"ok" ]; then + break + fi + + sleep 1 + done + + echo "Interface ${IFACE} is ready!" +} + + +# Wait for all interfaces to be up and ready +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} +{% endfor %} From 14de0a15489daca71ddb75a81d7c8d6b2d9efa93 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Wed, 2 Mar 2022 19:08:06 -0800 Subject: [PATCH 084/139] [containerd]Fixing container commands when mode is local and state is disabled (#9986) Why I did it During warm-reboot and fast-reboot the below error logs appear Feb 3 22:05:15.187408 r-lionfish-13 ERR container: docker cmd: kill for nat failed with 404 Client Error for http+docker://localhost/v1.41/containers/nat/json: Not Found ("No such container: nat") The container command when called for local mode doesn't check if it is enabled before calling docker kill which throws the above errors. https://github.com/Azure/sonic-utilities/blob/b6ca76b4821453171d9607383b808385968eeeeb/scripts/fast-reboot#L699 How I did it Checking feature state if local mode and returning error exit code along with valid debug message. How to verify it Manually tested with warm-reboot and fast-reboot Added UT to verify it. --- src/sonic-ctrmgrd/ctrmgr/container | 54 +++++++++++++++-------- src/sonic-ctrmgrd/tests/container_test.py | 45 ++++++++++++++++++- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index 666c967540a..db6ded635ee 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -26,6 +26,7 @@ CONTAINER_ID = "container_id" REMOTE_STATE = "remote_state" VERSION = "container_version" SYSTEM_STATE = "system_state" +STATE = "state" KUBE_LABEL_TABLE = "KUBE_LABELS" KUBE_LABEL_SET_KEY = "SET" @@ -38,6 +39,9 @@ SONIC_CTR_CONFIG_PEND_SECS = "revert_to_local_on_wait_seconds" DEFAULT_PEND_SECS = ( 5 * 60 ) WAIT_POLL_SECS = 2 +SUCCESS = 0 +FAILURE = -1 + remote_ctr_enabled = False def debug_msg(m): @@ -87,10 +91,10 @@ def read_data(is_config, feature, fields): def read_config(feature): """ Read requried feature config """ - set_owner, no_fallback = read_data(True, feature, - [(SET_OWNER, "local"), (NO_FALLBACK, False)]) + set_owner, no_fallback, state = read_data(True, feature, + [(SET_OWNER, "local"), (NO_FALLBACK, False), (STATE, "disabled")]) - return (set_owner, not no_fallback) + return (set_owner, not no_fallback, state) def read_state(feature): @@ -107,12 +111,12 @@ def docker_action(action, feature, **kwargs): container = client.containers.get(feature) getattr(container, action)(**kwargs) syslog.syslog(syslog.LOG_INFO, "docker cmd: {} for {}".format(action, feature)) - return 0 + return SUCCESS except (docker.errors.NotFound, docker.errors.APIError) as err: syslog.syslog(syslog.LOG_ERR, "docker cmd: {} for {} failed with {}". format(action, feature, str(err))) - return -1 + return FAILURE def set_label(feature, create): @@ -186,7 +190,7 @@ def container_start(feature, **kwargs): init() - set_owner, fallback = read_config(feature) + set_owner, fallback, _ = read_config(feature) _, remote_state, _ = read_state(feature) debug_msg("{}: set_owner:{} fallback:{} remote_state:{}".format( @@ -244,8 +248,8 @@ def container_stop(feature, **kwargs): debug_msg("BEGIN") init() - - set_owner, _ = read_config(feature) + ret = SUCCESS + set_owner, _ , _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) remove_label = (remote_state != "pending") or (set_owner == "local") @@ -257,7 +261,7 @@ def container_stop(feature, **kwargs): set_label(feature, False) if docker_id: - docker_action("stop", docker_id, **kwargs) + ret = docker_action("stop", docker_id, **kwargs) else: syslog.syslog( syslog.LOG_ERR if current_owner != "none" else syslog.LOG_INFO, @@ -286,6 +290,7 @@ def container_stop(feature, **kwargs): update_data(feature, data) debug_msg("END") + return ret def container_kill(feature, **kwargs): @@ -301,19 +306,25 @@ def container_kill(feature, **kwargs): init() - set_owner, _ = read_config(feature) + ret = SUCCESS + set_owner, _ , state = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) remove_label = (set_owner != "local") or (current_owner != "local") - debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{}".format( - feature, set_owner, current_owner, remote_state, docker_id)) + debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{} state:{}".format( + feature, set_owner, current_owner, remote_state, docker_id, state)) if remove_label: set_label(feature, False) + if set_owner == "local": + if state not in ["enabled", "always_enabled"]: + debug_msg("{} is not enabled".format(feature)) + return FAILURE + if docker_id: - docker_action("kill", docker_id, **kwargs) + ret = docker_action("kill", docker_id, **kwargs) else: syslog.syslog( @@ -322,6 +333,7 @@ def container_kill(feature, **kwargs): debug_msg("END") + return ret def container_wait(feature, **kwargs): @@ -341,10 +353,11 @@ def container_wait(feature, **kwargs): init() - set_owner, fallback = read_config(feature) + set_owner, fallback, _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) pend_wait_secs = 0 + ret = SUCCESS if not docker_id and fallback: pend_wait_secs = get_config_data( @@ -377,8 +390,9 @@ def container_wait(feature, **kwargs): format(feature)) else: debug_msg("END -- transitioning to docker wait") - docker_action("wait", docker_id, **kwargs) + ret = docker_action("wait", docker_id, **kwargs) + return ret def main(): parser=argparse.ArgumentParser(description="container commands for start/stop/wait/kill/id") @@ -389,24 +403,26 @@ def main(): args = parser.parse_args() kwargs = {} + ret = 0 if args.action == "start": - container_start(args.name, **kwargs) + ret = container_start(args.name, **kwargs) elif args.action == "stop": if args.timeout is not None: kwargs['timeout'] = args.timeout - container_stop(args.name, **kwargs) + ret = container_stop(args.name, **kwargs) elif args.action == "kill": - container_kill(args.name, **kwargs) + ret = container_kill(args.name, **kwargs) elif args.action == "wait": - container_wait(args.name, **kwargs) + ret = container_wait(args.name, **kwargs) elif args.action == "id": id = container_id(args.name, **kwargs) print(id) + return ret if __name__ == "__main__": main() diff --git a/src/sonic-ctrmgrd/tests/container_test.py b/src/sonic-ctrmgrd/tests/container_test.py index cc5f89e8d97..4738597c72c 100755 --- a/src/sonic-ctrmgrd/tests/container_test.py +++ b/src/sonic-ctrmgrd/tests/container_test.py @@ -269,7 +269,8 @@ common_test.CONFIG_DB_NO: { common_test.FEATURE_TABLE: { "snmp": { - "set_owner": "local" + "set_owner": "local", + "state": "enabled" } } }, @@ -348,6 +349,30 @@ } } +# container_kill test cases +# test case 0 -- container kill local disabled container +# -- no change in state-db +# -- no label update +# +invalid_kill_test_data = { + 0: { + common_test.DESCR: "container kill for local disabled container", + common_test.PRE: { + common_test.CONFIG_DB_NO: { + common_test.FEATURE_TABLE: { + "sflow": { + "set_owner": "local" + } + } + } + }, + common_test.POST: { + }, + common_test.ACTIONS: { + } + } +} + # container_wait test cases # test case 0 -- container wait local @@ -498,6 +523,24 @@ def test_kill(self, mock_docker, mock_table, mock_conn): ret = common_test.check_mock_containers() assert ret == 0 + @patch("container.swsscommon.DBConnector") + @patch("container.swsscommon.Table") + @patch("container.docker.from_env") + def test_invalid_kill(self, mock_docker, mock_table, mock_conn): + self.init() + common_test.set_mock(mock_table, mock_conn, mock_docker) + + for (i, ct_data) in invalid_kill_test_data.items(): + common_test.do_start_test("container_test:container_kill", i, ct_data) + + ret = container.container_kill("sflow") + assert ret != 0 + + ret = common_test.check_tables_returned() + assert ret == 0 + + ret = common_test.check_mock_containers() + assert ret == 0 @patch("container.swsscommon.DBConnector") @patch("container.swsscommon.Table") From e104247950a1c38fa11d555c514a5c74e748b82c Mon Sep 17 00:00:00 2001 From: Vadym Hlushko <62022266+vadymhlushko-mlnx@users.noreply.github.com> Date: Thu, 3 Mar 2022 15:58:17 +0200 Subject: [PATCH 085/139] [nvgre] Added YANG model and tests (#10095) - Why I did it NVGRE Tunnel feature extends the Config DB with new tables. These tables require a new YANG model. - How I did it Added a new YANG model sonic-nvgre-tunnel.yang - How to verify it Added YANG test cases. Signed-off-by: Vadym Hlushko --- src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 21 ++- .../tests/yang_model_tests/tests/nvgre.json | 25 ++++ .../yang_model_tests/tests_config/nvgre.json | 125 ++++++++++++++++++ .../yang-models/sonic-nvgre-tunnel.yang | 109 +++++++++++++++ 5 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json create mode 100644 src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index e0bacac194e..d8b9a0d0c4a 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -109,6 +109,7 @@ def run(self): './yang-models/sonic-mirror-session.yang', './yang-models/sonic-ntp.yang', './yang-models/sonic-nat.yang', + './yang-models/sonic-nvgre-tunnel.yang', './yang-models/sonic-pbh.yang', './yang-models/sonic-port.yang', './yang-models/sonic-policer.yang', @@ -167,6 +168,7 @@ def run(self): './cvlyang-models/sonic-mgmt_vrf.yang', './cvlyang-models/sonic-ntp.yang', './cvlyang-models/sonic-nat.yang', + './cvlyang-models/sonic-nvgre-tunnel.yang', './cvlyang-models/sonic-pbh.yang', './cvlyang-models/sonic-policer.yang', './cvlyang-models/sonic-port.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 3a888986665..89a915e72b5 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1562,7 +1562,7 @@ } }, - + "MCLAG_DOMAIN": { "123": { "source_ip": "12.1.1.1", @@ -1606,6 +1606,8 @@ } }, + + "POLICER": { "everflow_static_policer": { "meter_type": "bytes", @@ -1614,8 +1616,23 @@ "cbs": "12500000", "color": "aware", "red_packet_action": "drop" - } + } + }, + + + "NVGRE_TUNNEL": { + "tunnel_1": { + "src_ip": "10.0.0.1" + } + }, + "NVGRE_TUNNEL_MAP": { + "tunnel_1|Vlan111": { + "vlan_id": "111", + "vsid": "5000" + } } + + }, "SAMPLE_CONFIG_DB_UNKNOWN": { "UNKNOWN_TABLE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json new file mode 100644 index 00000000000..e776b0d9064 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/nvgre.json @@ -0,0 +1,25 @@ +{ + "NVGRE_TUNNEL_AND_TUNNEL_MAP": { + "desc": "NVGRE_TUNNEL with NVGRE_TUNNEL_MAP" + }, + + "NVGRE_TUNNEL_INVALID_SRC_IP": { + "desc": "INVALID src_ip value for NVGRE_TUNNEL", + "eStrKey": "InvalidValue" + }, + + "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { + "desc": "Unexisting NVGRE_TUNNEL", + "eStrKey": "LeafRef" + }, + + "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { + "desc": "Invalid VLAN ID", + "eStrKey": "Pattern" + }, + + "NVGRE_TUNNEL_MAP_INVALID_VSID": { + "desc": "INVALID VSID value for NVGRE_TUNNEL_MAP", + "eStrKey": "Pattern" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json new file mode 100644 index 00000000000..8c2588fa7d3 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/nvgre.json @@ -0,0 +1,125 @@ +{ + "NVGRE_TUNNEL_AND_TUNNEL_MAP": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_INVALID_SRC_IP": { + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "INVALID" + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_UNEXISTING_NVGRE_TUNNEL_NAME": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "INVALID", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_INVALID_VLAN_ID": { + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 5000, + "vsid": 5000 + } + ] + } + } + }, + + "NVGRE_TUNNEL_MAP_INVALID_VSID": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan200" + } + ] + } + }, + "sonic-nvgre-tunnel:sonic-nvgre-tunnel": { + "sonic-nvgre-tunnel:NVGRE_TUNNEL": { + "NVGRE_TUNNEL_LIST": [ + { + "tunnel_name": "tunnel_1", + "src_ip": "10.0.0.1" + } + ] + }, + "sonic-nvgre-tunnel:NVGRE_TUNNEL_MAP": { + "NVGRE_TUNNEL_MAP_LIST": [ + { + "tunnel_name": "tunnel_1", + "tunnel_map_name": "Vlan200", + "vlan_id": 200, + "vsid": 999999999 + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang b/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang new file mode 100644 index 00000000000..b10c35d9404 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-nvgre-tunnel.yang @@ -0,0 +1,109 @@ +module sonic-nvgre-tunnel { + + yang-version 1.1; + + namespace "http://github.com/Azure/sonic-nvgre-tunnel"; + prefix nvgre; + + import ietf-inet-types { + prefix inet; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "NVGRE Tunnel YANG Module for SONiC OS"; + + revision 2021-10-31 { + description + "First Revision"; + } + + container sonic-nvgre-tunnel { + + container NVGRE_TUNNEL { + + description "NVGRE_TUNNEL part of config_db.json"; + + list NVGRE_TUNNEL_LIST { + + key "tunnel_name"; + + leaf tunnel_name { + description "NVGRE Tunnel name"; + + type string { + length 1..255; + } + } + + leaf src_ip { + description "Source IP address"; + + mandatory true; + type inet:ip-address; + } + + } + /* end of NVGRE_TUNNEL_LIST */ + + } + /* end of container NVGRE_TUNNEL */ + + container NVGRE_TUNNEL_MAP { + + description "NVGRE_TUNNEL_MAP part of config_db.json"; + + list NVGRE_TUNNEL_MAP_LIST { + + key "tunnel_name tunnel_map_name"; + + leaf tunnel_name { + description "NVGRE Tunnel name"; + + type leafref { + path /nvgre:sonic-nvgre-tunnel/nvgre:NVGRE_TUNNEL/nvgre:NVGRE_TUNNEL_LIST/nvgre:tunnel_name; + } + } + + leaf tunnel_map_name { + description "NVGRE Tunnel map name"; + + type string { + length 1..255; + } + } + + leaf vlan_id { + description "VLAN identifier"; + + mandatory true; + type uint16 { + range 1..4094; + } + } + + leaf vsid { + description "Virtual Subnet Identifier"; + + mandatory true; + type uint32 { + range 0..16777214; + } + } + + } + /* end of NVGRE_TUNNEL_MAP_LIST */ + + } + /* end of container NVGRE_TUNNEL_MAP */ + + } + /* end of container sonic-nvgre-tunnel */ + +} +/* end of module sonic-nvgre-tunnel */ From 582ea7cfc613844fd36f739452e932b49b3bf6c6 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 4 Mar 2022 01:22:15 +0800 Subject: [PATCH 086/139] [Unit Test]: Fix sonic config engine test not stable issue(#10147) Co-authored-by: azureuser --- src/sonic-config-engine/tests/common_utils.py | 13 +++++++ src/sonic-config-engine/tests/test_j2files.py | 38 +++++++++---------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/sonic-config-engine/tests/common_utils.py b/src/sonic-config-engine/tests/common_utils.py index 3d8a3029dad..47fe9f37f2a 100644 --- a/src/sonic-config-engine/tests/common_utils.py +++ b/src/sonic-config-engine/tests/common_utils.py @@ -1,4 +1,6 @@ import json +import filecmp +import os import re import sys @@ -31,3 +33,14 @@ def liststr_to_dict(liststr): return list_obj +def cmp(file1, file2): + """ compare files """ + try: + with open(file1, 'r') as f: + obj1 = json.load(f) + with open(file2, 'r') as f: + obj2 = json.load(f) + return obj1 == obj2 + except: + return filecmp.cmp(file1, file2) + diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 5e782ce2fa1..b0bfbe9f372 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -46,37 +46,37 @@ def test_interfaces(self): interfaces_template = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'interfaces', 'interfaces.j2') argument = '-m ' + self.t0_minigraph + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'interfaces'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'interfaces'), self.output_file)) argument = '-m ' + self.t0_mvrf_minigraph + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces'), self.output_file)) def test_ports_json(self): ports_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ports.json.j2') argument = '-m ' + self.simple_minigraph + ' -p ' + self.t0_port_config + ' -t ' + ports_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ports.json'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ports.json'), self.output_file)) def test_dhcp_relay(self): # Test generation of wait_for_intf.sh template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'wait_for_intf.sh.j2') argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'wait_for_intf.sh'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'wait_for_intf.sh'), self.output_file)) # Test generation of docker-dhcp-relay.supervisord.conf template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file), self.output_file) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file), self.output_file) def test_radv(self): # Test generation of radvd.conf with multiple ipv6 prefixes template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-router-advertiser', 'radvd.conf.j2') argument = '-m ' + self.radv_test_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'radvd.conf'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'radvd.conf'), self.output_file)) def test_lldp(self): lldpd_conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-lldp', 'lldpd.conf.j2') @@ -89,19 +89,19 @@ def test_lldp(self): mgmt_iface_ipv4_and_ipv6_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv4_and_ipv6.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv4_and_ipv6_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv4_and_ipv6, self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv4_and_ipv6, self.output_file)) # Test generation of lldpd.conf if management interface IPv4 only exist mgmt_iface_ipv4_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv4.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv4_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv4, self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv4, self.output_file)) # Test generation of lldpd.conf if Management interface IPv6 only exist mgmt_iface_ipv6_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv6.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv6_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv6, self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv6, self.output_file)) def test_ipinip(self): ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') @@ -109,7 +109,7 @@ def test_ipinip(self): self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ipinip.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_l2switch_template(self): argument = '-k Mellanox-SN2700 --preset l2 -p ' + self.t0_port_config @@ -210,7 +210,7 @@ def test_qos_arista7050_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_qos_dell9332_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32') @@ -229,7 +229,7 @@ def test_qos_dell9332_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell9332.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_qos_dell6100_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') @@ -248,7 +248,7 @@ def test_qos_dell6100_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell6100.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected): dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) @@ -268,7 +268,7 @@ def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer os.remove(buffers_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_buffers_dell6100_render_template(self): self._test_buffers_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'buffers.json.j2', 'buffers-dell6100.json') @@ -288,7 +288,7 @@ def test_ipinip_multi_asic(self): print(argument) self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_swss_switch_render_template(self): switch_template = os.path.join( @@ -317,7 +317,7 @@ def test_swss_switch_render_template(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_swss_switch_render_template_multi_asic(self): # verify the ECMP hash seed changes per namespace @@ -349,7 +349,7 @@ def test_swss_switch_render_template_multi_asic(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) os.environ["NAMESPACE_ID"] = "" def test_ndppd_conf(self): @@ -359,7 +359,7 @@ def test_ndppd_conf(self): argument = '-j {} -t {} > {}'.format(vlan_interfaces_json, conf_template, self.output_file) self.run_script(argument) - assert filecmp.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) def test_ntp_conf(self): conf_template = os.path.join(self.test_dir, "ntp.conf.j2") @@ -368,7 +368,7 @@ def test_ntp_conf(self): argument = '-j {} -t {} > {}'.format(ntp_interfaces_json, conf_template, self.output_file) self.run_script(argument) - assert filecmp.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) def tearDown(self): os.environ["CFGGEN_UNIT_TESTING"] = "" From 34a4817ad0827a15d9f44d5ab2c5003ea10eb4c7 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 4 Mar 2022 07:50:41 +0800 Subject: [PATCH 087/139] [AS7712/PDDF] Add idle_state=-2 for pca954x deselect (#10079) Signed-off-by: Jostar Yang jostar_yang@accton.com.tw Why I did it Linux kernel 5.10, 'force_deselct_on_exit' parameter used for driver i2c_mux_pca954x is no longer valid. Instead an attribute 'idle_state' is added per MUX device. So set idle_state=-2 will let do deselect to pca954 when device channel exit . To avoid cause another device channel access i2c fail. How I did it Remove force_deselect_on_exit because not use this parameter. Add "idle_state":"-2" to each "virt_bus" How to verify it Test all sysfs are fine. --- .../pddf/pddf-device.json | 8 ++++---- .../x86_64-accton_as7712_32x-r0/installer.conf | 1 + .../pddf/pddf-device.json | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json index b48506f9054..34013b2a84a 100644 --- a/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as4630_54pe-r0/pddf/pddf-device.json @@ -33,7 +33,7 @@ "std_kos": [ "i2c_dev", - "i2c_mux_pca954x force_deselect_on_exit=1", + "i2c_mux_pca954x", "optoe" ], "description":"kernel modules are loaded while moving to pdf mode, but they should not be unloaded while moving to nonpddf mode.", @@ -105,7 +105,7 @@ "i2c": { "topo_info": { "parent_bus":"0x1", "dev_addr":"0x77", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x2"}, + "dev_attr": { "virt_bus":"0x2", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"MUX2" }, @@ -122,7 +122,7 @@ "i2c": { "topo_info": { "parent_bus":"0x2", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0xa"}, + "dev_attr": { "virt_bus":"0xa", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PSU1" }, @@ -161,7 +161,7 @@ "i2c": { "topo_info": { "parent_bus":"0x3", "dev_addr":"0x70", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x12"}, + "dev_attr": { "virt_bus":"0x12", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT49" }, diff --git a/device/accton/x86_64-accton_as7712_32x-r0/installer.conf b/device/accton/x86_64-accton_as7712_32x-r0/installer.conf index 14404194ef5..d0ed16575e7 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/installer.conf +++ b/device/accton/x86_64-accton_as7712_32x-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=i2c-ismt,i2c_ismt,i2c-i801,i2c_i801" diff --git a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json index d84e6fde2b1..439a52ca9a5 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json +++ b/device/accton/x86_64-accton_as7712_32x-r0/pddf/pddf-device.json @@ -34,7 +34,7 @@ "i2c-ismt", "i2c-i801", "i2c_dev", - "i2c_mux_pca954x force_deselect_on_exit=1", + "i2c_mux_pca954x", "optoe" ], "pddf_kos": @@ -116,7 +116,7 @@ "i2c": { "topo_info": { "parent_bus":"0x1", "dev_addr":"0x76", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x2"}, + "dev_attr": { "virt_bus":"0x2", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"FAN-CTRL" }, @@ -137,7 +137,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x71", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0xa"}, + "dev_attr": { "virt_bus":"0xa", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PSU2" }, @@ -402,7 +402,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x72", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x12"}, + "dev_attr": { "virt_bus":"0x12", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT9" }, @@ -423,7 +423,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x73", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x1a"}, + "dev_attr": { "virt_bus":"0x1a", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT6" }, @@ -444,7 +444,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x74", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x22"}, + "dev_attr": { "virt_bus":"0x22", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT17" }, @@ -465,7 +465,7 @@ "i2c": { "topo_info": { "parent_bus":"0x0", "dev_addr":"0x75", "dev_type":"pca9548"}, - "dev_attr": { "virt_bus":"0x2a"}, + "dev_attr": { "virt_bus":"0x2a", "idle_state":"-2"}, "channel": [ { "chn":"0", "dev":"PORT29" }, From 482ff1ca5085bdad4adacacca241254792468923 Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Fri, 4 Mar 2022 05:28:34 +0530 Subject: [PATCH 088/139] [pddf]: Support for idle_state device parameter is required for muxes using i2c_mux_pca954x driver (#10060) As per linux kernel 5.10, 'force_deselct_on_exit' parameter used for driver i2c_mux_pca954x is no longer valid. Instead an attribute 'idle_state' is added per MUX device. This needs to be set to -1 : For leaving the mux state as is -2 : For deselecting the channel upon exit : To always set a channel upon exit This needs to be accommodated inside the PDDF JSON parser as well. --- platform/pddf/i2c/utils/pddfparse.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/pddf/i2c/utils/pddfparse.py b/platform/pddf/i2c/utils/pddfparse.py index 9d4b82d7594..b8c7f39138a 100755 --- a/platform/pddf/i2c/utils/pddfparse.py +++ b/platform/pddf/i2c/utils/pddfparse.py @@ -359,9 +359,18 @@ def create_mux_device(self, dev, ops): ret = self.runcmd(cmd) if ret != 0: return create_ret.append(ret) - self.create_device(dev['i2c']['dev_attr'], "pddf/devices/mux", ops) + cmd = "echo %s > /sys/kernel/pddf/devices/mux/virt_bus" % (dev['i2c']['dev_attr']['virt_bus']) + ret = self.runcmd(cmd) + if ret != 0: + return create_ret.append(ret) cmd = "echo 'add' > /sys/kernel/pddf/devices/mux/dev_ops" ret = self.runcmd(cmd) + # Check if the dev_attr array contain idle_state + if 'idle_state' in dev['i2c']['dev_attr']: + cmd = "echo {} > /sys/bus/i2c/devices/{}-00{:02x}/idle_state".format(dev['i2c']['dev_attr']['idle_state'], + int(dev['i2c']['topo_info']['parent_bus'],0), int(dev['i2c']['topo_info']['dev_addr'],0)) + ret = self.runcmd(cmd) + return create_ret.append(ret) def create_xcvr_i2c_device(self, dev, ops): From a3c10515f4977d659eb12f421be6fc0a7a56cd4f Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Fri, 4 Mar 2022 07:59:12 +0800 Subject: [PATCH 089/139] [as7326-56x] Modify to check eeprom by pre_pddf_init.sh (#7841) Modify to check eeprom by pre_pddf_init.sh Signed-off-by: Jostar Yang --- .../as7326-56x/utils/pre_pddf_init.sh | 23 +++++++++++++++++++ .../sonic-platform-accton-as7326-56x.postinst | 18 --------------- 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100755 platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pre_pddf_init.sh diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pre_pddf_init.sh b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pre_pddf_init.sh new file mode 100755 index 00000000000..8b8c45ef54e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/pre_pddf_init.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Steps to check syseeprom i2c address +modprobe i2c-i801 +modprobe i2c-dev +use_57_eeprom=true +i2cget -y -f 0 0x56 0x0 +if [ $? -eq 0 ]; then + use_57_eeprom=false + echo "The board has system EEPROM at I2C address 0x56." +fi + +if $use_57_eeprom ; then + echo "The board has system EEPROM at I2C address 0x57." + # syseeprom is at the i2c address 0x57. Change the PDDF JSON file + if [ -f /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf_support ] && \ + [ -f /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json ]; then + sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c04"},@\ + "topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \ + /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json + sync + fi +fi diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.postinst b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.postinst index 94fd9cf67df..035f07e5716 100644 --- a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.postinst +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7326-56x.postinst @@ -2,24 +2,6 @@ # Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default) # Enable pddf-platform-monitor -# Steps to check syseeprom i2c address -modprobe i2c-i801 -modprobe i2c-dev -use_57_eeprom=true -(i2cget -y -f 0 0x56 0x0) > /dev/null 2>&1 -if [ $? -eq 0 ]; then - use_57_eeprom=false -fi - -if $use_57_eeprom ; then - echo "The board has system EEPROM at I2C address 0x57" - # syseeprom is at the i2c address 0x57. Change the PDDF JSON file - sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c04"},@\ - "topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \ - /usr/share/sonic/device/x86_64-accton_as7326_56x-r0/pddf/pddf-device.json - sync -fi - depmod -a systemctl enable as7326-platform-handle_mac.service systemctl start as7326-platform-handle_mac.service From b400a648235e6043b8bcfe909a65eafd7eac57bf Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Fri, 4 Mar 2022 05:51:18 +0530 Subject: [PATCH 090/139] [Marvell] Update armhf driver/sai deb version (#10126) Fixed Marvell SAI deb version naming issue reported in Marvell-switching/sonic-marvell-binaries#62 Signed-off-by: Rajkumar Pennadam Ramamoorthy --- platform/marvell-armhf/prestera.mk | 2 +- platform/marvell-armhf/sai.mk | 1 - platform/marvell-armhf/sai/Makefile | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/platform/marvell-armhf/prestera.mk b/platform/marvell-armhf/prestera.mk index 2365319b9d0..113b8f41a39 100644 --- a/platform/marvell-armhf/prestera.mk +++ b/platform/marvell-armhf/prestera.mk @@ -4,7 +4,7 @@ export MRVL_PRESTERA_VER = 1.0 export MRVL_PRESTERA = mrvlprestera_$(MRVL_PRESTERA_VER)_$(PLATFORM_ARCH) export MRVL_PRESTERA_DEB = $(MRVL_PRESTERA).deb export MRVL_PRESTERA_SRC_URL = https://github.com/Marvell-switching/mrvl-prestera.git -export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.0 +export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.2 $(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera $(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) diff --git a/platform/marvell-armhf/sai.mk b/platform/marvell-armhf/sai.mk index 3672cc70dba..4df1b2c5b6f 100644 --- a/platform/marvell-armhf/sai.mk +++ b/platform/marvell-armhf/sai.mk @@ -2,7 +2,6 @@ export MRVL_SAI_VERSION = 1.9.1-1 export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb -export MRVL_SAI_PACKAGE = mrvllibsai_$(PLATFORM_ARCH)_$(MRVL_SAI_VERSION).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai $(eval $(call add_conflict_package,$(MRVL_SAI),$(LIBSAIVS_DEV))) diff --git a/platform/marvell-armhf/sai/Makefile b/platform/marvell-armhf/sai/Makefile index a6199f59544..cf78504388c 100644 --- a/platform/marvell-armhf/sai/Makefile +++ b/platform/marvell-armhf/sai/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/$(MRVL_SAI_PACKAGE) +MRVL_SAI_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/$(MRVL_SAI) $(addprefix $(DEST)/, $(MRVL_SAI)): $(DEST)/% : # get deb package From 622962a213bb509f61fa286b88780fc7dd923cb7 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Thu, 3 Mar 2022 16:22:31 -0800 Subject: [PATCH 091/139] [linkmgrd]: update linkmgrd submodule (#10117) ce72b0d Longxiang Lyu Thu Feb 24 06:05:12 2022 Put handler member functions as virtual in base (#30) ef59e4f Jing Zhang Fri Feb 25 11:38:28 2022 Incrementing tolerance on mux state inconsistency (#27) 2d12892 Longxiang Lyu Wed Feb 16 03:32:06 2022 Rename LinkManagerStateMachine to ActiveStandbyStateMachine (#26) f38634c Jing Zhang Thu Feb 17 17:23:56 2022 Update log level for mux probing and mux state chance (#23) a8434dd Jing Zhang Thu Feb 17 17:21:01 2022 Handle xcvrd crashing scenarios (#22) 2ebdb2b Longxiang Lyu Mon Feb 14 13:26:07 2022 [make] Enable make extra includes (#24) --- src/linkmgrd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linkmgrd b/src/linkmgrd index ef1f5ebc9a6..ce72b0d2b8b 160000 --- a/src/linkmgrd +++ b/src/linkmgrd @@ -1 +1 @@ -Subproject commit ef1f5ebc9a64207e622da1fb11eb78e6d95e7f45 +Subproject commit ce72b0d2b8bb10c8734d841cf27614c2e3b197c8 From d0ff8b5f481fbd12bba308b136d28411fa2e36f5 Mon Sep 17 00:00:00 2001 From: Alexander Allen Date: Thu, 3 Mar 2022 20:10:15 -0500 Subject: [PATCH 092/139] [pmon] Clean up supervisord chassis_db_init entry and fix startsecs (#10071) Why I did it Code review was still in progress when #9858 was merged and upon further testing I have arrived at a better solution. How I did it Modified supervisord configuration j2 template for pmon to require no minimum uptime for chassisd_db_init and to remove the redundant exit_codes directive How to verify it Boot switch and verify in syslog that there are no errors related to chassis_db_init --- .../docker-platform-monitor/docker-pmon.supervisord.conf.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 795714f6881..b93f0cef3ce 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -47,10 +47,9 @@ command=/usr/local/bin/chassis_db_init priority=3 autostart=false autorestart=false -exitcodes=0 stdout_logfile=syslog stderr_logfile=syslog -startsecs=10 +startsecs=0 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} From c40f04f0e24bfaf8c9c649882b4606c129dab26b Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Thu, 3 Mar 2022 20:56:08 -0500 Subject: [PATCH 093/139] [chassis][supervisor]monit container-checker failed due to unexpected "database-chassis" docker running #9042 (#9043) Why I did it Fixed the monit container_checker fails due to unexpected "database-chassis" docker running on Supervisor card in the VOQ chassis. fixes #9042 How I did it Added database-chassis to the always running docker list if platform is supervisor card. How to verify it Execute the CLI command "sudo monit status container_checker" Signed-off-by: mlok --- files/image_config/monit/container_checker | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index 63bd7b3e182..197e4f04a49 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -20,7 +20,7 @@ import docker import sys import swsssdk -from sonic_py_common import multi_asic +from sonic_py_common import multi_asic, device_info from swsscommon import swsscommon @@ -63,6 +63,8 @@ def get_expected_running_containers(): always_running_containers.add(container_name + str(asic_id)) else: always_running_containers.add(container_name) + if device_info.is_supervisor(): + always_running_containers.add("database-chassis") return expected_running_containers, always_running_containers def get_current_running_from_DB(always_running_containers): From 55a0722a33c19f9693ff441d3b4265876dc92cf3 Mon Sep 17 00:00:00 2001 From: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Date: Sat, 5 Mar 2022 09:20:38 +0800 Subject: [PATCH 094/139] support BGP_ALLOWED_PREFIXES (#10142) --- src/sonic-yang-models/setup.py | 5 +- .../tests/files/sample_config_db.json | 8 + .../tests/yang_model_tests/tests/bgp.json | 41 ++++- .../yang_model_tests/tests_config/bgp.json | 171 ++++++++++++++++++ .../yang-models/sonic-bgp-allowed-prefix.yang | 102 +++++++++++ 5 files changed, 323 insertions(+), 4 deletions(-) create mode 100644 src/sonic-yang-models/yang-models/sonic-bgp-allowed-prefix.yang diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index d8b9a0d0c4a..42954925582 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -85,6 +85,7 @@ def run(self): './yang-models/sonic-bgp-neighbor.yang', './yang-models/sonic-bgp-peergroup.yang', './yang-models/sonic-bgp-peerrange.yang', + './yang-models/sonic-bgp-allowed-prefix.yang', './yang-models/sonic-breakout_cfg.yang', './yang-models/sonic-buffer-pg.yang', './yang-models/sonic-buffer-pool.yang', @@ -126,11 +127,8 @@ def run(self): './yang-models/sonic-versions.yang', './yang-models/sonic-vlan.yang', './yang-models/sonic-vrf.yang', - './yang-models/sonic-mclag.yang', - './yang-models/sonic-vlan-sub-interface.yang', - './yang-models/sonic-warm-restart.yang', './yang-models/sonic-lldp.yang', './yang-models/sonic-scheduler.yang', @@ -153,6 +151,7 @@ def run(self): './cvlyang-models/sonic-bgp-neighbor.yang', './cvlyang-models/sonic-bgp-peergroup.yang', './cvlyang-models/sonic-bgp-peerrange.yang', + './cvlyang-models/sonic-bgp-allowed-prefix.yang', './cvlyang-models/sonic-breakout_cfg.yang', './cvlyang-models/sonic-copp.yang', './cvlyang-models/sonic-crm.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 89a915e72b5..e7b03092efa 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1216,6 +1216,14 @@ "peer_group": "PG1" } }, + "BGP_ALLOWED_PREFIXES" :{ + "DEPLOYMENT_ID|4|123:123": { + "default_action": "permit" + }, + "DEPLOYMENT_ID|5": { + "default_action": "permit" + } + }, "ROUTE_MAP_SET": { "map1": { } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json index 8f92f2d9052..966171888b3 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json @@ -157,7 +157,46 @@ }, "BGP_PEERRANGE_ALL_VALID": { "desc": "Configure BGP peer range table." + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_ALL_VALID": { + "desc": "Configue BGP allowed prefix list." + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_DEPLOYMENT": { + "desc": "Invalid default action.", + "eStrKey" : "Pattern" + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_DEFAULT_ACTION": { + "desc": "Invalid default action.", + "eStrKey" : "InvalidValue", + "eStr" : ["default_action"] + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_PREFIXES_IPV4": { + "desc": "Invalid IPv4 prefix.", + "eStrKey" : "Pattern" + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_PREFIXES_IPV6": { + "desc": "Invalid IPv6 prefix.", + "eStrKey" : "Pattern" + }, + "BGP_ALLOWED_PREFIXES_LIST_ALL_VALID": { + "desc": "Configue BGP allowed prefix list." + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_DEPLOYMENT": { + "desc": "Invalid default action.", + "eStrKey" : "Pattern" + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_DEFAULT_ACTION": { + "desc": "Invalid default action.", + "eStrKey" : "InvalidValue", + "eStr" : ["default_action"] + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_PREFIXES_IPV4": { + "desc": "Invalid IPv4 prefix.", + "eStrKey" : "Pattern" + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_PREFIXES_IPV6": { + "desc": "Invalid IPv6 prefix.", + "eStrKey" : "Pattern" } - } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json index 62bfdc4269e..a6a30bd4055 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json @@ -1420,6 +1420,177 @@ ] } } + }, + + "BGP_ALLOWED_PREFIXES_COM_LIST_ALL_VALID": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_COM_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "community": "123:123", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + }, + { + "deployment": "DEPLOYMENT_ID", + "id": "5", + "community": "456:456", + "default_action": "permit", + "prefixes_v4": ["10.10.0.0/24", "10.11.0.0/24"], + "prefixes_v6": ["fc00:f1::/64", "fc00:a1::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_DEPLOYMENT": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_COM_LIST": [ + { + "deployment": "DEPLOYMENTID", + "id": "4", + "community": "123:123", + "default_action": "permitall", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_DEFAULT_ACTION": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_COM_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "community": "123:123", + "default_action": "permitall", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_PREFIXES_IPV4": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_COM_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "community": "123:123", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/48", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_COM_LIST_INVALID_PREFIXES_IPV6": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_COM_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "community": "123:123", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0./24"], + "prefixes_v6": ["fc00:f0::/129", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_LIST_ALL_VALID": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + }, + { + "deployment": "DEPLOYMENT_ID", + "id": "5", + "default_action": "permit", + "prefixes_v4": ["10.10.0.0/24", "10.11.0.0/24"], + "prefixes_v6": ["fc00:f1::/64", "fc00:a1::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_DEPLOYMENT": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_LIST": [ + { + "deployment": "DEPLOYMENTID", + "id": "4", + "default_action": "permitall", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_DEFAULT_ACTION": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "default_action": "permitall", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_PREFIXES_IPV4": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/48", "10.1.0.0/24"], + "prefixes_v6": ["fc00:f0::/64", "fc00:a0::/64"] + } + ] + } + } + }, + "BGP_ALLOWED_PREFIXES_LIST_INVALID_PREFIXES_IPV6": { + "sonic-bgp-allowed-prefix:sonic-bgp-allowed-prefix": { + "sonic-bgp-allowed-prefix:BGP_ALLOWED_PREFIXES": { + "BGP_ALLOWED_PREFIXES_LIST": [ + { + "deployment": "DEPLOYMENT_ID", + "id": "4", + "default_action": "permit", + "prefixes_v4": ["10.0.0.0/24", "10.1.0.0./24"], + "prefixes_v6": ["fc00:f0::/129", "fc00:a0::/64"] + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-allowed-prefix.yang b/src/sonic-yang-models/yang-models/sonic-bgp-allowed-prefix.yang new file mode 100644 index 00000000000..94238798377 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-bgp-allowed-prefix.yang @@ -0,0 +1,102 @@ +module sonic-bgp-allowed-prefix { + namespace "http://github.com/Azure/sonic-bgp-allowed-prefix"; + prefix bgppre; + yang-version 1.1; + + import sonic-bgp-common { + prefix bgpcmn; + } + + import ietf-inet-types { + prefix inet; + } + + import sonic-routing-policy-sets { + prefix rpolsets; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONIC BGP Allowed Prefix"; + + revision 2022-02-26 { + description + "Initial revision."; + } + + container sonic-bgp-allowed-prefix { + container BGP_ALLOWED_PREFIXES { + list BGP_ALLOWED_PREFIXES_COM_LIST { + key "deployment id community"; + + leaf deployment { + type string { + pattern "DEPLOYMENT_ID"; + } + description "BGP allowed prefix list key type"; + } + + leaf id { + type uint32; + description "BGP allowed prefix list deployment id"; + } + + leaf community { + type string; + description "BGP allowed prefix list deployment community"; + } + + leaf default_action { + type rpolsets:routing-policy-action-type; + description "Permit/Deny action for BGP allow prefix list"; + } + + leaf-list prefixes_v4 { + type inet:ipv4-prefix; + description "BGP V4 allowed prefix list"; + } + + leaf-list prefixes_v6 { + type inet:ipv6-prefix; + description "BGP V6 allowed prefix list"; + } + } + + list BGP_ALLOWED_PREFIXES_LIST { + key "deployment id"; + + leaf deployment { + type string { + pattern "DEPLOYMENT_ID"; + } + description "BGP allowed prefix list key type"; + } + + leaf id { + type uint32; + description "BGP allowed prefix list deployment id"; + } + + leaf default_action { + type rpolsets:routing-policy-action-type; + description "Permit/Deny action for BGP allow prefix list"; + } + + leaf-list prefixes_v4 { + type inet:ipv4-prefix; + description "BGP V4 allowed prefix list"; + } + + leaf-list prefixes_v6 { + type inet:ipv6-prefix; + description "BGP V6 allowed prefix list"; + } + } + } + } +} From 85976cbca3a59c94a14802e0e6c416d75b4bb924 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Sat, 5 Mar 2022 09:33:50 +0800 Subject: [PATCH 095/139] [AS5835-54X] Fix I2C bus order (#9146) Why I did it To fix I2C bus order to meet with HW SPEC. Let i801 use bus-0 and ismt use bus-1 How I did it Modprobe i801 and then do ismt. So i801 will use bus-0 and ismt will use bus-1. How to verify it Test show cmd and sensors work well Co-authored-by: Jostar Yang --- .../accton/x86_64-accton_as5835_54x-r0/installer.conf | 2 ++ .../as5835-54x/utils/accton_as5835_54x_util.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/installer.conf b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf index 925a32fc0c3..a0944fd0e30 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/installer.conf +++ b/device/accton/x86_64-accton_as5835_54x-r0/installer.conf @@ -1,3 +1,5 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off modprobe.blacklist=i2c-ismt,i2c_ismt,i2c-i801,i2c_i801" + diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py index dc26ae1c819..79b1e730ee9 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py @@ -128,6 +128,8 @@ def driver_check(): kos = [ 'modprobe i2c_dev', +'modprobe i2c_i801', +'modprobe i2c_ismt', 'modprobe i2c_mux_pca954x force_deselect_on_exit=1', 'modprobe accton_as5835_54x_cpld' , 'modprobe ym2651y' , @@ -282,6 +284,14 @@ def device_install(): print(output) if FORCE == 0: return status + + # set all pca954x idle_disconnect + cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state' + status, output = log_os_system(cmd, 1) + if status: + print(output) + if FORCE == 0: + return status for i in range(49, 55): #Set qsfp port to normal state log_os_system("echo 0 > /sys/bus/i2c/devices/3-0062/module_reset_" + str(i), 1) From d959c4adcd07728daa7d6cc00e8382ae829fbe09 Mon Sep 17 00:00:00 2001 From: jostar-yang Date: Sat, 5 Mar 2022 09:40:27 +0800 Subject: [PATCH 096/139] [AS4630-54PE] Fix led drv and i2c bus order (#9170) Signed-off-by: Jostar Yang jostar_yang@accton.com.tw Why I did it Fix led drv because CPLD SPEC is updated. Fix i2c bus order How I did it Fix led drv. Set blacklist to i801 and ismt. Let accton util to modprobe i801 and ismt. How to verify it Test led and sensors cmd. Results are fine. --- .../installer.conf | 1 + .../modules/x86-64-accton-as4630-54pe-leds.c | 0 .../utils/accton_as4630_54pe_util.py | 24 +++++++++---------- 3 files changed, 12 insertions(+), 13 deletions(-) mode change 100755 => 100644 platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c diff --git a/device/accton/x86_64-accton_as4630_54pe-r0/installer.conf b/device/accton/x86_64-accton_as4630_54pe-r0/installer.conf index 925a32fc0c3..735fa7992db 100755 --- a/device/accton/x86_64-accton_as4630_54pe-r0/installer.conf +++ b/device/accton/x86_64-accton_as4630_54pe-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off modprobe.blacklist=i2c-ismt,i2c_ismt,i2c-i801,i2c_i801" diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/modules/x86-64-accton-as4630-54pe-leds.c old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py index f0081b33b2c..66599ad88ad 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py @@ -118,7 +118,6 @@ def main(): elif opt in ('-f', '--force'): FORCE = 1 else: - print("TEST") logging.info('no option') for arg in args: if arg == 'install': @@ -167,7 +166,9 @@ def driver_inserted(): kos = [ 'depmod -ae', 'modprobe i2c_dev', -'modprobe i2c_mux_pca954x force_deselect_on_exit=1', +'modprobe i2c_i801', +'modprobe i2c_ismt', +'modprobe i2c_mux_pca954x', 'modprobe ym2651y', 'modprobe x86_64_accton_as4630_54pe_cpld', 'modprobe x86_64_accton_as4630_54pe_leds', @@ -176,17 +177,7 @@ def driver_inserted(): def driver_install(): global FORCE - - ret=log_os_system("lsmod|grep i2c_ismt",1) - my_log("rmmond i2cismt") - log_os_system("rmmod i2c_ismt", 1) - log_os_system("rmmod i2c_i801", 1) - log_os_system("modprobe i2c-i801", 1) - time.sleep(1) - log_os_system("modprobe i2c-ismt", 1) - - - + for i in range(0,len(kos)): status, output = log_os_system(kos[i], 1) if status: @@ -226,6 +217,13 @@ def device_install(): if FORCE == 0: return status + # set all pca954x idle_disconnect + cmd = 'echo -2 | tee /sys/bus/i2c/drivers/pca954x/*-00*/idle_state' + status, output = log_os_system(cmd, 1) + if status: + print(output) + if FORCE == 0: + return status for i in range(0,len(sfp_map)): if(i < 4): opt='optoe2' From b2409be2f2298bf6657257b3454763fd6568e124 Mon Sep 17 00:00:00 2001 From: arunlk-dell <83708154+arunlk-dell@users.noreply.github.com> Date: Sat, 5 Mar 2022 07:23:35 +0530 Subject: [PATCH 097/139] DellEMC: N3248TE Platform API 2.0 changes (#9735) Why I did it N3248TE - Platform API 2.0 changes How I did it Implemented the functional API's needed for Platform API 2.0 How to verify it Used the API 2.0 test suite to validate the test cases. --- .../n3248te/sonic_platform/chassis.py | 72 +++++++++- .../n3248te/sonic_platform/component.py | 49 +++++++ .../n3248te/sonic_platform/eeprom.py | 17 +-- .../n3248te/sonic_platform/fan.py | 85 ++++++++++-- .../n3248te/sonic_platform/fan_drawer.py | 123 +++++++++++++++++- .../n3248te/sonic_platform/psu.py | 56 ++++++-- .../n3248te/sonic_platform/sfp.py | 5 +- .../n3248te/sonic_platform/thermal.py | 19 ++- 8 files changed, 388 insertions(+), 38 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py index 9686892f6f2..d2922eac1fa 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/chassis.py @@ -19,7 +19,6 @@ from sonic_platform.psu import Psu from sonic_platform.thermal import Thermal from sonic_platform.watchdog import Watchdog - from sonic_platform.fan import Fan from sonic_platform.fan_drawer import FanDrawer except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -62,6 +61,12 @@ class Chassis(ChassisBase): 53: 24, 54: 25, } + SYSTEM_LED_COLORS = { + "green", + "blink_green", + "yellow", + "blink_yellow" + } def __init__(self): ChassisBase.__init__(self) @@ -89,8 +94,6 @@ def __init__(self): self._watchdog = Watchdog() self._num_sfps = 54 self._num_fans = MAX_N3248TE_FANTRAY * MAX_N3248TE_FAN - self._fan_list = [Fan(i, j) for i in range(MAX_N3248TE_FANTRAY) \ - for j in range(MAX_N3248TE_FAN)] for k in range(MAX_N3248TE_FANTRAY): fandrawer = FanDrawer(k) self._fan_drawer_list.append(fandrawer) @@ -105,6 +108,7 @@ def __init__(self): self._global_port_pres_dict[port_num] = '1' if presence else '0' self._watchdog = Watchdog() + self.status_led_reg = "system_led" self.locator_led_reg = "locator_led" self.LOCATOR_LED_ON = "blink_blue" self.LOCATOR_LED_OFF = self.STATUS_LED_COLOR_OFF @@ -125,7 +129,6 @@ def _set_cpld_register(self, reg_name, value): cpld_reg_file = self.CPLD_DIR + '/' + reg_name if (not os.path.isfile(cpld_reg_file)): - #print "open error" return rv try: @@ -136,6 +139,40 @@ def _set_cpld_register(self, reg_name, value): return rv + def get_status_led(self): + """ + Gets the current system LED color + + Returns: + A string that represents the supported color + """ + + color = self._get_cpld_register(self.status_led_reg) + + if color not in list(self.SYSTEM_LED_COLORS): + return self.sys_ledcolor + + return color + + def initizalize_system_led(self): + self.sys_ledcolor = "green" + + def set_status_led(self,color): + """ + Set system LED status based on the color type passed in the argument. + Argument: Color to be set + Returns: + bool: True is specified color is set, Otherwise return False + """ + + if color not in list(self.SYSTEM_LED_COLORS): + return False + if(not self._set_cpld_register(self.status_led_reg, color)): + return False + + self.sys_ledcolor = color + return True + # check for this event change for sfp / do we need to handle timeout/sleep def get_change_event(self, timeout=0): @@ -193,7 +230,7 @@ def get_name(self): Returns: string: The name of the chassis """ - return self._eeprom.modelstr().decode() + return self._eeprom.modelstr() def get_presence(self): """ @@ -348,3 +385,28 @@ def get_locator_led(self): return self.LOCATOR_LED_OFF else: return self.LOCATOR_LED_OFF + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether Chassis is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_revision(self): + """ + Retrives the hardware revision of the device + + Returns: + string: Revision value of device + """ + return self._eeprom.revision_str() diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/component.py index ec0dba2ab5b..ccf90f881b0 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/component.py @@ -80,3 +80,52 @@ def install_firmware(self, image_path): A boolean, True if install was successful, False if not """ return False + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the part number of the component + Returns: + string: Part number of component + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'NA' + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + bool: True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/eeprom.py index 75584cbc80b..1c1c5c6df07 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/eeprom.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# -# DellEmc Z9332F +# DellEmc N3248TE # # Platform and model specific eeprom subclass, inherits from the base class, # and provides the followings: @@ -11,7 +11,6 @@ try: import os.path from sonic_eeprom import eeprom_tlvinfo - import binascii except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -75,9 +74,9 @@ def base_mac_addr(self, e): (is_valid, t) = self.get_tlv_field( self.eeprom_data, self._TLV_CODE_MAC_BASE) if not is_valid or t[1] != 6: - return super(eeprom_tlvinfo.TlvInfoDecoder, self).switchaddrstr(t) + return super(TlvInfoDecoder, self).switchaddrstr(e) - return ":".join([binascii.b2a_hex(T) for T in t[2]]) + return ":".join(["{:02x}".format(T) for T in t[2]]).upper() def modelstr(self): """ @@ -88,7 +87,7 @@ def modelstr(self): if not is_valid: return "N/A" - return results[2] + return results[2].decode('ascii') def part_number_str(self): """ @@ -99,7 +98,7 @@ def part_number_str(self): if not is_valid: return "N/A" - return results[2] + return results[2].decode('ascii') def serial_str(self): """ @@ -110,7 +109,7 @@ def serial_str(self): if not is_valid: return "N/A" - return results[2] + return results[2].decode('ascii') def revision_str(self): """ @@ -121,7 +120,7 @@ def revision_str(self): if not is_valid: return "N/A" - return results[2] + return results[2].decode('ascii') def system_eeprom_info(self): """ @@ -130,5 +129,3 @@ def system_eeprom_info(self): found in the system EEPROM. """ return self.eeprom_tlv_dict - - diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py index 873ae4163a8..ff8ea160b95 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ######################################################################## -# DellEMC Z9332F +# DellEMC N3248TE # # Module contains an implementation of SONiC Platform Base API and # provides the Fans' information which are available in the platform. @@ -26,15 +26,19 @@ def __init__(self, fantray_index=0, fan_index=0, psu_fan=False, dependency=None) self.presence_reg = "fan{}_prs".format(fantray_index) self.dir_reg = "fan{}_dir".format(fantray_index) self.rpm_file = "/sys/bus/i2c/devices/7-002c/fan{}_input".format(fantray_index+1) + self.status_file = "/sys/bus/i2c/devices/7-002c/fan{}_fault".format(fantray_index+1) self.eeprom = "/sys/bus/i2c/devices/{}-0050/eeprom".format(15 + fantray_index) self.fantray_index = fantray_index + self.fan_index = fan_index else: - self.presence_reg = "psu{}_prs".format(fantray_index) - self.psu_index = fantray_index + self.psu_index = fan_index - 1 self.dependancy = dependency + self.presence_reg = "psu{}_prs".format(self.psu_index) + self.status_reg = "psu{}_status".format(self.psu_index) self.dir_reg = "" - self.dps_hwmon = "/sys/bus/i2c/devices/{}-005e/hwmon/".format(fantray_index+10) - self.eeprom = "/sys/bus/i2c/devices/{}-0056/eeprom".format(10 + fantray_index) + self.dps_hwmon = "/sys/bus/i2c/devices/{}-005e/hwmon/".format(self.psu_index + 10) + self.eeprom = "/sys/bus/i2c/devices/{}-0056/eeprom".format(self.psu_index + 10) + self.fan_index = fan_index self.max_speed = 0 def _get_cpld_register(self, reg_name): @@ -55,9 +59,9 @@ def get_name(self): String: The name of the device """ if self.is_psu_fan: - return "PSU{} Fan".format(self.psu_index) + return "PSU{} Fan".format(self.psu_index+1) else: - return "Fan{}".format(self.fantray_index+1) + return "FanTray{}-Fan{}".format(self.fantray_index+1, self.fan_index+1) def get_model(self): """ @@ -95,6 +99,8 @@ def get_presence(self): return False if int(presence,0) == 1: return True + else: + return False def get_status(self): """ @@ -102,7 +108,20 @@ def get_status(self): Returns: bool: True if FAN is operating properly, False if not """ - return True + if not self.is_psu_fan: + status = open(self.status_file, "rb").read() + if int(status, 0) == 1: + return False + else: + return True + else: + status = self._get_cpld_register(self.status_reg) + if status == 'ERR': + return False + if int(status, 0) == 1: + return True + else: + return False def get_direction(self): """ @@ -118,7 +137,7 @@ def get_direction(self): """ if not self.is_psu_fan: val = self._get_cpld_register(self.dir_reg) - direction = 'Exhaust' if val == 'F2B' else 'Intake' + direction = 'exhaust' if val == 'F2B' else 'intake' if direction == 'ERR': return None else: @@ -126,7 +145,7 @@ def get_direction(self): val = open(self.eeprom, "rb").read()[0xe1:0xe8] except Exception: return None - direction = 'Exhaust' if val == 'FORWARD' else 'Intake' + direction = 'exhaust' if val == 'FORWARD' else 'intake' return direction def get_speed(self): @@ -167,3 +186,49 @@ def get_speed_rpm(self): except Exception: return None return fan_speed + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.fan_index + + def is_replaceable(self): + """ + Indicate whether Fan is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + if self.get_presence(): + # The tolerance value is fixed as 20% for all the DellEMC platforms + tolerance = 20 + else: + tolerance = 0 + + return tolerance + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan status LED + Returns: + bool: True if set success, False if fail. + """ + # Fan tray status LED controlled by HW + # Return True to avoid thermalctld alarm + return True + diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan_drawer.py index 5142827554d..1812f427cc3 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/fan_drawer.py @@ -14,20 +14,51 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") -N3248TE_FANS_PER_FANTRAY = 2 +N3248TE_FANS_PER_FANTRAY = 1 class FanDrawer(FanDrawerBase): """DellEMC Platform-specific Fan class""" + FANTRAY_LED_COLORS = { + "off", + "green", + "yellow" + } + def __init__(self, fantray_index): FanDrawerBase.__init__(self) # FanTray is 1-based in DellEMC platforms + self.fantray_led_reg = "fan{}_led".format(fantray_index) self.fantrayindex = fantray_index + 1 for i in range(N3248TE_FANS_PER_FANTRAY): self._fan_list.append(Fan(fantray_index, i)) + def _get_cpld_register(self, reg_name): + # On successful read, returns the value read from given + # reg name and on failure rethrns 'ERR' + cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name + try: + rv = open(cpld_reg_file, 'r').read() + except IOError : return 'ERR' + return rv.strip('\r\n').lstrip(' ') + + def _set_cpld_register(self, reg_name, value): + # On successful write, returns the value will be written on + # reg_name and on failure returns 'ERR' + cpld_dir = "/sys/devices/platform/dell-n3248te-cpld.0/" + cpld_reg_file = cpld_dir + '/' + reg_name + + try: + with open(cpld_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception: + rv = 'ERR' + + return rv + def get_name(self): """ Retrieves the fan drawer name @@ -35,3 +66,93 @@ def get_name(self): string: The name of the device """ return "FanTray{}".format(self.fantrayindex) + + def get_status_led(self): + """ + Gets the current system LED color + + Returns: + A string that represents the supported color + """ + + color = self._get_cpld_register(self.fantray_led_reg) + + #if color not in list(self.FANTRAY_LED_COLORS): + # return self.sys_ledcolor + + return color + + def set_status_led(self,color): + """ + Set system LED status based on the color type passed in the argument. + Argument: Color to be set + Returns: + bool: True is specified color is set, Otherwise return False + """ + + if color not in list(self.FANTRAY_LED_COLORS): + return False + + if(not self._set_cpld_register(self.fantray_led_reg, color)): + return False + + return True + + def get_presence(self): + """ + Retrives the presence of the fan drawer + Returns: + bool: True if fan_tray is present, False if not + """ + return self.get_fan(0).get_presence() + + def get_model(self): + """ + Retrieves the part number of the fan drawer + Returns: + string: Part number of fan drawer + """ + return "NA" + + def get_serial(self): + """ + Retrieves the serial number of the fan drawer + Returns: + string: Serial number of the fan drawer + """ + return "NA" + + def get_status(self): + """ + Retrieves the operational status of the fan drawer + Returns: + bool: True if fan drawer is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.fantrayindex + + def is_replaceable(self): + """ + Indicate whether this fan drawer is replaceable. + Returns: + bool: True if it is replaceable, False if not + """ + return True + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 0.0 diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py index 30d4f2bd6c2..617b2ce7f96 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/psu.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ######################################################################## -# DellEMC Z9332F +# DellEMC N3248TE # # Module contains an implementation of SONiC Platform Base API and # provides the PSUs' information which are available in the platform @@ -91,7 +91,9 @@ def get_presence(self): self.dps_hwmon_exist = os.path.exists(self.dps_hwmon) if not self.dps_hwmon_exist: self._reload_dps_module() - return int(presence, 0) + if int(presence, 0) == 1: + return True + return False def get_model(self): """ @@ -103,7 +105,7 @@ def get_model(self): try: val = open(self.eeprom, "rb").read()[0x50:0x62] except Exception: val = None - return val.decode() + return val.decode('ascii') def get_serial(self): """ @@ -115,7 +117,22 @@ def get_serial(self): try: val = open(self.eeprom, "rb").read()[0xc4:0xd9] except Exception: val = None - return val.decode() + return val.decode('ascii') + + def get_revision(self): + """ + Retrieves the serial number of the PSU + + Returns: + string: Serial number of PSU + """ + try: val = open(self.eeprom, "rb").read()[0xc4:0xd9] + except Exception: + val = None + if val != "NA" and len(val) == 23: + return val[-3:] + else: + return "NA" def get_status(self): """ @@ -126,7 +143,9 @@ def get_status(self): """ status = self._get_cpld_register(self.psu_status).strip() if status == 'ERR' : return False - return int(status, 0) + if int(status, 0) == 1: + return True + return False def get_voltage(self): """ @@ -141,7 +160,7 @@ def get_voltage(self): voltage = int(volt_reading)/1000 except Exception: return None - return "{:.1f}".format(voltage) + return float(voltage) def get_current(self): """ @@ -156,7 +175,7 @@ def get_current(self): current = int(curr_reading)/1000 except Exception: return None - return "{:.1f}".format(current) + return float(current) def get_power(self): """ @@ -168,10 +187,10 @@ def get_power(self): """ power_reading = self._get_dps_register(self.psu_power_reg) try: - power = int(power_reading)/1000 + power = int(power_reading)/(1000*1000) except Exception: return None - return "{:.1f}".format(power) + return float(power) def get_powergood_status(self): """ @@ -204,4 +223,21 @@ def get_type(self): try: val = open(self.eeprom, "rb").read()[0xe8:0xea] except Exception: return None - return val + return val.decode() + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this PSU is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py index a69c2b4419d..0a30ae272d7 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/sfp.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# -# DELLEMC S5248F +# DELLEMC N3248TE # # Module contains an implementation of SONiC Platform Base API and # provides the platform information @@ -17,6 +17,9 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +SFP_PORT_START = 49 +SFP_PORT_END = 54 + class Sfp(SfpOptoeBase): """ DELLEMC Platform-specific Sfp class diff --git a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/thermal.py index 96edda7c14d..b07eb5d075e 100644 --- a/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/n3248te/sonic_platform/thermal.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ######################################################################## -# DellEMC Z9332F +# DellEMC N3248TE # # Module contains an implementation of SONiC Platform Base API and # provides the Thermals' information which are available in the platform @@ -144,3 +144,20 @@ def set_low_threshold(self, temperature): """ # Thermal threshold values are pre-defined based on HW. return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this Thermal is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False From 2ef9d6552593ab5ffefda60e73b88372d02b6b70 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:05:46 +0800 Subject: [PATCH 098/139] [yang]: AAA login pattern (#9805) Signed-off-by: Gang Lv ganglv@microsoft.com #### Why I did it end2end test is blocked by Yang model for AAA login pattern. #### How I did it Add pattern to AAA yang models. #### How to verify it Run UT for sonc-yang-models. #### Which release branch to backport (provide reason below if selected) - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 #### Description for the changelog Fix #9713 #### A picture of a cute animal (not mandatory but encouraged) --- .../tests/yang_model_tests/tests/aaa.json | 4 ++++ .../tests/yang_model_tests/tests_config/aaa.json | 10 ++++++++++ .../yang-models/sonic-system-aaa.yang | 8 ++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json b/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json index dc3a60a24df..972b404b88d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/aaa.json @@ -6,6 +6,10 @@ "desc": "Configure a wrong type in AAA table.", "eStrKey": "InvalidValue" }, + "AAA_TEST_WRONG_LOGIN": { + "desc": "Configure a wrong type in AAA table.", + "eStr": ["Invalid login choice"] + }, "AAA_TEST_WRONG_FAILTHROUGH": { "desc": "Configure a wrong failthrough in AAA table.", "eStrKey": "Pattern", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json index 5b05fc33303..fbf63f994cc 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/aaa.json @@ -24,6 +24,16 @@ } }, + "AAA_TEST_WRONG_LOGIN": { + "sonic-system-aaa:sonic-system-aaa": { + "sonic-system-aaa:AAA": { + "AAA_LIST": [{ + "login": "locallll" + }] + } + } + }, + "AAA_TEST_WRONG_FAILTHROUGH": { "sonic-system-aaa:sonic-system-aaa": { "sonic-system-aaa:AAA": { diff --git a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang index 5df05d475de..c3a44212695 100644 --- a/src/sonic-yang-models/yang-models/sonic-system-aaa.yang +++ b/src/sonic-yang-models/yang-models/sonic-system-aaa.yang @@ -30,8 +30,12 @@ module sonic-system-aaa { } leaf login { - type string; - description "AAA authentication/authorization/accounting methods - local/tacacs+/disable"; + type string { + pattern '((tacacs\+|local|radius|default),)*(tacacs\+|local|radius|default)' { + error-message "Invalid login choice"; + } + } + description "AAA authentication/authorization/accounting methods - radius/tacacs+/local/default"; default "local"; } From eec49a2e09538b7b0dc93ef6aab72c1e6c5e0a67 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Sun, 6 Mar 2022 22:04:18 -0800 Subject: [PATCH 099/139] [yang] support acl MIRROR_ACTION (#10100) Why I did it ACL doesn't have mirror related action How I did it Add 'MIRROR_INGRESS_ACTION' and 'MIRROR_EGRESS_ACTION' to sonic-acl.yang.j2 How to verify it Run the YANG model unit tests --- .../tests/files/sample_config_db.json | 15 ++++ .../tests/yang_model_tests/tests/acl.json | 7 ++ .../yang_model_tests/tests_config/acl.json | 70 +++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 16 +++++ 4 files changed, 108 insertions(+) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index e7b03092efa..89b27eb5f5c 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -282,6 +282,11 @@ "SRC_IPV6": "::/0", "PRIORITY": "990000", "DST_IPV6": "::/0" + }, + "EVERFLOW_DSCP|RULE_1": { + "MIRROR_INGRESS_ACTION": "erspan", + "DSCP": "10", + "PRIORITY": "9999" } }, "DEVICE_METADATA": { @@ -750,7 +755,17 @@ "Ethernet25", "Ethernet24" ] + }, + "EVERFLOW_DSCP": { + "type": "MIRROR_DSCP", + "policy_desc": "EVERFLOW_DSCP", + "ports": [ + "Ethernet14", + "Ethernet24" + ], + "stage": "ingress" } + }, "PBH_HASH_FIELD": { "inner_ip_proto": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json index 8c307c30f29..980622cbd3e 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/acl.json @@ -105,5 +105,12 @@ }, "ACL_PACKET_ACTION_VALIDATE_VALUE_ACCEPT": { "desc": "Configure CTRLPLANE with proper action ACCEPT." + }, + "ACL_RULE_WITH_INVALID_MIRROR_INGRESS_ACTION": { + "desc": "Configure ACL_RULE with invalid mirror action.", + "eStrKey" : "LeafRef" + }, + "ACL_RULE_WITH_VALID_MIRROR_INGRESS_ACTION": { + "desc": "Configure ACL_RULE with valid mirror action." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json index 98acc17a63a..b2aa6b3fb15 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/acl.json @@ -820,5 +820,75 @@ ] } } + }, + "ACL_RULE_WITH_INVALID_MIRROR_INGRESS_ACTION": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW_DSCP", + "MIRROR_INGRESS_ACTION": "mirror_session_dscp", + "PRIORITY": 9999, + "RULE_NAME": "Rule_20", + "DSCP": "10" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW_DSCP", + "policy_desc": "EVERFLOW_DSCP", + "ports": [ + "" + ], + "stage": "ingress", + "type": "MIRROR_DSCP" + } + ] + } + } + }, + "ACL_RULE_WITH_VALID_MIRROR_INGRESS_ACTION": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW_DSCP", + "MIRROR_INGRESS_ACTION": "mirror_session_dscp", + "PRIORITY": 9999, + "RULE_NAME": "Rule_20", + "DSCP": "10" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "EVERFLOW_DSCP", + "policy_desc": "EVERFLOW_DSCP", + "ports": [ + "" + ], + "stage": "ingress", + "type": "MIRROR_DSCP" + } + ] + } + }, + "sonic-mirror-session:sonic-mirror-session": { + "sonic-mirror-session:MIRROR_SESSION": { + "MIRROR_SESSION_LIST": [ + { + "name":"mirror_session_dscp", + "type": "ERSPAN", + "dst_ip": "11.1.1.1", + "src_ip": "10.1.1.1", + "gre_type": "0x1234", + "dscp": "10" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 index f38844d09fe..d007f82e096 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -33,6 +33,10 @@ module sonic-acl { prefix lag; } + import sonic-mirror-session { + prefix sms; + } + description "ACL YANG Module for SONiC OS"; revision 2019-07-01 { @@ -65,6 +69,18 @@ module sonic-acl { type stypes:packet_action; } + leaf MIRROR_INGRESS_ACTION { + type leafref { + path "/sms:sonic-mirror-session/sms:MIRROR_SESSION/sms:MIRROR_SESSION_LIST/sms:name"; + } + } + + leaf MIRROR_EGRESS_ACTION { + type leafref { + path "/sms:sonic-mirror-session/sms:MIRROR_SESSION/sms:MIRROR_SESSION_LIST/sms:name"; + } + } + leaf IP_TYPE { type stypes:ip_type; } From 78e867a79403efd80915e66ff51ebe1733d72a2a Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Mon, 7 Mar 2022 15:54:05 +0800 Subject: [PATCH 100/139] [YANG]: Update port Yang models to support multi-asic platform (#10113) Why I did it Multi-asic platform add aisc_port_name and role to PORT table, and port_index range is changed. How I did it Update sonic-port.yang, add asic_port_name and role, and remove range limitation. How to verify it Run UT for sonic-yang-models. Signed-off-by: Gang Lv ganglv@microsoft.com --- .../tests/files/sample_config_db.json | 5 +- .../tests/yang_model_tests/tests/port.json | 8 +++ .../yang_model_tests/tests_config/port.json | 71 +++++++++++++++++++ .../yang-models/sonic-port.yang | 15 +++- 4 files changed, 96 insertions(+), 3 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 89b27eb5f5c..6dbffce671e 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -420,7 +420,10 @@ "description": "", "speed": "11100", "tpid": "0x8100", - "admin_status": "up" + "admin_status": "up", + "index": "0", + "asic_port_name": "Eth0-ASIC1", + "role": "Ext" }, "Ethernet1": { "alias": "Eth1/2", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json index f936d7a0b80..b3aa253c2e7 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/port.json @@ -73,5 +73,13 @@ "PORT_INVALID_MUX_CABLE_TEST": { "desc": "PORT_INVALID_MUX_CABLE_TEST non-boolean values, expect fail", "eStrKey": "InvalidValue" + }, + "PORT_VALID_MULTIASIC_TEST": { + "desc": "PORT_VALID_MULTIASIC_TEST no failure." + }, + "PORT_INVALID_MULTIASIC_TEST": { + "desc": "PORT_INVALID_MULTIASIC_TEST invalid role pattern, expect fail", + "eStrKey": "Pattern" } + } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json index 5d7fff2cd87..e1549261cb9 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json @@ -314,5 +314,76 @@ ] } } + }, + + "PORT_VALID_MULTIASIC_TEST": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "alias": "eth8", + "lanes": "65", + "speed": 50000, + "index": "0", + "asic_port_name": "Eth8-ASIC1", + "role": "Ext" + }, + { + "name": "Ethernet9", + "alias": "eth9", + "lanes": "66", + "speed": 50000, + "index": "1", + "asic_port_name": "Eth9-ASIC1" + }, + { + "name": "Ethernet10", + "alias": "eth10", + "lanes": "67", + "speed": 50000, + "index": "2", + "asic_port_name": "Eth10-ASIC1", + "role": "Int" + }, + { + "name": "Ethernet11", + "alias": "eth11", + "lanes": "68", + "speed": 50000, + "index": "3", + "asic_port_name": "Eth11-ASIC1", + "role": "Inb" + }, + { + "name": "Ethernet12", + "alias": "eth12", + "lanes": "69", + "speed": 50000, + "index": "4", + "asic_port_name": "Eth12-ASIC1", + "role": "Rec" + } + ] + } + } + }, + + "PORT_INVALID_MULTIASIC_TEST": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "name": "Ethernet8", + "alias": "eth8", + "lanes": "65", + "speed": 50000, + "index": "0", + "asic_port_name": "Eth8-ASIC1", + "role": "Invalid" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-port.yang b/src/sonic-yang-models/yang-models/sonic-port.yang index b2031688af7..d296eaa05c3 100644 --- a/src/sonic-yang-models/yang-models/sonic-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-port.yang @@ -110,9 +110,20 @@ module sonic-port{ } leaf index { - type uint16 { - range 0..256; + type uint16; + } + + leaf asic_port_name { + type string; + description "port name in asic and asic name, e.g Eth0-ASIC1"; + } + + leaf role { + type string { + pattern "Ext|Int|Inb|Rec"; } + description "Internal port or External port for multi-asic platform"; + default "Ext"; } leaf admin_status { From fe0a7693f4dd502c2d9f86d08227be1c92ae09d2 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 8 Mar 2022 01:39:33 +0800 Subject: [PATCH 101/139] [smartmontools] Install smartmontools with apt-get and upgrade it to 7.2-1 (#10087) Why I did it Smartmontools 6.6 has an issue with reading SMART info of nvme SSD Smartmontools can be installed with apt-get, no need to build and install How I did it Use apt-get to install smartmontools 7.2-1 Remove previous make files for smartmontools 6.6 How to verify it verify with "smartctl" can read out correct SMART info on NVME ssd. verify "show platform ssdhealth" can still work Signed-off-by: Kebo Liu --- .../build_templates/sonic_debian_extension.j2 | 2 +- slave.mk | 1 - sonic-slave-bullseye/Dockerfile.j2 | 3 --- sonic-slave-buster/Dockerfile.j2 | 3 --- sonic-slave-stretch/Dockerfile.j2 | 6 ------ src/smartmontools/.gitignore | 3 --- src/smartmontools/Makefile | 19 ------------------- 7 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 src/smartmontools/.gitignore delete mode 100644 src/smartmontools/Makefile diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 3efb5ae0690..0a2b5536232 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -328,7 +328,7 @@ sudo cp $IMAGE_CONFIGS/monit/restart_service $FILESYSTEM_ROOT/usr/bin/ sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/restart_service # Install custom-built smartmontools -sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/smartmontools_*.deb +sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install smartmontools=7.2-1 # Install custom-built openssh sshd sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/openssh-server_*.deb diff --git a/slave.mk b/slave.mk index 1b879350b73..66831571aa7 100644 --- a/slave.mk +++ b/slave.mk @@ -974,7 +974,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(LIBNSS_TACPLUS) \ $(MONIT) \ $(OPENSSH_SERVER) \ - $(SMARTMONTOOLS) \ $(PYTHON_SWSSCOMMON) \ $(PYTHON3_SWSSCOMMON) \ $(SONIC_UTILITIES_DATA) \ diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index c0a23c59624..dc6ba779e26 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -279,9 +279,6 @@ RUN apt-get update && apt-get install -y \ librrd8 \ librrd-dev \ rrdtool \ -# For smartmontools 6.6-1 - automake1.11 \ - libselinux1-dev \ # For kdump-tools liblzo2-dev \ # For iptables diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 0f5c6414a19..715ad8e1905 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -291,9 +291,6 @@ RUN apt-get update && apt-get install -y \ librrd8 \ librrd-dev \ rrdtool \ -# For smartmontools 6.6-1 - automake1.11 \ - libselinux1-dev \ # For kdump-tools liblzo2-dev \ # For iptables diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 93c6d21d41e..d9528f67d02 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -272,9 +272,6 @@ RUN apt-get update && apt-get install -y \ librrd8 \ librrd-dev \ rrdtool \ -# For smartmontools 6.6-1 - automake1.11 \ - libselinux1-dev \ # For kdump-tools liblzo2-dev \ # For iptables @@ -315,9 +312,6 @@ RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confdef" ## do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix RUN sudo augtool --autosave "set /files/etc/dpkg/dpkg.cfg/force-confold" -# For smartmontools 6.6-1 -RUN apt-get -t stretch-backports install -y debhelper - # For linux build RUN apt-get -y build-dep linux diff --git a/src/smartmontools/.gitignore b/src/smartmontools/.gitignore deleted file mode 100644 index a0991ff4402..00000000000 --- a/src/smartmontools/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!Makefile diff --git a/src/smartmontools/Makefile b/src/smartmontools/Makefile deleted file mode 100644 index 8f0f0695659..00000000000 --- a/src/smartmontools/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -SHELL = /bin/bash -.ONESHELL: -.SHELLFLAGS += -e - - -MAIN_TARGET = smartmontools_$(SMARTMONTOOLS_VERSION_FULL)_$(CONFIGURED_ARCH).deb - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - rm -rf smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR) - wget -O smartmontools_$(SMARTMONTOOLS_VERSION_MAJOR).orig.tar.gz -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_MAJOR).orig.tar.gz?sv=2015-04-05&sr=b&sig=JZx4qiLuO36T0rsGqk4V2RDuWjRw6NztsLK7vlBYAkg%3D&se=2046-08-20T23%3A47%3A13Z&sp=r" - wget -O smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc?sv=2015-04-05&sr=b&sig=IS7FKUN%2Bvq0T55f4X2hGAViB70Y%2FgzjGgvzpUJLyUfA%3D&se=2046-08-20T23%3A46%3A57Z&sp=r" - wget -O smartmontools_$(SMARTMONTOOLS_VERSION_FULL).debian.tar.xz -N "https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_$(SMARTMONTOOLS_VERSION_FULL).debian.tar.xz?sv=2015-04-05&sr=b&sig=H0RFeC41MCvhTQCln85DuPLn5v2goozwz%2FB9sA9p5eQ%3D&se=2046-08-20T23%3A46%3A02Z&sp=r" - dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc - - pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR) - dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) - popd - - mv $* $(DEST)/ From d9a61b07a7b8e2aa699da5c1ee7b0eb111d219c6 Mon Sep 17 00:00:00 2001 From: Renuka Manavalan <47282725+renukamanavalan@users.noreply.github.com> Date: Mon, 7 Mar 2022 15:01:31 -0800 Subject: [PATCH 102/139] send log to /var/log/syslog; Add user info the message (#10033) Why I did it Desired the log message destination to be syslog and it misses the critical info. How I did it Non logical code changes only. Logging update, just for one message only a) The log message is directed to /var/log/syslog, instead of /var/log/auth.log b) Include user alias in the message How to verify it Pick a user alias that has not logged into the switch yet Add this alias to /etc/tacplus_user Attempt to login as that user Look for the error message in /var/log/syslog e.g. "Feb 18 19:16:41.592191 sonic ERR sshd[5233]: auth fail: Password incorrect. user: user_xyz" --- .../pam/0010-handle-bad-password-set-by-sshd.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tacacs/pam/0010-handle-bad-password-set-by-sshd.patch b/src/tacacs/pam/0010-handle-bad-password-set-by-sshd.patch index 07134fd6fd5..c4355d9a85d 100644 --- a/src/tacacs/pam/0010-handle-bad-password-set-by-sshd.patch +++ b/src/tacacs/pam/0010-handle-bad-password-set-by-sshd.patch @@ -1,6 +1,6 @@ -From 36f67d58c39a5aceeec3182e381735c8a4a0a657 Mon Sep 17 00:00:00 2001 +From ed8b0366d3dbe137752fbb37a4b9fd1d46402d5b Mon Sep 17 00:00:00 2001 From: Renuka Manavalan -Date: Fri, 5 Nov 2021 17:43:10 +0000 +Date: Fri, 18 Feb 2022 22:27:39 +0000 Subject: [PATCH] handle bad password set by sshd --- @@ -11,7 +11,7 @@ Subject: [PATCH] handle bad password set by sshd 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/pam_tacplus.c b/pam_tacplus.c -index d57657a..eb53c94 100644 +index d57657a..38b6ee3 100644 --- a/pam_tacplus.c +++ b/pam_tacplus.c @@ -248,6 +248,13 @@ int pam_sm_authenticate (pam_handle_t * pamh, int flags, @@ -19,7 +19,7 @@ index d57657a..eb53c94 100644 } + if (validate_not_sshd_bad_pass(pass) != PAM_SUCCESS) { -+ syslog(LOG_ERR, "auth fail: Password incorrect"); ++ syslog(LOG_LOCAL0|LOG_ERR, "auth fail: Password incorrect. user: %s", user); + memset(pass, 0, strlen (pass)); + free(pass); + return PAM_AUTH_ERR; @@ -47,10 +47,10 @@ index d57657a..eb53c94 100644 pass = NULL; } diff --git a/support.c b/support.c -index 1ea2e30..8a7dfbb 100644 +index f056ec4..81f3466 100644 --- a/support.c +++ b/support.c -@@ -114,6 +114,43 @@ int converse(pam_handle_t * pamh, int nargs, const struct pam_message *message, +@@ -117,6 +117,43 @@ int converse(pam_handle_t * pamh, int nargs, const struct pam_message *message, return retval; } @@ -94,7 +94,7 @@ index 1ea2e30..8a7dfbb 100644 /* stolen from pam_stress */ int tacacs_get_password (pam_handle_t * pamh, int flags ,int ctrl, char **password) { -@@ -436,4 +473,4 @@ int _pam_parse (int argc, const char **argv) { +@@ -459,4 +496,4 @@ int _pam_parse (int argc, const char **argv) { } return ctrl; From 14921e39d1ec077d7c2ce9f8eb3853e6f6c68afc Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 8 Mar 2022 10:15:52 +0800 Subject: [PATCH 103/139] [Build][Ci]: Support to use the cisco sai packages built by azp (#10102) Why I did it Support to use the cisco sai packages built by azp --- .../official-build-cisco-8000.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.azure-pipelines/official-build-cisco-8000.yml b/.azure-pipelines/official-build-cisco-8000.yml index aeec64a848a..61b6b03171e 100644 --- a/.azure-pipelines/official-build-cisco-8000.yml +++ b/.azure-pipelines/official-build-cisco-8000.yml @@ -22,6 +22,11 @@ resources: name: Cisco-8000-sonic/platform-cisco-8000 endpoint: cisco-connection +variables: +- group: SONIC-AKV-STROAGE-1 +- name: StorageSASKey + value: $(sonicstorage-SasToken) + stages: - stage: Build pool: sonic @@ -29,6 +34,7 @@ stages: CACHE_MODE: wcache SKIP_CHECKOUT: true TERM: '' + PACKAGE_URL: "https://sonicstorage.blob.core.windows.net/packages" jobs: - template: azure-pipelines-build.yml @@ -60,5 +66,29 @@ stages: make PLATFORM=cisco-8000 platform/cisco-8000 tar xfz $(System.ArtifactsDirectory)/artifactory-*.tar.gz -C platform/cisco-8000 displayName: 'Setup cisco artifacts' + - script: | + set -ex + filename=$(find platform/cisco-8000/artifactory/sonic -name cisco-* -type f | head -n 1) + if [ -z "$filename" ]; then + echo "Cisco sai package not found" 1>&2 + exit 1 + fi + cd $(dirname $filename) + echo "PWD=$(pwd)" + ls -l *.deb + while read -r package; do + # Cisco version format: -sai--- + # The may contain several values in one build, the part is skipped when publishing to storage + # See https://github.com/Cisco-8000-sonic/sdk/blob/master/azure-pipelines.yml + # The $PACKAGE_URL is only accessible for AZP + version=$(echo $package | awk -F_ '{print $(NF-1)}' | cut -d- -f1,2,4,5) + package_url="$PACKAGE_URL/sai/ciscosai/master/$version/$package" + echo "Override package $package from $package_url" + wget "$package_url$StorageSASKey" -O "$package" + done < <(ls *.deb) + env: + StorageSASKey: $(StorageSASKey) + condition: ne(variables['Build.Reason'], 'PullRequest') + displayName: "Override cisco sai packages" jobGroups: - name: cisco-8000 From 29f6b01be634b731970b6b88f459721e168b4610 Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:48:04 +0800 Subject: [PATCH 104/139] [sonic-cfggen]: Fix generated deployment_id (#10154) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it Config db schema generated by minigraph can’t pass yang validation, deployment_id can’t be none for yang validation. How I did it Update minigraph.py, skip deployment_id with None value How to verify it Run UT for sonic-config-enginue. Run command 'sonic-cfggen -m tests/multi_npu_data/sample-minigraph-noportchannel.xml -p tests/multi_npu_data/sample_port_config-3.ini -n asic3 --print-data'. Signed-off-by: Gang Lv ganglv@microsoft.com --- src/sonic-config-engine/minigraph.py | 4 +- .../tests/t0-sample-deployment-id.xml | 347 ++++++++++++++++++ src/sonic-config-engine/tests/test_cfggen.py | 6 + 3 files changed, 356 insertions(+), 1 deletion(-) create mode 100644 src/sonic-config-engine/tests/t0-sample-deployment-id.xml diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 2d0e9ac0b66..b4f1f3acbd7 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1282,7 +1282,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results = {} results['DEVICE_METADATA'] = {'localhost': { 'bgp_asn': bgp_asn, - 'deployment_id': deployment_id, 'region': region, 'cloudtype': cloudtype, 'docker_routing_config_mode': docker_routing_config_mode, @@ -1293,6 +1292,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw } } + if deployment_id is not None: + results['DEVICE_METADATA']['localhost']['deployment_id'] = deployment_id + cluster = [devices[key] for key in devices if key.lower() == hostname.lower()][0].get('cluster', "") if cluster: results['DEVICE_METADATA']['localhost']['cluster'] = cluster diff --git a/src/sonic-config-engine/tests/t0-sample-deployment-id.xml b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml new file mode 100644 index 00000000000..b6b47d97910 --- /dev/null +++ b/src/sonic-config-engine/tests/t0-sample-deployment-id.xml @@ -0,0 +1,347 @@ + + + + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 180 + 60 + + + switch-t0 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 180 + 60 + + + switch-t0 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 180 + 60 + + + + + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ +
10.1.0.32
+ BGPSLBPassive + 10.10.10.10/26;100.100.100.100/26 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/112 + + + + PortChannel02 + fortyGigE0/116 + + + + PortChannel03 + fortyGigE0/120 + + + + PortChannel04 + fortyGigE0/124 + + + + + + Vlan1000 + fortyGigE0/4;fortyGigE0/8;fortyGigE0/12;fortyGigE0/16;fortyGigE0/20;fortyGigE0/24;fortyGigE0/28;fortyGigE0/32;fortyGigE0/36;fortyGigE0/40;fortyGigE0/44;fortyGigE0/48;fortyGigE0/52;fortyGigE0/56;fortyGigE0/60;fortyGigE0/64;fortyGigE0/68;fortyGigE0/72;fortyGigE0/76;fortyGigE0/80;fortyGigE0/84;fortyGigE0/88;fortyGigE0/92;fortyGigE0/96 + False + 0.0.0.0/0 + + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + PortChannel02 + 10.0.0.58/31 + + + + PortChannel02 + FC00::75/126 + + + + PortChannel03 + 10.0.0.60/31 + + + + PortChannel03 + FC00::79/126 + + + + PortChannel04 + 10.0.0.62/31 + + + + PortChannel04 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/27 + + + + + + PortChannel01;PortChannel02;PortChannel03;PortChannel04 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1/1 + switch-t0 + fortyGigE0/112 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1/1 + switch-t0 + fortyGigE0/116 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1/1 + switch-t0 + fortyGigE0/120 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1/1 + switch-t0 + fortyGigE0/124 + + + + + switch-t0 + Force10-S6000 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + switch-t0 + + + ErspanDestinationIpv4 + + 2.2.2.2 + + + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index bf1221cab9e..c75c53b7f62 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -23,6 +23,7 @@ def setUp(self): self.sample_graph_metadata = os.path.join(self.test_dir, 'simple-sample-graph-metadata.xml') self.sample_graph_pc_test = os.path.join(self.test_dir, 'pc-test-graph.xml') self.sample_graph_bgp_speaker = os.path.join(self.test_dir, 't0-sample-bgp-speaker.xml') + self.sample_graph_deployment_id = os.path.join(self.test_dir, 't0-sample-deployment-id.xml') self.sample_graph_voq = os.path.join(self.test_dir, 'sample-voq-graph.xml') self.sample_device_desc = os.path.join(self.test_dir, 'device.xml') self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') @@ -498,6 +499,11 @@ def test_minigraph_deployment_id(self): output = self.run_script(argument) self.assertEqual(output.strip(), "1") + def test_minigraph_deployment_id_null(self): + argument = '-m "' + self.sample_graph_deployment_id + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\']"' + output = self.run_script(argument) + self.assertNotIn('deployment_id', output.strip()) + def test_minigraph_ethernet_interfaces(self, **kwargs): graph_file = kwargs.get('graph_file', self.sample_graph_simple) argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet8\']"' From f1d6d7ccce50ff2ea25307752ddaf44b2da9e082 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 8 Mar 2022 21:15:43 +0800 Subject: [PATCH 105/139] [Build]: Fix the bin image generated from raw image issue (#10083) Why I did it It is to fix the issue #10048 When building .raw image, for instance, target/sonic-broadcom.raw, it will generate a .bin image, target/sonic-broadcom.bin, as the intermediate file. The intermediate file is a build target which may contains different dependencies with the raw one. --- build_image.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build_image.sh b/build_image.sh index 871ba839a90..71351dbfe7e 100755 --- a/build_image.sh +++ b/build_image.sh @@ -68,6 +68,8 @@ generate_kvm_image() generate_onie_installer_image() { + output_file=$OUTPUT_ONIE_IMAGE + [ -n "$1" ] && output_file=$1 # Copy platform-specific ONIE installer config files where onie-mk-demo.sh expects them rm -rf ./installer/x86_64/platforms/ mkdir -p ./installer/x86_64/platforms/ @@ -83,7 +85,7 @@ generate_onie_installer_image() ## Generate an ONIE installer image ## Note: Don't leave blank between lines. It is single line command. ./onie-mk-demo.sh $TARGET_PLATFORM $TARGET_MACHINE $TARGET_PLATFORM-$TARGET_MACHINE-$ONIEIMAGE_VERSION \ - installer platform/$TARGET_MACHINE/platform.conf $OUTPUT_ONIE_IMAGE OS $IMAGE_VERSION $ONIE_IMAGE_PART_SIZE \ + installer platform/$TARGET_MACHINE/platform.conf $output_file OS $IMAGE_VERSION $ONIE_IMAGE_PART_SIZE \ $ONIE_INSTALLER_PAYLOAD } @@ -119,12 +121,13 @@ if [ "$IMAGE_TYPE" = "onie" ]; then elif [ "$IMAGE_TYPE" = "raw" ]; then echo "Build RAW image" + tmp_output_onie_image=${OUTPUT_ONIE_IMAGE}.tmp mkdir -p `dirname $OUTPUT_RAW_IMAGE` sudo rm -f $OUTPUT_RAW_IMAGE generate_device_list "./installer/$TARGET_PLATFORM/platforms_asic" - generate_onie_installer_image + generate_onie_installer_image "$tmp_output_onie_image" echo "Creating SONiC raw partition : $OUTPUT_RAW_IMAGE of size $RAW_IMAGE_DISK_SIZE MB" fallocate -l "$RAW_IMAGE_DISK_SIZE"M $OUTPUT_RAW_IMAGE @@ -135,8 +138,9 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then ## Generate a partition dump that can be used to 'dd' in-lieu of using the onie-nos-installer ## Run the installer ## The 'build' install mode of the installer is used to generate this dump. - sudo chmod a+x $OUTPUT_ONIE_IMAGE - sudo ./$OUTPUT_ONIE_IMAGE + sudo chmod a+x $tmp_output_onie_image + sudo ./$tmp_output_onie_image + rm $tmp_output_onie_image [ -r $OUTPUT_RAW_IMAGE ] || { echo "Error : $OUTPUT_RAW_IMAGE not generated!" From d112e7cca9087d02892ada9d70bddcc5d5616c24 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Tue, 8 Mar 2022 05:56:42 -0800 Subject: [PATCH 106/139] [submodule] Update sonic-utilities (#10163) 47c243e [show][muxcable] fix the sudo access error for show muxcable metrics (#2083) f872516 [muxcable][show] enhance show mux status to show last switchover time (#2067) d440df7 [warmboot] Migrate 10G ports during warm-reboot on s6100 (#2064) 494c6d7 [counterpoll] Display the correct default poll interval for watermark counters (#2082) 499988e [show][config] add muxcable command line support for retrieve / reset ICMP packet loss data (#2046) 8b01d3e Remove the warning message appear when there are no ports on CONFIG DB (#2050) ed6e66e [GCU] Supporting Groupings during path-xpath translation (#2044) 25b3455 [ci] Use official build debian pkg instead and parameterize source branch (#2079) --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index a9bbaf22731..47c243eb7e9 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit a9bbaf2273169ed9f4c764cc39e97708995e0fa3 +Subproject commit 47c243eb7e9cbe6ebd3479290a98183071cf2124 From bf5f9c29184d57070181bec8dd811f35277f63e0 Mon Sep 17 00:00:00 2001 From: Kostiantyn Yarovyi Date: Wed, 9 Mar 2022 06:27:08 +0200 Subject: [PATCH 107/139] [BFN] Update configuration files (#9913) * [Barefoot] update switch-tna-sai.conf file * remove deprecated conf files * [Barefoot] update switch-tna-sai.conf file for Accton wedge100bf_32qs platform * pdated switch-tna-sai.conf --- .../montara/switch-tna-sai.conf | 21 ++++++------ .../Arista-7170-32C-C32/switch-sai.conf | 33 ------------------ .../Arista-7170-32C-C32/switch-tna-sai.conf | 17 +++++----- .../Arista-7170-32CD-C32/switch-sai.conf | 33 ------------------ .../Arista-7170-32CD-C32/switch-tna-sai.conf | 17 +++++----- .../Arista-7170-64C/switch-sai.conf | 33 ------------------ .../Arista-7170-64C/switch-tna-sai.conf | 17 +++++----- .../Arista-7170-Q59S20/switch-sai.conf | 33 ------------------ .../Arista-7170-Q59S20/switch-tna-sai.conf | 17 +++++----- .../newport/switch-tna-sai.conf | 27 +++++++-------- .../montara/switch-sai.conf | 34 ------------------- .../montara/switch-tna-sai.conf | 21 ++++++------ .../mavericks/switch-sai.conf | 34 ------------------- .../mavericks/switch-tna-sai.conf | 21 ++++++------ .../INGRASYS-S9180-32X/switch-tna-sai.conf | 21 ++++++------ .../INGRASYS-S9280-64X/switch-tna-sai.conf | 21 ++++++------ .../OSW1800-48x6q/switch-tna-sai.conf | 21 ++++++------ 17 files changed, 105 insertions(+), 316 deletions(-) delete mode 100644 device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-sai.conf delete mode 100644 device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-sai.conf delete mode 100644 device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-sai.conf delete mode 100644 device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-sai.conf delete mode 100644 device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf delete mode 100644 device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf diff --git a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf index 4a4d41f3806..8c34ef9d6a9 100644 --- a/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf +++ b/device/accton/x86_64-accton_wedge100bf_32qs-r0/montara/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-sai.conf b/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-sai.conf deleted file mode 100644 index 0a807b1c9ea..00000000000 --- a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-sai.conf +++ /dev/null @@ -1,33 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:1c.4/0000:07:00.0", - "pcie_domain": 0, - "pcie_bus": 7, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-tna-sai.conf b/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-tna-sai.conf index ece3fcbe6a9..dc8c82ce254 100644 --- a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-tna-sai.conf +++ b/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/switch-tna-sai.conf @@ -1,16 +1,8 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, "sds_fw_path": "share/tofino_sds_fw/avago/firmware" } ], @@ -27,7 +19,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -35,5 +26,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-sai.conf b/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-sai.conf deleted file mode 100644 index 0a807b1c9ea..00000000000 --- a/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-sai.conf +++ /dev/null @@ -1,33 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:1c.4/0000:07:00.0", - "pcie_domain": 0, - "pcie_bus": 7, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-tna-sai.conf b/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-tna-sai.conf index ece3fcbe6a9..dc8c82ce254 100644 --- a/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-tna-sai.conf +++ b/device/arista/x86_64-arista_7170_32cd/Arista-7170-32CD-C32/switch-tna-sai.conf @@ -1,16 +1,8 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, "sds_fw_path": "share/tofino_sds_fw/avago/firmware" } ], @@ -27,7 +19,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -35,5 +26,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-sai.conf b/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-sai.conf deleted file mode 100644 index 0a807b1c9ea..00000000000 --- a/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-sai.conf +++ /dev/null @@ -1,33 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:1c.4/0000:07:00.0", - "pcie_domain": 0, - "pcie_bus": 7, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-tna-sai.conf b/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-tna-sai.conf index ece3fcbe6a9..dc8c82ce254 100644 --- a/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-tna-sai.conf +++ b/device/arista/x86_64-arista_7170_64c/Arista-7170-64C/switch-tna-sai.conf @@ -1,16 +1,8 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, "sds_fw_path": "share/tofino_sds_fw/avago/firmware" } ], @@ -27,7 +19,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -35,5 +26,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-sai.conf b/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-sai.conf deleted file mode 100644 index 0a807b1c9ea..00000000000 --- a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-sai.conf +++ /dev/null @@ -1,33 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:1c.4/0000:07:00.0", - "pcie_domain": 0, - "pcie_bus": 7, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-tna-sai.conf b/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-tna-sai.conf index ece3fcbe6a9..dc8c82ce254 100644 --- a/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-tna-sai.conf +++ b/device/arista/x86_64-arista_7170_64c/Arista-7170-Q59S20/switch-tna-sai.conf @@ -1,16 +1,8 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, "sds_fw_path": "share/tofino_sds_fw/avago/firmware" } ], @@ -27,7 +19,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -35,5 +26,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf b/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf index cf6e445dba1..2789eb0e2c0 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/newport/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino2", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -20,21 +12,28 @@ "agent0": "lib/platform/x86_64-accton_as9516bf_32d-r0/libpltfm_mgr.so", "p4_programs": [ { + "program-name": "switch", + "bfrt-config": "share/switch/bf-rt.json", "p4_pipelines": [ { "p4_pipeline_name": "pipe", "config": "share/switch/pipe/tofino2.bin", "context": "share/switch/pipe/context.json" } - ], - "program-name": "switch", - "sai": "lib/libsai.so", - "bfrt-config": "share/switch/bf-rt.json", + ], "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, "non_default_port_ppgs": 5 } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf deleted file mode 100644 index fc224c9602e..00000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-sai.conf +++ /dev/null @@ -1,34 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "agent0": "lib/platform/x86_64-accton_wedge100bf_32x-r0/libpltfm_mgr.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf index 085a1b8dcdf..dc6f78e0b1e 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf deleted file mode 100644 index 81a7d7bc28c..00000000000 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-sai.conf +++ /dev/null @@ -1,34 +0,0 @@ -{ - "chip_list": [ - { - "id": "asic-0", - "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" - } - ], - "instance": 0, - "p4_program_list": [ - { - "id": "pgm-0", - "instance": 0, - "path": "switch", - "program-name": "switch", - "pd": "lib/tofinopd/switch/libpd.so", - "pd-thrift": "lib/tofinopd/switch/libpdthrift.so", - "table-config": "share/tofinopd/switch/context.json", - "tofino-bin": "share/tofinopd/switch/tofino.bin", - "switchapi": "lib/libswitchapi.so", - "sai": "lib/libsai.so", - "agent0": "lib/platform/x86_64-accton_wedge100bf_65x-r0/libpltfm_mgr.so", - "switchapi_port_add": false, - "non_default_port_ppgs": 5 - } - ] -} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf index ddcb9d4ba28..e07192619af 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/INGRASYS-S9180-32X/switch-tna-sai.conf b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/INGRASYS-S9180-32X/switch-tna-sai.conf index 9fbf9d3cdb6..193dcde96bc 100644 --- a/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/INGRASYS-S9180-32X/switch-tna-sai.conf +++ b/device/ingrasys/x86_64-ingrasys_s9180_32x-r0/INGRASYS-S9180-32X/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/INGRASYS-S9280-64X/switch-tna-sai.conf b/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/INGRASYS-S9280-64X/switch-tna-sai.conf index 4895ac901ff..2425102e231 100644 --- a/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/INGRASYS-S9280-64X/switch-tna-sai.conf +++ b/device/ingrasys/x86_64-ingrasys_s9280_64x-r0/INGRASYS-S9280-64X/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } diff --git a/device/wnc/x86_64-wnc_osw1800-r0/OSW1800-48x6q/switch-tna-sai.conf b/device/wnc/x86_64-wnc_osw1800-r0/OSW1800-48x6q/switch-tna-sai.conf index 7cb3ddc48fc..03b0924d433 100644 --- a/device/wnc/x86_64-wnc_osw1800-r0/OSW1800-48x6q/switch-tna-sai.conf +++ b/device/wnc/x86_64-wnc_osw1800-r0/OSW1800-48x6q/switch-tna-sai.conf @@ -1,17 +1,9 @@ { - "instance": 0, "chip_list": [ { - "id": "asic-0", "chip_family": "Tofino", - "instance": 0, - "pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0", - "pcie_domain": 0, - "pcie_bus": 5, - "pcie_fn": 0, - "pcie_dev": 0, - "pcie_int_mode": 1, - "sds_fw_path": "share/tofino_sds_fw/avago/firmware" + "sds_fw_path": "share/tofino_sds_fw/avago/firmware", + "instance": 0 } ], "p4_devices": [ @@ -28,7 +20,6 @@ } ], "program-name": "switch", - "sai": "lib/libsai.so", "bfrt-config": "share/switch/bf-rt.json", "model_json_path" : "share/switch/aug_model.json", "switchapi_port_add": false, @@ -36,5 +27,13 @@ } ] } + ], + "switch_options": [ + { + "device-id": 0, + "model_json_path": "share/switch/aug_model.json", + "non_default_port_ppgs": 5, + "switchapi_port_add": false + } ] } From 3fa18d18d4c06fe38164ebfefdc3187820fc7496 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozodoi Date: Wed, 9 Mar 2022 06:28:01 +0200 Subject: [PATCH 108/139] Add necessary changes for python3 virtual environment of sonic-mgmt docker container (#9277) This PR includes necessary changes for the setup of the Python3 virtual environment in the sonic-mgmt docker container. How to activate Python3 virtual environment? Connect to the sonic-mgmt container $ docker exec -ti sonic-mgmt bash Activate the virtual environment $ source /var/user/env-python3/bin/activate Why I did it Migration of sonic-mgmt codebase from Python 2 to Python 3 How I did it Added all necessary dependencies to the env-python3 virtual environment. Signed-off-by: Oleksandr Kozodoi --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 67 ++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 67486f74bbb..e2054ae81ba 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -177,7 +177,6 @@ RUN python -m virtualenv --system-site-packages env-201811 RUN env-201811/bin/pip install cryptography==3.3.2 ansible==2.0.0.2 RUN python3 -m venv env-python3 -RUN env-python3/bin/pip3 install cryptography==3.3.2 azure-kusto-data azure-kusto-ingest defusedxml pytest aiohttp # NOTE: There is an ordering dependency for pycryptodome. Leaving this at # the end until we figure that out. @@ -186,3 +185,69 @@ RUN pip install pycryptodome==3.9.8 # Install allure-pytest library RUN pip install --upgrade setuptools \ && pip install allure-pytest==2.8.22 + +# Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. +ENV VIRTUAL_ENV=env-python3 +ARG BACKUP_OF_PATH="$PATH" +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 PYTHONIOENCODING=UTF-8 + +RUN python3 -m pip install --upgrade --ignore-installed pip setuptools==58.4.0 + +RUN python3 -m pip install setuptools-rust \ + aiohttp \ + defusedxml \ + azure-kusto-ingest \ + azure-kusto-data \ + cffi \ + contextlib2==0.6.0.post1 \ + cryptography==3.3.2 \ + "future>=0.16.0" \ + gitpython \ + ipaddr \ + ipython==5.4.1 \ + ixnetwork-restpy==1.0.64 \ + ixnetwork-open-traffic-generator==0.0.79 \ + snappi[ixnetwork,convergence]==0.5.11 \ + jinja2==2.7.2 \ + jsonpatch \ + lxml \ + natsort \ + netaddr \ + netmiko==2.4.2 \ + paramiko==2.7.1 \ + passlib \ + pexpect \ + prettytable \ + psutil \ + pyasn1==0.4.8 \ + pyfiglet \ + pylint==1.8.1 \ + pyro4 \ + pysnmp==4.4.12 \ + pytest-repeat \ + pytest-html \ + pytest-xdist==1.28.0 \ + pytest \ + redis \ + requests \ + rpyc \ + six \ + tabulate \ + textfsm \ + virtualenv \ + wheel==0.33.6 \ + pysubnettree \ + nnpy \ + dpkt \ + pycryptodome==3.9.8 \ + ansible==2.8.12 \ + pytest-ansible \ + allure-pytest==2.8.22 \ + retry \ + thrift==0.11.0 \ + ptf + +# Deactivating a virtualenv. +ENV PATH="$BACKUP_OF_PATH" From 01798447ab878ee3343fb0be8ad44a47758bbc4d Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:04:36 -0800 Subject: [PATCH 109/139] [Chassis][QoS template] Skip configuring buffer and QoS config on recirc ports (#7869) * Added test case to verify the template changes. --- files/build_templates/buffers_config.j2 | 4 +- files/build_templates/qos_config.j2 | 4 +- ...le-arista-7800r3-48cq2-lc-t2-minigraph.xml | 2786 +++++++++++++++++ .../py2/buffer-arista7800r3-48cq2-lc.json | 590 ++++ .../py2/qos-arista7800r3-48cq2-lc.json | 1487 +++++++++ .../py3/buffer-arista7800r3-48cq2-lc.json | 590 ++++ .../py3/qos-arista7800r3-48cq2-lc.json | 1487 +++++++++ src/sonic-config-engine/tests/test_j2files.py | 25 + 8 files changed, 6971 insertions(+), 2 deletions(-) create mode 100644 src/sonic-config-engine/tests/sample-arista-7800r3-48cq2-lc-t2-minigraph.xml create mode 100644 src/sonic-config-engine/tests/sample_output/py2/buffer-arista7800r3-48cq2-lc.json create mode 100644 src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/buffer-arista7800r3-48cq2-lc.json create mode 100644 src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index cb64cd3d433..a67316af5f3 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -101,7 +101,9 @@ def {%- endif %} {%- else %} {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{%- endif %} + {%- if not port.startswith('Ethernet-Rec') and not port.startswith('Ethernet-IB') %} + {%- if PORT_ALL.append(port) %}{%- endif %} + {%- endif %} {%- endfor %} {%- endif %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 6748cd99be9..2a01e470fde 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -1,6 +1,8 @@ {%- set PORT_ALL = [] %} {%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{% endif %} + {%- if not port.startswith('Ethernet-Rec') and not port.startswith('Ethernet-IB') %} + {%- if PORT_ALL.append(port) %}{% endif %} + {%- endif %} {%- endfor %} {%- if PORT_ALL | sort_by_port_index %}{% endif %} diff --git a/src/sonic-config-engine/tests/sample-arista-7800r3-48cq2-lc-t2-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7800r3-48cq2-lc-t2-minigraph.xml new file mode 100644 index 00000000000..f2332c5cacd --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7800r3-48cq2-lc-t2-minigraph.xml @@ -0,0 +1,2786 @@ + + + + + + dut-lc4 + 1.1.1.3 + dut-lc3 + 1.1.1.1 + true + + + dut-lc5 + 1.1.1.5 + dut-lc3 + 1.1.1.1 + true + + + + + 65001 + dut-lc4 + + + + + + 65001 + dut-lc5 + + + + + + 65001 + dut-lc3 + + +
1.1.1.1
+ + +
+ +
1.1.1.1
+ + +
+
+ +
+
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.1/32 + + 10.1.0.1/32 + + + HostIP + Loopback0 + + FC00:10::1/128 + + FC00:10::1/128 + + + + + ManagementIP1 + eth0 + 10.240.76.57/25 + + + ManagementIP2 + eth0 + fdfd:5c41:712d:e049::af0:4c39/64 + + + + + Ethernet-IB0 + port + 1.1.1.1/32 + + + Ethernet-IB0 + port + fc00:3000::1/128 + + + + + + dut-lc3 + + + + + + + IPInterface + + Ethernet1/1 + 10.0.0.2/31 + + + IPInterface + + Ethernet10/1 + 10.0.0.4/31 + + + IPInterface + + Ethernet11/1 + 10.0.0.6/31 + + + IPInterface + + Ethernet12/1 + 10.0.0.8/31 + + + IPInterface + + Ethernet13/1 + 10.0.0.10/31 + + + IPInterface + + Ethernet14/1 + 10.0.0.12/31 + + + IPInterface + + Ethernet15/1 + 10.0.0.14/31 + + + IPInterface + + Ethernet16/1 + 10.0.0.16/31 + + + IPInterface + + Ethernet17/1 + 10.0.0.18/31 + + + IPInterface + + Ethernet18/1 + 10.0.0.20/31 + + + IPInterface + + Ethernet19/1 + 10.0.0.22/31 + + + IPInterface + + Ethernet2/1 + 10.0.0.24/31 + + + IPInterface + + Ethernet20/1 + 10.0.0.26/31 + + + IPInterface + + Ethernet21/1 + 10.0.0.28/31 + + + IPInterface + + Ethernet22/1 + 10.0.0.30/31 + + + IPInterface + + Ethernet23/1 + 10.0.0.32/31 + + + IPInterface + + Ethernet24/1 + 10.0.0.34/31 + + + IPInterface + + Ethernet25/1 + 10.0.0.36/31 + + + IPInterface + + Ethernet26/1 + 10.0.0.38/31 + + + IPInterface + + Ethernet27/1 + 10.0.0.40/31 + + + IPInterface + + Ethernet28/1 + 10.0.0.42/31 + + + IPInterface + + Ethernet29/1 + 10.0.0.44/31 + + + IPInterface + + Ethernet3/1 + 10.0.0.46/31 + + + IPInterface + + Ethernet30/1 + 10.0.0.48/31 + + + IPInterface + + Ethernet31/1 + 10.0.0.50/31 + + + IPInterface + + Ethernet32/1 + 10.0.0.52/31 + + + IPInterface + + Ethernet33/1 + 10.0.0.54/31 + + + IPInterface + + Ethernet34/1 + 10.0.0.56/31 + + + IPInterface + + Ethernet35/1 + 10.0.0.58/31 + + + IPInterface + + Ethernet36/1 + 10.0.0.60/31 + + + IPInterface + + Ethernet37/1 + 10.0.0.62/31 + + + IPInterface + + Ethernet38/1 + 10.0.0.64/31 + + + IPInterface + + Ethernet39/1 + 10.0.0.66/31 + + + IPInterface + + Ethernet4/1 + 10.0.0.68/31 + + + IPInterface + + Ethernet40/1 + 10.0.0.70/31 + + + IPInterface + + Ethernet42/1 + 10.0.0.72/31 + + + IPInterface + + Ethernet45/1 + 10.0.0.74/31 + + + IPInterface + + Ethernet46/1 + 10.0.0.76/31 + + + IPInterface + + Ethernet47/1 + 10.0.0.78/31 + + + IPInterface + + Ethernet48/1 + 10.0.0.80/31 + + + IPInterface + + Ethernet5/1 + 10.0.0.82/31 + + + IPInterface + + Ethernet6/1 + 10.0.0.84/31 + + + IPInterface + + Ethernet7/1 + 10.0.0.86/31 + + + IPInterface + + Ethernet8/1 + 10.0.0.88/31 + + + IPInterface + + Ethernet9/1 + 10.0.0.90/31 + + + IPInterface + + Ethernet-Rec0 + 10.0.0.92/31 + + + IPInterface + + Ethernet-IB0 + 1.1.1.1/32 + + + + + + + + + + + + DeviceInterfaceLink + 100000 + nvm473 + Ethernet180 + dut-lc3 + Ethernet0 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet20 + dut-lc3 + Ethernet36 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet24 + dut-lc3 + Ethernet40 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet28 + dut-lc3 + Ethernet44 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet32 + dut-lc3 + Ethernet48 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet40 + dut-lc3 + Ethernet52 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet36 + dut-lc3 + Ethernet56 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet44 + dut-lc3 + Ethernet60 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet132 + dut-lc3 + Ethernet64 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet128 + dut-lc3 + Ethernet68 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet136 + dut-lc3 + Ethernet72 + + + DeviceInterfaceLink + 100000 + nvm473 + Ethernet176 + dut-lc3 + Ethernet4 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet140 + dut-lc3 + Ethernet76 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet144 + dut-lc3 + Ethernet80 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet148 + dut-lc3 + Ethernet84 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet152 + dut-lc3 + Ethernet88 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet156 + dut-lc3 + Ethernet92 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet64 + dut-lc3 + Ethernet96 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet68 + dut-lc3 + Ethernet100 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet72 + dut-lc3 + Ethernet104 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet76 + dut-lc3 + Ethernet108 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet80 + dut-lc3 + Ethernet112 + + + DeviceInterfaceLink + 100000 + nvm473 + Ethernet188 + dut-lc3 + Ethernet8 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet84 + dut-lc3 + Ethernet116 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet88 + dut-lc3 + Ethernet120 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet92 + dut-lc3 + Ethernet124 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet96 + dut-lc3 + Ethernet128 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet100 + dut-lc3 + Ethernet132 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet104 + dut-lc3 + Ethernet136 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet108 + dut-lc3 + Ethernet140 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet240 + dut-lc3 + Ethernet144 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet244 + dut-lc3 + Ethernet148 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet248 + dut-lc3 + Ethernet152 + + + DeviceInterfaceLink + 100000 + nvm473 + Ethernet184 + dut-lc3 + Ethernet12 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet252 + dut-lc3 + Ethernet156 + + + DeviceInterfaceLink + 100000 + nvm473 + Ethernet192 + dut-lc3 + Ethernet164 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet112 + dut-lc3 + Ethernet176 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet116 + dut-lc3 + Ethernet180 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet120 + dut-lc3 + Ethernet184 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet124 + dut-lc3 + Ethernet188 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet0 + dut-lc3 + Ethernet16 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet4 + dut-lc3 + Ethernet20 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet8 + dut-lc3 + Ethernet24 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet12 + dut-lc3 + Ethernet28 + + + DeviceInterfaceLink + 100000 + nv338 + Ethernet16 + dut-lc3 + Ethernet32 + + + + + dut-lc3 + Arista-7800R3-48CQ2-C48 + + + + + + + dut-lc3 + + + ForcedMgmtRoutes + + 172.16.0.0/12;10.80.0.0/12;10.64.0.0/14;10.240.0.0/13 + + ForcedMgmtRoutes + + FD7A:629F:52A4::/48;FDFD:5C41:712D::/48 + + + SwitchId + + 0 + + + NtpResources + time.aristanetworks.com + + + SwitchType + + voq + + + MaxCores + + 16 + + + SubRole + + + + + + + + + + + Arista-7800R3-48CQ2-C48 + + + Ethernet1/1 + eth1/1-connected-to-nvm473@eth46/1 + 100000 + rs + + + Ethernet10/1 + eth10/1-connected-to-nv338@eth6/1 + 100000 + rs + + + Ethernet11/1 + eth11/1-connected-to-nv338@eth7/1 + 100000 + rs + + + Ethernet12/1 + eth12/1-connected-to-nv338@eth8/1 + 100000 + rs + + + Ethernet13/1 + eth13/1-connected-to-nv338@eth9/1 + 100000 + rs + + + Ethernet14/1 + eth14/1-connected-to-nv338@eth11/1 + 100000 + rs + + + Ethernet15/1 + eth15/1-connected-to-nv338@eth10/1 + 100000 + rs + + + Ethernet16/1 + eth16/1-connected-to-nv338@eth12/1 + 100000 + rs + + + Ethernet17/1 + eth17/1-connected-to-nv338@eth34/1 + 100000 + rs + + + Ethernet18/1 + eth18/1-connected-to-nv338@eth33/1 + 100000 + rs + + + Ethernet19/1 + eth19/1-connected-to-nv338@eth35/1 + 100000 + rs + + + Ethernet2/1 + eth2/1-connected-to-nvm473@eth45/1 + 100000 + rs + + + Ethernet20/1 + eth20/1-connected-to-nv338@eth36/1 + 100000 + rs + + + Ethernet21/1 + eth21/1-connected-to-nv338@eth37/1 + 100000 + rs + + + Ethernet22/1 + eth22/1-connected-to-nv338@eth38/1 + 100000 + none + + + Ethernet23/1 + eth23/1-connected-to-nv338@eth39/1 + 100000 + none + + + Ethernet24/1 + eth24/1-connected-to-nv338@eth40/1 + 100000 + none + + + Ethernet25/1 + eth25/1-connected-to-nv338@eth17/1 + 100000 + none + + + Ethernet26/1 + eth26/1-connected-to-nv338@eth18/1 + 100000 + none + + + Ethernet27/1 + eth27/1-connected-to-nv338@eth19/1 + 100000 + none + + + Ethernet28/1 + eth28/1-connected-to-nv338@eth20/1 + 100000 + rs + + + Ethernet29/1 + eth29/1-connected-to-nv338@eth21/1 + 100000 + rs + + + Ethernet3/1 + eth3/1-connected-to-nvm473@eth48/1 + 100000 + rs + + + Ethernet30/1 + eth30/1-connected-to-nv338@eth22/1 + 100000 + rs + + + Ethernet31/1 + eth31/1-connected-to-nv338@eth23/1 + 100000 + rs + + + Ethernet32/1 + eth32/1-connected-to-nv338@eth24/1 + 100000 + rs + + + Ethernet33/1 + eth33/1-connected-to-nv338@eth25/1 + 100000 + rs + + + Ethernet34/1 + eth34/1-connected-to-nv338@eth26/1 + 100000 + rs + + + Ethernet35/1 + eth35/1-connected-to-nv338@eth27/1 + 100000 + rs + + + Ethernet36/1 + eth36/1-connected-to-nv338@eth28/1 + 100000 + rs + + + Ethernet37/1 + eth37/1-connected-to-nv338@eth61/1 + 100000 + rs + + + Ethernet38/1 + eth38/1-connected-to-nv338@eth62/1 + 100000 + rs + + + Ethernet39/1 + eth39/1-connected-to-nv338@eth63/1 + 100000 + rs + + + Ethernet4/1 + eth4/1-connected-to-nvm473@eth47/1 + 100000 + rs + + + Ethernet40/1 + eth40/1-connected-to-nv338@eth64/1 + 100000 + rs + + + Ethernet42/1 + eth42/1-connected-to-nvm473@eth49/1 + 100000 + rs + + + Ethernet45/1 + eth45/1-connected-to-nv338@eth29/1 + 100000 + rs + + + Ethernet46/1 + eth46/1-connected-to-nv338@eth30/1 + 100000 + rs + + + Ethernet47/1 + eth47/1-connected-to-nv338@eth31/1 + 100000 + rs + + + Ethernet48/1 + eth48/1-connected-to-nv338@eth32/1 + 100000 + rs + + + Ethernet5/1 + eth5/1-connected-to-nv338@eth1/1 + 100000 + rs + + + Ethernet6/1 + eth6/1-connected-to-nv338@eth2/1 + 100000 + rs + + + Ethernet7/1 + eth7/1-connected-to-nv338@eth3/1 + 100000 + rs + + + Ethernet8/1 + eth8/1-connected-to-nv338@eth4/1 + 100000 + rs + + + Ethernet9/1 + eth9/1-connected-to-nv338@eth5/1 + 100000 + rs + + + + + eth0 + eth0 + 1000 + + + eth0 + eth0 + 1000 + + + + + Cpu0 + dut-lc3 + Asic0 + 10000 + 1 + 0 + 0 + 0 + 8 + + + Ethernet0 + dut-lc3 + Asic0 + 100000 + 2 + 0 + 0 + 1 + 8 + + + Ethernet4 + dut-lc3 + Asic0 + 100000 + 3 + 0 + 0 + 2 + 8 + + + Ethernet8 + dut-lc3 + Asic0 + 100000 + 4 + 0 + 0 + 3 + 8 + + + Ethernet12 + dut-lc3 + Asic0 + 100000 + 5 + 0 + 0 + 4 + 8 + + + Ethernet16 + dut-lc3 + Asic0 + 100000 + 6 + 0 + 0 + 5 + 8 + + + Ethernet20 + dut-lc3 + Asic0 + 100000 + 7 + 0 + 0 + 6 + 8 + + + Ethernet24 + dut-lc3 + Asic0 + 100000 + 8 + 0 + 0 + 7 + 8 + + + Ethernet28 + dut-lc3 + Asic0 + 100000 + 9 + 0 + 0 + 8 + 8 + + + Ethernet32 + dut-lc3 + Asic0 + 100000 + 10 + 0 + 0 + 9 + 8 + + + Ethernet36 + dut-lc3 + Asic0 + 100000 + 11 + 0 + 0 + 10 + 8 + + + Ethernet40 + dut-lc3 + Asic0 + 100000 + 12 + 0 + 0 + 11 + 8 + + + Ethernet44 + dut-lc3 + Asic0 + 100000 + 13 + 0 + 0 + 12 + 8 + + + Ethernet48 + dut-lc3 + Asic0 + 100000 + 14 + 0 + 0 + 13 + 8 + + + Ethernet52 + dut-lc3 + Asic0 + 100000 + 15 + 0 + 0 + 14 + 8 + + + Ethernet56 + dut-lc3 + Asic0 + 100000 + 16 + 0 + 0 + 15 + 8 + + + Ethernet60 + dut-lc3 + Asic0 + 100000 + 17 + 0 + 0 + 16 + 8 + + + Ethernet64 + dut-lc3 + Asic0 + 100000 + 18 + 0 + 0 + 17 + 8 + + + Ethernet68 + dut-lc3 + Asic0 + 100000 + 19 + 0 + 0 + 18 + 8 + + + Ethernet72 + dut-lc3 + Asic0 + 100000 + 20 + 0 + 0 + 19 + 8 + + + Ethernet76 + dut-lc3 + Asic0 + 100000 + 21 + 0 + 0 + 20 + 8 + + + Ethernet80 + dut-lc3 + Asic0 + 100000 + 22 + 0 + 0 + 21 + 8 + + + Ethernet84 + dut-lc3 + Asic0 + 100000 + 23 + 0 + 0 + 22 + 8 + + + Ethernet88 + dut-lc3 + Asic0 + 100000 + 24 + 0 + 0 + 23 + 8 + + + Ethernet92 + dut-lc3 + Asic0 + 100000 + 25 + 0 + 0 + 24 + 8 + + + Ethernet96 + dut-lc3 + Asic0 + 100000 + 26 + 0 + 1 + 25 + 8 + + + Ethernet100 + dut-lc3 + Asic0 + 100000 + 27 + 0 + 1 + 26 + 8 + + + Ethernet104 + dut-lc3 + Asic0 + 100000 + 28 + 0 + 1 + 27 + 8 + + + Ethernet108 + dut-lc3 + Asic0 + 100000 + 29 + 0 + 1 + 28 + 8 + + + Ethernet112 + dut-lc3 + Asic0 + 100000 + 30 + 0 + 1 + 29 + 8 + + + Ethernet116 + dut-lc3 + Asic0 + 100000 + 31 + 0 + 1 + 30 + 8 + + + Ethernet120 + dut-lc3 + Asic0 + 100000 + 32 + 0 + 1 + 31 + 8 + + + Ethernet124 + dut-lc3 + Asic0 + 100000 + 33 + 0 + 1 + 32 + 8 + + + Ethernet128 + dut-lc3 + Asic0 + 100000 + 34 + 0 + 1 + 33 + 8 + + + Ethernet132 + dut-lc3 + Asic0 + 100000 + 35 + 0 + 1 + 34 + 8 + + + Ethernet136 + dut-lc3 + Asic0 + 100000 + 36 + 0 + 1 + 35 + 8 + + + Ethernet140 + dut-lc3 + Asic0 + 100000 + 37 + 0 + 1 + 36 + 8 + + + Ethernet144 + dut-lc3 + Asic0 + 100000 + 38 + 0 + 1 + 37 + 8 + + + Ethernet148 + dut-lc3 + Asic0 + 100000 + 39 + 0 + 1 + 38 + 8 + + + Ethernet152 + dut-lc3 + Asic0 + 100000 + 40 + 0 + 1 + 39 + 8 + + + Ethernet156 + dut-lc3 + Asic0 + 100000 + 41 + 0 + 1 + 40 + 8 + + + Ethernet160 + dut-lc3 + Asic0 + 100000 + 42 + 0 + 1 + 41 + 8 + + + Ethernet164 + dut-lc3 + Asic0 + 100000 + 43 + 0 + 1 + 42 + 8 + + + Ethernet168 + dut-lc3 + Asic0 + 100000 + 44 + 0 + 1 + 43 + 8 + + + Ethernet172 + dut-lc3 + Asic0 + 100000 + 45 + 0 + 1 + 44 + 8 + + + Ethernet176 + dut-lc3 + Asic0 + 100000 + 46 + 0 + 1 + 45 + 8 + + + Ethernet180 + dut-lc3 + Asic0 + 100000 + 47 + 0 + 1 + 46 + 8 + + + Ethernet184 + dut-lc3 + Asic0 + 100000 + 48 + 0 + 1 + 47 + 8 + + + Ethernet188 + dut-lc3 + Asic0 + 100000 + 49 + 0 + 1 + 48 + 8 + + + Ethernet-Rec0 + dut-lc3 + Asic0 + 400000 + 50 + 0 + 0 + 221 + 8 + + + Ethernet-IB0 + dut-lc3 + Asic0 + 400000 + 51 + 0 + 1 + 222 + 8 + + + Cpu0 + dut-lc4 + Asic0 + 10000 + 52 + 2 + 0 + 0 + 8 + + + Ethernet0 + dut-lc4 + Asic0 + 100000 + 53 + 2 + 0 + 1 + 8 + + + Ethernet4 + dut-lc4 + Asic0 + 100000 + 54 + 2 + 0 + 2 + 8 + + + Ethernet8 + dut-lc4 + Asic0 + 100000 + 55 + 2 + 0 + 3 + 8 + + + Ethernet12 + dut-lc4 + Asic0 + 100000 + 56 + 2 + 0 + 4 + 8 + + + Ethernet16 + dut-lc4 + Asic0 + 100000 + 57 + 2 + 0 + 5 + 8 + + + Ethernet20 + dut-lc4 + Asic0 + 100000 + 58 + 2 + 0 + 6 + 8 + + + Ethernet24 + dut-lc4 + Asic0 + 100000 + 59 + 2 + 0 + 7 + 8 + + + Ethernet28 + dut-lc4 + Asic0 + 100000 + 60 + 2 + 0 + 8 + 8 + + + Ethernet32 + dut-lc4 + Asic0 + 100000 + 61 + 2 + 0 + 9 + 8 + + + Ethernet36 + dut-lc4 + Asic0 + 100000 + 62 + 2 + 0 + 10 + 8 + + + Ethernet40 + dut-lc4 + Asic0 + 100000 + 63 + 2 + 0 + 11 + 8 + + + Ethernet44 + dut-lc4 + Asic0 + 100000 + 64 + 2 + 0 + 12 + 8 + + + Ethernet48 + dut-lc4 + Asic0 + 100000 + 65 + 2 + 0 + 13 + 8 + + + Ethernet52 + dut-lc4 + Asic0 + 100000 + 66 + 2 + 0 + 14 + 8 + + + Ethernet56 + dut-lc4 + Asic0 + 100000 + 67 + 2 + 0 + 15 + 8 + + + Ethernet60 + dut-lc4 + Asic0 + 100000 + 68 + 2 + 0 + 16 + 8 + + + Ethernet64 + dut-lc4 + Asic0 + 100000 + 69 + 2 + 0 + 17 + 8 + + + Ethernet68 + dut-lc4 + Asic0 + 100000 + 70 + 2 + 0 + 18 + 8 + + + Ethernet72 + dut-lc4 + Asic0 + 100000 + 71 + 2 + 0 + 19 + 8 + + + Ethernet76 + dut-lc4 + Asic0 + 100000 + 72 + 2 + 0 + 20 + 8 + + + Ethernet80 + dut-lc4 + Asic0 + 100000 + 73 + 2 + 0 + 21 + 8 + + + Ethernet84 + dut-lc4 + Asic0 + 100000 + 74 + 2 + 0 + 22 + 8 + + + Ethernet88 + dut-lc4 + Asic0 + 100000 + 75 + 2 + 0 + 23 + 8 + + + Ethernet92 + dut-lc4 + Asic0 + 100000 + 76 + 2 + 0 + 24 + 8 + + + Ethernet96 + dut-lc4 + Asic0 + 100000 + 77 + 2 + 1 + 25 + 8 + + + Ethernet100 + dut-lc4 + Asic0 + 100000 + 78 + 2 + 1 + 26 + 8 + + + Ethernet104 + dut-lc4 + Asic0 + 100000 + 79 + 2 + 1 + 27 + 8 + + + Ethernet108 + dut-lc4 + Asic0 + 100000 + 80 + 2 + 1 + 28 + 8 + + + Ethernet112 + dut-lc4 + Asic0 + 100000 + 81 + 2 + 1 + 29 + 8 + + + Ethernet116 + dut-lc4 + Asic0 + 100000 + 82 + 2 + 1 + 30 + 8 + + + Ethernet120 + dut-lc4 + Asic0 + 100000 + 83 + 2 + 1 + 31 + 8 + + + Ethernet124 + dut-lc4 + Asic0 + 100000 + 84 + 2 + 1 + 32 + 8 + + + Ethernet128 + dut-lc4 + Asic0 + 100000 + 85 + 2 + 1 + 33 + 8 + + + Ethernet132 + dut-lc4 + Asic0 + 100000 + 86 + 2 + 1 + 34 + 8 + + + Ethernet136 + dut-lc4 + Asic0 + 100000 + 87 + 2 + 1 + 35 + 8 + + + Ethernet140 + dut-lc4 + Asic0 + 100000 + 88 + 2 + 1 + 36 + 8 + + + Ethernet144 + dut-lc4 + Asic0 + 100000 + 89 + 2 + 1 + 37 + 8 + + + Ethernet148 + dut-lc4 + Asic0 + 100000 + 90 + 2 + 1 + 38 + 8 + + + Ethernet152 + dut-lc4 + Asic0 + 100000 + 91 + 2 + 1 + 39 + 8 + + + Ethernet156 + dut-lc4 + Asic0 + 100000 + 92 + 2 + 1 + 40 + 8 + + + Ethernet160 + dut-lc4 + Asic0 + 100000 + 93 + 2 + 1 + 41 + 8 + + + Ethernet164 + dut-lc4 + Asic0 + 100000 + 94 + 2 + 1 + 42 + 8 + + + Ethernet168 + dut-lc4 + Asic0 + 100000 + 95 + 2 + 1 + 43 + 8 + + + Ethernet172 + dut-lc4 + Asic0 + 100000 + 96 + 2 + 1 + 44 + 8 + + + Ethernet176 + dut-lc4 + Asic0 + 100000 + 97 + 2 + 1 + 45 + 8 + + + Ethernet180 + dut-lc4 + Asic0 + 100000 + 98 + 2 + 1 + 46 + 8 + + + Ethernet184 + dut-lc4 + Asic0 + 100000 + 99 + 2 + 1 + 47 + 8 + + + Ethernet188 + dut-lc4 + Asic0 + 100000 + 100 + 2 + 1 + 48 + 8 + + + Ethernet-Rec0 + dut-lc4 + Asic0 + 400000 + 101 + 2 + 0 + 221 + 8 + + + Ethernet-IB0 + dut-lc4 + Asic0 + 400000 + 102 + 2 + 1 + 222 + 8 + + + Cpu0 + dut-lc5 + Asic0 + 10000 + 103 + 4 + 0 + 0 + 8 + + + Ethernet0 + dut-lc5 + Asic0 + 100000 + 104 + 4 + 0 + 1 + 8 + + + Ethernet4 + dut-lc5 + Asic0 + 100000 + 105 + 4 + 0 + 2 + 8 + + + Ethernet8 + dut-lc5 + Asic0 + 100000 + 106 + 4 + 0 + 3 + 8 + + + Ethernet12 + dut-lc5 + Asic0 + 100000 + 107 + 4 + 0 + 4 + 8 + + + Ethernet16 + dut-lc5 + Asic0 + 100000 + 108 + 4 + 0 + 5 + 8 + + + Ethernet20 + dut-lc5 + Asic0 + 100000 + 109 + 4 + 0 + 6 + 8 + + + Ethernet24 + dut-lc5 + Asic0 + 100000 + 110 + 4 + 0 + 7 + 8 + + + Ethernet28 + dut-lc5 + Asic0 + 100000 + 111 + 4 + 0 + 8 + 8 + + + Ethernet32 + dut-lc5 + Asic0 + 100000 + 112 + 4 + 0 + 9 + 8 + + + Ethernet36 + dut-lc5 + Asic0 + 100000 + 113 + 4 + 0 + 10 + 8 + + + Ethernet40 + dut-lc5 + Asic0 + 100000 + 114 + 4 + 0 + 11 + 8 + + + Ethernet44 + dut-lc5 + Asic0 + 100000 + 115 + 4 + 0 + 12 + 8 + + + Ethernet48 + dut-lc5 + Asic0 + 100000 + 116 + 4 + 0 + 13 + 8 + + + Ethernet52 + dut-lc5 + Asic0 + 100000 + 117 + 4 + 0 + 14 + 8 + + + Ethernet56 + dut-lc5 + Asic0 + 100000 + 118 + 4 + 0 + 15 + 8 + + + Ethernet60 + dut-lc5 + Asic0 + 100000 + 119 + 4 + 0 + 16 + 8 + + + Ethernet64 + dut-lc5 + Asic0 + 100000 + 120 + 4 + 0 + 17 + 8 + + + Ethernet68 + dut-lc5 + Asic0 + 100000 + 121 + 4 + 0 + 18 + 8 + + + Ethernet72 + dut-lc5 + Asic0 + 100000 + 122 + 4 + 0 + 19 + 8 + + + Ethernet76 + dut-lc5 + Asic0 + 100000 + 123 + 4 + 0 + 20 + 8 + + + Ethernet80 + dut-lc5 + Asic0 + 100000 + 124 + 4 + 0 + 21 + 8 + + + Ethernet84 + dut-lc5 + Asic0 + 100000 + 125 + 4 + 0 + 22 + 8 + + + Ethernet88 + dut-lc5 + Asic0 + 100000 + 126 + 4 + 0 + 23 + 8 + + + Ethernet92 + dut-lc5 + Asic0 + 100000 + 127 + 4 + 0 + 24 + 8 + + + Ethernet96 + dut-lc5 + Asic0 + 100000 + 128 + 4 + 1 + 25 + 8 + + + Ethernet100 + dut-lc5 + Asic0 + 100000 + 129 + 4 + 1 + 26 + 8 + + + Ethernet104 + dut-lc5 + Asic0 + 100000 + 130 + 4 + 1 + 27 + 8 + + + Ethernet108 + dut-lc5 + Asic0 + 100000 + 131 + 4 + 1 + 28 + 8 + + + Ethernet112 + dut-lc5 + Asic0 + 100000 + 132 + 4 + 1 + 29 + 8 + + + Ethernet116 + dut-lc5 + Asic0 + 100000 + 133 + 4 + 1 + 30 + 8 + + + Ethernet120 + dut-lc5 + Asic0 + 100000 + 134 + 4 + 1 + 31 + 8 + + + Ethernet124 + dut-lc5 + Asic0 + 100000 + 135 + 4 + 1 + 32 + 8 + + + Ethernet128 + dut-lc5 + Asic0 + 100000 + 136 + 4 + 1 + 33 + 8 + + + Ethernet132 + dut-lc5 + Asic0 + 100000 + 137 + 4 + 1 + 34 + 8 + + + Ethernet136 + dut-lc5 + Asic0 + 100000 + 138 + 4 + 1 + 35 + 8 + + + Ethernet140 + dut-lc5 + Asic0 + 100000 + 139 + 4 + 1 + 36 + 8 + + + Ethernet144 + dut-lc5 + Asic0 + 100000 + 140 + 4 + 1 + 37 + 8 + + + Ethernet148 + dut-lc5 + Asic0 + 100000 + 141 + 4 + 1 + 38 + 8 + + + Ethernet152 + dut-lc5 + Asic0 + 100000 + 142 + 4 + 1 + 39 + 8 + + + Ethernet156 + dut-lc5 + Asic0 + 100000 + 143 + 4 + 1 + 40 + 8 + + + Ethernet160 + dut-lc5 + Asic0 + 100000 + 144 + 4 + 1 + 41 + 8 + + + Ethernet164 + dut-lc5 + Asic0 + 100000 + 145 + 4 + 1 + 42 + 8 + + + Ethernet168 + dut-lc5 + Asic0 + 100000 + 146 + 4 + 1 + 43 + 8 + + + Ethernet172 + dut-lc5 + Asic0 + 100000 + 147 + 4 + 1 + 44 + 8 + + + Ethernet176 + dut-lc5 + Asic0 + 100000 + 148 + 4 + 1 + 45 + 8 + + + Ethernet180 + dut-lc5 + Asic0 + 100000 + 149 + 4 + 1 + 46 + 8 + + + Ethernet184 + dut-lc5 + Asic0 + 100000 + 150 + 4 + 1 + 47 + 8 + + + Ethernet188 + dut-lc5 + Asic0 + 100000 + 151 + 4 + 1 + 48 + 8 + + + Ethernet-Rec0 + dut-lc5 + Asic0 + 400000 + 152 + 4 + 0 + 221 + 8 + + + Ethernet-IB0 + dut-lc5 + Asic0 + 400000 + 153 + 4 + 1 + 222 + 8 + + + + + dut-lc3 + Arista-7800R3-48CQ2-C48 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7800r3-48cq2-lc.json new file mode 100644 index 00000000000..c05eca81eaa --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7800r3-48cq2-lc.json @@ -0,0 +1,590 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet180": "5m", + "Ethernet8": "5m", + "Ethernet184": "5m", + "Ethernet188": "5m", + "Ethernet0": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet128": "5m", + "Ethernet104": "5m", + "Ethernet68": "5m", + "Ethernet96": "5m", + "Ethernet124": "5m", + "Ethernet148": "5m", + "Ethernet92": "5m", + "Ethernet120": "5m", + "Ethernet144": "5m", + "Ethernet52": "5m", + "Ethernet160": "5m", + "Ethernet140": "5m", + "Ethernet56": "5m", + "Ethernet164": "5m", + "Ethernet76": "5m", + "Ethernet72": "5m", + "Ethernet64": "5m", + "Ethernet32": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet12": "5m", + "Ethernet168": "5m", + "Ethernet116": "5m", + "Ethernet80": "5m", + "Ethernet112": "5m", + "Ethernet84": "5m", + "Ethernet152": "5m", + "Ethernet136": "5m", + "Ethernet156": "5m", + "Ethernet132": "5m", + "Ethernet48": "5m", + "Ethernet172": "5m", + "Ethernet44": "5m", + "Ethernet176": "5m", + "Ethernet40": "5m", + "Ethernet28": "5m", + "Ethernet88": "5m", + "Ethernet60": "5m", + "Ethernet20": "5m", + "Ethernet24": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "3220805000", + "type": "both", + "mode": "dynamic", + "xoff": "2102272" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"1280", + "dynamic_th":"-2", + "xon_offset":"2560", + "xon":"0", + "xoff":"66048" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "xon_offset":"0", + "static_th":"30535680" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"33030144" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet180|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet184|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet188|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet0|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet108|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet100|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet128|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet104|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet148|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet144|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet140|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet164|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet152|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet136|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet156|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet132|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet176|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json new file mode 100644 index 00000000000..3044749a277 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json @@ -0,0 +1,1487 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet4|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet12|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet20|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet28|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet36|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet44|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet84|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet92|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet100|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet108|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet116|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet124|0": { + "scheduler": "scheduler.0" + }, + "Ethernet128|0": { + "scheduler": "scheduler.0" + }, + "Ethernet132|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet140|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet164|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet180|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet188|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet4|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet12|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet20|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet28|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet36|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet44|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet84|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet92|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet100|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet108|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet116|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet124|1": { + "scheduler": "scheduler.0" + }, + "Ethernet128|1": { + "scheduler": "scheduler.0" + }, + "Ethernet132|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet140|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet164|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet180|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet188|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet4|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet12|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet20|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler": "scheduler.0" + }, + "Ethernet28|2": { + "scheduler": "scheduler.0" + }, + "Ethernet32|2": { + "scheduler": "scheduler.0" + }, + "Ethernet36|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet44|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet52|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet60|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet76|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet84|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet92|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet100|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet108|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet116|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet124|2": { + "scheduler": "scheduler.0" + }, + "Ethernet128|2": { + "scheduler": "scheduler.0" + }, + "Ethernet132|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler": "scheduler.0" + }, + "Ethernet140|2": { + "scheduler": "scheduler.0" + }, + "Ethernet144|2": { + "scheduler": "scheduler.0" + }, + "Ethernet148|2": { + "scheduler": "scheduler.0" + }, + "Ethernet152|2": { + "scheduler": "scheduler.0" + }, + "Ethernet156|2": { + "scheduler": "scheduler.0" + }, + "Ethernet164|2": { + "scheduler": "scheduler.0" + }, + "Ethernet176|2": { + "scheduler": "scheduler.0" + }, + "Ethernet180|2": { + "scheduler": "scheduler.0" + }, + "Ethernet184|2": { + "scheduler": "scheduler.0" + }, + "Ethernet188|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet4|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet12|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet20|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet28|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet36|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet44|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet84|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet92|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet100|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet108|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet116|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet124|5": { + "scheduler": "scheduler.0" + }, + "Ethernet128|5": { + "scheduler": "scheduler.0" + }, + "Ethernet132|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet140|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet164|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet180|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet188|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet4|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet12|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet20|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler": "scheduler.0" + }, + "Ethernet28|6": { + "scheduler": "scheduler.0" + }, + "Ethernet32|6": { + "scheduler": "scheduler.0" + }, + "Ethernet36|6": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet44|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet52|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet60|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet76|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet84|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet92|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet100|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet108|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet116|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet124|6": { + "scheduler": "scheduler.0" + }, + "Ethernet128|6": { + "scheduler": "scheduler.0" + }, + "Ethernet132|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler": "scheduler.0" + }, + "Ethernet140|6": { + "scheduler": "scheduler.0" + }, + "Ethernet144|6": { + "scheduler": "scheduler.0" + }, + "Ethernet148|6": { + "scheduler": "scheduler.0" + }, + "Ethernet152|6": { + "scheduler": "scheduler.0" + }, + "Ethernet156|6": { + "scheduler": "scheduler.0" + }, + "Ethernet164|6": { + "scheduler": "scheduler.0" + }, + "Ethernet176|6": { + "scheduler": "scheduler.0" + }, + "Ethernet180|6": { + "scheduler": "scheduler.0" + }, + "Ethernet184|6": { + "scheduler": "scheduler.0" + }, + "Ethernet188|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7800r3-48cq2-lc.json new file mode 100644 index 00000000000..56538fd0935 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7800r3-48cq2-lc.json @@ -0,0 +1,590 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet4": "5m", + "Ethernet8": "5m", + "Ethernet12": "5m", + "Ethernet16": "5m", + "Ethernet20": "5m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet44": "5m", + "Ethernet48": "5m", + "Ethernet52": "5m", + "Ethernet56": "5m", + "Ethernet60": "5m", + "Ethernet64": "5m", + "Ethernet68": "5m", + "Ethernet72": "5m", + "Ethernet76": "5m", + "Ethernet80": "5m", + "Ethernet84": "5m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet108": "5m", + "Ethernet112": "5m", + "Ethernet116": "5m", + "Ethernet120": "5m", + "Ethernet124": "5m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "5m", + "Ethernet140": "5m", + "Ethernet144": "5m", + "Ethernet148": "5m", + "Ethernet152": "5m", + "Ethernet156": "5m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "5m", + "Ethernet172": "5m", + "Ethernet176": "5m", + "Ethernet180": "5m", + "Ethernet184": "5m", + "Ethernet188": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "3220805000", + "type": "both", + "mode": "dynamic", + "xoff": "2102272" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"1280", + "dynamic_th":"-2", + "xon_offset":"2560", + "xon":"0", + "xoff":"66048" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "xon_offset":"0", + "static_th":"30535680" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"33030144" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet0|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet36|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet40|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet44|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet48|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet52|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet56|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet60|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet64|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet68|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet72|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet4|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet76|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet80|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet84|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet88|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet92|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet96|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet100|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet104|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet108|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet112|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet8|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet116|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet120|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet124|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet128|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet132|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet136|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet140|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet144|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet148|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet152|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet12|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet156|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet164|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet176|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet180|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet184|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet188|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet16|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet20|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet24|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet28|0": { + "profile" : "ingress_lossy_profile" + }, + "Ethernet32|0": { + "profile" : "ingress_lossy_profile" + } + }, + + "BUFFER_QUEUE": { + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json new file mode 100644 index 00000000000..3044749a277 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json @@ -0,0 +1,1487 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "AZURE", + "tc_to_queue_map" : "AZURE", + "tc_to_pg_map" : "AZURE", + "pfc_to_queue_map": "AZURE", + "pfc_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|3": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet4|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet8|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet12|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet16|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet20|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet24|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet28|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet32|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet36|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet40|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet44|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet48|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet52|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet56|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet60|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet64|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet68|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet72|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet76|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet80|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet84|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet88|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet92|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet96|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet100|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet104|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet108|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet112|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet116|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet120|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet124|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet128|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet132|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet136|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet140|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet144|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet148|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet152|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet156|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet164|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet176|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet180|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet184|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet188|4": { + "scheduler" : "scheduler.1", + "wred_profile": "AZURE_LOSSLESS" + }, + "Ethernet0|0": { + "scheduler": "scheduler.0" + }, + "Ethernet4|0": { + "scheduler": "scheduler.0" + }, + "Ethernet8|0": { + "scheduler": "scheduler.0" + }, + "Ethernet12|0": { + "scheduler": "scheduler.0" + }, + "Ethernet16|0": { + "scheduler": "scheduler.0" + }, + "Ethernet20|0": { + "scheduler": "scheduler.0" + }, + "Ethernet24|0": { + "scheduler": "scheduler.0" + }, + "Ethernet28|0": { + "scheduler": "scheduler.0" + }, + "Ethernet32|0": { + "scheduler": "scheduler.0" + }, + "Ethernet36|0": { + "scheduler": "scheduler.0" + }, + "Ethernet40|0": { + "scheduler": "scheduler.0" + }, + "Ethernet44|0": { + "scheduler": "scheduler.0" + }, + "Ethernet48|0": { + "scheduler": "scheduler.0" + }, + "Ethernet52|0": { + "scheduler": "scheduler.0" + }, + "Ethernet56|0": { + "scheduler": "scheduler.0" + }, + "Ethernet60|0": { + "scheduler": "scheduler.0" + }, + "Ethernet64|0": { + "scheduler": "scheduler.0" + }, + "Ethernet68|0": { + "scheduler": "scheduler.0" + }, + "Ethernet72|0": { + "scheduler": "scheduler.0" + }, + "Ethernet76|0": { + "scheduler": "scheduler.0" + }, + "Ethernet80|0": { + "scheduler": "scheduler.0" + }, + "Ethernet84|0": { + "scheduler": "scheduler.0" + }, + "Ethernet88|0": { + "scheduler": "scheduler.0" + }, + "Ethernet92|0": { + "scheduler": "scheduler.0" + }, + "Ethernet96|0": { + "scheduler": "scheduler.0" + }, + "Ethernet100|0": { + "scheduler": "scheduler.0" + }, + "Ethernet104|0": { + "scheduler": "scheduler.0" + }, + "Ethernet108|0": { + "scheduler": "scheduler.0" + }, + "Ethernet112|0": { + "scheduler": "scheduler.0" + }, + "Ethernet116|0": { + "scheduler": "scheduler.0" + }, + "Ethernet120|0": { + "scheduler": "scheduler.0" + }, + "Ethernet124|0": { + "scheduler": "scheduler.0" + }, + "Ethernet128|0": { + "scheduler": "scheduler.0" + }, + "Ethernet132|0": { + "scheduler": "scheduler.0" + }, + "Ethernet136|0": { + "scheduler": "scheduler.0" + }, + "Ethernet140|0": { + "scheduler": "scheduler.0" + }, + "Ethernet144|0": { + "scheduler": "scheduler.0" + }, + "Ethernet148|0": { + "scheduler": "scheduler.0" + }, + "Ethernet152|0": { + "scheduler": "scheduler.0" + }, + "Ethernet156|0": { + "scheduler": "scheduler.0" + }, + "Ethernet164|0": { + "scheduler": "scheduler.0" + }, + "Ethernet176|0": { + "scheduler": "scheduler.0" + }, + "Ethernet180|0": { + "scheduler": "scheduler.0" + }, + "Ethernet184|0": { + "scheduler": "scheduler.0" + }, + "Ethernet188|0": { + "scheduler": "scheduler.0" + }, + "Ethernet0|1": { + "scheduler": "scheduler.0" + }, + "Ethernet4|1": { + "scheduler": "scheduler.0" + }, + "Ethernet8|1": { + "scheduler": "scheduler.0" + }, + "Ethernet12|1": { + "scheduler": "scheduler.0" + }, + "Ethernet16|1": { + "scheduler": "scheduler.0" + }, + "Ethernet20|1": { + "scheduler": "scheduler.0" + }, + "Ethernet24|1": { + "scheduler": "scheduler.0" + }, + "Ethernet28|1": { + "scheduler": "scheduler.0" + }, + "Ethernet32|1": { + "scheduler": "scheduler.0" + }, + "Ethernet36|1": { + "scheduler": "scheduler.0" + }, + "Ethernet40|1": { + "scheduler": "scheduler.0" + }, + "Ethernet44|1": { + "scheduler": "scheduler.0" + }, + "Ethernet48|1": { + "scheduler": "scheduler.0" + }, + "Ethernet52|1": { + "scheduler": "scheduler.0" + }, + "Ethernet56|1": { + "scheduler": "scheduler.0" + }, + "Ethernet60|1": { + "scheduler": "scheduler.0" + }, + "Ethernet64|1": { + "scheduler": "scheduler.0" + }, + "Ethernet68|1": { + "scheduler": "scheduler.0" + }, + "Ethernet72|1": { + "scheduler": "scheduler.0" + }, + "Ethernet76|1": { + "scheduler": "scheduler.0" + }, + "Ethernet80|1": { + "scheduler": "scheduler.0" + }, + "Ethernet84|1": { + "scheduler": "scheduler.0" + }, + "Ethernet88|1": { + "scheduler": "scheduler.0" + }, + "Ethernet92|1": { + "scheduler": "scheduler.0" + }, + "Ethernet96|1": { + "scheduler": "scheduler.0" + }, + "Ethernet100|1": { + "scheduler": "scheduler.0" + }, + "Ethernet104|1": { + "scheduler": "scheduler.0" + }, + "Ethernet108|1": { + "scheduler": "scheduler.0" + }, + "Ethernet112|1": { + "scheduler": "scheduler.0" + }, + "Ethernet116|1": { + "scheduler": "scheduler.0" + }, + "Ethernet120|1": { + "scheduler": "scheduler.0" + }, + "Ethernet124|1": { + "scheduler": "scheduler.0" + }, + "Ethernet128|1": { + "scheduler": "scheduler.0" + }, + "Ethernet132|1": { + "scheduler": "scheduler.0" + }, + "Ethernet136|1": { + "scheduler": "scheduler.0" + }, + "Ethernet140|1": { + "scheduler": "scheduler.0" + }, + "Ethernet144|1": { + "scheduler": "scheduler.0" + }, + "Ethernet148|1": { + "scheduler": "scheduler.0" + }, + "Ethernet152|1": { + "scheduler": "scheduler.0" + }, + "Ethernet156|1": { + "scheduler": "scheduler.0" + }, + "Ethernet164|1": { + "scheduler": "scheduler.0" + }, + "Ethernet176|1": { + "scheduler": "scheduler.0" + }, + "Ethernet180|1": { + "scheduler": "scheduler.0" + }, + "Ethernet184|1": { + "scheduler": "scheduler.0" + }, + "Ethernet188|1": { + "scheduler": "scheduler.0" + }, + "Ethernet0|2": { + "scheduler": "scheduler.0" + }, + "Ethernet4|2": { + "scheduler": "scheduler.0" + }, + "Ethernet8|2": { + "scheduler": "scheduler.0" + }, + "Ethernet12|2": { + "scheduler": "scheduler.0" + }, + "Ethernet16|2": { + "scheduler": "scheduler.0" + }, + "Ethernet20|2": { + "scheduler": "scheduler.0" + }, + "Ethernet24|2": { + "scheduler": "scheduler.0" + }, + "Ethernet28|2": { + "scheduler": "scheduler.0" + }, + "Ethernet32|2": { + "scheduler": "scheduler.0" + }, + "Ethernet36|2": { + "scheduler": "scheduler.0" + }, + "Ethernet40|2": { + "scheduler": "scheduler.0" + }, + "Ethernet44|2": { + "scheduler": "scheduler.0" + }, + "Ethernet48|2": { + "scheduler": "scheduler.0" + }, + "Ethernet52|2": { + "scheduler": "scheduler.0" + }, + "Ethernet56|2": { + "scheduler": "scheduler.0" + }, + "Ethernet60|2": { + "scheduler": "scheduler.0" + }, + "Ethernet64|2": { + "scheduler": "scheduler.0" + }, + "Ethernet68|2": { + "scheduler": "scheduler.0" + }, + "Ethernet72|2": { + "scheduler": "scheduler.0" + }, + "Ethernet76|2": { + "scheduler": "scheduler.0" + }, + "Ethernet80|2": { + "scheduler": "scheduler.0" + }, + "Ethernet84|2": { + "scheduler": "scheduler.0" + }, + "Ethernet88|2": { + "scheduler": "scheduler.0" + }, + "Ethernet92|2": { + "scheduler": "scheduler.0" + }, + "Ethernet96|2": { + "scheduler": "scheduler.0" + }, + "Ethernet100|2": { + "scheduler": "scheduler.0" + }, + "Ethernet104|2": { + "scheduler": "scheduler.0" + }, + "Ethernet108|2": { + "scheduler": "scheduler.0" + }, + "Ethernet112|2": { + "scheduler": "scheduler.0" + }, + "Ethernet116|2": { + "scheduler": "scheduler.0" + }, + "Ethernet120|2": { + "scheduler": "scheduler.0" + }, + "Ethernet124|2": { + "scheduler": "scheduler.0" + }, + "Ethernet128|2": { + "scheduler": "scheduler.0" + }, + "Ethernet132|2": { + "scheduler": "scheduler.0" + }, + "Ethernet136|2": { + "scheduler": "scheduler.0" + }, + "Ethernet140|2": { + "scheduler": "scheduler.0" + }, + "Ethernet144|2": { + "scheduler": "scheduler.0" + }, + "Ethernet148|2": { + "scheduler": "scheduler.0" + }, + "Ethernet152|2": { + "scheduler": "scheduler.0" + }, + "Ethernet156|2": { + "scheduler": "scheduler.0" + }, + "Ethernet164|2": { + "scheduler": "scheduler.0" + }, + "Ethernet176|2": { + "scheduler": "scheduler.0" + }, + "Ethernet180|2": { + "scheduler": "scheduler.0" + }, + "Ethernet184|2": { + "scheduler": "scheduler.0" + }, + "Ethernet188|2": { + "scheduler": "scheduler.0" + }, + "Ethernet0|5": { + "scheduler": "scheduler.0" + }, + "Ethernet4|5": { + "scheduler": "scheduler.0" + }, + "Ethernet8|5": { + "scheduler": "scheduler.0" + }, + "Ethernet12|5": { + "scheduler": "scheduler.0" + }, + "Ethernet16|5": { + "scheduler": "scheduler.0" + }, + "Ethernet20|5": { + "scheduler": "scheduler.0" + }, + "Ethernet24|5": { + "scheduler": "scheduler.0" + }, + "Ethernet28|5": { + "scheduler": "scheduler.0" + }, + "Ethernet32|5": { + "scheduler": "scheduler.0" + }, + "Ethernet36|5": { + "scheduler": "scheduler.0" + }, + "Ethernet40|5": { + "scheduler": "scheduler.0" + }, + "Ethernet44|5": { + "scheduler": "scheduler.0" + }, + "Ethernet48|5": { + "scheduler": "scheduler.0" + }, + "Ethernet52|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet60|5": { + "scheduler": "scheduler.0" + }, + "Ethernet64|5": { + "scheduler": "scheduler.0" + }, + "Ethernet68|5": { + "scheduler": "scheduler.0" + }, + "Ethernet72|5": { + "scheduler": "scheduler.0" + }, + "Ethernet76|5": { + "scheduler": "scheduler.0" + }, + "Ethernet80|5": { + "scheduler": "scheduler.0" + }, + "Ethernet84|5": { + "scheduler": "scheduler.0" + }, + "Ethernet88|5": { + "scheduler": "scheduler.0" + }, + "Ethernet92|5": { + "scheduler": "scheduler.0" + }, + "Ethernet96|5": { + "scheduler": "scheduler.0" + }, + "Ethernet100|5": { + "scheduler": "scheduler.0" + }, + "Ethernet104|5": { + "scheduler": "scheduler.0" + }, + "Ethernet108|5": { + "scheduler": "scheduler.0" + }, + "Ethernet112|5": { + "scheduler": "scheduler.0" + }, + "Ethernet116|5": { + "scheduler": "scheduler.0" + }, + "Ethernet120|5": { + "scheduler": "scheduler.0" + }, + "Ethernet124|5": { + "scheduler": "scheduler.0" + }, + "Ethernet128|5": { + "scheduler": "scheduler.0" + }, + "Ethernet132|5": { + "scheduler": "scheduler.0" + }, + "Ethernet136|5": { + "scheduler": "scheduler.0" + }, + "Ethernet140|5": { + "scheduler": "scheduler.0" + }, + "Ethernet144|5": { + "scheduler": "scheduler.0" + }, + "Ethernet148|5": { + "scheduler": "scheduler.0" + }, + "Ethernet152|5": { + "scheduler": "scheduler.0" + }, + "Ethernet156|5": { + "scheduler": "scheduler.0" + }, + "Ethernet164|5": { + "scheduler": "scheduler.0" + }, + "Ethernet176|5": { + "scheduler": "scheduler.0" + }, + "Ethernet180|5": { + "scheduler": "scheduler.0" + }, + "Ethernet184|5": { + "scheduler": "scheduler.0" + }, + "Ethernet188|5": { + "scheduler": "scheduler.0" + }, + "Ethernet0|6": { + "scheduler": "scheduler.0" + }, + "Ethernet4|6": { + "scheduler": "scheduler.0" + }, + "Ethernet8|6": { + "scheduler": "scheduler.0" + }, + "Ethernet12|6": { + "scheduler": "scheduler.0" + }, + "Ethernet16|6": { + "scheduler": "scheduler.0" + }, + "Ethernet20|6": { + "scheduler": "scheduler.0" + }, + "Ethernet24|6": { + "scheduler": "scheduler.0" + }, + "Ethernet28|6": { + "scheduler": "scheduler.0" + }, + "Ethernet32|6": { + "scheduler": "scheduler.0" + }, + "Ethernet36|6": { + "scheduler": "scheduler.0" + }, + "Ethernet40|6": { + "scheduler": "scheduler.0" + }, + "Ethernet44|6": { + "scheduler": "scheduler.0" + }, + "Ethernet48|6": { + "scheduler": "scheduler.0" + }, + "Ethernet52|6": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + }, + "Ethernet60|6": { + "scheduler": "scheduler.0" + }, + "Ethernet64|6": { + "scheduler": "scheduler.0" + }, + "Ethernet68|6": { + "scheduler": "scheduler.0" + }, + "Ethernet72|6": { + "scheduler": "scheduler.0" + }, + "Ethernet76|6": { + "scheduler": "scheduler.0" + }, + "Ethernet80|6": { + "scheduler": "scheduler.0" + }, + "Ethernet84|6": { + "scheduler": "scheduler.0" + }, + "Ethernet88|6": { + "scheduler": "scheduler.0" + }, + "Ethernet92|6": { + "scheduler": "scheduler.0" + }, + "Ethernet96|6": { + "scheduler": "scheduler.0" + }, + "Ethernet100|6": { + "scheduler": "scheduler.0" + }, + "Ethernet104|6": { + "scheduler": "scheduler.0" + }, + "Ethernet108|6": { + "scheduler": "scheduler.0" + }, + "Ethernet112|6": { + "scheduler": "scheduler.0" + }, + "Ethernet116|6": { + "scheduler": "scheduler.0" + }, + "Ethernet120|6": { + "scheduler": "scheduler.0" + }, + "Ethernet124|6": { + "scheduler": "scheduler.0" + }, + "Ethernet128|6": { + "scheduler": "scheduler.0" + }, + "Ethernet132|6": { + "scheduler": "scheduler.0" + }, + "Ethernet136|6": { + "scheduler": "scheduler.0" + }, + "Ethernet140|6": { + "scheduler": "scheduler.0" + }, + "Ethernet144|6": { + "scheduler": "scheduler.0" + }, + "Ethernet148|6": { + "scheduler": "scheduler.0" + }, + "Ethernet152|6": { + "scheduler": "scheduler.0" + }, + "Ethernet156|6": { + "scheduler": "scheduler.0" + }, + "Ethernet164|6": { + "scheduler": "scheduler.0" + }, + "Ethernet176|6": { + "scheduler": "scheduler.0" + }, + "Ethernet180|6": { + "scheduler": "scheduler.0" + }, + "Ethernet184|6": { + "scheduler": "scheduler.0" + }, + "Ethernet188|6": { + "scheduler": "scheduler.0" + } + } +} diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index b0bfbe9f372..eb002720d98 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -23,6 +23,7 @@ def setUp(self): self.mlnx_port_config = os.path.join(self.test_dir, 'sample-port-config-mlnx.ini') self.dell6100_t0_minigraph = os.path.join(self.test_dir, 'sample-dell-6100-t0-minigraph.xml') self.arista7050_t0_minigraph = os.path.join(self.test_dir, 'sample-arista-7050-t0-minigraph.xml') + self.arista7800r3_48cq2_lc_t2_minigraph = os.path.join(self.test_dir, 'sample-arista-7800r3-48cq2-lc-t2-minigraph.xml') self.multi_asic_minigraph = os.path.join(self.test_dir, 'multi_npu_data', 'sample-minigraph.xml') self.multi_asic_port_config = os.path.join(self.test_dir, 'multi_npu_data', 'sample_port_config-0.ini') self.dell9332_t1_minigraph = os.path.join(self.test_dir, 'sample-dell-9332-t1-minigraph.xml') @@ -212,6 +213,30 @@ def test_qos_arista7050_render_template(self): sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') assert utils.cmp(sample_output_file, self.output_file) + def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self): + arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', 'x86_64-arista_7800r3_48cq2_lc', 'Arista-7800R3-48CQ2-C48') + qos_file = os.path.join(arista_dir_path, 'qos.json.j2') + buffer_file = os.path.join(arista_dir_path, 'buffers.json.j2') + port_config_ini_file = os.path.join(arista_dir_path, 'port_config.ini') + + # copy qos_config.j2 and buffer_config.j2 to the Arista 7800r3_48cq2_lc directory to have all templates in one directory + qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') + shutil.copy2(qos_config_file, arista_dir_path) + buffer_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'buffers_config.j2') + shutil.copy2(buffer_config_file, arista_dir_path) + + for template_file, cfg_file, sample_output_file in [(qos_file, 'qos_config.j2', 'qos-arista7800r3-48cq2-lc.json'), + (buffer_file, 'buffers_config.j2', 'buffer-arista7800r3-48cq2-lc.json') ]: + argument = '-m ' + self.arista7800r3_48cq2_lc_t2_minigraph + ' -p ' + port_config_ini_file + ' -t ' + template_file + ' > ' + self.output_file + self.run_script(argument) + + # cleanup + cfg_file_new = os.path.join(arista_dir_path, cfg_file) + os.remove(cfg_file_new) + + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, sample_output_file) + assert filecmp.cmp(sample_output_file, self.output_file) + def test_qos_dell9332_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32') qos_file = os.path.join(dell_dir_path, 'qos.json.j2') From 86017096b2139420a7b2b5f2e4a57987a4747cd5 Mon Sep 17 00:00:00 2001 From: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com> Date: Thu, 10 Mar 2022 08:54:33 +0800 Subject: [PATCH 110/139] [bgpcfgd] to support removal part of configuration of bgp allowed prefix list (#10165) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix allow list issue Signed-off-by: stormliang * add the ipaddress in the install list * add unit test Co-authored-by: Ubuntu Why I did it Failed to remove part of configuration of bgp allowed prefix list. The details in #10141 How I did it There are two issues: In FRR, ipv6 default route is ::/0, but in the configuration, it is 0::/0, string comparison would be false, but why ipv4 failed to remove the allowed prefix list, ipv6 works? Looks into next one for the answer. The current managers_allow_list doesn’t support removal part of the prefix list. But why IPv6 works in 1? It is because the bug for the IPv6 default route comparison, it would do the update no matter what is the operation (the code will compare the prefix list in the FRR and configuration db, if all configurations in db are presented in FRR, it do nothing, otherwise it will update the prefix list based on the configuration from db). How to verify it Follow the step in #10141 --- .../bgpcfgd/managers_allow_list.py | 49 ++++-- src/sonic-bgpcfgd/setup.py | 1 + src/sonic-bgpcfgd/tests/test_allow_list.py | 155 +++++++++++++----- 3 files changed, 153 insertions(+), 52 deletions(-) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py index 435be91d20d..e03bb19c163 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py @@ -2,6 +2,7 @@ Implementation of "allow-list" feature """ import re +import ipaddress from .log import log_debug, log_info, log_err, log_warn from .template import TemplateFabric @@ -19,6 +20,7 @@ class BGPAllowListMgr(Manager): ROUTE_MAP_ENTRY_WITH_COMMUNITY_END = 29990 ROUTE_MAP_ENTRY_WITHOUT_COMMUNITY_START = 30000 ROUTE_MAP_ENTRY_WITHOUT_COMMUNITY_END = 65530 + PREFIX_LIST_POS = 1 # the position of the ip prefix in the permit string. V4 = "v4" # constant for af enum: V4 V6 = "v6" # constant for af enum: V6 @@ -228,6 +230,12 @@ def __update_prefix_list(self, af, pl_name, allow_list): constant_list = self.__get_constant_list(af) allow_list = self.__to_prefix_list(af, allow_list) log_debug("BGPAllowListMgr::__update_prefix_list. af='%s' prefix-list name=%s" % (af, pl_name)) + ''' + Need to check exist and equality of the allowed prefix list. + A. If exist and equal, no operation needed. + B. If exist but not equal, first delete then add prefix based on the data from condig db and constants. + C. If non-exist, directly add prefix based on the data from condig db and constants. + ''' exist, correct = self.__is_prefix_list_valid(af, pl_name, allow_list, constant_list) if correct: log_debug("BGPAllowListMgr::__update_prefix_list. the prefix-list '%s' exists and correct" % pl_name) @@ -237,7 +245,7 @@ def __update_prefix_list(self, af, pl_name, allow_list): seq_no = 10 if exist: cmds.append('no %s prefix-list %s' % (family, pl_name)) - for entry in constant_list + allow_list: + for entry in self.__normalize_ipnetwork(af, constant_list + allow_list): cmds.append('%s prefix-list %s seq %d %s' % (family, pl_name, seq_no, entry)) seq_no += 10 return cmds @@ -258,6 +266,24 @@ def __remove_prefix_list(self, af, pl_name): family = self.__af_to_family(af) return ["no %s prefix-list %s" % (family, pl_name)] + def __normalize_ipnetwork(self, af, allow_prefix_list): + ''' + Normalize IPv6 addresses + for example: + 2001:cdba:0000:0000:0000:0000:3257:9652 + 2001:cdba:0:0:0:0:3257:9652 + 2001:cdba::3257:9652 + after normalize, all would be normalized to + 2001:cdba::3257:9652 + ''' + normalize_list = [] + for allow_item in allow_prefix_list: + tmp_list = allow_item.split(' ') + if af == self.V6: + tmp_list[self.PREFIX_LIST_POS] = str(ipaddress.IPv6Network(tmp_list[self.PREFIX_LIST_POS])) + normalize_list.append(' '.join(tmp_list)) + return normalize_list + def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): """ Check that a prefix list exists and it has valid entries @@ -266,7 +292,8 @@ def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): :param allow_list: a prefix-list which must be a part of the valid prefix list :param constant_list: a constant list which must be on top of each "allow" prefix list on the device :return: a tuple. The first element of the tuple has True if the prefix-list exists, False otherwise, - The second element of the tuple has True if the prefix-list contains correct entries, False if not + The second element of the tuple has True if allow prefix list in running configuraiton is + equal with ones in config db + constants, False if not """ assert af == self.V4 or af == self.V6 family = self.__af_to_family(af) @@ -274,20 +301,18 @@ def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): conf = self.cfg_mgr.get_text() if not any(line.strip().startswith(match_string) for line in conf): return False, False # if the prefix list is not exists, it is not correct - constant_set = set(constant_list) - allow_set = set(allow_list) + expect_set = set(self.__normalize_ipnetwork(af, constant_list)) + expect_set.update(set(self.__normalize_ipnetwork(af, allow_list))) + + config_list = [] for line in conf: if line.startswith(match_string): found = line[len(match_string):].strip().split(' ') rule = " ".join(found[1:]) - if rule in constant_set: - constant_set.discard(rule) - elif rule in allow_set: - if constant_set: - return True, False # Not everything from constant set is presented - else: - allow_set.discard(rule) - return True, len(allow_set) == 0 # allow_set should be presented all + config_list.append(rule) + + # Return double Ture, when running configuraiton is identical with config db + constants. + return True, expect_set == set(self.__normalize_ipnetwork(af, config_list)) def __update_community(self, community_name, community_value): """ diff --git a/src/sonic-bgpcfgd/setup.py b/src/sonic-bgpcfgd/setup.py index ab86ca20ec1..b451accb979 100755 --- a/src/sonic-bgpcfgd/setup.py +++ b/src/sonic-bgpcfgd/setup.py @@ -18,6 +18,7 @@ 'jinja2>=2.10', 'netaddr==0.8.0', 'pyyaml==5.4.1', + 'ipaddress==1.0.23' ], setup_requires = [ 'pytest-runner', diff --git a/src/sonic-bgpcfgd/tests/test_allow_list.py b/src/sonic-bgpcfgd/tests/test_allow_list.py index cb0896982a3..5207c628346 100644 --- a/src/sonic-bgpcfgd/tests/test_allow_list.py +++ b/src/sonic-bgpcfgd/tests/test_allow_list.py @@ -79,8 +79,8 @@ def test_set_handler_with_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -110,8 +110,8 @@ def test_set_handler_with_community_and_permit_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -142,8 +142,8 @@ def test_set_handler_with_community_and_deny_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -178,8 +178,8 @@ def test_set_handler_no_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -206,8 +206,8 @@ def test_set_handler_no_community_with_permit_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -234,8 +234,8 @@ def test_set_handler_no_community_with_deny_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -257,8 +257,8 @@ def test_del_handler_with_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -292,8 +292,8 @@ def test_del_handler_with_exiting_community_deny_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -331,8 +331,8 @@ def test_del_handler_with_exiting_community_permit_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -365,8 +365,8 @@ def test_del_handler_with_exiting_community_deny_action_global_deny(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -401,8 +401,8 @@ def test_del_handler_with_exiting_community_permit_action_global_deny(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -441,8 +441,8 @@ def test_del_handler_no_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -470,8 +470,8 @@ def test_del_handler_with_no_community_deny_action(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -503,8 +503,8 @@ def test_del_handler_with_no_community_permit_action_global_deny(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -543,8 +543,8 @@ def test_set_handler_with_community_data_is_already_presented(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -572,8 +572,8 @@ def test_set_handler_no_community_data_is_already_presented(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -636,8 +636,8 @@ def test_set_handler_with_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -660,8 +660,8 @@ def test_set_handler_with_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 40 permit 80.90.0.0/16 le 32', 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 50 permit fc02::/64 le 128', @@ -679,8 +679,8 @@ def test_set_handler_no_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', @@ -700,14 +700,89 @@ def test_set_handler_no_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 40 permit 80.90.0.0/16 le 32', 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 50 permit fc02::/64 le 128', ] ) +def test_set_handler_with_community_update_prefixes_remove(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|1010:2020", { + "prefixes_v4": "10.20.30.0/24", + "prefixes_v6": "fc00:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + ] + ) + +def test_set_handler_no_community_update_prefixes_remove(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5", { + "prefixes_v4": "20.20.30.0/24", + "prefixes_v6": "fc01:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + ] + ) + @patch.dict("sys.modules", swsscommon=swsscommon_module_mock) def test___set_handler_validate(): from bgpcfgd.managers_allow_list import BGPAllowListMgr From c8db7a2d529df3bbb622dfe7e5df939423c98c2c Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 10 Mar 2022 13:15:44 +0800 Subject: [PATCH 111/139] [Mellanox][SAISERVER] Support Mellanox saiserverv1 and saiserverv2 docker (#9686) * support saiserverv1 and saiserverv2 docker * add saiserver into buster and revert some changes * update thrift version --- platform/mellanox/docker-saiserver-mlnx.mk | 9 ++++---- .../docker-saiserver-mlnx/Dockerfile.j2 | 19 +++++++-------- .../docker-saiserver-mlnx/supervisord.conf | 2 +- platform/mellanox/libsaithrift-dev.mk | 23 +++++++++++++------ 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/platform/mellanox/docker-saiserver-mlnx.mk b/platform/mellanox/docker-saiserver-mlnx.mk index da74234bbf7..b765b338edd 100644 --- a/platform/mellanox/docker-saiserver-mlnx.mk +++ b/platform/mellanox/docker-saiserver-mlnx.mk @@ -16,15 +16,16 @@ # # docker image for mlnx saiserver -DOCKER_SAISERVER_MLNX = docker-saiserver-mlnx.gz +DOCKER_SAISERVER_MLNX = docker-saiserver$(SAITHRIFT_VER)-mlnx.gz $(DOCKER_SAISERVER_MLNX)_PATH = $(PLATFORM_PATH)/docker-saiserver-mlnx $(DOCKER_SAISERVER_MLNX)_DEPENDS += $(SAISERVER) $(PYTHON_SDK_API) $(DOCKER_SAISERVER_MLNX)_PYTHON_DEBS += $(MLNX_SFPD) -$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_SAISERVER_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MLNX) -SONIC_STRETCH_DOCKERS += $(DOCKER_SAISERVER_MLNX) +SONIC_BUSTER_DOCKERS += $(DOCKER_SAISERVER_MLNX) + +$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER) -$(DOCKER_SAISERVER_MLNX)_CONTAINER_NAME = saiserver $(DOCKER_SAISERVER_MLNX)_RUN_OPT += --privileged -t $(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SAISERVER_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 index 1444c7a24d6..d5b5e92ea81 100644 --- a/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-saiserver-mlnx/Dockerfile.j2 @@ -14,7 +14,8 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## -FROM docker-config-engine-stretch +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -22,7 +23,11 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +## Pre-install the fundamental packages +RUN apt-get update \ + && apt-get -y install \ + gdb \ + libboost-atomic1.71.0 COPY \ {% for deb in docker_saiserver_mlnx_debs.split(' ') -%} @@ -38,15 +43,7 @@ debs/ RUN apt-get install -y --no-install-recommends libxml2 iptables libbsd0 protobuf-c-compiler protobuf-compiler python-protobuf libprotobuf-c1 python-future python-ipaddr libnet1 pkg-config asciidoc xmlto -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_saiserver_mlnx_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_saiserver_mlnx_pydebs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} +{{ install_debian_packages(docker_saiserver_mlnx_debs.split(' ')) }} COPY ["start.sh", "/usr/bin/"] diff --git a/platform/mellanox/docker-saiserver-mlnx/supervisord.conf b/platform/mellanox/docker-saiserver-mlnx/supervisord.conf index cb67a0fc9a4..e90e4164504 100644 --- a/platform/mellanox/docker-saiserver-mlnx/supervisord.conf +++ b/platform/mellanox/docker-saiserver-mlnx/supervisord.conf @@ -20,7 +20,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:saiserver] -command=/usr/bin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini +command=/usr/sbin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini priority=3 autostart=false autorestart=false diff --git a/platform/mellanox/libsaithrift-dev.mk b/platform/mellanox/libsaithrift-dev.mk index 03daf65fac8..d50311976cf 100644 --- a/platform/mellanox/libsaithrift-dev.mk +++ b/platform/mellanox/libsaithrift-dev.mk @@ -18,19 +18,28 @@ SAI_VER = 0.9.4 -LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb +LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(MLNX_SAI) $(MLNX_SAI_DEV) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) +ifeq ($(SAITHRIFT_V2),y) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 +else +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) +endif +$(LIBSAITHRIFT_DEV)_DEPENDS += $(MLNX_SAI) $(MLNX_SAI_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(MLNX_SAI) + SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) -PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb +PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) -SAISERVER = saiserver_$(SAI_VER)_amd64.deb -$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(MLNX_SAI) +SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb +$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) -SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb +SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_amd64.deb $(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) From a89f294fd5e1cdd1074922e48d507b65bf180b98 Mon Sep 17 00:00:00 2001 From: Taras Keryk Date: Thu, 10 Mar 2022 12:55:06 +0200 Subject: [PATCH 112/139] [BFN] Implementation API for platform component (#10180) * [BFN] Implementation API for platform component SONiC has a concept of "platform components" this may include - CPLD, FPGA, BIOS, BMC, etc. These changes are needed to read the version of the BIOS and BMC component. What I did Create components.py module Add funcion for reading componet version to thrift interface How I did it The previous implementaion didn't have platform components API, so fwutil return an empty list. After implementation of the platform component API, we have actual list of platform components and firmware versions How to verify it Run manually 'fwutil show status' or run unit tests Previous command output Chassis Module Component Version Description ------------------------ -------- ----------- --------- ------------- New command output Chassis Module Component Version Description ------------------------ -------- ----------- --------- ------------- Chassis1 N/A BIOS 1.2.3 Chassis BIOS BMC 5.1 Chassis BMC Signed-off-by: Taras Keryk * [BFN] Implementation API for platform component SONiC has a concept of "platform components" this may include - CPLD, FPGA, BIOS, BMC, etc. These changes are needed to read the version of the BIOS and BMC component. What I did Create components.py module Add funcion for reading componet version to thrift interface How I did it The previous implementaion didn't have platform components API, so fwutil return an empty list. After implementation of the platform component API, we have actual list of platform components and firmware versions How to verify it Run manually 'fwutil show status' or run unit tests Previous command output Chassis Module Component Version Description ------------------------ -------- ----------- --------- ------------- New command output Chassis Module Component Version Description ------------------------ -------- ----------- --------- ------------- Chassis1 N/A BIOS 1.2.3 Chassis BIOS BMC 5.1 Chassis BMC Signed-off-by: Taras Keryk * [BFN] Implementation API for platform component get chassis name from json * [BFN] Implementation API for platform component Updated platform and platrom_components json * [BFN] Implementation API for platform component Fixed spaces in component.py * [BFN] Implementation API for platform component Fixed exception in component.py * Update chassis.py * [BFN] Implementation API for platform component Fixed spaces in component.py, chassis.py * [BFN] Implementation API for platform component: Fixed spaces in component.py, chassis.py * Fixed exception in get_bios_version --- .../x86_64-accton_as9516_32d-r0/platform.json | 8 + .../platform_components.json | 16 +- .../platform.json | 8 + .../platform_components.json | 16 +- .../sonic_platform/chassis.py | 8 + .../sonic_platform/component.py | 314 ++++++ .../pltfm_mgr_rpc/pltfm_mgr_rpc.py | 910 +++++++++++++++--- .../sonic_platform/pltfm_mgr_rpc/ttypes.py | 83 +- 8 files changed, 1172 insertions(+), 191 deletions(-) create mode 100644 platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json index b92b929fb99..115dd194b72 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform.json @@ -1,6 +1,14 @@ { "chassis": { "name": "Newport", + "components": [ + { + "name": "BIOS" + }, + { + "name": "BMC" + } + ], "fans": [ { "name": "counter-rotating-fan-1" diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json index 43874566a3a..118079de469 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json @@ -1,8 +1,10 @@ -{ - "chassis": { - "Newport": { - "component": { - } - } - } +{ + "chassis": { + "Newport": { + "component": { + "BIOS": { }, + "BMC": { } + } + } + } } \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json index 769386a14ce..ea18a031344 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json @@ -1,6 +1,14 @@ { "chassis": { "name": "Wedge100BF-32X-O-AC-F-BF", + "components": [ + { + "name": "BIOS" + }, + { + "name": "BMC" + } + ], "fans": [ { "name": "counter-rotating-fan-1" diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json index df77fa3e1bf..30befc827a9 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json @@ -1,8 +1,10 @@ -{ - "chassis": { - "Wedge100BF-32X-O-AC-F-BF": { - "component": { - } - } - } +{ + "chassis": { + "Wedge100BF-32X-O-AC-F-BF": { + "component": { + "BIOS": { }, + "BMC": { } + } + } + } } \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py index fac75ae518a..64536abbb53 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py @@ -19,6 +19,7 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +NUM_COMPONENT = 2 class Chassis(ChassisBase): """ Platform-specific Chassis class @@ -44,6 +45,7 @@ def __init__(self): self.ready = False self.phy_port_cur_state = {} self.qsfp_interval = self.QSFP_CHECK_INTERVAL + self.__initialize_components() @property def _eeprom(self): @@ -128,6 +130,12 @@ def qsfp_max_port_get(client): self.PORT_END = self.QSFP_PORT_END self.PORTS_IN_BLOCK = self.QSFP_PORT_END + def __initialize_components(self): + from sonic_platform.component import Components + for index in range(0, NUM_COMPONENT): + component = Components(index) + self._component_list.append(component) + def get_name(self): """ Retrieves the name of the chassis diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py new file mode 100644 index 00000000000..5e72bb63e34 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/component.py @@ -0,0 +1,314 @@ +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase + from platform_thrift_client import thrift_try + import json + from collections import OrderedDict + from sonic_py_common import device_info + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +def get_bios_version(): + """ + Retrieves the firmware version of the BIOS + Returns: + A string containing the firmware version of the BIOS + """ + try: + return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip().decode() + except subprocess.CalledProcessError as e: + raise RuntimeError("Failed to getget BIOS version") + +def get_bmc_version(): + """ + Retrieves the firmware version of the BMC + Returns: + A string containing the firmware version of the BMC + """ + ver = "N/A" + def bmc_get(client): + return client.pltfm_mgr.pltfm_mgr_chss_mgmt_bmc_ver_get() + try: + ver = thrift_try(bmc_get) + except Exception: + pass + + return ver + +class BFPlatformComponentsParser(object): + """ + BFPlatformComponentsParser + """ + CHASSIS_KEY = "chassis" + MODULE_KEY = "module" + COMPONENT_KEY = "component" + FIRMWARE_KEY = "firmware" + + def __init__(self, platform_components_path): + self.__chassis_component_map = OrderedDict() + self.__component_list = [] + self.__bf_model = "" + self.__parse_platform_components(platform_components_path) + + def __is_str(self, obj): + return isinstance(obj, str) + + def __is_dict(self, obj): + return isinstance(obj, dict) + + def __parser_fail(self, msg): + raise RuntimeError("Failed to parse \"{}\": {}".format(PLATFORM_COMPONENTS_FILE, msg)) + + def __parser_platform_fail(self, msg): + self.__parser_fail("invalid platform schema: {}".format(msg)) + + def __parser_chassis_fail(self, msg): + self.__parser_fail("invalid chassis schema: {}".format(msg)) + + def __parser_component_fail(self, msg): + self.__parser_fail("invalid component schema: {}".format(msg)) + + def __parse_component_section(self, section, component, is_module_component=False): + if not self.__is_dict(component): + self.__parser_component_fail("dictionary is expected: key={}".format(self.COMPONENT_KEY)) + + if not component: + return + + missing_key = None + + for key1, value1 in component.items(): + if not self.__is_dict(value1): + self.__parser_component_fail("dictionary is expected: key={}".format(key1)) + + self.__chassis_component_map[section][key1] = OrderedDict() + + if value1: + if len(value1) < 1 or len(value1) > 3: + self.__parser_component_fail("unexpected number of records: key={}".format(key1)) + + if self.FIRMWARE_KEY not in value1: + missing_key = self.FIRMWARE_KEY + break + + for key2, value2 in value1.items(): + if not self.__is_str(value2): + self.__parser_component_fail("string is expected: key={}".format(key2)) + + self.__chassis_component_map[section][key1] = value1 + + if missing_key is not None: + self.__parser_component_fail("\"{}\" key hasn't been found".format(missing_key)) + + def __parse_chassis_section(self, chassis): + self.__chassis_component_map = OrderedDict() + + if not self.__is_dict(chassis): + self.__parser_chassis_fail("dictionary is expected: key={}".format(self.CHASSIS_KEY)) + + if not chassis: + self.__parser_chassis_fail("dictionary is empty: key={}".format(self.CHASSIS_KEY)) + + if len(chassis) != 1: + self.__parser_chassis_fail("unexpected number of records: key={}".format(self.CHASSIS_KEY)) + + for key, value in chassis.items(): + if not self.__is_dict(value): + self.__parser_chassis_fail("dictionary is expected: key={}".format(key)) + + if not value: + self.__parser_chassis_fail("dictionary is empty: key={}".format(key)) + + if self.COMPONENT_KEY not in value: + self.__parser_chassis_fail("\"{}\" key hasn't been found".format(self.COMPONENT_KEY)) + + if len(value) != 1: + self.__parser_chassis_fail("unexpected number of records: key={}".format(key)) + + self.__chassis_component_map[key] = OrderedDict() + self.__parse_component_section(key, value[self.COMPONENT_KEY]) + + def get_components_list(self): + self.__component_list = [] + for key, value in self.__chassis_component_map[self.__bf_model].items(): + self.__component_list.append(key) + + return self.__component_list + + def get_chassis_component_map(self): + return self.__chassis_component_map + + def __parse_platform_components(self, platform_components_path): + with open(platform_components_path) as platform_components: + data = json.load(platform_components) + kkey, val = list(data[self.CHASSIS_KEY].items())[0] + self.__bf_model = kkey + + if not self.__is_dict(data): + self.__parser_platform_fail("dictionary is expected: key=root") + + if not data: + self.__parser_platform_fail("dictionary is empty: key=root") + + if self.CHASSIS_KEY not in data: + self.__parser_platform_fail("\"{}\" key hasn't been found".format(self.CHASSIS_KEY)) + + if len(data) != 1: + self.__parser_platform_fail("unexpected number of records: key=root") + + self.__parse_chassis_section(data[self.CHASSIS_KEY]) + + chassis_component_map = property(fget=get_chassis_component_map) + +class Components(ComponentBase): + """BFN Montara Platform-specific Component class""" + bf_platform = device_info.get_path_to_platform_dir() + bf_platform_json = "{}/platform_components.json".format(bf_platform.strip()) + bpcp = BFPlatformComponentsParser(bf_platform_json) + + def __init__(self, component_index=0): + try: + self.index = component_index + self.name = "N/A" + self.version = "N/A" + self.description = "N/A" + self.name = self.bpcp.get_components_list()[self.index] + except IndexError as e: + print("Error: No components found in plaform_components.json") + + if (self.name == "BMC"): + self.version = get_bmc_version() + self.description = "Chassis BMC" + elif (self.name == "BIOS"): + self.version = get_bios_version() + self.description = "Chassis BIOS" + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + if not self.name: + return "N/A" + return self.name + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return self.description + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + Returns: + A string containing the firmware version of the component + """ + return self.version + + def install_firmware(self, image_path): + """ + Installs firmware to the component + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install was successful, False if not + """ + return False + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if component is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the component + Returns: + string: Model/part number of component + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + A boolean value, True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_available_firmware_version(self, image_path): + return 'None' + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + return 'None' + + def update_firmware(self, image_path): + """ + Updates firmware of the component + + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + + Args: + image_path: A string, path to firmware image + + Raises: + RuntimeError: update failed + """ + return False + + def auto_update_firmware(self, image_path, boot_action): + """ + Default handling of attempted automatic update for a component + Will skip the installation if the boot_action is 'warm' or 'fast' and will call update_firmware() + if boot_action is fast. + """ + return 1 diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py index 419ac57ebb2..25ab556b375 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.13.0) +# Autogenerated by Thrift Compiler (0.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -74,6 +74,26 @@ def pltfm_mgr_fan_info_get(self, fan_num): """ pass + def pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + """ + Parameters: + - port_num + - page + - offset + - length + + """ + pass + + def pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + """ + Parameters: + - port_num + - page + + """ + pass + def pltfm_mgr_qsfp_presence_get(self, port_num): """ Parameters: @@ -284,6 +304,9 @@ def pltfm_mgr_sensor_info_get(self, options): """ pass + def pltfm_mgr_chss_mgmt_bmc_get(self): + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -552,6 +575,82 @@ def recv_pltfm_mgr_fan_info_get(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_fan_info_get failed: unknown result") + def pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + """ + Parameters: + - port_num + - page + - offset + - length + + """ + self.send_pltfm_mgr_qsfp_cached_num_bytes_get(port_num, page, offset, length) + return self.recv_pltfm_mgr_qsfp_cached_num_bytes_get() + + def send_pltfm_mgr_qsfp_cached_num_bytes_get(self, port_num, page, offset, length): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_cached_num_bytes_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_cached_num_bytes_get_args() + args.port_num = port_num + args.page = page + args.offset = offset + args.length = length + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_cached_num_bytes_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_cached_num_bytes_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_cached_num_bytes_get failed: unknown result") + + def pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + """ + Parameters: + - port_num + - page + + """ + self.send_pltfm_mgr_qsfp_cached_page_get(port_num, page) + return self.recv_pltfm_mgr_qsfp_cached_page_get() + + def send_pltfm_mgr_qsfp_cached_page_get(self, port_num, page): + self._oprot.writeMessageBegin('pltfm_mgr_qsfp_cached_page_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_qsfp_cached_page_get_args() + args.port_num = port_num + args.page = page + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_qsfp_cached_page_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_qsfp_cached_page_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_qsfp_cached_page_get failed: unknown result") + def pltfm_mgr_qsfp_presence_get(self, port_num): """ Parameters: @@ -1444,6 +1543,34 @@ def recv_pltfm_mgr_sensor_info_get(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_sensor_info_get failed: unknown result") + def pltfm_mgr_chss_mgmt_bmc_get(self): + self.send_pltfm_mgr_chss_mgmt_bmc_get() + return self.recv_pltfm_mgr_chss_mgmt_bmc_get() + + def send_pltfm_mgr_chss_mgmt_bmc_get(self): + self._oprot.writeMessageBegin('pltfm_mgr_chss_mgmt_bmc_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_chss_mgmt_bmc_get_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_pltfm_mgr_chss_mgmt_bmc_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = pltfm_mgr_chss_mgmt_bmc_get_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.ouch is not None: + raise result.ouch + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_chss_mgmt_bmc_get failed: unknown result") + class Processor(Iface, TProcessor): def __init__(self, handler): @@ -1457,6 +1584,8 @@ def __init__(self, handler): self._processMap["pltfm_mgr_pwr_rail_info_get"] = Processor.process_pltfm_mgr_pwr_rail_info_get self._processMap["pltfm_mgr_fan_speed_set"] = Processor.process_pltfm_mgr_fan_speed_set self._processMap["pltfm_mgr_fan_info_get"] = Processor.process_pltfm_mgr_fan_info_get + self._processMap["pltfm_mgr_qsfp_cached_num_bytes_get"] = Processor.process_pltfm_mgr_qsfp_cached_num_bytes_get + self._processMap["pltfm_mgr_qsfp_cached_page_get"] = Processor.process_pltfm_mgr_qsfp_cached_page_get self._processMap["pltfm_mgr_qsfp_presence_get"] = Processor.process_pltfm_mgr_qsfp_presence_get self._processMap["pltfm_mgr_qsfp_detect_transceiver"] = Processor.process_pltfm_mgr_qsfp_detect_transceiver self._processMap["pltfm_mgr_qsfp_info_get"] = Processor.process_pltfm_mgr_qsfp_info_get @@ -1483,6 +1612,7 @@ def __init__(self, handler): self._processMap["pltfm_mgr_qsfp_pwr_override_set"] = Processor.process_pltfm_mgr_qsfp_pwr_override_set self._processMap["pltfm_mgr_qsfp_lpmode_set"] = Processor.process_pltfm_mgr_qsfp_lpmode_set self._processMap["pltfm_mgr_sensor_info_get"] = Processor.process_pltfm_mgr_sensor_info_get + self._processMap["pltfm_mgr_chss_mgmt_bmc_get"] = Processor.process_pltfm_mgr_chss_mgmt_bmc_get self._on_message_begin = None def on_message_begin(self, func): @@ -1710,6 +1840,58 @@ def process_pltfm_mgr_fan_info_get(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_pltfm_mgr_qsfp_cached_num_bytes_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_cached_num_bytes_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_cached_num_bytes_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_cached_num_bytes_get(args.port_num, args.page, args.offset, args.length) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_cached_num_bytes_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_pltfm_mgr_qsfp_cached_page_get(self, seqid, iprot, oprot): + args = pltfm_mgr_qsfp_cached_page_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_qsfp_cached_page_get_result() + try: + result.success = self._handler.pltfm_mgr_qsfp_cached_page_get(args.port_num, args.page) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_qsfp_cached_page_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + def process_pltfm_mgr_qsfp_presence_get(self, seqid, iprot, oprot): args = pltfm_mgr_qsfp_presence_get_args() args.read(iprot) @@ -2386,6 +2568,32 @@ def process_pltfm_mgr_sensor_info_get(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() + def process_pltfm_mgr_chss_mgmt_bmc_get(self, seqid, iprot, oprot): + args = pltfm_mgr_chss_mgmt_bmc_get_args() + args.read(iprot) + iprot.readMessageEnd() + result = pltfm_mgr_chss_mgmt_bmc_get_result() + try: + result.success = self._handler.pltfm_mgr_chss_mgmt_bmc_get() + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except InvalidPltfmMgrOperation as ouch: + msg_type = TMessageType.REPLY + result.ouch = ouch + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("pltfm_mgr_chss_mgmt_bmc_get", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -2585,8 +2793,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2703,8 +2910,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2839,8 +3045,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2942,11 +3147,295 @@ def __ne__(self, other): all_structs.append(pltfm_mgr_pwr_supply_info_get_args) pltfm_mgr_pwr_supply_info_get_args.thrift_spec = ( None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 + (1, TType.I16, 'ps_num', None, None, ), # 1 +) + + +class pltfm_mgr_pwr_supply_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_pwr_supply_info_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_supply_info_get_result) +pltfm_mgr_pwr_supply_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_supply_info_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_pwr_rail_info_get_args(object): + """ + Attributes: + - ps_num + + """ + + + def __init__(self, ps_num=None,): + self.ps_num = ps_num + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I16: + self.ps_num = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_args') + if self.ps_num is not None: + oprot.writeFieldBegin('ps_num', TType.I16, 1) + oprot.writeI16(self.ps_num) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_rail_info_get_args) +pltfm_mgr_pwr_rail_info_get_args.thrift_spec = ( + None, # 0 + (1, TType.I16, 'ps_num', None, None, ), # 1 +) + + +class pltfm_mgr_pwr_rail_info_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = pltfm_mgr_pwr_rail_info_t() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_pwr_rail_info_get_result) +pltfm_mgr_pwr_rail_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_rail_info_t, None], None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) + + +class pltfm_mgr_fan_speed_set_args(object): + """ + Attributes: + - fan_num + - percent + + """ + + + def __init__(self, fan_num=None, percent=None,): + self.fan_num = fan_num + self.percent = percent + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.fan_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.percent = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_fan_speed_set_args') + if self.fan_num is not None: + oprot.writeFieldBegin('fan_num', TType.I32, 1) + oprot.writeI32(self.fan_num) + oprot.writeFieldEnd() + if self.percent is not None: + oprot.writeFieldBegin('percent', TType.I32, 2) + oprot.writeI32(self.percent) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_fan_speed_set_args) +pltfm_mgr_fan_speed_set_args.thrift_spec = ( + None, # 0 + (1, TType.I32, 'fan_num', None, None, ), # 1 + (2, TType.I32, 'percent', None, None, ), # 2 ) -class pltfm_mgr_pwr_supply_info_get_result(object): +class pltfm_mgr_fan_speed_set_result(object): """ Attributes: - success @@ -2969,15 +3458,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_supply_info_t() - self.success.read(iprot) + if ftype == TType.I32: + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -2989,10 +3476,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_supply_info_get_result') + oprot.writeStructBegin('pltfm_mgr_fan_speed_set_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -3014,23 +3501,23 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_pwr_supply_info_get_result) -pltfm_mgr_pwr_supply_info_get_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_supply_info_t, None], None, ), # 0 +all_structs.append(pltfm_mgr_fan_speed_set_result) +pltfm_mgr_fan_speed_set_result.thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) -class pltfm_mgr_pwr_rail_info_get_args(object): +class pltfm_mgr_fan_info_get_args(object): """ Attributes: - - ps_num + - fan_num """ - def __init__(self, ps_num=None,): - self.ps_num = ps_num + def __init__(self, fan_num=None,): + self.fan_num = fan_num def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3042,8 +3529,8 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 1: - if ftype == TType.I16: - self.ps_num = iprot.readI16() + if ftype == TType.I32: + self.fan_num = iprot.readI32() else: iprot.skip(ftype) else: @@ -3055,10 +3542,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_args') - if self.ps_num is not None: - oprot.writeFieldBegin('ps_num', TType.I16, 1) - oprot.writeI16(self.ps_num) + oprot.writeStructBegin('pltfm_mgr_fan_info_get_args') + if self.fan_num is not None: + oprot.writeFieldBegin('fan_num', TType.I32, 1) + oprot.writeI32(self.fan_num) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3076,14 +3563,14 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_pwr_rail_info_get_args) -pltfm_mgr_pwr_rail_info_get_args.thrift_spec = ( +all_structs.append(pltfm_mgr_fan_info_get_args) +pltfm_mgr_fan_info_get_args.thrift_spec = ( None, # 0 - (1, TType.I16, 'ps_num', None, None, ), # 1 + (1, TType.I32, 'fan_num', None, None, ), # 1 ) -class pltfm_mgr_pwr_rail_info_get_result(object): +class pltfm_mgr_fan_info_get_result(object): """ Attributes: - success @@ -3107,14 +3594,13 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRUCT: - self.success = pltfm_mgr_pwr_rail_info_t() + self.success = pltfm_mgr_fan_info_t() self.success.read(iprot) else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3126,7 +3612,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_pwr_rail_info_get_result') + oprot.writeStructBegin('pltfm_mgr_fan_info_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRUCT, 0) self.success.write(oprot) @@ -3151,25 +3637,29 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_pwr_rail_info_get_result) -pltfm_mgr_pwr_rail_info_get_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [pltfm_mgr_pwr_rail_info_t, None], None, ), # 0 +all_structs.append(pltfm_mgr_fan_info_get_result) +pltfm_mgr_fan_info_get_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [pltfm_mgr_fan_info_t, None], None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) -class pltfm_mgr_fan_speed_set_args(object): +class pltfm_mgr_qsfp_cached_num_bytes_get_args(object): """ Attributes: - - fan_num - - percent + - port_num + - page + - offset + - length """ - def __init__(self, fan_num=None, percent=None,): - self.fan_num = fan_num - self.percent = percent + def __init__(self, port_num=None, page=None, offset=None, length=None,): + self.port_num = port_num + self.page = page + self.offset = offset + self.length = length def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3182,12 +3672,22 @@ def read(self, iprot): break if fid == 1: if ftype == TType.I32: - self.fan_num = iprot.readI32() + self.port_num = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - self.percent = iprot.readI32() + self.page = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.offset = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.length = iprot.readI32() else: iprot.skip(ftype) else: @@ -3199,14 +3699,22 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_num_bytes_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) oprot.writeFieldEnd() - if self.percent is not None: - oprot.writeFieldBegin('percent', TType.I32, 2) - oprot.writeI32(self.percent) + if self.page is not None: + oprot.writeFieldBegin('page', TType.I32, 2) + oprot.writeI32(self.page) + oprot.writeFieldEnd() + if self.offset is not None: + oprot.writeFieldBegin('offset', TType.I32, 3) + oprot.writeI32(self.offset) + oprot.writeFieldEnd() + if self.length is not None: + oprot.writeFieldBegin('length', TType.I32, 4) + oprot.writeI32(self.length) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3224,15 +3732,17 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_fan_speed_set_args) -pltfm_mgr_fan_speed_set_args.thrift_spec = ( +all_structs.append(pltfm_mgr_qsfp_cached_num_bytes_get_args) +pltfm_mgr_qsfp_cached_num_bytes_get_args.thrift_spec = ( None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 - (2, TType.I32, 'percent', None, None, ), # 2 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'page', None, None, ), # 2 + (3, TType.I32, 'offset', None, None, ), # 3 + (4, TType.I32, 'length', None, None, ), # 4 ) -class pltfm_mgr_fan_speed_set_result(object): +class pltfm_mgr_qsfp_cached_num_bytes_get_result(object): """ Attributes: - success @@ -3255,14 +3765,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.I32: - self.success = iprot.readI32() + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3274,10 +3783,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_speed_set_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_num_bytes_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.I32, 0) - oprot.writeI32(self.success) + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -3299,23 +3808,25 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_fan_speed_set_result) -pltfm_mgr_fan_speed_set_result.thrift_spec = ( - (0, TType.I32, 'success', None, None, ), # 0 +all_structs.append(pltfm_mgr_qsfp_cached_num_bytes_get_result) +pltfm_mgr_qsfp_cached_num_bytes_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) -class pltfm_mgr_fan_info_get_args(object): +class pltfm_mgr_qsfp_cached_page_get_args(object): """ Attributes: - - fan_num + - port_num + - page """ - def __init__(self, fan_num=None,): - self.fan_num = fan_num + def __init__(self, port_num=None, page=None,): + self.port_num = port_num + self.page = page def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: @@ -3328,7 +3839,12 @@ def read(self, iprot): break if fid == 1: if ftype == TType.I32: - self.fan_num = iprot.readI32() + self.port_num = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.page = iprot.readI32() else: iprot.skip(ftype) else: @@ -3340,10 +3856,14 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_args') - if self.fan_num is not None: - oprot.writeFieldBegin('fan_num', TType.I32, 1) - oprot.writeI32(self.fan_num) + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_page_get_args') + if self.port_num is not None: + oprot.writeFieldBegin('port_num', TType.I32, 1) + oprot.writeI32(self.port_num) + oprot.writeFieldEnd() + if self.page is not None: + oprot.writeFieldBegin('page', TType.I32, 2) + oprot.writeI32(self.page) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -3361,14 +3881,15 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_fan_info_get_args) -pltfm_mgr_fan_info_get_args.thrift_spec = ( +all_structs.append(pltfm_mgr_qsfp_cached_page_get_args) +pltfm_mgr_qsfp_cached_page_get_args.thrift_spec = ( None, # 0 - (1, TType.I32, 'fan_num', None, None, ), # 1 + (1, TType.I32, 'port_num', None, None, ), # 1 + (2, TType.I32, 'page', None, None, ), # 2 ) -class pltfm_mgr_fan_info_get_result(object): +class pltfm_mgr_qsfp_cached_page_get_result(object): """ Attributes: - success @@ -3391,15 +3912,13 @@ def read(self, iprot): if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = pltfm_mgr_fan_info_t() - self.success.read(iprot) + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3411,10 +3930,10 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_fan_info_get_result') + oprot.writeStructBegin('pltfm_mgr_qsfp_cached_page_get_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) oprot.writeFieldEnd() if self.ouch is not None: oprot.writeFieldBegin('ouch', TType.STRUCT, 1) @@ -3436,9 +3955,9 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_fan_info_get_result) -pltfm_mgr_fan_info_get_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [pltfm_mgr_fan_info_t, None], None, ), # 0 +all_structs.append(pltfm_mgr_qsfp_cached_page_get_result) +pltfm_mgr_qsfp_cached_page_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) @@ -3534,8 +4053,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3670,8 +4188,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3801,13 +4318,12 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -3923,8 +4439,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4071,8 +4586,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4207,8 +4721,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4367,8 +4880,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4503,8 +5015,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4644,8 +5155,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4788,8 +5298,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -4932,8 +5441,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5077,8 +5585,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5222,8 +5729,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5367,8 +5873,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5511,8 +6016,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5655,8 +6159,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5799,8 +6302,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -5938,8 +6440,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6074,8 +6575,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6211,8 +6711,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6359,8 +6858,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6495,8 +6993,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6631,8 +7128,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6791,8 +7287,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -6939,8 +7434,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -7006,7 +7500,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.options = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.options = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -7070,13 +7564,12 @@ def read(self, iprot): break if fid == 0: if ftype == TType.STRING: - self.success = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 1: if ftype == TType.STRUCT: - self.ouch = InvalidPltfmMgrOperation() - self.ouch.read(iprot) + self.ouch = InvalidPltfmMgrOperation.read(iprot) else: iprot.skip(ftype) else: @@ -7118,6 +7611,121 @@ def __ne__(self, other): (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) + + +class pltfm_mgr_chss_mgmt_bmc_get_args(object): + + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_get_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_chss_mgmt_bmc_get_args) +pltfm_mgr_chss_mgmt_bmc_get_args.thrift_spec = ( +) + + +class pltfm_mgr_chss_mgmt_bmc_get_result(object): + """ + Attributes: + - success + - ouch + + """ + + + def __init__(self, success=None, ouch=None,): + self.success = success + self.ouch = ouch + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRING: + self.success = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.ouch = InvalidPltfmMgrOperation.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_get_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRING, 0) + oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) + oprot.writeFieldEnd() + if self.ouch is not None: + oprot.writeFieldBegin('ouch', TType.STRUCT, 1) + self.ouch.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(pltfm_mgr_chss_mgmt_bmc_get_result) +pltfm_mgr_chss_mgmt_bmc_get_result.thrift_spec = ( + (0, TType.STRING, 'success', 'UTF8', None, ), # 0 + (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 +) fix_spec(all_structs) del all_structs - diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py index da4a62d4eef..50159694166 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/ttypes.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.13.0) +# Autogenerated by Thrift Compiler (0.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -16,6 +16,24 @@ all_structs = [] +class qsfp_eeprom_page_t(object): + PAGE0_LOWER = 0 + PAGE0_UPPER = 1 + PAGE3 = 2 + + _VALUES_TO_NAMES = { + 0: "PAGE0_LOWER", + 1: "PAGE0_UPPER", + 2: "PAGE3", + } + + _NAMES_TO_VALUES = { + "PAGE0_LOWER": 0, + "PAGE0_UPPER": 1, + "PAGE3": 2, + } + + class pltfm_mgr_sys_tmp_t(object): """ Attributes: @@ -241,37 +259,37 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.prod_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.prod_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.sys_asm_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_asm_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.bfn_pcba_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.bfn_pcba_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.bfn_pcbb_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.bfn_pcbb_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: - self.odm_pcba_part_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.odm_pcba_part_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.odm_pcba_ser_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.odm_pcba_ser_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: @@ -291,42 +309,42 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 12: if ftype == TType.STRING: - self.prod_ser_num = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_ser_num = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.STRING: - self.prod_ast_tag = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.prod_ast_tag = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.STRING: - self.sys_mfger = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_mfger = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 15: if ftype == TType.STRING: - self.sys_mfg_date = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.sys_mfg_date = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 16: if ftype == TType.STRING: - self.pcb_mfger = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.pcb_mfger = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 17: if ftype == TType.STRING: - self.assembled_at = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.assembled_at = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 18: if ftype == TType.STRING: - self.loc_mac_addr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.loc_mac_addr = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 19: if ftype == TType.STRING: - self.ext_mac_addr = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.ext_mac_addr = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 20: @@ -336,7 +354,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 21: if ftype == TType.STRING: - self.location = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.location = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 22: @@ -535,17 +553,17 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 8: if ftype == TType.STRING: - self.model = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.model = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRING: - self.serial = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.serial = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.STRING: - self.rev = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.rev = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) else: @@ -1278,26 +1296,39 @@ class InvalidPltfmMgrOperation(TException): def __init__(self, code=None,): - self.code = code + super(InvalidPltfmMgrOperation, self).__setattr__('code', code) - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return + def __setattr__(self, *args): + raise TypeError("can't modify immutable instance") + + def __delattr__(self, *args): + raise TypeError("can't modify immutable instance") + + def __hash__(self): + return hash(self.__class__) ^ hash((self.code, )) + + @classmethod + def read(cls, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + code = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - self.code = iprot.readI32() + code = iprot.readI32() else: iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() iprot.readStructEnd() + return cls( + code=code, + ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: From 861ea26d1887354033f4568059e1f3f79c4b62e3 Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Thu, 10 Mar 2022 14:42:43 -0800 Subject: [PATCH 113/139] [yang]: Update DEVICE_METADATA yang models to support 'sub_role' (#10161) #### Why I did it Fix https://github.com/Azure/sonic-buildimage/issues/9591 #### How I did it Add 'sub_role' to device_metadata yang models. #### How to verify it Run UT for sonc-yang-models. --- src/sonic-yang-models/tests/files/sample_config_db.json | 3 ++- .../tests/yang_model_tests/tests/device_metadata.json | 5 ++++- .../yang_model_tests/tests_config/device_metadata.json | 9 +++++++++ .../yang-models/sonic-device_metadata.yang | 5 +++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 6dbffce671e..920181646c4 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -302,7 +302,8 @@ "asic_name": "Asic0", "switch_id": "2", "switch_type": "voq", - "max_cores": "8" + "max_cores": "8", + "sub_role": "FrondEnd" } }, "VLAN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index ca26e24cd32..ecfff6f69a6 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -100,6 +100,9 @@ }, "DEVICE_METADATA_CORRECT_VOQ_CONFIG": { "desc": "Verifying VOQ configuration." - } + }, + "DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": { + "desc": "Verifying valid sub_role configuration." + } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index bfc9c080b75..de0d4e15dce 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -274,5 +274,14 @@ } } } + }, + "DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "sub_role": "FrontEnd" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index 0dc88f436d8..87170850d89 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -127,6 +127,11 @@ module sonic-device_metadata { type string; } + leaf sub_role { + type string; + description "sub_role indicates if ASIC is FrondEnd or BackEnd."; + } + leaf downstream_subrole { type string; } From 560c0d989ad8426903eb1b4b665e718649629692 Mon Sep 17 00:00:00 2001 From: pavannaregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Fri, 11 Mar 2022 04:53:21 +0530 Subject: [PATCH 114/139] Adding libubootenv-tool into bullseye image (#10146) Why I did it uboot env get and set commands fw_printenv/fw_setenv are not available in bullseye sonic image. Some platforms using them where failing. Ex: sonic-installer commands in marvell-armhf. In case of buster, u-boot-tools was providing these commands. How I did it Added libubootenv-tool which provides these tools along with other uboot tools in build_debian.sh. How to verify it root@localhost:# fw_printenv serverip serverip=10.4.50.39 root@localhost:# fw_setenv serverip 10.4.50.38 root@localhost:~# fw_printenv serverip serverip=10.4.50.38 Change-Id: I558f8737f41d83d3e8527ce340391ae8f978b6d8 Signed-off-by: Pavan Naregundi --- build_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index 73984cb6cc5..fb0d45263d6 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -190,7 +190,7 @@ if [ -f platform/$CONFIGURED_PLATFORM/modules ]; then fi ## Add mtd and uboot firmware tools package -sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install u-boot-tools mtd-utils device-tree-compiler +sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install u-boot-tools libubootenv-tool mtd-utils device-tree-compiler ## Install docker echo '[INFO] Install docker' From f34b5e601d8e5cfa8af70718edf04374f25abf13 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:21:35 +0800 Subject: [PATCH 115/139] [Submodule]: Update submodule for sonic-telemetry (#10124) e56e9b4 Fix CVE-2021-3121 warning (#96) bf1be4f [ci]: Support code diff coverage threshold 50% (#94) 64e516c Ported Marvell armhf build on x86 for debian buster to use cross-compilation instead of qemu emulation (#80) e426388 [ci]: Support azp code coverage (#87) --- src/sonic-telemetry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-telemetry b/src/sonic-telemetry index 0443e660502..e56e9b44e4a 160000 --- a/src/sonic-telemetry +++ b/src/sonic-telemetry @@ -1 +1 @@ -Subproject commit 0443e66050256a87f8e92db7cd3c36cc139ebe14 +Subproject commit e56e9b44e4a7e3b211f070c298041951c543885b From 9cdf81230b3819c45a5680ea0970474869da3569 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Fri, 11 Mar 2022 09:23:37 +0800 Subject: [PATCH 116/139] [Build]: Fix /proc not mounted issue (#10164) [Build]: Fix /proc not mounted issue --- build_debian.sh | 3 +++ files/build_templates/sonic_debian_extension.j2 | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index fb0d45263d6..41741d6c5f8 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -67,6 +67,9 @@ mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime +## ensure proc is mounted +sudo mount proc /proc -t proc || true + ## make / as a mountpoint in chroot env, needed by dockerd pushd $FILESYSTEM_ROOT sudo mount --bind . . diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 0a2b5536232..991b838a6d2 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -648,10 +648,7 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then fi {% if installer_images.strip() -%} -clean_proc() { - sudo umount /proc || true -} -trap_push clean_proc +## ensure proc is mounted sudo mount proc /proc -t proc || true sudo mkdir $FILESYSTEM_ROOT/target sudo mount --bind target $FILESYSTEM_ROOT/target @@ -732,7 +729,6 @@ if [ $MULTIARCH_QEMU_ENVIRON == y ]; then else sudo chroot $FILESYSTEM_ROOT $DOCKER_CTL_SCRIPT stop fi -sudo umount /proc || true sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json" {% for entry in feature_vs_image_names.split(' ') -%} From 759172dc8b50180800082c125796c2d3aaa9a33a Mon Sep 17 00:00:00 2001 From: Taras Keryk Date: Fri, 11 Mar 2022 11:31:27 +0200 Subject: [PATCH 117/139] [BFN] Regenerated pltfm_mgr_rpc.py to the latest version (#10180) (#10208) Signed-off-by: Taras Keryk Why I did it The previous implementaion of API for platform component didn't have the new thrift files How I did it Add the new thrift-generated: pltfm_mgr_rpc.py, ttypes.py How to verify it Run manually 'fwutil show status' or run unit tests Previous command output had no information about components New command output Chassis Module Component Version Description ------------------------ -------- ----------- --------- ------------- Chassis1 N/A BIOS 1.2.3 Chassis BIOS BMC 5.1 Chassis BMC --- .../pltfm_mgr_rpc/pltfm_mgr_rpc.py | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py index 25ab556b375..0fa03d58b31 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/pltfm_mgr_rpc/pltfm_mgr_rpc.py @@ -304,7 +304,7 @@ def pltfm_mgr_sensor_info_get(self, options): """ pass - def pltfm_mgr_chss_mgmt_bmc_get(self): + def pltfm_mgr_chss_mgmt_bmc_ver_get(self): pass @@ -1543,18 +1543,18 @@ def recv_pltfm_mgr_sensor_info_get(self): raise result.ouch raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_sensor_info_get failed: unknown result") - def pltfm_mgr_chss_mgmt_bmc_get(self): - self.send_pltfm_mgr_chss_mgmt_bmc_get() - return self.recv_pltfm_mgr_chss_mgmt_bmc_get() + def pltfm_mgr_chss_mgmt_bmc_ver_get(self): + self.send_pltfm_mgr_chss_mgmt_bmc_ver_get() + return self.recv_pltfm_mgr_chss_mgmt_bmc_ver_get() - def send_pltfm_mgr_chss_mgmt_bmc_get(self): - self._oprot.writeMessageBegin('pltfm_mgr_chss_mgmt_bmc_get', TMessageType.CALL, self._seqid) - args = pltfm_mgr_chss_mgmt_bmc_get_args() + def send_pltfm_mgr_chss_mgmt_bmc_ver_get(self): + self._oprot.writeMessageBegin('pltfm_mgr_chss_mgmt_bmc_ver_get', TMessageType.CALL, self._seqid) + args = pltfm_mgr_chss_mgmt_bmc_ver_get_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_pltfm_mgr_chss_mgmt_bmc_get(self): + def recv_pltfm_mgr_chss_mgmt_bmc_ver_get(self): iprot = self._iprot (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: @@ -1562,14 +1562,14 @@ def recv_pltfm_mgr_chss_mgmt_bmc_get(self): x.read(iprot) iprot.readMessageEnd() raise x - result = pltfm_mgr_chss_mgmt_bmc_get_result() + result = pltfm_mgr_chss_mgmt_bmc_ver_get_result() result.read(iprot) iprot.readMessageEnd() if result.success is not None: return result.success if result.ouch is not None: raise result.ouch - raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_chss_mgmt_bmc_get failed: unknown result") + raise TApplicationException(TApplicationException.MISSING_RESULT, "pltfm_mgr_chss_mgmt_bmc_ver_get failed: unknown result") class Processor(Iface, TProcessor): @@ -1612,7 +1612,7 @@ def __init__(self, handler): self._processMap["pltfm_mgr_qsfp_pwr_override_set"] = Processor.process_pltfm_mgr_qsfp_pwr_override_set self._processMap["pltfm_mgr_qsfp_lpmode_set"] = Processor.process_pltfm_mgr_qsfp_lpmode_set self._processMap["pltfm_mgr_sensor_info_get"] = Processor.process_pltfm_mgr_sensor_info_get - self._processMap["pltfm_mgr_chss_mgmt_bmc_get"] = Processor.process_pltfm_mgr_chss_mgmt_bmc_get + self._processMap["pltfm_mgr_chss_mgmt_bmc_ver_get"] = Processor.process_pltfm_mgr_chss_mgmt_bmc_ver_get self._on_message_begin = None def on_message_begin(self, func): @@ -2568,13 +2568,13 @@ def process_pltfm_mgr_sensor_info_get(self, seqid, iprot, oprot): oprot.writeMessageEnd() oprot.trans.flush() - def process_pltfm_mgr_chss_mgmt_bmc_get(self, seqid, iprot, oprot): - args = pltfm_mgr_chss_mgmt_bmc_get_args() + def process_pltfm_mgr_chss_mgmt_bmc_ver_get(self, seqid, iprot, oprot): + args = pltfm_mgr_chss_mgmt_bmc_ver_get_args() args.read(iprot) iprot.readMessageEnd() - result = pltfm_mgr_chss_mgmt_bmc_get_result() + result = pltfm_mgr_chss_mgmt_bmc_ver_get_result() try: - result.success = self._handler.pltfm_mgr_chss_mgmt_bmc_get() + result.success = self._handler.pltfm_mgr_chss_mgmt_bmc_ver_get() msg_type = TMessageType.REPLY except TTransport.TTransportException: raise @@ -2589,7 +2589,7 @@ def process_pltfm_mgr_chss_mgmt_bmc_get(self, seqid, iprot, oprot): logging.exception('Unexpected exception in handler') msg_type = TMessageType.EXCEPTION result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("pltfm_mgr_chss_mgmt_bmc_get", msg_type, seqid) + oprot.writeMessageBegin("pltfm_mgr_chss_mgmt_bmc_ver_get", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -7613,7 +7613,7 @@ def __ne__(self, other): ) -class pltfm_mgr_chss_mgmt_bmc_get_args(object): +class pltfm_mgr_chss_mgmt_bmc_ver_get_args(object): def read(self, iprot): @@ -7634,7 +7634,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_get_args') + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_ver_get_args') oprot.writeFieldStop() oprot.writeStructEnd() @@ -7651,12 +7651,12 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_chss_mgmt_bmc_get_args) -pltfm_mgr_chss_mgmt_bmc_get_args.thrift_spec = ( +all_structs.append(pltfm_mgr_chss_mgmt_bmc_ver_get_args) +pltfm_mgr_chss_mgmt_bmc_ver_get_args.thrift_spec = ( ) -class pltfm_mgr_chss_mgmt_bmc_get_result(object): +class pltfm_mgr_chss_mgmt_bmc_ver_get_result(object): """ Attributes: - success @@ -7697,7 +7697,7 @@ def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return - oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_get_result') + oprot.writeStructBegin('pltfm_mgr_chss_mgmt_bmc_ver_get_result') if self.success is not None: oprot.writeFieldBegin('success', TType.STRING, 0) oprot.writeString(self.success.encode('utf-8') if sys.version_info[0] == 2 else self.success) @@ -7722,8 +7722,8 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) -all_structs.append(pltfm_mgr_chss_mgmt_bmc_get_result) -pltfm_mgr_chss_mgmt_bmc_get_result.thrift_spec = ( +all_structs.append(pltfm_mgr_chss_mgmt_bmc_ver_get_result) +pltfm_mgr_chss_mgmt_bmc_ver_get_result.thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', None, ), # 0 (1, TType.STRUCT, 'ouch', [InvalidPltfmMgrOperation, None], None, ), # 1 ) From a29ba9cf22c4145bad119a2578cbb88eb8d31f37 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 11 Mar 2022 17:35:17 +0800 Subject: [PATCH 118/139] Correct thrift 0141 typo fix (#10199) Correct libsaithrift dependency package name from LIBTHRIFT_DEV_0_14_1 THRIFT_COMPILER_0_14_1 to LIBTHRIFT_0_14_1_DEV THRIFT_0_14_1_COMPILER How I did it How to verify it Test Done: make BLDENV=buster SAITHRIFT_V2=y -f Makefile.work target/debs/buster/saiserverv2_0.9.4_amd64.deb --- platform/broadcom/libsaithrift-dev.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/libsaithrift-dev.mk b/platform/broadcom/libsaithrift-dev.mk index 1e4d0da13bb..c1bd9b90de1 100644 --- a/platform/broadcom/libsaithrift-dev.mk +++ b/platform/broadcom/libsaithrift-dev.mk @@ -6,7 +6,7 @@ LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI #Support two different versions of thrift ifeq ($(SAITHRIFT_V2),y) -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_DEV_0_14_1) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_COMPILER_0_14_1) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) $(PYTHON3_THRIFT_0_14_1) $(THRIFT_0_14_1_COMPILER) $(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_14_1) $(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 else From 8d419ca2c59b0f75c24ba4ed73fbdc7df7812260 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Fri, 11 Mar 2022 08:09:07 -0800 Subject: [PATCH 119/139] [Arista] Remove arista.log from rsyslog default logrotate (#9731) Why I did it In parallel of this change Arista added a custom logrotate configuration as part of its driver library. Having 2 logrotate configuration for the same log file triggers an issue. Fixes aristanetworks/sonic#38 How I did it Arista merged a few changes in sonic-buildimage which added a logrotate configuration aristanetworks/sonic@e43c797 It is therefore the right path to remove the arista.log line from the logrotate.d/rsyslog configuration. How to verify it Logrotate works without any error message, arista log rotation happens and arista daemons still append logs once file was truncated. --- files/image_config/logrotate/rsyslog.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/files/image_config/logrotate/rsyslog.j2 b/files/image_config/logrotate/rsyslog.j2 index 1a5c92c3382..28a7d9dd2ee 100644 --- a/files/image_config/logrotate/rsyslog.j2 +++ b/files/image_config/logrotate/rsyslog.j2 @@ -24,7 +24,6 @@ } /var/log/auth.log -/var/log/arista.log /var/log/cron.log /var/log/syslog /var/log/teamd.log From 092b0b2ba10a791bd703794a6e7a813380c412d4 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 12 Mar 2022 19:07:10 +0800 Subject: [PATCH 120/139] [Build]: fix some version info missing in version control files issue (#10211) [Build]: fix some version info missing in version control files issue --- build_debian.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index 41741d6c5f8..6ffa2eb62fd 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -562,6 +562,9 @@ if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then fi fi +# Collect host image version files before cleanup +scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT + # Remove GCC sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove gcc @@ -593,7 +596,6 @@ sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS ## Note: -x to skip directories on different file systems, such as /proc sudo du -hsx $FILESYSTEM_ROOT sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker -scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -comp zstd -b 1M -e boot -e var/lib/docker -e $PLATFORM_DIR # Ensure admin gid is 1000 From ebe2d19623a00656181503f512908b8b2f5ded09 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Sat, 12 Mar 2022 19:08:21 +0800 Subject: [PATCH 121/139] [Build]: Clean up pip cache (#10143) [Build]: Clean up pip cache --- build_debian.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build_debian.sh b/build_debian.sh index 6ffa2eb62fd..62de5a8218f 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -577,6 +577,9 @@ sudo LANG=C chroot $FILESYSTEM_ROOT bash -c 'rm -rf /usr/share/doc/* /usr/share/ ## Clean up proxy [ -n "$http_proxy" ] && sudo rm -f $FILESYSTEM_ROOT/etc/apt/apt.conf.d/01proxy +## Clean up pip cache +sudo LANG=C chroot $FILESYSTEM_ROOT pip3 cache purge + ## Umount all echo '[INFO] Umount all' ## Display all process details access /proc From b73da484c4d834f17a8563f39556e617fbc6869c Mon Sep 17 00:00:00 2001 From: xwjiang2021 <96218837+xwjiang2021@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:18:12 +0800 Subject: [PATCH 122/139] Install the allure-pytest package globally in sonic-mgmt docker (#10216) Why I did it This fix is to address issue: Azure/sonic-mgmt#5280 In the sonic-mgmt Dockerfile, python package allure-pytest is installed after ENV USER $user. Consequently the package is installed to path /home/$user/.local and is only available to the $user account. If we use root account in sonic-mgmt docker container to run tests, any script importing the allure package will fail with ImportError. We need to install the allure-pytest package to global directory instead of user local directory. How I did it Update the sonic-mgmt Dockerfile to ensure that the allure-pytest package is installed to global directory How to verify it Build a new sonic-mgmt docker image based on the changes. Use sonic-mgmt docker container of the newly built image to run test scripts that depend on the allure-pytest package. No ImportError is raised. --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index e2054ae81ba..8349df8e439 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -21,7 +21,6 @@ RUN apt-get update && apt-get install -y build-essential \ python \ python-dev \ python-scapy \ - python-setuptools \ python-pip \ python3-pip \ python3-venv \ @@ -33,6 +32,7 @@ RUN apt-get update && apt-get install -y build-essential \ telnet \ vim +RUN pip install setuptools==44.1.1 RUN pip install cffi==1.10.0 \ contextlib2==0.6.0.post1 \ cryptography==3.3.2 \ @@ -74,6 +74,7 @@ RUN pip install cffi==1.10.0 \ virtualenv \ retry \ thrift==0.11.0 \ + allure-pytest==2.8.22 \ && git clone https://github.com/p4lang/scapy-vxlan.git \ && cd scapy-vxlan \ && python setup.py install \ @@ -182,10 +183,6 @@ RUN python3 -m venv env-python3 # the end until we figure that out. RUN pip install pycryptodome==3.9.8 -# Install allure-pytest library -RUN pip install --upgrade setuptools \ - && pip install allure-pytest==2.8.22 - # Activating a virtualenv. The virtualenv automatically works for RUN, ENV and CMD. ENV VIRTUAL_ENV=env-python3 ARG BACKUP_OF_PATH="$PATH" From 7178c668dd69c551fd58f5ebaf584f75ae765961 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:20:20 +0800 Subject: [PATCH 123/139] [Build]: Fix installing dpkg packages in parallel issue (#10175) Why I did it Fix the debian packages installing in parallel issue. Add apt hook command to support apt to print no version control info. --- src/sonic-build-hooks/hooks/apt | 5 ++ src/sonic-build-hooks/hooks/apt-get | 39 ++++------ .../scripts/buildinfo_base.sh | 74 +++++++++++++++++++ 3 files changed, 92 insertions(+), 26 deletions(-) create mode 100755 src/sonic-build-hooks/hooks/apt diff --git a/src/sonic-build-hooks/hooks/apt b/src/sonic-build-hooks/hooks/apt new file mode 100755 index 00000000000..f4b0f97287b --- /dev/null +++ b/src/sonic-build-hooks/hooks/apt @@ -0,0 +1,5 @@ +#!/bin/bash + +. /usr/local/share/buildinfo/scripts/buildinfo_base.sh + +APT_REAL_COMMAND=$(get_command apt) $(dirname "$0")/apt-get "$@" diff --git a/src/sonic-build-hooks/hooks/apt-get b/src/sonic-build-hooks/hooks/apt-get index 9ae50a11865..f1f789542b7 100755 --- a/src/sonic-build-hooks/hooks/apt-get +++ b/src/sonic-build-hooks/hooks/apt-get @@ -3,36 +3,23 @@ INSTALL= . /usr/local/share/buildinfo/scripts/buildinfo_base.sh -REAL_COMMAND=$(get_command apt-get) +REAL_COMMAND=$APT_REAL_COMMAND +[ -z "$REAL_COMMAND" ] && REAL_COMMAND=$(get_command apt-get) if [ -z "$REAL_COMMAND" ]; then echo "The command apt-get does not exist." 1>&2 exit 1 fi -VERSION_FILE="/usr/local/share/buildinfo/versions/versions-deb" -if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ]; then - for para in $@ - do - if [[ "$para" != -* ]]; then - continue - fi - if [ ! -z "$INSTALL" ]; then - if [[ "$para" == *=* ]]; then - continue - elif [[ "$para" == *=* ]]; then - continue - else - package=$para - if ! grep -q "^${package}=" $VERSION_FILE; then - echo "The version of the package ${package} is not specified." - exit 1 - fi - fi - elif [[ "$para" == "install" ]]; then - INSTALL=y - fi - done +INSTALL=$(check_apt_install) +COMMAND_INFO="Locked by command: $REAL_COMMAND $@" +if [ "$INSTALL" == y ]; then + check_apt_version + lock_result=$(acquire_apt_installation_lock "$COMMAND_INFO" ) + $REAL_COMMAND "$@" + command_result=$? + [ "$lock_result" == y ] && release_apt_installation_lock + exit $command_result +else + $REAL_COMMAND "$@" fi - -$REAL_COMMAND "$@" diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index d46ffec1833..22ab3da4e9a 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -12,6 +12,7 @@ VERSION_DEB_PREFERENCE=$BUILDINFO_PATH/versions/01-versions-deb WEB_VERSION_FILE=$VERSION_PATH/versions-web BUILD_WEB_VERSION_FILE=$BUILD_VERSION_PATH/versions-web REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/debian' +DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock . $BUILDINFO_PATH/config/buildinfo.config @@ -182,6 +183,79 @@ run_pip_command() return $result } +# Check if the command is to install the debian packages +# The apt/apt-get command format: apt/apt-get [options] {update|install} +check_apt_install() +{ + for para in "$@" + do + if [[ "$para" == -* ]]; then + continue + fi + + if [[ "$para" == "install" ]]; then + echo y + fi + + break + done +} + +# Print warning message if a debian package version not specified when debian version control enabled. +check_apt_version() +{ + VERSION_FILE="/usr/local/share/buildinfo/versions/versions-deb" + local install=$(check_apt_install "$@") + if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ] && [ "$install" == "y" ]; then + for para in "$@" + do + if [[ "$para" == -* ]]; then + continue + fi + + if [[ "$para" == *=* ]]; then + continue + else + package=$para + if ! grep -q "^${package}=" $VERSION_FILE; then + echo "Warning: the version of the package ${package} is not specified." 1>&2 + fi + fi + done + fi +} + +acquire_apt_installation_lock() +{ + local result=n + local wait_in_second=10 + local count=60 + local info="$1" + for ((i=1; i<=$count; i++)); do + if [ -f $DPKG_INSTALLTION_LOCK_FILE ]; then + local lock_info=$(cat $DPKG_INSTALLTION_LOCK_FILE || true) + echo "Waiting dpkg lock for $wait_in_second, $i/$count, info: $lock_info" 1>&2 + sleep $wait_in_second + else + # Create file in an atomic operation + if (set -o noclobber; echo "$info">$DPKG_INSTALLTION_LOCK_FILE) &>/dev/null; then + result=y + break + else + echo "Failed to creat lock, Waiting dpkg lock for $wait_in_second, $i/$count, info: $lock_info" 1>&2 + sleep $wait_in_second + fi + fi + done + + echo $result +} + +release_apt_installation_lock() +{ + rm -f $DPKG_INSTALLTION_LOCK_FILE +} + ENABLE_VERSION_CONTROL_DEB=$(check_version_control "deb") ENABLE_VERSION_CONTROL_PY2=$(check_version_control "py2") ENABLE_VERSION_CONTROL_PY3=$(check_version_control "py3") From eea3cc7ad167d2f53bee0a1e5d301f62802cbd12 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:41:37 +0800 Subject: [PATCH 124/139] [Build]: only install grpc in amd64 (#10212) [Build]: only install grpc in amd64 Unblock marvell-armhf build. --- files/build_templates/sonic_debian_extension.j2 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 991b838a6d2..6cafa76014d 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -131,8 +131,10 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install psutil sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install ipaddr # Install Python module for grpcio and grpcio-toole -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.39.0" -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.39.0" +if [[ $CONFIGURED_ARCH == amd64 ]]; then + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio==1.39.0" + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "grpcio-tools==1.39.0" +fi # Install SwSS SDK Python 3 package # Note: the scripts will be overwritten by corresponding Python 2 package From 3fa627f290bf1d04a11aa13118bbbff57058bea3 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Mon, 14 Mar 2022 18:09:20 +0800 Subject: [PATCH 125/139] Add a config variable to override default container registry instead of dockerhub. (#10166) * Add variable to reset default docker registry * fix bug in docker version control --- Makefile.work | 9 +++++++-- dockers/docker-base-bullseye/Dockerfile.j2 | 7 ++++--- dockers/docker-base-buster/Dockerfile.j2 | 7 ++++--- dockers/docker-base-stretch/Dockerfile.j2 | 7 ++++--- dockers/docker-base/Dockerfile.j2 | 7 ++++--- dockers/docker-ptf/Dockerfile.j2 | 7 ++++--- dockers/docker-sonic-mgmt/Dockerfile.j2 | 3 ++- rules/config | 3 +++ scripts/docker_version_control.sh | 6 ++++-- slave.mk | 3 +++ sonic-slave-bullseye/Dockerfile.j2 | 11 ++++++----- sonic-slave-buster/Dockerfile.j2 | 9 +++++---- sonic-slave-jessie/Dockerfile.j2 | 7 ++++--- sonic-slave-stretch/Dockerfile.j2 | 7 ++++--- 14 files changed, 58 insertions(+), 35 deletions(-) diff --git a/Makefile.work b/Makefile.work index 39879110d4e..8042de7d198 100644 --- a/Makefile.work +++ b/Makefile.work @@ -115,6 +115,10 @@ rules/config.user: include rules/config -include rules/config.user +ifneq ($(DEFAULT_CONTAINER_REGISTRY),) +override DEFAULT_CONTAINER_REGISTRY := $(DEFAULT_CONTAINER_REGISTRY)/ +endif + ifeq ($(ENABLE_DOCKER_BASE_PULL),) override ENABLE_DOCKER_BASE_PULL = n endif @@ -139,9 +143,9 @@ $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ scripts/generate_buildinfo_config.sh) # Generate the slave Dockerfile, and prepare build info for it -$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) +$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user) -$(shell BUILD_SLAVE=y scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) +$(shell BUILD_SLAVE=y DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) # Add the versions in the tag, if the version change, need to rebuild the slave SLAVE_BASE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* src/sonic-build-hooks/hooks/* | sha1sum | awk '{print substr($$1,0,11);}') @@ -291,6 +295,7 @@ SONIC_BUILD_INSTRUCTION := make \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ + SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \ SLAVE_DIR=$(SLAVE_DIR) \ ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \ diff --git a/dockers/docker-base-bullseye/Dockerfile.j2 b/dockers/docker-base-bullseye/Dockerfile.j2 index 3ac14a4841c..1b33003ce0a 100644 --- a/dockers/docker-base-bullseye/Dockerfile.j2 +++ b/dockers/docker-base-bullseye/Dockerfile.j2 @@ -1,10 +1,11 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-bullseye +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-bullseye +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:bullseye +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:bullseye {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index ac3fd7743e7..e16a0f677b0 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -1,10 +1,11 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-buster +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-buster +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:buster +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:buster {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index b77814bb282..5603dc50279 100644 --- a/dockers/docker-base-stretch/Dockerfile.j2 +++ b/dockers/docker-base-stretch/Dockerfile.j2 @@ -1,10 +1,11 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:stretch +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:stretch {% endif %} # Clean documentation in FROM image diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index 616a4cde7af..15df3fe8a75 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie {% else %} -FROM {{DOCKER_BASE_ARCH}}/debian:jessie +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:jessie {% endif %} ## Remove retired jessie-updates repo diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index b152e94e99b..d999d01e002 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM debian:buster +FROM {{ prefix }}debian:buster {% endif %} MAINTAINER Pavel Shirshov diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 8349df8e439..df26f2ccf38 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -1,4 +1,5 @@ -FROM ubuntu:18.04 +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +FROM {{ prefix }}ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive diff --git a/rules/config b/rules/config index c7ffbcaa451..fe5d7ac3e99 100644 --- a/rules/config +++ b/rules/config @@ -211,3 +211,6 @@ INCLUDE_MUX = y # ENABLE_ASAN - enable address sanitizer ENABLE_ASAN ?= n + +# reset default container registry from dockerhub to other +DEFAULT_CONTAINER_REGISTRY ?= diff --git a/scripts/docker_version_control.sh b/scripts/docker_version_control.sh index 595477c859c..da8cd0484f4 100755 --- a/scripts/docker_version_control.sh +++ b/scripts/docker_version_control.sh @@ -16,6 +16,8 @@ mkdir -p target/versions/default . src/sonic-build-hooks/buildinfo/config/buildinfo.config image_tag=`grep "^FROM " $DOCKERFILE | awk '{print$2}'` +image_tag_noprefix=$image_tag +[ -n "$DEFAULT_CONTAINER_REGISTRY" ] && image_tag_noprefix=$(echo $image_tag | sed "s#$DEFAULT_CONTAINER_REGISTRY##") image=`echo $image_tag | cut -f1 -d:` tag=`echo $image_tag | cut -f2 -d:` @@ -25,7 +27,7 @@ if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION exit 0 fi if [ -f $version_file ];then - hash_value=`grep "${ARCH}:${image_tag}" $version_file | awk -F== '{print$2}'` + hash_value=`grep "${ARCH}:${image_tag_noprefix}" $version_file | awk -F== '{print$2}'` fi if [ -z $hash_value ];then hash_value=unknown @@ -43,5 +45,5 @@ else fi fi if [[ "$hash_value" != "unknown" ]];then - echo -e "${ARCH}:${image_tag}==$hash_value" >> $new_version_file + echo -e "${ARCH}:${image_tag_noprefix}==$hash_value" >> $new_version_file fi diff --git a/slave.mk b/slave.mk index 66831571aa7..0bd81ff371a 100644 --- a/slave.mk +++ b/slave.mk @@ -130,6 +130,8 @@ include $(RULES_PATH)/config export PACKAGE_URL_PREFIX export TRUSTED_GPG_URLS export SONIC_VERSION_CONTROL_COMPONENTS +DEFAULT_CONTAINER_REGISTRY := $(SONIC_DEFAULT_CONTAINER_REGISTRY) +export DEFAULT_CONTAINER_REGISTRY ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y) ENABLE_PFCWD_ON_START = y @@ -326,6 +328,7 @@ $(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)") $(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") $(info "SONIC_VERSION_CONTROL_COMPONENTS": "$(SONIC_VERSION_CONTROL_COMPONENTS)") $(info "ENABLE_ASAN" : "$(ENABLE_ASAN)") +$(info "DEFAULT_CONTAINER_REGISTRY" : "$(SONIC_DEFAULT_CONTAINER_REGISTRY)") ifeq ($(CONFIGURED_PLATFORM),vs) $(info "BUILD_MULTIASIC_KVM" : "$(BUILD_MULTIASIC_KVM)") endif diff --git a/sonic-slave-bullseye/Dockerfile.j2 b/sonic-slave-bullseye/Dockerfile.j2 index dc6ba779e26..a75cef0b680 100644 --- a/sonic-slave-bullseye/Dockerfile.j2 +++ b/sonic-slave-bullseye/Dockerfile.j2 @@ -1,13 +1,14 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu -FROM multiarch/debian-debootstrap:armhf-bullseye +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-bullseye COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu -FROM multiarch/debian-debootstrap:arm64-bullseye +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-aarch64-6.1.0-8 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-bullseye COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin {%- else -%} -FROM debian:bullseye +FROM {{ prefix }}debian:bullseye {%- endif %} MAINTAINER gulv@microsoft.com diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 715ad8e1905..fa8ac44f1b9 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -1,11 +1,12 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/qemu-user-static:x86_64-arm-5.0.0-2 as qemu -FROM multiarch/debian-debootstrap:armhf-buster +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-5.0.0-2 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-buster +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {%- else -%} -FROM debian:buster +FROM {{ prefix }}debian:buster {%- endif %} MAINTAINER gulv@microsoft.com diff --git a/sonic-slave-jessie/Dockerfile.j2 b/sonic-slave-jessie/Dockerfile.j2 index 2eaa306cdce..1d98e6d9b6c 100644 --- a/sonic-slave-jessie/Dockerfile.j2 +++ b/sonic-slave-jessie/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" -%} -FROM multiarch/debian-debootstrap:armhf-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie {%- elif CONFIGURED_ARCH == "arm64" -%} -FROM multiarch/debian-debootstrap:arm64-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie {%- else -%} -FROM debian:jessie +FROM {{ prefix }}debian:jessie {%- endif %} MAINTAINER johnar@microsoft.com diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index d9528f67d02..ad13ed0c124 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:armhf-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch {%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} -FROM multiarch/debian-debootstrap:arm64-stretch +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {%- else -%} -FROM debian:stretch +FROM {{ prefix }}debian:stretch {%- endif %} MAINTAINER gulv@microsoft.com From 2919b4820f95bd49ceb579986f5c58b4e3532c6e Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:45:27 +0200 Subject: [PATCH 126/139] [hostcfgd] record feature state in STATE DB (#9842) - Why I did it To implement blocking feature state change. - How I did it Record the actual feature state in STATE DB from hostcfg. - How to verify it UT + verification by running on the switch and checking STATE DB. Signed-off-by: Stepan Blyschak --- files/image_config/monit/container_checker | 13 +++---- src/sonic-host-services/scripts/hostcfgd | 39 ++++++++++++++----- .../tests/hostcfgd/hostcfgd_radius_test.py | 1 + .../tests/hostcfgd/hostcfgd_tacacs_test.py | 3 +- .../tests/hostcfgd/hostcfgd_test.py | 24 ++++++++++-- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker index 197e4f04a49..a67a96a0c18 100755 --- a/files/image_config/monit/container_checker +++ b/files/image_config/monit/container_checker @@ -32,7 +32,7 @@ def get_expected_running_containers(): value of field 'has_global_scope', the number of ASICs and the value of field 'has_per_asic_scope'. If the device has single ASIC, the container name was put into the list. - @return: A set which contains the expected running containers and a set that has + @return: A set which contains the expected running containers and a set that has containers marked as "always_enabled". """ config_db = swsssdk.ConfigDBConnector() @@ -82,7 +82,7 @@ def get_current_running_from_DB(always_running_containers): state_db = swsscommon.DBConnector("STATE_DB", 0) tbl = swsscommon.Table(state_db, "FEATURE") if not tbl.getKeys(): - return False, None + return running_containers for name in tbl.getKeys(): data = dict(tbl.get(name)[1]) @@ -101,7 +101,7 @@ def get_current_running_from_DB(always_running_containers): print("Failed to get container '{}'. Error: '{}'".format(name, err)) pass - return True, running_containers + return running_containers def get_current_running_from_dockers(): @@ -128,13 +128,12 @@ def get_current_running_containers(always_running_containers): """ @summary: This function will get the list of currently running containers. If available in STATE-DB, get from DB else from list of dockers. - + @return: A set of currently running containers. """ - ret, current_running_containers = get_current_running_from_DB(always_running_containers) - if not ret: - current_running_containers = get_current_running_from_dockers() + current_running_containers = get_current_running_from_DB(always_running_containers) + current_running_containers.update(get_current_running_from_dockers()) return current_running_containers diff --git a/src/sonic-host-services/scripts/hostcfgd b/src/sonic-host-services/scripts/hostcfgd index 9b39fb5eb80..be8317259e3 100755 --- a/src/sonic-host-services/scripts/hostcfgd +++ b/src/sonic-host-services/scripts/hostcfgd @@ -12,7 +12,7 @@ import signal import jinja2 from sonic_py_common import device_info from swsscommon.swsscommon import SubscriberStateTable, DBConnector, Select -from swsscommon.swsscommon import ConfigDBConnector, TableConsumable +from swsscommon.swsscommon import ConfigDBConnector, TableConsumable, Table # FILE PAM_AUTH_CONF = "/etc/pam.d/common-auth-sonic" @@ -41,6 +41,7 @@ RADIUS_PAM_AUTH_CONF_DIR = "/etc/pam_radius_auth.d/" # MISC Constants CFG_DB = "CONFIG_DB" +STATE_DB = "STATE_DB" HOSTCFGD_MAX_PRI = 10 # Used to enforce ordering b/w daemons under Hostcfgd DEFAULT_SELECT_TIMEOUT = 1000 @@ -166,16 +167,23 @@ class FeatureHandler(object): SYSTEMD_SYSTEM_DIR = '/etc/systemd/system/' SYSTEMD_SERVICE_CONF_DIR = os.path.join(SYSTEMD_SYSTEM_DIR, '{}.service.d/') - def __init__(self, config_db, device_config): + # Feature state constants + FEATURE_STATE_ENABLED = "enabled" + FEATURE_STATE_DISABLED = "disabled" + FEATURE_STATE_FAILED = "failed" + + def __init__(self, config_db, feature_state_table, device_config): self._config_db = config_db + self._feature_state_table = feature_state_table self._device_config = device_config self._cached_config = {} self.is_multi_npu = device_info.is_multi_npu() def handle(self, feature_name, op, feature_cfg): if not feature_cfg: - self._cached_config.pop(feature_name) syslog.syslog(syslog.LOG_INFO, "Deregistering feature {}".format(feature_name)) + self._cached_config.pop(feature_name) + self._feature_state_table._del(feature_name) return feature = Feature(feature_name, feature_cfg, self._device_config) @@ -253,7 +261,6 @@ class FeatureHandler(object): return True def update_feature_auto_restart(self, feature, feature_name): - dir_name = self.SYSTEMD_SERVICE_CONF_DIR.format(feature_name) auto_restart_conf = os.path.join(dir_name, 'auto_restart.conf') @@ -341,8 +348,11 @@ class FeatureHandler(object): except Exception as err: syslog.syslog(syslog.LOG_ERR, "Feature '{}.{}' failed to be enabled and started" .format(feature.name, feature_suffixes[-1])) + self.set_feature_state(feature, self.FEATURE_STATE_FAILED) return + self.set_feature_state(feature, self.FEATURE_STATE_ENABLED) + def disable_feature(self, feature): cmds = [] feature_names, feature_suffixes = self.get_feature_attribute(feature) @@ -363,11 +373,17 @@ class FeatureHandler(object): except Exception as err: syslog.syslog(syslog.LOG_ERR, "Feature '{}.{}' failed to be stopped and disabled" .format(feature.name, feature_suffixes[-1])) + self.set_feature_state(feature, self.FEATURE_STATE_FAILED) return + self.set_feature_state(feature, self.FEATURE_STATE_DISABLED) + def resync_feature_state(self, feature): self._config_db.mod_entry('FEATURE', feature.name, {'state': feature.state}) + def set_feature_state(self, feature, state): + self._feature_state_table.set(feature.name, [('state', state)]) + class Iptables(object): def __init__(self): @@ -914,14 +930,14 @@ class NtpCfg(object): new_src = data.get('src_intf', '') new_src_set = set(new_src.split(";")) new_vrf = data.get('vrf', '') - + # Update the Local Cache self.ntp_global = data # check if ntp server configured, if not, do nothing if not self.ntp_servers: syslog.syslog(syslog.LOG_INFO, "No ntp server when global config change, do nothing") - return + return if orig_src_set != new_src_set: syslog.syslog(syslog.LOG_INFO, "ntp global update for source intf old {} new {}, restarting ntp-config" @@ -957,6 +973,7 @@ class HostConfigDaemon: self.config_db = ConfigDBConnector() self.config_db.connect(wait_for_init=True, retry_on=True) self.dbconn = DBConnector(CFG_DB, 0) + self.state_db_conn = DBConnector(STATE_DB, 0) self.selector = Select() syslog.syslog(syslog.LOG_INFO, 'ConfigDB connect success') @@ -964,6 +981,8 @@ class HostConfigDaemon: self.callbacks = dict() self.subscriber_map = dict() + feature_state_table = Table(self.state_db_conn, 'FEATURE') + # Load DEVICE metadata configurations self.device_config = {} self.device_config['DEVICE_METADATA'] = self.config_db.get_table('DEVICE_METADATA') @@ -976,7 +995,7 @@ class HostConfigDaemon: self.iptables = Iptables() # Intialize Feature Handler - self.feature_handler = FeatureHandler(self.config_db, self.device_config) + self.feature_handler = FeatureHandler(self.config_db, feature_state_table, self.device_config) self.feature_handler.sync_state_field() # Initialize Ntp Config Handler @@ -987,7 +1006,7 @@ class HostConfigDaemon: # Initialize AAACfg self.hostname_cache="" self.aaacfg = AaaCfg() - + def load(self): aaa = self.config_db.get_table('AAA') @@ -1004,7 +1023,7 @@ class HostConfigDaemon: self.hostname_cache = dev_meta['localhost']['hostname'] except Exception as e: pass - + # Update AAA with the hostname self.aaacfg.hostname_update(self.hostname_cache) @@ -1130,7 +1149,7 @@ class HostConfigDaemon: self.subscribe('VLAN_SUB_INTERFACE', lambda table, key, op, data: self.vlan_sub_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) self.subscribe('PORTCHANNEL_INTERFACE', lambda table, key, op, data: self.portchannel_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) self.subscribe('INTERFACE', lambda table, key, op, data: self.phy_intf_handler(key, op, data), HOSTCFGD_MAX_PRI-5) - + syslog.syslog(syslog.LOG_INFO, "Waiting for systemctl to finish initialization") self.wait_till_system_init_done() diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py index 4e3d1864810..9738f16852e 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_radius_test.py @@ -36,6 +36,7 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgdRADIUS(TestCase): diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py index 3cc3504d606..18bf5c17e6c 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_tacacs_test.py @@ -35,6 +35,7 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgdTACACS(TestCase): """ @@ -44,7 +45,7 @@ def run_diff(self, file1, file2): return subprocess.check_output('diff -uR {} {} || true'.format(file1, file2), shell=True) """ - Check different config + Check different config """ def check_config(self, test_name, test_data, config_name): t_path = templates_path diff --git a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py index bbce866e233..db9a35075a0 100644 --- a/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py +++ b/src/sonic-host-services/tests/hostcfgd/hostcfgd_test.py @@ -27,20 +27,23 @@ hostcfgd.SubscriberStateTable = MockSubscriberStateTable hostcfgd.Select = MockSelect hostcfgd.DBConnector = MockDBConnector +hostcfgd.Table = mock.Mock() class TestHostcfgd(TestCase): """ Test hostcfd daemon - feature """ - def __verify_table(self, table, expected_table): + def __verify_table(self, table, feature_state_table, expected_table): """ verify config db tables - Compares Config DB table (FEATURE) with expected output table + Compares Config DB table (FEATURE) with expected output table. + Verifies that State DB table (FEATURE) is updated. Args: table(dict): Current Config Db table + feature_state_table(Mock): Mocked State DB FEATURE table expected_table(dict): Expected Config Db table Returns: @@ -48,6 +51,19 @@ def __verify_table(self, table, expected_table): """ ddiff = DeepDiff(table, expected_table, ignore_order=True) print('DIFF:', ddiff) + + def get_state(cfg_state): + """ Translates CONFIG DB state field into STATE DB state field """ + if cfg_state == 'always_disabled': + return 'disabled' + elif cfg_state == 'always_enabled': + return 'enabled' + else: + return cfg_state + + feature_state_table.set.assert_has_calls([ + mock.call(feature, [('state', get_state(table[feature]['state']))]) for feature in table + ]) return True if not ddiff else False def __verify_fs(self, table): @@ -93,6 +109,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): fs.add_real_paths(swsscommon_package.__path__) # add real path of swsscommon for database_config.json fs.create_dir(hostcfgd.FeatureHandler.SYSTEMD_SYSTEM_DIR) MockConfigDb.set_config_db(test_data['config_db']) + feature_state_table_mock = mock.Mock() with mock.patch('hostcfgd.subprocess') as mocked_subprocess: popen_mock = mock.Mock() attrs = test_data['popen_attributes'] @@ -102,7 +119,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): # Initialize Feature Handler device_config = {} device_config['DEVICE_METADATA'] = MockConfigDb.CONFIG_DB['DEVICE_METADATA'] - feature_handler = hostcfgd.FeatureHandler(MockConfigDb(), device_config) + feature_handler = hostcfgd.FeatureHandler(MockConfigDb(), feature_state_table_mock, device_config) # sync the state field and Handle Feature Updates feature_handler.sync_state_field() @@ -113,6 +130,7 @@ def test_hostcfgd_feature_handler(self, test_name, test_data, fs): # Verify if the updates are properly updated assert self.__verify_table( MockConfigDb.get_config_db()['FEATURE'], + feature_state_table_mock, test_data['expected_config_db']['FEATURE'] ), 'Test failed for test data: {0}'.format(test_data) mocked_subprocess.check_call.assert_has_calls(test_data['expected_subprocess_calls'], any_order=True) From 330eb8dda9e4ce276e50e9d3d3fcf8cb90d89fb0 Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:24:26 -0700 Subject: [PATCH 127/139] update submodule sonic-py-swsssdk (#10220) --- src/sonic-py-swsssdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-py-swsssdk b/src/sonic-py-swsssdk index 7cd7e0c1580..24366480c21 160000 --- a/src/sonic-py-swsssdk +++ b/src/sonic-py-swsssdk @@ -1 +1 @@ -Subproject commit 7cd7e0c1580d15c341160c68b73fd7d948e9fd24 +Subproject commit 24366480c213893388766a3b0dd3c492b9c04b8f From d7c3ce00454682cc9c5b6b7a5d56dd82384f4536 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Mon, 14 Mar 2022 11:34:02 -0700 Subject: [PATCH 128/139] Specify the filesystem type when mounting to /host (#10169) When mounting the partition that contains `/host` during initramfs, the mount binary available there (coming from busybox) tries each filesystem in `/proc/filesystems` and sees which one succeeds. During this time, there may be some error messages logged into dmesg because some of the incorrect filesystems failed to mount the partition. Specify the filesystem type explicitly so that initramfs knows it's that type, and we know what filesystem will always get used there. Fixes #9998 Signed-off-by: Saikrishna Arcot --- files/initramfs-tools/union-mount.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/initramfs-tools/union-mount.j2 b/files/initramfs-tools/union-mount.j2 index c680e69300d..7a64f71d70b 100644 --- a/files/initramfs-tools/union-mount.j2 +++ b/files/initramfs-tools/union-mount.j2 @@ -132,7 +132,7 @@ case "${ROOT}" in ;; *) ## Mount the raw partition again - mount ${ROOT} ${rootmnt}/host + mount -t ext4 ${ROOT} ${rootmnt}/host ;; esac From 0243ed95387792635edcde3800633f610df35204 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Tue, 15 Mar 2022 10:03:54 +0800 Subject: [PATCH 129/139] [build]: Fix marvell-armhf build hung issue (#10156) (#10229) Why I did it The marvel-armhf build is hung, it does not exit after waiting for a long time. It is caused by the process /etc/entropy.py which is started by the postinst script in target/debs/buster/sonic-platform-nokia-7215_1.0_armhf.deb --- files/build_templates/sonic_debian_extension.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 6cafa76014d..455179c0802 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -652,6 +652,11 @@ fi {% if installer_images.strip() -%} ## ensure proc is mounted sudo mount proc /proc -t proc || true +if [[ $CONFIGURED_ARCH == armhf ]]; then + # A workaround to fix the armhf build hung issue, caused by sonic-platform-nokia-7215_1.0_armhf.deb post installation script + ps -eo pid,cmd | grep python | grep "/etc/entropy.py" | awk '{print $1}' | xargs sudo kill -9 2>/dev/null || true +fi + sudo mkdir $FILESYSTEM_ROOT/target sudo mount --bind target $FILESYSTEM_ROOT/target sudo LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker info From 286ff289f56835117e8890014e41f5cc16f27e4d Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Tue, 15 Mar 2022 14:47:36 +0800 Subject: [PATCH 130/139] [sonic-config-engine] Add failure details in sonic-config-engine unit test. (#10210) --- src/sonic-config-engine/tests/test_j2files.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index eb002720d98..b922ae45dbc 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -1,4 +1,3 @@ -import filecmp import json import os import shutil @@ -110,7 +109,7 @@ def test_ipinip(self): self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ipinip.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_l2switch_template(self): argument = '-k Mellanox-SN2700 --preset l2 -p ' + self.t0_port_config @@ -211,7 +210,7 @@ def test_qos_arista7050_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self): arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', 'x86_64-arista_7800r3_48cq2_lc', 'Arista-7800R3-48CQ2-C48') @@ -235,7 +234,7 @@ def test_qos_and_buffer_arista7800r3_48cq2_lc_render_template(self): os.remove(cfg_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, sample_output_file) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_qos_dell9332_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32') @@ -254,7 +253,7 @@ def test_qos_dell9332_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell9332.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_qos_dell6100_render_template(self): dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') @@ -273,7 +272,7 @@ def test_qos_dell6100_render_template(self): os.remove(qos_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell6100.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected): dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) @@ -293,7 +292,7 @@ def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer os.remove(buffers_config_file_new) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_buffers_dell6100_render_template(self): self._test_buffers_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'buffers.json.j2', 'buffers-dell6100.json') @@ -313,7 +312,7 @@ def test_ipinip_multi_asic(self): print(argument) self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_swss_switch_render_template(self): switch_template = os.path.join( @@ -342,7 +341,7 @@ def test_swss_switch_render_template(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) def test_swss_switch_render_template_multi_asic(self): # verify the ECMP hash seed changes per namespace @@ -374,7 +373,7 @@ def test_swss_switch_render_template_multi_asic(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert utils.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) os.environ["NAMESPACE_ID"] = "" def test_ndppd_conf(self): From 18d00dfbe70d1dba75e2c534585879944b4e9230 Mon Sep 17 00:00:00 2001 From: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com> Date: Tue, 15 Mar 2022 09:20:36 +0200 Subject: [PATCH 131/139] [teamd.sh] kill teamd docker on warm shutdown for faster shutdown (#10219) This can save 6 sec for teamd LAG restoration - the time between: ``` Mar 9 13:51:10.467757 r-panther-13 WARNING teamd#teamd_PortChannel1[28]: Got SIGUSR1. Mar 9 13:52:33.310707 r-panther-13 INFO teamd#teamd_PortChannel1[27]: carrier changed to UP ``` - Why I did it Optimize warm boot. Specifically reduce the time needed for LAG restoration. - How I did it Kill teamd docker after graceful shutdown of teamd processes. - How to verify it Run warm reboot. Signed-off-by: Stepan Blyschak --- files/scripts/teamd.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/scripts/teamd.sh b/files/scripts/teamd.sh index 57b70913e91..4de3f25c4db 100755 --- a/files/scripts/teamd.sh +++ b/files/scripts/teamd.sh @@ -93,13 +93,17 @@ stop() { # We call `docker kill teamd` to ensure the container stops as quickly as possible, # Note: teamd must be killed before syncd, because it will send the last packet through CPU port docker exec -i ${SERVICE}$DEV pkill -USR2 -f ${TEAMD_CMD} || [ $? == 1 ] + fi + + if [[ x"$WARM_BOOT" == x"true" ]] || [[ x"$FAST_BOOT" == x"true" ]]; then while docker exec -i ${SERVICE}$DEV pgrep -f ${TEAMD_CMD} > /dev/null; do sleep 0.05 done docker kill ${SERVICE}$DEV &> /dev/null || debug "Docker ${SERVICE}$DEV is not running ($?) ..." + else + /usr/bin/${SERVICE}.sh stop $DEV fi - /usr/bin/${SERVICE}.sh stop $DEV debug "Stopped ${SERVICE}$DEV service..." } From d08add5523096bd40a880724dded9fe2d0e923ed Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Tue, 15 Mar 2022 21:40:55 +0800 Subject: [PATCH 132/139] [submodule] Update sonic-swss submodule pointer (#10209) Update sonic-swss with the following changes: 29d5d8da Use abort instead of exit in case calling SAI API failure (#2170) 12f980c8 Fix issue config qos reload causing orchagent aborted via tracking dependencies among QoS tables (#2116) 6e5ed1c0 [chassis][syncd][sai] Adjusting response timeout during syncd init (#2159) 0a99f546 Try get port operational speed from STATE DB (#2119) 828cccfe [crm] Use sai_object_type_get_availability() API to get counters (#2098) 18c73a19 Allow IPv4 link-local nexthops (#1903) Signed-off-by: Stephen Sun --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 7d2942f7ef4..00266891a9f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 7d2942f7ef4ac01209582c02d142bd131208b2a4 +Subproject commit 00266891a9f41e5bd37100b05237e865cde429b2 From 5a531f4eb24edf0caca47edcf0d5a2c73e0e63d4 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:21:50 -0400 Subject: [PATCH 133/139] [Nokia][VoQ] The role of the Inband port should be "Inb" and recycle port (#9950) Signed-off-by: mlok --- .../Nokia-IXR7250E-36x400G/0/port_config.ini | 3 ++- .../Nokia-IXR7250E-36x400G/1/port_config.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini index 8d017026081..3633842330f 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/0/port_config.ini @@ -17,4 +17,5 @@ Ethernet14 24,25,26,27,28,29,30,31 Ethernet14 15 Eth14 Ethernet15 16,17,18,19,20,21,22,23 Ethernet15 16 Eth15-ASIC0 Ext 400000 0 16 8 Ethernet16 8,9,10,11,12,13,14,15 Ethernet16 17 Eth16-ASIC0 Ext 400000 0 17 8 Ethernet17 0,1,2,3,4,5,6,7 Ethernet17 18 Eth17-ASIC0 Ext 400000 0 18 8 -Ethernet-IB0 115 Ethernet-IB0 37 Rcy-ASIC0 Int 10000 0 19 8 +Ethernet-IB0 115 Ethernet-IB0 37 Rcy1-ASIC0 Inb 10000 0 19 8 +Ethernet-Rec0 116 Ethernet-Rec0 39 Rcy2-ASIC0 Rec 10000 1 20 8 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini index 76fd968fec2..90376150d65 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x400G/1/port_config.ini @@ -17,4 +17,5 @@ Ethernet32 24,25,26,27,28,29,30,31 Ethernet32 33 Eth14 Ethernet33 16,17,18,19,20,21,22,23 Ethernet33 34 Eth15-ASIC1 Ext 400000 0 16 8 Ethernet34 8,9,10,11,12,13,14,15 Ethernet34 35 Eth16-ASIC1 Ext 400000 0 17 8 Ethernet35 0,1,2,3,4,5,6,7 Ethernet35 36 Eth17-ASIC1 Ext 400000 0 18 8 -Ethernet-IB1 115 Ethernet-IB1 38 Rcy-ASIC1 Int 10000 0 19 8 +Ethernet-IB1 115 Ethernet-IB1 38 Rcy1-ASIC1 Inb 10000 0 19 8 +Ethernet-Rec1 116 Ethernet-Rec1 40 Rcy2-ASIC1 Rec 10000 1 20 8 From 28f6a51d26af0a744ab5194bd8a8101953ce1304 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 15 Mar 2022 10:26:36 -0700 Subject: [PATCH 134/139] [doc] Moving Configuration.md from swss to sonic-yang-models folder (#10078) #### Why I did it Moved Configuration.md from swss to yang folder. The configuration schema should be present along with yang models and when users add yang model they could update configuration document as well. --- src/sonic-yang-models/doc/Configuration.md | 1540 ++++++++++++++++++++ 1 file changed, 1540 insertions(+) create mode 100644 src/sonic-yang-models/doc/Configuration.md diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md new file mode 100644 index 00000000000..b5890681ce4 --- /dev/null +++ b/src/sonic-yang-models/doc/Configuration.md @@ -0,0 +1,1540 @@ +# SONiC Configuration Database Manual + +Table of Contents +================= + + * [Introduction](#introduction) + * [Configuration](#configuration) + * [Config Load and Save](#config-load-and-save) + * [Incremental Configuration](#incremental-configuration) + * [Redis and Json Schema](#redis-and-json-schema) + * [ACL and Mirroring](#acl-and-mirroring) + * [BGP Sessions](#bgp-sessions) + * [BUFFER_PG](#buffer_pg) + * [Buffer pool](#buffer-pool) + * [Buffer profile](#buffer-profile) + * [Buffer queue](#buffer-queue) + * [Buffer port ingress profile list](#buffer-port-ingress-profile-list) + * [Buffer port egress profile list](#buffer-port-egress-profile-list) + * [Cable length](#cable-length) + * [COPP_TABLE](#copp_table) + * [CRM](#crm) + * [Data Plane L3 Interfaces](#data-plane-l3-interfaces) + * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) + * [Device Metadata](#device-metadata) + * [Device neighbor metada](#device-neighbor-metada) + * [DSCP_TO_TC_MAP](#dscp_to_tc_map) + * [FLEX_COUNTER_TABLE](#flex_counter_table) + * [L2 Neighbors](#l2-neighbors) + * [Loopback Interface](#loopback-interface) + * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) + * [Management Interface](#management-interface) + * [Management port](#management-port) + * [Management VRF](#management-vrf) + * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) + * [NTP Global Configuration](#ntp-global-configuration) + * [NTP and SYSLOG servers](#ntp-and-syslog-servers) + * [Policer](#policer) + * [Port](#port) + * [Port Channel](#port-channel) + * [Portchannel member](#portchannel-member) + * [Scheduler](#scheduler) + * [Port QoS Map](#port-qos-map) + * [Queue](#queue) + * [Tacplus Server](#tacplus-server) + * [TC to Priority group map](#tc-to-priority-group-map) + * [TC to Queue map](#tc-to-queue-map) + * [Versions](#versions) + * [VLAN](#vlan) + * [VLAN_MEMBER](#vlan_member) + * [Virtual router](#virtual-router) + * [WRED_PROFILE](#wred_profile) + * [For Developers](#for-developers) + * [Generating Application Config by Jinja2 Template](#generating-application-config-by-jinja2-template) + * [Incremental Configuration by Subscribing to ConfigDB](#incremental-configuration-by-subscribing-to-configdb) + + + +# Introduction +This document lists the configuration commands schema applied in the SONiC eco system. All these commands find relevance in collecting system information, analysis and even for trouble shooting. All the commands are categorized under relevant topics with corresponding examples. + +# Configuration + +SONiC is managing configuration in a single source of truth - a redisDB +instance that we refer as ConfigDB. Applications subscribe to ConfigDB +and generate their running configuration correspondingly. + +(Before Sep 2017, we were using an XML file named minigraph.xml to +configure SONiC devices. For historical documentation, please refer to +[Configuration with +Minigraph](https://github.com/Azure/SONiC/wiki/Configuration-with-Minigraph-(~Sep-2017))) + +# **Config Load and Save** + +In current version of SONiC, ConfigDB is implemented as database 4 of +local redis. When system boots, configurations will be loaded from +/etc/sonic/config_db.json file into redis. Please note that ConfigDB +content won't be written back into /etc/sonic/config_db.json file +automatically. In order to do that, a config save command need to be +manually executed from CLI. Similarly, config load will trigger a force +load of json file into DB. Generally, content in +/etc/sonic/config_db.json can be considered as starting config, and +content in redisDB running config. + +We keep a way to load configuration from minigraph and write into +ConfigDB for backward compatibility. To do that, run `config +load_minigraph`. + +### Incremental Configuration + +The design of ConfigDB supports incremental configuration - application +could subscribe to changes in ConfigDB and response correspondingly. +However, this feature is not implemented by all applications yet. By Sep +2017 now, the only application that supports incremental configuration +is BGP (docker-fpm-quagga). For other applications, a manual restart is +required after configuration changes in ConfigDB. + +# **Redis and Json Schema** + +ConfigDB uses a table-object schema that is similar with +[AppDB](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md), +and `config_db.json` is a straight-forward serialization of DB. As an +example, the following fragments could be BGP-related configuration in +redis and json, correspondingly: + + +***Redis format*** +``` +127.0.0.1:6379[4]> keys BGP_NEIGHBOR:* + +1) "BGP_NEIGHBOR:10.0.0.31" +2) "BGP_NEIGHBOR:10.0.0.39" +3) "BGP_NEIGHBOR:10.0.0.11" +4) "BGP_NEIGHBOR:10.0.0.7" + +... + +127.0.0.1:6379[4]> hgetall BGP_NEIGHBOR:10.0.0.3 + +1) "admin_status" +2) "up" +3) "peer_addr" +4) "10.0.0.2" +5) "asn" +6) "65200" +7) "name" +8) "ARISTA07T2" +``` + +***Json format*** +``` +"BGP_NEIGHBOR": { + "10.0.0.57": { + "rrclient": "0", + "name": "ARISTA01T1", + "local_addr": "10.0.0.56", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, + "10.0.0.59": { + "rrclient": "0", + "name": "ARISTA02T1", + "local_addr": "10.0.0.58", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + }, +} +``` + +Full sample config_db.json files are availables at +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db.json) +and +[here](https://github.com/Azure/SONiC/blob/gh-pages/doc/config_db_t0.json). + + +### ACL and Mirroring + +ACL and mirroring related configuration are defined in +**MIRROR_SESSION**, **ACL_TABLE** and **ACL_RULE** tables. Those +tables are in progress of migrating from APPDB. Please refer to their +schema in APPDB +[here](https://github.com/Azure/sonic-swss/blob/4c56d23b9ff4940bdf576cf7c9e5aa77adcbbdcc/doc/swss-schema.md) +and migration plan +[here](https://github.com/Azure/SONiC/wiki/ACL-Configuration-Requirement-Description). + +``` +{ +"MIRROR_SESSION": { + "everflow0": { + "src_ip": "10.1.0.32", + "dst_ip": "2.2.2.2" + } + }, + +"ACL_TABLE": { + "DATAACL": { + "policy_desc" : "data_acl", + "type": "l3", + "ports": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ] + } + } +} +``` + +***Below ACL table added as per the mail*** +``` +{ +"ACL_TABLE": { + "aaa": { + "type": "L3", + "ports": "Ethernet0" + } + }, +"ACL_RULE": { + "aaa|rule_0": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "0" + }, + "aaa|rule_1": { + "PRIORITY": "55", + "PACKET_ACTION": "DROP", + "L4_SRC_PORT": "1" + } + } +} +``` + +***Below ACL table added by comparig minigraph.xml & config_db.json*** + +``` +{ +"ACL_TABLE": { + "EVERFLOW": { + "type": "MIRROR", + "policy_desc": "EVERFLOW", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "EVERFLOWV6": { + "type": "MIRRORV6", + "policy_desc": "EVERFLOWV6", + "ports": [ + "PortChannel0001", + "PortChannel0002", + "PortChannel0003", + "PortChannel0004" + ] + }, + "SNMP_ACL": { + "services": [ + "SNMP" + ], + "type": "CTRLPLANE", + "policy_desc": "SNMP_ACL" + }, + "SSH_ONLY": { + "services": [ + "SSH" + ], + "type": "CTRLPLANE", + "policy_desc": "SSH_ONLY" + } + }, + +"ACL_RULE": { + "SNMP_ACL|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SNMP_ACL|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "1.1.1.1/32", + "IP_PROTOCOL": "17" + }, + "SNMP_ACL|RULE_2": { + "PRIORITY": "9998", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "2.2.2.2/32", + "IP_PROTOCOL": "17" + }, + "SSH_ONLY|DEFAULT_RULE": { + "PRIORITY": "1", + "PACKET_ACTION": "DROP", + "ETHER_TYPE": "2048" + }, + "SSH_ONLY|RULE_1": { + "PRIORITY": "9999", + "PACKET_ACTION": "ACCEPT", + "SRC_IP": "4.4.4.4/8", + "IP_PROTOCOL": "6" + } + } +} + +``` + +***ACL table type configuration example*** +``` +{ + "ACL_TABLE_TYPE": { + "CUSTOM_L3": { + "MATCHES": [ + "IN_PORTS", + "OUT_PORTS", + "SRC_IP" + ], + "ACTIONS": [ + "PACKET_ACTION", + "MIRROR_INGRESS_ACTION" + ], + "BIND_POINTS": [ + "PORT", + "LAG" + ] + } + }, + "ACL_TABLE": { + "DATAACL": { + "STAGE": "INGRESS", + "TYPE": "CUSTOM_L3", + "PORTS": [ + "Ethernet0", + "PortChannel1" + ] + } + }, + "ACL_RULE": { + "DATAACL|RULE0": { + "PRIORITY": "999", + "PACKET_ACTION": "DROP", + "SRC_IP": "1.1.1.1/32", + } + } +} +``` + +### BGP Sessions + +BGP session configuration is defined in **BGP_NEIGHBOR** table. BGP +neighbor address is used as key of bgp neighbor objects. Object +attributes include remote AS number, neighbor router name, and local +peering address. Dynamic neighbor is also supported by defining peer +group name and IP ranges in **BGP_PEER_RANGE** table. + +``` +{ +"BGP_NEIGHBOR": { + "10.0.0.61": { + "local_addr": "10.0.0.60", + "asn": 64015, + "name": "ARISTA15T0" + }, + "10.0.0.49": { + "local_addr": "10.0.0.48", + "asn": 64009, + "name": "ARISTA09T0" + }, + + "10.0.0.63": { + "rrclient": "0", + "name": "ARISTA04T1", + "local_addr": "10.0.0.62", + "nhopself": "0", + "holdtime": "10", + "asn": "64600", + "keepalive": "3" + } + +"BGP_PEER_RANGE": { + "BGPSLBPassive": { + "name": "BGPSLBPassive", + "ip_range": [ + "10.250.0.0/27" + ] + }, + "BGPVac": { + "name": "BGPVac", + "ip_range": [ + "10.2.0.0/16" + ] + } + } +} +``` + +### BUFFER_PG + +When the system is running in traditional buffer model, profiles needs to explicitly configured: + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet1|3-4": { + "profile": "pg_lossless_40000_5m_profile" + }, + "Ethernet2|3-4": { + "profile": "pg_lossless_40000_5m_profile" + } + } +} + +``` + +When the system is running in dynamic buffer model, profiles can be: + + - either calculated dynamically according to ports' configuration and just configured as "NULL"; + - or configured explicitly. + +``` +{ +"BUFFER_PG": { + "Ethernet0|3-4": { + "profile": "NULL" + }, + "Ethernet1|3-4": { + "profile": "NULL" + }, + "Ethernet2|3-4": { + "profile": "static_profile" + } + } +} + +``` + +### Buffer pool + +When the system is running in traditional buffer model, the size of all of the buffer pools and xoff of ingress_lossless_pool need to be configured explicitly. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + "size": "9243812" + }, + "ingress_lossless_pool": { + "xoff": "4194112", + "type": "ingress", + "mode": "dynamic", + "size": "10875072" + } + } +} + +``` + +When the system is running in dynamic buffer model, the size of some of the buffer pools can be omitted and will be dynamically calculated. + +``` +{ +"BUFFER_POOL": { + "egress_lossless_pool": { + "type": "egress", + "mode": "static", + "size": "15982720" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic", + }, + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic", + } + } +} + +``` + + +### Buffer profile + +``` +{ +"BUFFER_PROFILE": { + "egress_lossless_profile": { + "static_th": "3995680", + "pool": "egress_lossless_pool", + "size": "1518" + }, + "egress_lossy_profile": { + "dynamic_th": "3", + "pool": "egress_lossy_pool", + "size": "1518" + }, + "ingress_lossy_profile": { + "dynamic_th": "3", + "pool": "ingress_lossless_pool", + "size": "0" + }, + "pg_lossless_40000_5m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "66560", + "pool": "ingress_lossless_pool", + "size": "1248" + }, + "pg_lossless_40000_40m_profile": { + "xon_offset": "2288", + "dynamic_th": "-3", + "xon": "2288", + "xoff": "71552", + "pool": "ingress_lossless_pool", + "size": "1248" + } + } +} + +``` + +When the system is running in dynamic buffer model and the headroom_type is dynamic, only dynamic_th needs to be configured and rest of fields can be omitted. +This kind of profiles will be handled by buffer manager and won't be applied to SAI. + +``` +{ + { + "non_default_dynamic_th_profile": { + "dynamic_th": 1, + "headroom_type": "dynamic" + } + } +} +``` + +### Buffer queue + +``` +{ +"BUFFER_QUEUE": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|0-2": { + "profile": "egress_lossy_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|3-4": { + "profile": "egress_lossless_profile" + }, + "Ethernet50,Ethernet52,Ethernet54,Ethernet56|5-6": { + "profile": "egress_lossy_profile" + } + } +} + +``` + +### Buffer port ingress profile list + +``` +{ +"BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "ingress_lossy_profile,ingress_lossless_profile" + } + } +} + +``` + +### Buffer port egress profile list + +``` +{ +"BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet50": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet52": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + }, + "Ethernet56": { + "profile_list": "egress_lossy_profile,egress_lossless_profile" + } + } +} + +``` + +### Cable length + +``` +{ +"CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet9": "5m", + "Ethernet2": "5m", + "Ethernet58": "5m", + "Ethernet59": "5m", + "Ethernet50": "40m", + "Ethernet51": "5m", + "Ethernet52": "40m", + "Ethernet53": "5m", + "Ethernet54": "40m", + "Ethernet55": "5m", + "Ethernet56": "40m" + } + } +} + +``` + +### COPP_TABLE + +``` +{ +"COPP_TABLE": { + "default": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "0", + "red_action": "drop" + }, + + "trap.group.arp": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "4", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "arp_req,arp_resp,neigh_discovery", + "trap_priority": "4" + }, + + "trap.group.lldp.dhcp.udld": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "lldp,dhcp,udld", + "trap_priority": "4" + }, + + "trap.group.bgp.lacp": { + "queue": "4", + "trap_action": "trap", + "trap_ids": "bgp,bgpv6,lacp", + "trap_priority": "4" + }, + + "trap.group.ip2me": { + "cbs": "600", + "cir": "600", + "meter_type": "packets", + "mode": "sr_tcm", + "queue": "1", + "red_action": "drop", + "trap_action": "trap", + "trap_ids": "ip2me", + "trap_priority": "1" + } + } +} +``` + +### CRM + +``` +{ +"CRM": { + "Config": { + "acl_table_threshold_type": "percentage", + "nexthop_group_threshold_type": "percentage", + "fdb_entry_high_threshold": "85", + "acl_entry_threshold_type": "percentage", + "ipv6_neighbor_low_threshold": "70", + "nexthop_group_member_low_threshold": "70", + "acl_group_high_threshold": "85", + "ipv4_route_high_threshold": "85", + "acl_counter_high_threshold": "85", + "ipv4_route_low_threshold": "70", + "ipv4_route_threshold_type": "percentage", + "ipv4_neighbor_low_threshold": "70", + "acl_group_threshold_type": "percentage", + "ipv4_nexthop_high_threshold": "85", + "ipv6_route_threshold_type": "percentage", + "snat_entry_threshold_type": "percentage", + "snat_entry_high_threshold": "85", + "snat_entry_low_threshold": "70", + "dnat_entry_threshold_type": "percentage", + "dnat_entry_high_threshold": "85", + "dnat_entry_low_threshold": "70", + "ipmc_entry_threshold_type": "percentage", + "ipmc_entry_high_threshold": "85", + "ipmc_entry_low_threshold": "70" + } + } +} + +``` + +### Data Plane L3 Interfaces + +IP configuration for data plane are defined in **INTERFACE**, +**PORTCHANNEL_INTERFACE**, and **VLAN_INTERFACE** table. The objects +in all three tables have the interface (could be physical port, port +channel, or vlan) that IP address is attached to as first-level key, and +IP prefix as second-level key. IP interface objects don't have any +attributes. + +``` +{ +"INTERFACE": { + "Ethernet0|10.0.0.0/31": {}, + "Ethernet4|10.0.0.2/31": {}, + "Ethernet8|10.0.0.4/31": {} + ... + }, + +"PORTCHANNEL_INTERFACE": { + "PortChannel01|10.0.0.56/31": {}, + "PortChannel01|FC00::71/126": {}, + "PortChannel02|10.0.0.58/31": {}, + "PortChannel02|FC00::75/126": {} + ... + }, +"VLAN_INTERFACE": { + "Vlan1000|192.168.0.1/27": {} + } +} + +``` + + +### DEFAULT_LOSSLESS_BUFFER_PARAMETER + +This table stores the default lossless buffer parameters for dynamic buffer calculation. + +``` +{ + "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { + "AZURE": { + "default_dynamic_th": "0", + "over_subscribe_ratio": "2" + } + } +} +``` + +### Device Metadata + +The **DEVICE_METADATA** table contains only one object named +*localhost*. In this table the device metadata such as hostname, hwsku, +deployment envionment id and deployment type are specified. BGP local AS +number is also specified in this table as current only single BGP +instance is supported in SONiC. + +``` +{ +"DEVICE_METADATA": { + "localhost": { + "hwsku": "Force10-S6100", + "default_bgp_status": "up", + "docker_routing_config_mode": "unified", + "hostname": "sonic-s6100-01", + "platform": "x86_64-dell_s6100_c2538-r0", + "mac": "4c:76:25:f4:70:82", + "default_pfcwd_status": "disable", + "bgp_asn": "65100", + "deployment_id": "1", + "type": "ToRRouter", + "buffer_model": "traditional" + } + } +} + +``` + + +### Device neighbor metada + +``` +{ +"DEVICE_NEIGHBOR_METADATA": { + "ARISTA01T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.45", + "hwsku": "Arista-VM", + "type": "LeafRouter" + }, + "ARISTA02T1": { + "lo_addr": "None", + "mgmt_addr": "10.11.150.46", + "hwsku": "Arista-VM", + "type": "LeafRouter" + } + } +} + +``` + + +### DSCP_TO_TC_MAP +``` +{ +"DSCP_TO_TC_MAP": { + "AZURE": { + "1": "1", + "0": "1", + "3": "3", + "2": "1", + "5": "2", + "4": "4", + "7": "1", + "6": "1", + "9": "1", + "8": "0" + } + } +} + +``` + + +### MPLS_TC_TO_TC_MAP +``` +{ +"MPLS_TC_TO_TC_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "2", + "5": "3", + "6": "3", + "7": "4" + } + } +} + +``` + +### FLEX_COUNTER_TABLE + +``` +{ +"FLEX_COUNTER_TABLE": { + "PFCWD": { + "FLEX_COUNTER_STATUS": "enable" + }, + "PORT": { + "FLEX_COUNTER_STATUS": "enable" + }, + "QUEUE": { + "FLEX_COUNTER_STATUS": "enable" + } + } +} + +``` + + +### L2 Neighbors + +The L2 neighbor and connection information can be configured in +**DEVICE_NEIGHBOR** table. Those information are used mainly for LLDP. +While mandatory fields include neighbor name acting as object key and +remote port / local port information in attributes, optional information +about neighbor device such as device type, hwsku, management address and +loopback address can also be defined. + +``` +{ +"DEVICE_NEIGHBOR": { + "ARISTA04T1": { + "mgmt_addr": "10.20.0.163", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet124", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA03T1": { + "mgmt_addr": "10.20.0.162", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet120", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA02T1": { + "mgmt_addr": "10.20.0.161", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet116", + "type": "LeafRouter", + "port": "Ethernet1" + }, + "ARISTA01T1": { + "mgmt_addr": "10.20.0.160", + "hwsku": "Arista", + "lo_addr": null, + "local_port": "Ethernet112", + "type": "LeafRouter", + "port": "Ethernet1" + } + } +} +``` + +### Loopback Interface + +Loopback interface configuration lies in **LOOPBACK_INTERFACE** table +and has similar schema with data plane interfaces. The loopback device +name and loopback IP prefix act as multi-level key for loopback +interface objects. + +``` +{ +"LOOPBACK_INTERFACE": { + "Loopback0|10.1.0.32/32": {}, + "Loopback0|FC00:1::32/128": {} + } +} + +``` + +### LOSSLESS_TRAFFIC_PATTERN + +The LOSSLESS_TRAFFIC_PATTERN table stores parameters related to +lossless traffic for dynamic buffer calculation + +``` +{ + "LOSSLESS_TRAFFIC_PATTERN": { + "AZURE": { + "mtu": "1024", + "small_packet_percentage": "100" + } + } +} +``` + +### Management Interface + +Management interfaces are defined in **MGMT_INTERFACE** table. Object +key is composed of management interface name and IP prefix. Attribute +***gwaddr*** specify the gateway address of the prefix. +***forced_mgmt_routes*** attribute can be used to specify addresses / +prefixes traffic to which are forced to go through management network +instead of data network. + +``` +{ +"MGMT_INTERFACE": { + "eth0|10.11.150.11/16": { + "gwaddr": "10.11.0.1" + }, + "eth0|FC00:2::32/64": { + "forced_mgmt_routes": [ + "10.0.0.100/31", + "10.250.0.8", + "10.255.0.0/28" + ], + "gwaddr": "fc00:2::1" + } + } +} + +``` + +### Management port + +``` +{ +"MGMT_PORT": { + "eth0": { + "alias": "eth0", + "admin_status": "up" + } + } +} + +``` + + +### Management VRF + +``` +{ +"MGMT_VRF_CONFIG": { + "vrf_global": { + "mgmtVrfEnabled": "true" + } + } +} +``` + +### MAP_PFC_PRIORITY_TO_QUEUE + +``` +{ +"MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` +### NTP Global Configuration + +These configuration options are used to modify the way that +ntp binds to the ports on the switch and which port it uses to +make ntp update requests from. + +***NTP VRF*** + +If this option is set to `default` then ntp will run within the default vrf +**when the management vrf is enabled**. If the mgmt vrf is enabled and this value is +not set to default then ntp will run within the mgmt vrf. + +This option **has no effect** if the mgmt vrf is not enabled. + +``` +{ +"NTP": { + "global": { + "vrf": "default" + } + } +} +``` + + +***NTP Source Port*** + +This option sets the port which ntp will choose to send time update requests from by. + +NOTE: If a Loopback interface is defined on the switch ntp will choose this by default, so this setting +is **required** if the switch has a Loopback interface and the ntp peer does not have defined routes +for that address. + +``` +{ +"NTP": { + "global": { + "src_intf": "Ethernet1" + } + } +} +``` + +### NTP and SYSLOG servers + +These information are configured in individual tables. Domain name or IP +address of the server is used as object key. Currently there are no +attributes in those objects. + +***NTP server*** +``` +{ +"NTP_SERVER": { + "2.debian.pool.ntp.org": {}, + "1.debian.pool.ntp.org": {}, + "3.debian.pool.ntp.org": {}, + "0.debian.pool.ntp.org": {} + }, + +"NTP_SERVER": { + "23.92.29.245": {}, + "204.2.134.164": {} + } +} +``` + +***Syslogserver*** +``` +{ +"SYSLOG_SERVER": { + "10.0.0.5": {}, + "10.0.0.6": {}, + "10.11.150.5": {} + } +} +``` + +### Policer + +Below is an example of the policer table configuration. +``` +{ + "POLICER": { + "everflow_static_policer": { + "meter_type": "bytes", + "mode": "sr_tcm", + "cir": "12500000", + "cbs": "12500000", + "pir": "17500000", + "pbs": "17500000", + "color": "aware", + "red_packet_action": "drop", + "yellow_packet_action": "drop" + "green_packet_action": "forward" + } + } +} + +``` +Key to the table defines policer name Below are the fields +- meter_type - Mandatory field. Defines how the metering is done. values - bytes, packets +- mode - Mandatory field. Defines one of the three modes support. values - sr_tcm, tr_tcm, storm +- cir - Committed information rate bytes/sec or packets/sec based on meter_type +- cbs - Committed burst size in bytes or packets based on meter_type +- pir - Peak information rate in bytes/sec or packets/sec based on meter_type +- pbs - Peak burst size in bytes or packets based on meter_type +- color - Defines the color source for the policer. values - aware, blind +- red_packet_action - Defines the action to be taken for red color packets +- yellow_packet_action - Defines the action to be taken for yellow color packets +- green_packet_action - Defines the action to be taken for green color packets. + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' +### Port + +In this table the physical port configurations are defined. Each object +will have port name as its key, and port name alias and port speed as +optional attributes. + +``` +{ +"PORT": { + "Ethernet0": { + "index": "0", + "lanes": "101,102", + "description": "fortyGigE1/1/1", + "mtu": "9100", + "alias": "fortyGigE1/1/1", + "speed": "40000" + }, + "Ethernet1": { + "index": "1", + "lanes": "103,104", + "description": "fortyGigE1/1/2", + "mtu": "9100", + "alias": "fortyGigE1/1/2", + "admin_status": "up", + "speed": "40000" + }, + "Ethernet63": { + "index": "63", + "lanes": "87,88", + "description": "fortyGigE1/4/16", + "mtu": "9100", + "alias": "fortyGigE1/4/16", + "speed": "40000" + } + } +} + +``` + +### Port Channel + +Port channels are defined in **PORTCHANNEL** table with port channel +name as object key and member list as attribute. + +``` +{ +"PORTCHANNEL": { + "PortChannel0003": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet54" + ], + "mtu": "9100" + }, + "PortChannel0004": { + "admin_status": "up", + "min_links": "1", + "members": [ + "Ethernet56" + ], + "mtu": "9100" + } + } +} +``` + + +### Portchannel member + +``` +{ +"PORTCHANNEL_MEMBER": { + "PortChannel0001|Ethernet50": {}, + "PortChannel0002|Ethernet52": {}, + "PortChannel0003|Ethernet54": {}, + "PortChannel0004|Ethernet56": {} + } +} + +``` +### Scheduler + +``` +{ +"SCHEDULER": { + "scheduler.0": { + "type": "STRICT" + }, + "scheduler.1": { + "type": "WRR" + "weight": "1", + "meter_type": "bytes", + "pir": "1250000000", + "pbs": "8192" + }, + "scheduler.port": { + "meter_type": "bytes", + "pir": "1000000000", + "pbs": "8192" + } + } +} +``` + +### Port QoS Map + +``` +{ +"PORT_QOS_MAP": { + "Ethernet50,Ethernet52,Ethernet54,Ethernet56": { + "tc_to_pg_map": "AZURE", + "tc_to_queue_map": "AZURE", + "pfc_enable": "3,4", + "pfc_to_queue_map": "AZURE", + "dscp_to_tc_map": "AZURE", + "dscp_to_fc_map": "AZURE", + "exp_to_fc_map": "AZURE", + "scheduler": "scheduler.port" + } + } +} +``` + +### Queue +``` +{ +"QUEUE": { + "Ethernet56|4": { + "wred_profile": "AZURE_LOSSLESS", + "scheduler": "scheduler.1" + }, + "Ethernet56|5": { + "scheduler": "scheduler.0" + }, + "Ethernet56|6": { + "scheduler": "scheduler.0" + } + } +} +``` + + +### Tacplus Server + +``` +{ +"TACPLUS_SERVER": { + "10.0.0.8": { + "priority": "1", + "tcp_port": "49" + }, + "10.0.0.9": { + "priority": "1", + "tcp_port": "49" + } + } +} +``` + + +### TC to Priority group map + +``` +{ +"TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### TC to Queue map + +``` +{ +"TC_TO_QUEUE_MAP": { + "AZURE": { + "1": "1", + "0": "0", + "3": "3", + "2": "2", + "5": "5", + "4": "4", + "7": "7", + "6": "6" + } + } +} +``` + +### Versions + +This table is where the curret version of the software is recorded. +``` +{ + "VERSIONS": { + "DATABASE": { + "VERSION": "version_1_0_1" + } + } +} +``` + +### VLAN + +This table is where VLANs are defined. VLAN name is used as object key, +and member list as well as an integer id are defined as attributes. If a +DHCP relay is required for this VLAN, a dhcp_servers attribute must be +specified for that VLAN, the value of which is a list that must contain +the domain name or IP address of one or more DHCP servers. + +``` +{ +"VLAN": { + "Vlan1000": { + "dhcp_servers": [ + "192.0.0.1", + "192.0.0.2", + "192.0.0.3", + "192.0.0.4" + ], + "members": [ + "Ethernet0", + "Ethernet4", + "Ethernet8", + "Ethernet12" + ], + "vlanid": "1000" + } + } +} +``` + +### VLAN_MEMBER + +VLAN member table has Vlan name together with physical port or port +channel name as object key, and tagging mode as attributes. + +``` +{ +"VLAN_MEMBER": { + "Vlan1000|PortChannel47": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan2000|PortChannel47": { + "tagging_mode": "tagged" + } + } +} +``` + +### Virtual router + +The virtual router table allows to insert or update a new virtual router +instance. The key of the instance is its name. The attributes in the +table allow to change properties of a virtual router. Attributes: + +- 'v4' contains boolean value 'true' or 'false'. Enable or + disable IPv4 in the virtual router +- 'v6' contains boolean value 'true' or 'false'. Enable or + disable IPv6 in the virtual router +- 'src_mac' contains MAC address. What source MAC address will be + used for packets egressing from the virtual router +- 'ttl_action' contains packet action. Defines the action for + packets with TTL == 0 or TTL == 1 +- 'ip_opt_action' contains packet action. Defines the action for + packets with IP options +- 'l3_mc_action' contains packet action. Defines the action for + unknown L3 multicast packets + +The packet action could be: + +- 'drop' +- 'forward' +- 'copy' +- 'copy_cancel' +- 'trap' +- 'log' +- 'deny' +- 'transit' + + +***TBD*** +``` +'VRF:rid1': { + 'v4': 'true', + 'v6': 'false', + 'src_mac': '02:04:05:06:07:08', + 'ttl_action': 'copy', + 'ip_opt_action': 'deny', + 'l3_mc_action': 'drop' +} +``` + + +### WRED_PROFILE + +``` +{ +"WRED_PROFILE": { + "AZURE_LOSSLESS": { + "red_max_threshold": "2097152", + "wred_green_enable": "true", + "ecn": "ecn_all", + "green_min_threshold": "1048576", + "red_min_threshold": "1048576", + "wred_yellow_enable": "true", + "yellow_min_threshold": "1048576", + "green_max_threshold": "2097152", + "green_drop_probability": "5", + "yellow_max_threshold": "2097152", + "wred_red_enable": "true", + "yellow_drop_probability": "5", + "red_drop_probability": "5" + } + } +} +``` + +### BREAKOUT_CFG + +This table is introduced as part of Dynamic Port Breakout(DPB) feature. +It shows the current breakout mode of all ports(root ports). +The list of root ports, all possible breakout modes, and default breakout modes + are obtained/derived from platform.json and hwsku.json files. + +``` +"BREAKOUT_CFG": { + "Ethernet0": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet4": { + "brkout_mode": "4x25G[10G]" + }, + "Ethernet8": { + "brkout_mode": "4x25G[10G]" + }, + + ...... + + "Ethernet116": { + "brkout_mode": "2x50G" + }, + "Ethernet120": { + "brkout_mode": "2x50G" + }, + "Ethernet124": { + "brkout_mode": "2x50G" + } +} +``` + +### AAA + +The AAA table defined the method SONiC used for Authentication, Authorization and Accounting. +The method could be: +- default +- local +- tacacs+ +- radius + +``` +"AAA": { + "authentication": { + "login": "local" + }, + "authorization": { + "login": "local" + }, + "accounting": { + "login": "local" + } +} +``` + +For Developers +============== + +Generating Application Config by Jinja2 Template +------------------------------------------------ + +To be added. + +Incremental Configuration by Subscribing to ConfigDB +---------------------------------------------------- + +Detail instruction to be added. A sample could be found in this +[PR](https://github.com/Azure/sonic-buildimage/pull/861) that +implemented dynamic configuration for BGP. From 004dc699104a898c2ac5d5938661e2efeff47954 Mon Sep 17 00:00:00 2001 From: gechiang <62408185+gechiang@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:50:33 -0700 Subject: [PATCH 135/139] [BRCM SAI 6.0.0.13-3] Fix Warmreboot issue (#10225) --- platform/broadcom/sai.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index ce3470e6635..e23515a1f5e 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,4 +1,4 @@ -LIBSAIBCM_VERSION = 6.0.0.13-1 +LIBSAIBCM_VERSION = 6.0.0.13-3 LIBSAIBCM_BRANCH_NAME = REL_6.0 LIBSAIBCM_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_VERSION)" From 98cfec29823720d3410a06d66f17597bb07891d8 Mon Sep 17 00:00:00 2001 From: FuzailBrcm <51665572+FuzailBrcm@users.noreply.github.com> Date: Wed, 16 Mar 2022 06:35:34 +0530 Subject: [PATCH 136/139] Using SFP refactoring framework in PDDF sfp class (#10047) * Using SFP refactoring framework in PDDF sfp class * Fixing a typo error --- .../sonic_platform_pddf_base/pddf_sfp.py | 1237 +---------------- 1 file changed, 66 insertions(+), 1171 deletions(-) diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py index cf77986aba6..f11acf1a209 100644 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py @@ -5,164 +5,21 @@ ############################################################################# try: - import time - from ctypes import create_string_buffer - from sonic_platform_base.sfp_base import SfpBase - from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId - from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom - from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId - from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom - from sonic_platform_base.sonic_sfp.sff8472 import sffbase - from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase except ImportError as e: raise ImportError(str(e) + "- required module not found") -# definitions of the offset and width for values in XCVR info eeprom -XCVR_INTFACE_BULK_OFFSET = 0 -XCVR_INTFACE_BULK_WIDTH_QSFP = 20 -XCVR_INTFACE_BULK_WIDTH_SFP = 21 -XCVR_TYPE_OFFSET = 0 -XCVR_TYPE_WIDTH = 1 -XCVR_EXT_TYPE_OFFSET = 1 -XCVR_EXT_TYPE_WIDTH = 1 -XCVR_CONNECTOR_OFFSET = 2 -XCVR_CONNECTOR_WIDTH = 1 -XCVR_COMPLIANCE_CODE_OFFSET = 3 -XCVR_COMPLIANCE_CODE_WIDTH = 8 -XCVR_ENCODING_OFFSET = 11 -XCVR_ENCODING_WIDTH = 1 -XCVR_NBR_OFFSET = 12 -XCVR_NBR_WIDTH = 1 -XCVR_EXT_RATE_SEL_OFFSET = 13 -XCVR_EXT_RATE_SEL_WIDTH = 1 -XCVR_CABLE_LENGTH_OFFSET = 14 -XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 -XCVR_CABLE_LENGTH_WIDTH_SFP = 6 -XCVR_VENDOR_NAME_OFFSET = 20 -XCVR_VENDOR_NAME_WIDTH = 16 -XCVR_VENDOR_OUI_OFFSET = 37 -XCVR_VENDOR_OUI_WIDTH = 3 -XCVR_VENDOR_PN_OFFSET = 40 -XCVR_VENDOR_PN_WIDTH = 16 -XCVR_HW_REV_OFFSET = 56 -XCVR_HW_REV_WIDTH_OSFP = 2 -XCVR_HW_REV_WIDTH_QSFP = 2 -XCVR_HW_REV_WIDTH_SFP = 4 -XCVR_VENDOR_SN_OFFSET = 68 -XCVR_VENDOR_SN_WIDTH = 16 -XCVR_VENDOR_DATE_OFFSET = 84 -XCVR_VENDOR_DATE_WIDTH = 8 -XCVR_DOM_CAPABILITY_OFFSET = 92 -XCVR_DOM_CAPABILITY_WIDTH = 1 -# definitions of the offset for values in OSFP info eeprom -OSFP_TYPE_OFFSET = 0 -OSFP_VENDOR_NAME_OFFSET = 129 -OSFP_VENDOR_PN_OFFSET = 148 -OSFP_HW_REV_OFFSET = 164 -OSFP_VENDOR_SN_OFFSET = 166 - -# definitions of the offset and width for values in DOM info eeprom -QSFP_DOM_REV_OFFSET = 1 -QSFP_DOM_REV_WIDTH = 1 -QSFP_TEMPE_OFFSET = 22 -QSFP_TEMPE_WIDTH = 2 -QSFP_VOLT_OFFSET = 26 -QSFP_VOLT_WIDTH = 2 -QSFP_CHANNL_MON_OFFSET = 34 -QSFP_CHANNL_MON_WIDTH = 16 -QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 -QSFP_CONTROL_OFFSET = 86 -QSFP_CONTROL_WIDTH = 8 -QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 -QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 -QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 -QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 -QSFP_POWEROVERRIDE_OFFSET = 93 -QSFP_POWEROVERRIDE_WIDTH = 1 -QSFP_MODULE_THRESHOLD_OFFSET = 128 -QSFP_MODULE_THRESHOLD_WIDTH = 24 -QSFP_CHANNEL_THRESHOLD_OFFSET = 176 -QSFP_CHANNEL_THRESHOLD_WIDTH = 24 - - -SFP_TEMPE_OFFSET = 96 -SFP_TEMPE_WIDTH = 2 -SFP_VOLT_OFFSET = 98 -SFP_VOLT_WIDTH = 2 -SFP_CHANNL_MON_OFFSET = 100 -SFP_CHANNL_MON_WIDTH = 6 -SFP_MODULE_THRESHOLD_OFFSET = 0 -SFP_MODULE_THRESHOLD_WIDTH = 40 -SFP_STATUS_CONTROL_OFFSET = 110 -SFP_STATUS_CONTROL_WIDTH = 1 -SFP_TX_DISABLE_HARD_BIT = 7 -SFP_TX_DISABLE_SOFT_BIT = 6 - - -qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', - 'Length OM2(m)', 'Length OM1(m)', - 'Length Cable Assembly(m)') - -sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', - 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', - 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') - -sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', - 'ESCONComplianceCodes', 'SONETComplianceCodes', - 'EthernetComplianceCodes', 'FibreChannelLinkLength', - 'FibreChannelTechnology', 'SFP+CableTechnology', - 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') - -qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', - 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', - 'Fibre Channel link length/Transmitter Technology', - 'Fibre Channel transmission media', 'Fibre Channel Speed') - -PAGE_OFFSET = 0 -KEY_OFFSET = 1 -KEY_WIDTH = 2 -FUNC_NAME = 3 - -INFO_OFFSET = 128 -DOM_OFFSET = 0 -DOM_OFFSET1 = 384 - - -class PddfSfp(SfpBase): +class PddfSfp(SfpOptoeBase): """ PDDF generic Sfp class """ pddf_obj = {} plugin_data = {} - _port_to_eeprom_mapping = {} _port_start = 0 _port_end = 0 - _port_to_type_mapping = {} - _qsfp_ports = [] - _sfp_ports = [] - - # Read out any bytes from any offset - def __read_eeprom_specific_bytes(self, offset, num_bytes): - sysfsfile_eeprom = None - eeprom_raw = [] - for i in range(0, num_bytes): - eeprom_raw.append("0x00") - try: - sysfsfile_eeprom = open(self.eeprom_path, mode="rb", buffering=0) - sysfsfile_eeprom.seek(offset) - raw = sysfsfile_eeprom.read(num_bytes) - for n in range(0, num_bytes): - eeprom_raw[n] = hex(raw[n])[2:].zfill(2) - except Exception as e: - print("Error: Unable to open eeprom_path: %s" % (str(e))) - finally: - if sysfsfile_eeprom: - sysfsfile_eeprom.close() - - return eeprom_raw def __init__(self, index, pddf_data=None, pddf_plugin_data=None): if not pddf_data or not pddf_plugin_data: @@ -183,492 +40,49 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): self.port_index = index+1 self.device = 'PORT{}'.format(self.port_index) self.sfp_type = self.pddf_obj.get_device_type(self.device) - self.is_qsfp_port = True if (self.sfp_type == 'QSFP' or self.sfp_type == 'QSFP28') else False - self.is_osfp_port = True if (self.sfp_type == 'OSFP' or self.sfp_type == 'QSFP-DD') else False self.eeprom_path = self.pddf_obj.get_path(self.device, 'eeprom') - self.info_dict_keys = ['type', 'vendor_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', - 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', - 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', - 'application_advertisement'] - - self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', - 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', - 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] - - self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', - 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', - 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', - 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', - 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] - - SfpBase.__init__(self) - - def get_transceiver_info(self): - """ - Retrieves transceiver info of this SFP - Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - type |1*255VCHAR |type of SFP - vendor_rev |1*255VCHAR |vendor revision of SFP - serial |1*255VCHAR |serial number of the SFP - manufacturer |1*255VCHAR |SFP vendor name - model |1*255VCHAR |SFP model name - connector |1*255VCHAR |connector information - encoding |1*255VCHAR |encoding information - ext_identifier |1*255VCHAR |extend identifier - ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance - cable_length |INT |cable length in m - nominal_bit_rate |INT |nominal bit rate by 100Mbs - specification_compliance |1*255VCHAR |specification compliance - vendor_date |1*255VCHAR |vendor date - vendor_oui |1*255VCHAR |vendor OUI - application_advertisement |1*255VCHAR |supported applications advertisement - ======================================================================== - """ - # check present status - if not self.get_presence(): - return None - - if self.is_osfp_port: - sfpi_obj = inf8628InterfaceId() - offset = 0 - type_offset = OSFP_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP - hw_rev_offset = OSFP_HW_REV_OFFSET - vendor_name_offset = OSFP_VENDOR_NAME_OFFSET - vendor_pn_offset = OSFP_VENDOR_PN_OFFSET - vendor_sn_offset = OSFP_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfp_type = 'OSFP' - - elif self.is_qsfp_port: - sfpi_obj = sff8436InterfaceId() - offset = 128 - type_offset = XCVR_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP - hw_rev_offset = XCVR_HW_REV_OFFSET - vendor_name_offset = XCVR_VENDOR_NAME_OFFSET - vendor_pn_offset = XCVR_VENDOR_PN_OFFSET - vendor_sn_offset = XCVR_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfp_type = 'QSFP' - else: - sfpi_obj = sff8472InterfaceId() - offset = 0 - type_offset = XCVR_TYPE_OFFSET - vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - hw_rev_offset = XCVR_HW_REV_OFFSET - vendor_name_offset = XCVR_VENDOR_NAME_OFFSET - vendor_pn_offset = XCVR_VENDOR_PN_OFFSET - vendor_sn_offset = XCVR_VENDOR_SN_OFFSET - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP - sfp_type = 'SFP' - - if sfpi_obj is None: - return None - - if self.is_osfp_port: - sfp_type_raw = self.__read_eeprom_specific_bytes((offset + type_offset), XCVR_TYPE_WIDTH) - if sfp_type_raw is not None: - sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) - sfp_type_abbrv_name = sfpi_obj.parse_sfp_type_abbrv_name(sfp_typ_raw, 0) - else: - sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_INTFACE_BULK_OFFSET), interface_info_bulk_width) - if sfp_interface_bulk_raw is not None: - sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw, 0) - - sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) - if sfp_vendor_oui_raw is not None: - sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_vendor_oui_raw, 0) - - sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) - if sfp_vendor_date_raw is not None: - sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_vendor_date_raw, 0) - - sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( - (offset + vendor_name_offset), XCVR_VENDOR_NAME_WIDTH) - sfp_vendor_name_data = sfpi_obj.parse_vendor_name( - sfp_vendor_name_raw, 0) - - sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( - (offset + vendor_pn_offset), XCVR_VENDOR_PN_WIDTH) - sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( - sfp_vendor_pn_raw, 0) - - sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( - (offset + hw_rev_offset), vendor_rev_width) - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( - sfp_vendor_rev_raw, 0) - - sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( - (offset + vendor_sn_offset), XCVR_VENDOR_SN_WIDTH) - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( - sfp_vendor_sn_raw, 0) - - xcvr_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') - compliance_code_dict = dict() - - if sfp_interface_bulk_data: - xcvr_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] - xcvr_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] - xcvr_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] - xcvr_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] - xcvr_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] - xcvr_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] - else: - xcvr_info_dict['type'] = sfp_type_data['data']['type']['value'] if sfp_type_data else 'N/A' - xcvr_info_dict['type_abbrv_name'] = sfp_type_abbrv_name['data']['type_abbrv_name']['value'] \ - if sfp_type_abbrv_name else 'N/A' - - xcvr_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] \ - if sfp_vendor_name_data else 'N/A' - xcvr_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' - xcvr_info_dict['vendor_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] \ - if sfp_vendor_rev_data else 'N/A' - xcvr_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' - xcvr_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] \ - if sfp_vendor_oui_data else 'N/A' - xcvr_info_dict['vendor_date'] = sfp_vendor_date_data['data'][ - 'VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' - xcvr_info_dict['cable_type'] = "Unknown" - xcvr_info_dict['cable_length'] = "Unknown" - - if sfp_type == 'QSFP': - for key in qsfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - xcvr_info_dict['cable_type'] = key - xcvr_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + SfpOptoeBase.__init__(self) - for key in qsfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance'][ - 'value'][key]['value'] - xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) + def get_eeprom_path(self): + return self.eeprom_path - nkey = 'Nominal Bit Rate(100Mbs)' - if nkey in sfp_interface_bulk_data['data']: - xcvr_info_dict['nominal_bit_rate'] = str( - sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) - else: - xcvr_info_dict['nominal_bit_rate'] = 'N/A' - elif sfp_type == 'OSFP': - pass - else: - for key in sfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - xcvr_info_dict['cable_type'] = key - xcvr_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) - - for key in sfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance'][ - 'value'][key]['value'] - xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) - - xcvr_info_dict['nominal_bit_rate'] = str( - sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) - - return xcvr_info_dict - - def get_transceiver_bulk_status(self): + def get_name(self): """ - Retrieves transceiver bulk status of this SFP - Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. - tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. - reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. - lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. - tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. - tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 - | |to channel 3. - temperature |INT |module temperature in Celsius - voltage |INT |supply voltage in mV - txbias |INT |TX Bias Current in mA, n is the channel number, - | |for example, tx2bias stands for tx bias of channel 2. - rxpower |INT |received optical power in mW, n is the channel number, - | |for example, rx2power stands for rx power of channel 2. - txpower |INT |TX output power in mW, n is the channel number, - | |for example, tx2power stands for tx power of channel 2. - ======================================================================== + Retrieves the name of the device + Returns: + string: The name of the device """ - # check present status - if not self.get_presence(): - return None - - xcvr_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') - - if self.is_osfp_port: - # Below part is added to avoid fail xcvrd, shall be implemented later - pass - elif self.is_qsfp_port: - # QSFPs - offset = 0 - offset_xcvr = 128 - - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return None - - sfpi_obj = sff8436InterfaceId() - if sfpi_obj is None: - return None - - qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( - (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) - if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_dom_capability( - qsfp_dom_capability_raw, 0) - else: - return None - - dom_temperature_raw = self.__read_eeprom_specific_bytes((offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) - if dom_temperature_raw is not None: - dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) - else: - return None - - dom_voltage_raw = self.__read_eeprom_specific_bytes((offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) - if dom_voltage_raw is not None: - dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) - else: - return None - - qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes((offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) - if qsfp_dom_rev_raw is not None: - qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) - else: - return None - - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - - # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 - # and claimed that it support tx_power with one indicator bit. - dom_channel_monitor_data = {} - qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] - qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] - if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) - else: - return None - - xcvr_dom_info_dict['tx1power'] = 'N/A' - xcvr_dom_info_dict['tx2power'] = 'N/A' - xcvr_dom_info_dict['tx3power'] = 'N/A' - xcvr_dom_info_dict['tx4power'] = 'N/A' - else: - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( - dom_channel_monitor_raw, 0) - else: - return None - - xcvr_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] - xcvr_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] - xcvr_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] - xcvr_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] - - if dom_channel_monitor_raw: - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - xcvr_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] - xcvr_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] - xcvr_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] - xcvr_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] - xcvr_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] - xcvr_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] - xcvr_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] - xcvr_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] - - else: - # SFPs - offset = 256 - - sfpd_obj = sff8472Dom() - if sfpd_obj is None: - return None - - dom_temperature_raw = self.__read_eeprom_specific_bytes((offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) - if dom_temperature_raw is not None: - dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) - else: - return None - - dom_voltage_raw = self.__read_eeprom_specific_bytes((offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) - if dom_voltage_raw is not None: - dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) - else: - return None - - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) - else: - return None - - xcvr_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - xcvr_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - xcvr_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] - xcvr_dom_info_dict['rx2power'] = 'N/A' - xcvr_dom_info_dict['rx3power'] = 'N/A' - xcvr_dom_info_dict['rx4power'] = 'N/A' - xcvr_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] - xcvr_dom_info_dict['tx2bias'] = 'N/A' - xcvr_dom_info_dict['tx3bias'] = 'N/A' - xcvr_dom_info_dict['tx4bias'] = 'N/A' - xcvr_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] - xcvr_dom_info_dict['tx2power'] = 'N/A' - xcvr_dom_info_dict['tx3power'] = 'N/A' - xcvr_dom_info_dict['tx4power'] = 'N/A' - - xcvr_dom_info_dict['rx_los'] = self.get_rx_los() - xcvr_dom_info_dict['tx_fault'] = self.get_tx_fault() - xcvr_dom_info_dict['reset_status'] = self.get_reset_status() - xcvr_dom_info_dict['lp_mode'] = self.get_lpmode() - - return xcvr_dom_info_dict + # Name of the port/sfp ? + return 'PORT{}'.format(self.port_index) - def get_transceiver_threshold_info(self): + def get_presence(self): """ - Retrieves transceiver threshold info of this SFP + Retrieves the presence of the PSU Returns: - A dict which contains following keys/values : - ======================================================================== - keys |Value Format |Information - ---------------------------|---------------|---------------------------- - temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. - templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. - temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. - templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. - vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. - vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. - vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. - vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. - rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. - rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. - rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. - rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. - txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. - txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. - txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. - txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. - txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. - txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. - txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. - txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. - ======================================================================== + bool: True if PSU is present, False if not """ - # check present status - if not self.get_presence(): - return None - - xcvr_dom_threshold_info_dict = dict.fromkeys(self.threshold_dict_keys, 'N/A') - - if self.is_osfp_port: - # Below part is added to avoid fail xcvrd, shall be implemented later - pass - elif self.is_qsfp_port: - # QSFPs - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return None - - offset = 384 - dom_thres_raw = self.__read_eeprom_specific_bytes( - (offset+QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) - if dom_thres_raw: - module_threshold_values = sfpd_obj.parse_module_threshold_values( - dom_thres_raw, 0) - module_threshold_data = module_threshold_values.get('data') - if module_threshold_data: - xcvr_dom_threshold_info_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] - xcvr_dom_threshold_info_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] - xcvr_dom_threshold_info_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] - xcvr_dom_threshold_info_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] - xcvr_dom_threshold_info_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] - xcvr_dom_threshold_info_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] - xcvr_dom_threshold_info_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] - xcvr_dom_threshold_info_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] - - dom_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), - QSFP_CHANNEL_THRESHOLD_WIDTH) - if dom_thres_raw: - channel_threshold_values = sfpd_obj.parse_channel_threshold_values( - dom_thres_raw, 0) - ch_th_data = channel_threshold_values.get('data') - if ch_th_data: - xcvr_dom_threshold_info_dict['rxpowerhighalarm'] = ch_th_data['RxPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowalarm'] = ch_th_data['RxPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerhighwarning'] = ch_th_data['RxPowerHighWarning']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowwarning'] = ch_th_data['RxPowerLowWarning']['value'] - xcvr_dom_threshold_info_dict['txpowerhighalarm'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerlowalarm'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerhighwarning'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txpowerlowwarning'] = "0.0dBm" - xcvr_dom_threshold_info_dict['txbiashighalarm'] = ch_th_data['TxBiasHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiaslowalarm'] = ch_th_data['TxBiasLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiashighwarning'] = ch_th_data['TxBiasHighWarning']['value'] - xcvr_dom_threshold_info_dict['txbiaslowwarning'] = ch_th_data['TxBiasLowWarning']['value'] + output = self.pddf_obj.get_attr_name_output(self.device, 'xcvr_present') + if not output: + return False + mode = output['mode'] + modpres = output['status'].rstrip() + if 'XCVR' in self.plugin_data: + if 'xcvr_present' in self.plugin_data['XCVR']: + ptype = self.sfp_type + vtype = 'valmap-'+ptype + if vtype in self.plugin_data['XCVR']['xcvr_present'][mode]: + vmap = self.plugin_data['XCVR']['xcvr_present'][mode][vtype] + if modpres in vmap: + return vmap[modpres] + else: + return False + # if self.plugin_data doesn't specify anything regarding Transceivers + if modpres == '1': + return True else: - # SFPs - sfpd_obj = sff8472Dom() - offset = 256 - eeprom_ifraw = self.__read_eeprom_specific_bytes(0, offset) - sfpi_obj = sff8472InterfaceId(eeprom_ifraw) - cal_type = sfpi_obj.get_calibration_type() - sfpd_obj._calibration_type = cal_type - - dom_module_threshold_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) - if dom_module_threshold_raw is not None: - dom_mod_th_data = sfpd_obj.parse_alarm_warning_threshold( - dom_module_threshold_raw, 0) - - xcvr_dom_threshold_info_dict['temphighalarm'] = dom_mod_th_data['data']['TempHighAlarm']['value'] - xcvr_dom_threshold_info_dict['templowalarm'] = dom_mod_th_data['data']['TempLowAlarm']['value'] - xcvr_dom_threshold_info_dict['temphighwarning'] = dom_mod_th_data['data']['TempHighWarning']['value'] - xcvr_dom_threshold_info_dict['templowwarning'] = dom_mod_th_data['data']['TempLowWarning']['value'] - xcvr_dom_threshold_info_dict['vcchighalarm'] = dom_mod_th_data['data']['VoltageHighAlarm']['value'] - xcvr_dom_threshold_info_dict['vcclowalarm'] = dom_mod_th_data['data']['VoltageLowAlarm']['value'] - xcvr_dom_threshold_info_dict['vcchighwarning'] = dom_mod_th_data[ - 'data']['VoltageHighWarning']['value'] - xcvr_dom_threshold_info_dict['vcclowwarning'] = dom_mod_th_data['data']['VoltageLowWarning']['value'] - xcvr_dom_threshold_info_dict['txbiashighalarm'] = dom_mod_th_data['data']['BiasHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiaslowalarm'] = dom_mod_th_data['data']['BiasLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txbiashighwarning'] = dom_mod_th_data['data']['BiasHighWarning']['value'] - xcvr_dom_threshold_info_dict['txbiaslowwarning'] = dom_mod_th_data['data']['BiasLowWarning']['value'] - xcvr_dom_threshold_info_dict['txpowerhighalarm'] = dom_mod_th_data['data']['TXPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['txpowerlowalarm'] = dom_mod_th_data['data']['TXPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['txpowerhighwarning'] = dom_mod_th_data['data']['TXPowerHighWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['txpowerlowwarning'] = dom_mod_th_data['data']['TXPowerLowWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['rxpowerhighalarm'] = dom_mod_th_data['data']['RXPowerHighAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerlowalarm'] = dom_mod_th_data['data']['RXPowerLowAlarm']['value'] - xcvr_dom_threshold_info_dict['rxpowerhighwarning'] = dom_mod_th_data['data']['RXPowerHighWarning'][ - 'value'] - xcvr_dom_threshold_info_dict['rxpowerlowwarning'] = dom_mod_th_data['data']['RXPowerLowWarning'][ - 'value'] - - return xcvr_dom_threshold_info_dict + return False def get_reset_status(self): """ @@ -677,20 +91,16 @@ def get_reset_status(self): A Boolean, True if reset enabled, False if disabled """ reset_status = None - if not self.get_presence(): - return reset_status - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_reset') - if not output: - return False - status = int(output['status'].rstrip()) + if output: + status = int(output['status'].rstrip()) - if status == 1: - reset_status = True - else: - reset_status = False + if status == 1: + reset_status = True + else: + reset_status = False return reset_status @@ -702,42 +112,19 @@ def get_rx_los(self): Note : RX LOS status is latched until a call to get_rx_los or a reset. """ rx_los = None - if not self.get_presence(): - return rx_los - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_rxlos') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - rx_los_list = [] - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - QSFP_CHANNL_RX_LOS_STATUS_OFFSET, QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if self.get_presence() else None - if dom_channel_monitor_raw is not None: - rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx_los_list.append(rx_los_data & 0x01 != 0) - rx_los_list.append(rx_los_data & 0x02 != 0) - rx_los_list.append(rx_los_data & 0x04 != 0) - rx_los_list.append(rx_los_data & 0x08 != 0) - rx_los = rx_los_list[0] and rx_los_list[1] and rx_los_list[2] and rx_los_list[3] - else: - # SFP ports - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - rx_los = (sffbase().test_bit(data, 1) != 0) - - else: + if output: status = int(output['status'].rstrip()) if status == 1: rx_los = True else: rx_los = False + else: + # Use common SfpOptoeBase implementation for get_rx_los + rx_los = super().get_rx_los() return rx_los @@ -749,42 +136,19 @@ def get_tx_fault(self): Note : TX fault status is lached until a call to get_tx_fault or a reset. """ tx_fault = None - if not self.get_presence(): - return tx_fault - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_txfault') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - tx_fault_list = [] - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - QSFP_CHANNL_TX_FAULT_STATUS_OFFSET, QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) \ - if self.get_presence() else None - if dom_channel_monitor_raw is not None: - tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx_fault_list.append(tx_fault_data & 0x01 != 0) - tx_fault_list.append(tx_fault_data & 0x02 != 0) - tx_fault_list.append(tx_fault_data & 0x04 != 0) - tx_fault_list.append(tx_fault_data & 0x08 != 0) - tx_fault = tx_fault_list[0] and tx_fault_list[1] and tx_fault_list[2] and tx_fault_list[3] - else: - # SFP - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - tx_fault = (sffbase().test_bit(data, 2) != 0) - else: + if output: status = int(output['status'].rstrip()) if status == 1: tx_fault = True else: tx_fault = False + else: + # Use common SfpOptoeBase implementation for get_tx_fault + tx_fault = super().get_tx_fault() return tx_fault @@ -795,86 +159,22 @@ def get_tx_disable(self): A Boolean, True if tx_disable is enabled, False if disabled """ tx_disable = False - if not self.get_presence(): - return tx_disable - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_txdisable') - if not output: - # read the values from EEPROM - if self.is_osfp_port: - return tx_disable - elif self.is_qsfp_port: - tx_disable_list = [] - - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return False - - dom_control_raw = self.__read_eeprom_specific_bytes( - QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None - if dom_control_raw is not None: - dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) - tx_disable_list.append( - 'On' == dom_control_data['data']['TX1Disable']['value']) - tx_disable_list.append( - 'On' == dom_control_data['data']['TX2Disable']['value']) - tx_disable_list.append( - 'On' == dom_control_data['data']['TX3Disable']['value']) - tx_disable_list.append( - 'On' == dom_control_data['data']['TX4Disable']['value']) - - return tx_disable_list - else: - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - tx_disable_hard = (sffbase().test_bit( - data, SFP_TX_DISABLE_HARD_BIT) != 0) - tx_disable_soft = (sffbase().test_bit( - data, SFP_TX_DISABLE_SOFT_BIT) != 0) - tx_disable = tx_disable_hard | tx_disable_soft - - return tx_disable - else: + if output: status = int(output['status'].rstrip()) if status == 1: tx_disable = True else: tx_disable = False + else: + # Use common SfpOptoeBase implementation for get_tx_disable + tx_disable = super().get_tx_disable() return tx_disable - def get_tx_disable_channel(self): - """ - Retrieves the TX disabled channels in this SFP - Returns: - A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent - TX channels which have been disabled in this SFP. - As an example, a returned value of 0x5 indicates that channel 0 - and channel 2 have been disabled. - """ - if not self.get_presence(): - return 0 - - if self.is_osfp_port: - return 0 - elif self.is_qsfp_port: - tx_disable_list = self.get_tx_disable() - if tx_disable_list is None: - return 0 - tx_disabled = 0 - for i in range(len(tx_disable_list)): - if tx_disable_list[i]: - tx_disabled |= 1 << i - return tx_disabled - else: - # SFP doesnt support this - return 0 - def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP @@ -882,162 +182,21 @@ def get_lpmode(self): A Boolean, True if lpmode is enabled, False if disabled """ lpmode = False - if not self.get_presence(): - return lpmode - device = 'PORT{}'.format(self.port_index) output = self.pddf_obj.get_attr_name_output(device, 'xcvr_lpmode') - if not output: - # Read from EEPROM - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - try: - eeprom = None - ctype = self.get_connector_type() - if ctype in ['Copper pigtail', 'No separable connector']: - return False - - eeprom = open(self.eeprom_path, "rb") - eeprom.seek(93) - status = ord(eeprom.read(1)) - - if ((status & 0x3) == 0x3): - # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 - lpmode = True - else: - # High Power Mode if one of the following conditions is matched: - # 1. "Power override" bit is 0 - # 2. "Power override" bit is 1 and "Power set" bit is 0 - lpmode = False - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - finally: - if eeprom is not None: - eeprom.close() - time.sleep(0.01) - else: - # SFP - pass - else: + if output: status = int(output['status'].rstrip()) if status == 1: lpmode = True else: lpmode = False - - return lpmode - - def get_power_override(self): - """ - Retrieves the power-override status of this SFP - Returns: - A Boolean, True if power-override is enabled, False if disabled - """ - power_override = False - if not self.get_presence(): - return power_override - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return False - - dom_control_raw = self.__read_eeprom_specific_bytes( - QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None - if dom_control_raw is not None: - dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) - power_override = ('On' == dom_control_data['data']['PowerOverride']['value']) - else: - # SFP doesnt suppor this - pass - - return power_override - - def get_temperature(self): - """ - Retrieves the temperature of this SFP - Returns: - An integer number of current temperature in Celsius - """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - if transceiver_dom_info_dict is not None: - # returns None if temperature is not found in the dictionary - return transceiver_dom_info_dict.get("temperature") - else: - return None - - def get_voltage(self): - """ - Retrieves the supply voltage of this SFP - Returns: - An integer number of supply voltage in mV - """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - # returns None if voltage is not found in the dictionary - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("voltage") else: - return None + # Use common SfpOptoeBase implementation for get_lpmode + lpmode = super().get_lpmode() - def get_tx_bias(self): - """ - Retrieves the TX bias current of this SFP - Returns: - A list of four integer numbers, representing TX bias in mA - for channel 0 to channel 4. - Ex. ['110.09', '111.12', '108.21', '112.09'] - """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - if transceiver_dom_info_dict is not None: - tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") - tx2_bs = transceiver_dom_info_dict.get("tx2bias", "N/A") - tx3_bs = transceiver_dom_info_dict.get("tx3bias", "N/A") - tx4_bs = transceiver_dom_info_dict.get("tx4bias", "N/A") - return [tx1_bs, tx2_bs, tx3_bs, tx4_bs] if transceiver_dom_info_dict else [] - else: - return None - - def get_rx_power(self): - """ - Retrieves the received optical power for this SFP - Returns: - A list of four integer numbers, representing received optical - power in mW for channel 0 to channel 4. - Ex. ['1.77', '1.71', '1.68', '1.70'] - """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - if transceiver_dom_info_dict is not None: - rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") - rx2_pw = transceiver_dom_info_dict.get("rx2power", "N/A") - rx3_pw = transceiver_dom_info_dict.get("rx3power", "N/A") - rx4_pw = transceiver_dom_info_dict.get("rx4power", "N/A") - return [rx1_pw, rx2_pw, rx3_pw, rx4_pw] if transceiver_dom_info_dict else [] - else: - return None - - def get_tx_power(self): - """ - Retrieves the TX power of this SFP - Returns: - A list of four integer numbers, representing TX power in mW - for channel 0 to channel 4. - Ex. ['1.86', '1.86', '1.86', '1.86'] - """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - if transceiver_dom_info_dict is not None: - tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") - tx2_pw = transceiver_dom_info_dict.get("tx2power", "N/A") - tx3_pw = transceiver_dom_info_dict.get("tx3power", "N/A") - tx4_pw = transceiver_dom_info_dict.get("tx4power", "N/A") - return [tx1_pw, tx2_pw, tx3_pw, tx4_pw] - else: - return None + return lpmode def get_intr_status(self): """ @@ -1068,17 +227,10 @@ def reset(self): A boolean, True if successful, False if not """ status = False - if not self.get_presence(): - return status - device = 'PORT{}'.format(self.port_index) - # TODO: Implement a wrapper set function to write the sequence path = self.pddf_obj.get_path(device, 'xcvr_reset') - # TODO: put the optic based reset logic using EEPROM - if path is None: - pass - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1095,6 +247,9 @@ def reset(self): status = True except IOError as e: status = False + else: + # Use common SfpOptoeBase implementation for reset + status = super().reset() return status @@ -1109,61 +264,11 @@ def tx_disable(self, tx_disable): """ # find out a generic implementation of tx_disable for SFP, QSFP and OSFP status = False - if not self.get_presence(): - return tx_disable - device = 'PORT{}'.format(self.port_index) path = self.pddf_obj.get_path(device, 'xcvr_txdisable') # TODO: put the optic based reset logic using EEPROM - if path is None: - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - eeprom_f = None - try: - txdisable_ctl = 0xf if tx_disable else 0x0 - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_CONTROL_OFFSET) - eeprom_f.write(buf[0]) - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - finally: - if eeprom_f is not None: - eeprom_f.close() - time.sleep(0.01) - - status = True - else: - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw is not None: - # Set bit 6 for Soft TX Disable Select - # 01000000 = 64 and 10111111 = 191 - txdisable_bit = 64 if tx_disable else 191 - status_control = int(status_control_raw[0], 16) - txdisable_ctl = (status_control | txdisable_bit) if tx_disable else ( - status_control & txdisable_bit) - try: - eeprom_f = open(self.eeprom_path, mode="r+b", buffering=0) - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - eeprom_f.seek(SFP_STATUS_CONTROL_OFFSET) - eeprom_f.write(buf[0]) - except Exception as e: - print(("Error: unable to open file: %s" % str(e))) - return False - finally: - if eeprom_f: - eeprom_f.close() - time.sleep(0.01) - status = True - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1178,48 +283,10 @@ def tx_disable(self, tx_disable): status = True except IOError as e: status = False - - return status - - def tx_disable_channel(self, channel, disable): - """ - Sets the tx_disable for specified SFP channels - Args: - channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, - e.g. 0x5 for channel 0 and channel 2. - disable : A boolean, True to disable TX channels specified in channel, - False to enable - Returns: - A boolean, True if successful, False if not - """ - # TODO: find a implementation - status = False - if not self.get_presence(): - return status - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - eeprom_f = None - try: - channel_state = self.get_tx_disable_channel() - txdisable_ctl = (channel_state | channel) if disable else (channel_state & ~channel) - buf = create_string_buffer(1) - buf[0] = bytes([txdisable_ctl]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_CONTROL_OFFSET) - eeprom_f.write(buf[0]) - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - finally: - if eeprom_f is not None: - eeprom_f.close() - time.sleep(0.01) - status = True else: - pass + # Use common SfpOptoeBase implementation for tx_disable + status = super().tx_disable(tx_disable) + return status @@ -1233,44 +300,10 @@ def set_lpmode(self, lpmode): A boolean, True if lpmode is set successfully, False if not """ status = False - if not self.get_presence(): - return status - device = 'PORT{}'.format(self.port_index) path = self.pddf_obj.get_path(device, 'xcvr_lpmode') - # TODO: put the optic based reset logic using EEPROM - if path is None: - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - try: - eeprom_f = None - ctype = self.get_connector_type() - if ctype in ['Copper pigtail', 'No separable connector']: - return False - - # Fill in write buffer - regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode - buffer = create_string_buffer(1) - buffer[0] = bytes([regval]) - - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(93) - eeprom_f.write(buffer[0]) - return True - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - finally: - if eeprom_f is not None: - eeprom_f.close() - time.sleep(0.01) - else: - pass - - else: + if path: try: f = open(path, 'r+') except IOError as e: @@ -1286,149 +319,11 @@ def set_lpmode(self, lpmode): status = True except IOError as e: status = False - - return status - - def set_power_override(self, power_override, power_set): - """ - Sets SFP power level using power_override and power_set - Args: - power_override : - A Boolean, True to override set_lpmode and use power_set - to control SFP power, False to disable SFP power control - through power_override/power_set and use set_lpmode - to control SFP power. - power_set : - Only valid when power_override is True. - A Boolean, True to set SFP to low power mode, False to set - SFP to high power mode. - Returns: - A boolean, True if power-override and power_set are set successfully, - False if not - """ - status = False - if not self.get_presence(): - return status - - if self.is_osfp_port: - pass - elif self.is_qsfp_port: - try: - power_override_bit = 0 - if power_override: - power_override_bit |= 1 << 0 - - power_set_bit = 0 - if power_set: - power_set_bit |= 1 << 1 - - buffer = create_string_buffer(1) - buffer[0] = bytes([power_override_bit | power_set_bit]) - # Write to eeprom - eeprom_f = open(self.eeprom_path, "r+b") - eeprom_f.seek(QSFP_POWEROVERRIDE_OFFSET) - eeprom_f.write(buffer[0]) - except IOError as e: - print("Error: unable to open file: %s" % str(e)) - return False - finally: - if eeprom_f is not None: - eeprom_f.close() - time.sleep(0.01) - return True else: - pass + # Use common SfpOptoeBase implementation for set_lpmode + status = super().set_lpmode(lpmode) return status - def get_name(self): - """ - Retrieves the name of the device - Returns: - string: The name of the device - """ - # Name of the port/sfp ? - return 'PORT{}'.format(self.port_index) - - def get_presence(self): - """ - Retrieves the presence of the PSU - Returns: - bool: True if PSU is present, False if not - """ - output = self.pddf_obj.get_attr_name_output(self.device, 'xcvr_present') - if not output: - return False - - mode = output['mode'] - modpres = output['status'].rstrip() - if 'XCVR' in self.plugin_data: - if 'xcvr_present' in self.plugin_data['XCVR']: - ptype = self.sfp_type - vtype = 'valmap-'+ptype - if vtype in self.plugin_data['XCVR']['xcvr_present'][mode]: - vmap = self.plugin_data['XCVR']['xcvr_present'][mode][vtype] - if modpres in vmap: - return vmap[modpres] - else: - return False - # if self.plugin_data doesn't specify anything regarding Transceivers - if modpres == '1': - return True - else: - return False - - def get_model(self): - """ - Retrieves the model number (or part number) of the device - Returns: - string: Model/part number of device - """ - transceiver_dom_info_dict = self.get_transceiver_info() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("model", "N/A") - else: - return None - - def get_serial(self): - """ - Retrieves the serial number of the device - Returns: - string: Serial number of device - """ - transceiver_dom_info_dict = self.get_transceiver_info() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("serial", "N/A") - else: - return None - - def get_status(self): - """ - Retrieves the operational status of the device - Returns: - A boolean value, True if device is operating properly, False if not - """ - return self.get_presence() and self.get_transceiver_bulk_status() - - def get_connector_type(self): - """ - Retrieves the device connector type - Returns: - enum: connector_code - """ - transceiver_dom_info_dict = self.get_transceiver_info() - if transceiver_dom_info_dict is not None: - return transceiver_dom_info_dict.get("connector", "N/A") - else: - return None - - def get_transceiver_change_event(self): - """ - TODO: This function need to be implemented - when decide to support monitoring SFP(Xcvrd) - on this platform. - """ - raise NotImplementedError - def dump_sysfs(self): return self.pddf_obj.cli_dump_dsysfs('xcvr') From 5617b1ae3efc6cee52b875651135ada67898ebf0 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 15 Mar 2022 18:12:49 -0700 Subject: [PATCH 137/139] Image disk space reduction (#10172) # Why I did it Reduce the disk space taken up during bootup and runtime. # How I did it 1. Remove python package cache from the base image and from the containers. 2. During bootup, if logs are to be stored in memory, then don't create the `var-log.ext4` file just to delete it later during bootup. 3. For the partition containing `/host`, don't reserve any blocks for just the root user. This just makes sure all disk space is available for all users, if needed during upgrades (for example). * Remove pip2 and pip3 caches from some containers Only containers which appeared to have a significant pip cache size are included here. Signed-off-by: Saikrishna Arcot * Don't create var-log.ext4 if we're storing logs in memory Signed-off-by: Saikrishna Arcot * Run tune2fs on the device containing /host to not reserve any blocks for just the root user Signed-off-by: Saikrishna Arcot --- dockers/docker-base-bullseye/Dockerfile.j2 | 2 +- dockers/docker-base-buster/Dockerfile.j2 | 2 +- dockers/docker-config-engine-bullseye/Dockerfile.j2 | 2 +- dockers/docker-config-engine-buster/Dockerfile.j2 | 2 +- dockers/docker-orchagent/Dockerfile.j2 | 2 +- dockers/docker-sonic-mgmt-framework/Dockerfile.j2 | 2 +- files/Aboot/boot0.j2 | 7 ++++++- files/initramfs-tools/varlog | 10 ++++++++++ installer/arm64/install.sh | 5 +++++ installer/armhf/install.sh | 5 +++++ installer/x86_64/install.sh | 11 +++++++++++ 11 files changed, 43 insertions(+), 7 deletions(-) diff --git a/dockers/docker-base-bullseye/Dockerfile.j2 b/dockers/docker-base-bullseye/Dockerfile.j2 index 1b33003ce0a..cae55517417 100644 --- a/dockers/docker-base-bullseye/Dockerfile.j2 +++ b/dockers/docker-base-bullseye/Dockerfile.j2 @@ -102,7 +102,7 @@ RUN apt-get -y purge \ RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /var/lib/apt/lists/* /tmp/* + rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index e16a0f677b0..52c784e9a7f 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -121,7 +121,7 @@ RUN apt-get -y purge \ RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /var/lib/apt/lists/* /tmp/* + rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache/ COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] diff --git a/dockers/docker-config-engine-bullseye/Dockerfile.j2 b/dockers/docker-config-engine-bullseye/Dockerfile.j2 index 84785d0669f..9d0ca97c760 100644 --- a/dockers/docker-config-engine-bullseye/Dockerfile.j2 +++ b/dockers/docker-config-engine-bullseye/Dockerfile.j2 @@ -49,4 +49,4 @@ RUN apt-get purge -y \ apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /debs /python-wheels + rm -rf /debs /python-wheels ~/.cache diff --git a/dockers/docker-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index 3022546a068..1e7a64bfcd3 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -49,4 +49,4 @@ RUN apt-get purge -y \ apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /debs /python-wheels + rm -rf /debs /python-wheels ~/.cache diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 5e403213c1d..f71f31cfc0a 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -64,7 +64,7 @@ RUN apt-get purge -y \ apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /debs + rm -rf /debs ~/.cache COPY ["files/arp_update", "/usr/bin"] COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"] diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index d727ac449d4..937c5368483 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -34,6 +34,6 @@ COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] RUN apt-get remove -y g++ python3-dev RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y -RUN rm -rf /debs +RUN rm -rf /debs ~/.cache ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 38eb8b5fe78..7306c36cfc0 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -351,7 +351,12 @@ extract_image() { unzip -oq "$swipath" -x boot0 "$dockerfs" -d "$image_path" ## detect rootfs type - rootfs_type=`grep " $target_path " /proc/mounts | cut -d' ' -f3` + local mountstr="$(grep " $target_path " /proc/mounts)" + local rootdev="$(echo $mountstr | cut -f1 -d' ')" + rootfs_type="$(echo $mountstr | cut -d' ' -f3)" + + ## Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $rootdev info "Extracting $dockerfs from swi" ## Unpacking dockerfs delayed diff --git a/files/initramfs-tools/varlog b/files/initramfs-tools/varlog index e8063e41a59..980b2452345 100644 --- a/files/initramfs-tools/varlog +++ b/files/initramfs-tools/varlog @@ -11,17 +11,27 @@ case $1 in ;; esac +logs_inram=false + # Extract kernel parameters set -- $(cat /proc/cmdline) for x in "$@"; do case "$x" in varlog_size=*) varlog_size="${x#varlog_size=}" + ;; + logs_inram=on) + logs_inram=true + ;; esac done [ -z "$varlog_size" ] && exit 0 +# If logs are being stored in memory, then don't bother +# creating the log file just to have it deleted afterwards. +$logs_inram && exit 0 + # exit when the var_log.ext4 exists and the size matches if [ -e "${rootmnt}/host/disk-img/var-log.ext4" ]; then cur_varlog_size=$(ls -l ${rootmnt}/host/disk-img/var-log.ext4 | awk '{print $5}') diff --git a/installer/arm64/install.sh b/installer/arm64/install.sh index dee3ceec903..249c5b52170 100755 --- a/installer/arm64/install.sh +++ b/installer/arm64/install.sh @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev fi # Create target directory or clean it up if exists diff --git a/installer/armhf/install.sh b/installer/armhf/install.sh index 9ade40d5149..8cffa755734 100755 --- a/installer/armhf/install.sh +++ b/installer/armhf/install.sh @@ -139,6 +139,11 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev fi # Create target directory or clean it up if exists diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index dbab4d54ab7..950d765d241 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -477,6 +477,9 @@ if [ "$install_env" = "onie" ]; then # Make filesystem mkfs.ext4 -L $demo_volume_label $demo_dev + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev + # Mount demo filesystem demo_mnt=$(${onie_bin} mktemp -d) || { echo "Error: Unable to create file system mount point" @@ -509,12 +512,20 @@ elif [ "$install_env" = "sonic" ]; then rm -rf $f fi done + + demo_dev=$(findmnt -n -o SOURCE --target /host) + + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev else demo_mnt="build_raw_image_mnt" demo_dev=$cur_wd/"%%OUTPUT_RAW_IMAGE%%" mkfs.ext4 -L $demo_volume_label $demo_dev + # Don't reserve any blocks just for root + tune2fs -m 0 -r 0 $demo_dev + echo "Mounting $demo_dev on $demo_mnt..." mkdir $demo_mnt mount -t auto -o loop $demo_dev $demo_mnt From c5849c9650f099428f10207992b58623445db314 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozodoi Date: Wed, 16 Mar 2022 06:00:51 +0200 Subject: [PATCH 138/139] Add scapy support for python3 virtual environment in the sonic-mgmt docker container (#10234) Why I did it Migration of sonic-mgmt codebase from Python 2 to Python 3 How I did it Added scapy dependencies to the env-python3 virtual environment. How to verify it Run test case: py.test --testbed=testbed-t0 --inventory=../ansible/lab --testbed_file=../ansible/testbed.csv --host-pattern=testbed-t0 -- module-path=../ansible/library lldp Signed-off-by: Oleksandr Kozodoi --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index df26f2ccf38..99ad9fa8fb8 100755 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -245,7 +245,8 @@ RUN python3 -m pip install setuptools-rust \ allure-pytest==2.8.22 \ retry \ thrift==0.11.0 \ - ptf + ptf \ + scapy==2.4.5 # Deactivating a virtualenv. ENV PATH="$BACKUP_OF_PATH" From 5c7aa50463512e16fefe564c80eb8838a49a3ee2 Mon Sep 17 00:00:00 2001 From: Arun Saravanan Balachandran <52521751+ArunSaravananBalachandran@users.noreply.github.com> Date: Thu, 17 Mar 2022 02:46:26 +0530 Subject: [PATCH 139/139] DellEMC: Z9332f - Component API Fixes (#10187) --- .../common/ipmihelper.py | 5 ++- .../common/onie_stage_fwpkg | 2 +- .../common/sonic_platform/hwaccess.py | 5 ++- .../z9332f/sonic_platform/component.py | 38 +++++++++++++++---- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py index d95329c40de..3908f90bdad 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py +++ b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py @@ -90,7 +90,10 @@ def get_twos_complement(val, bits): R_exp = get_twos_complement((factors[6] & 0xF0) >> 4, 4) B_exp = get_twos_complement(factors[6] & 0x0F, 4) - converted_reading = ((M * raw_value) + (B * 10**B_exp)) * 10**R_exp + if R_exp < 0: + converted_reading = ((M * raw_value) + (B * 10**B_exp)) / 10**(-R_exp) + else: + converted_reading = ((M * raw_value) + (B * 10**B_exp)) * 10**R_exp return True, converted_reading diff --git a/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg index 1ceaf32fe8c..dcc74a09a91 100755 --- a/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg +++ b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg @@ -45,7 +45,7 @@ function show_help_and_exit() echo " " echo " Available options:" echo " -h, -? : getting this help" - echo " -o [fwpkg] : stages the firmware update package" + echo " -a [fwpkg] : stages the firmware update package" exit 0 } diff --git a/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py b/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py index 373f71bdd5b..642a6ddc6fc 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py +++ b/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py @@ -39,7 +39,10 @@ def pci_set_value(resource, val, offset): # Read I2C device def i2c_get(bus, i2caddr, ofs): - return int(subprocess.check_output(['/usr/sbin/i2cget', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + try: + return int(subprocess.check_output(['/usr/sbin/i2cget', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + except (FileNotFoundError, subprocess.CalledProcessError): + return -1 def io_reg_read(io_resource, offset): fd = os.open(io_resource, os.O_RDONLY) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py index f652c2eccf8..214467f8c35 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py @@ -23,20 +23,36 @@ def get_bios_version(): - return subprocess.check_output( - ['dmidecode', '-s', 'bios-version']).decode('utf-8').strip() + try: + return subprocess.check_output(['dmidecode', '-s', 'bios-version'], + text=True).strip() + except (FileNotFoundError, subprocess.CalledProcessError): + return 'NA' def get_fpga_version(): val = hwaccess.pci_get_value('/sys/bus/pci/devices/0000:09:00.0/resource0', 0) return '{}.{}'.format((val >> 16) & 0xffff, val & 0xffff) def get_bmc_version(): - return subprocess.check_output( - ['cat', '/sys/class/ipmi/ipmi0/device/bmc/firmware_revision'] - ).decode('utf-8').strip() + val = 'NA' + try: + bmc_ver = subprocess.check_output(['ipmitool', 'mc', 'info'], + stderr=subprocess.STDOUT, text=True) + except (FileNotFoundError, subprocess.CalledProcessError): + pass + else: + version = re.search(r'Firmware Revision\s*:\s(.*)', bmc_ver) + if version: + val = version.group(1).strip() + + return val def get_cpld_version(bus, i2caddr): - return '{}'.format(hwaccess.i2c_get(bus, i2caddr, 0)) + val = hwaccess.i2c_get(bus, i2caddr, 0) + if val != -1: + return '{:x}.{:x}'.format((val >> 4) & 0xf, val & 0xf) + else: + return 'NA' def get_cpld0_version(): return get_cpld_version(5, 0x0d) @@ -69,7 +85,7 @@ def get_pciephy_version(): except (FileNotFoundError, subprocess.CalledProcessError): pass else: - version = re.search(r'PCIe FW loader version:\s(.*)', pcie_ver) + version = re.search(r'PCIe FW version:\s(.*)', pcie_ver) if version: val = version.group(1).strip() @@ -158,6 +174,14 @@ def _get_available_firmware_version(image_path): ver_info = ver_info.get("x86_64-dellemc_z9332f_d1508-r0") if ver_info: + components = list(ver_info.keys()) + for component in components: + if "CPLD" in component and ver_info[component].get('version'): + val = ver_info.pop(component) + ver = int(val['version'], 16) + val['version'] = "{:x}.{:x}".format((ver >> 4) & 0xf, ver & 0xf) + ver_info[component.replace("-", " ")] = val + return True, ver_info else: return False, "ERROR: Version info not available"