From b214a8a8b6f95f032e1265c24b749acd77345120 Mon Sep 17 00:00:00 2001 From: Vadym Hlushko <62022266+vadymhlushko-mlnx@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:54:13 +0300 Subject: [PATCH 01/32] [Mellanox] Change SDK API sx_mgmt_phy_module_info_get() to sysfs (#15963) - Why I did it Change Mellanox platform API implementation to use ASIC driver sysfs for the module operational state and status error fields. - How I did it Modify the platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py file by change the call of sx_mgmt_phy_module_info_get() SDK API to sysfs - How to verify it Simulate the unplug cable event Check the CLI output sfputil show presence sfputil show error-status -hw Simulate the plug cable event Repeat 2 step Signed-off-by: vadymhlushko-mlnx --- .../mlnx-platform-api/sonic_platform/sfp.py | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index aa83fd1455ec..9ec38e23ba39 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -134,6 +134,8 @@ SFP_A2H_PAGE0_PATH = '0/i2c-0x51/data' SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE = '/sys/module/sx_core/asic0/module{}/' SFP_EEPROM_ROOT_TEMPLATE = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE + 'eeprom/pages' +SFP_SYSFS_STATUS = 'status' +SFP_SYSFS_STATUS_ERROR = 'statuserror' SFP_SYSFS_PRESENT = 'present' SFP_SYSFS_RESET = 'reset' SFP_SYSFS_POWER_MODE = 'power_mode' @@ -215,24 +217,18 @@ def sdk_handle(self): @classmethod def _get_module_info(self, sdk_handle, sdk_index): """ - Get error code of the SFP module + Get oper state and error code of the SFP module Returns: - The error code fetch from SDK API + The oper state and error code fetched from sysfs """ - module_id_info_list = new_sx_mgmt_module_id_info_t_arr(1) - module_info_list = new_sx_mgmt_phy_module_info_t_arr(1) + status_file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(sdk_index) + SFP_SYSFS_STATUS + oper_state = utils.read_int_from_file(status_file_path) - module_id_info = sx_mgmt_module_id_info_t() - module_id_info.slot_id = 0 - module_id_info.module_id = sdk_index - sx_mgmt_module_id_info_t_arr_setitem(module_id_info_list, 0, module_id_info) + status_error_file_path = SFP_SDK_MODULE_SYSFS_ROOT_TEMPLATE.format(sdk_index) + SFP_SYSFS_STATUS_ERROR + error_type = utils.read_int_from_file(status_error_file_path) - rc = sx_mgmt_phy_module_info_get(sdk_handle, module_id_info_list, 1, module_info_list) - assert SX_STATUS_SUCCESS == rc, "sx_mgmt_phy_module_info_get failed, error code {}".format(rc) - - mod_info = sx_mgmt_phy_module_info_t_arr_getitem(module_info_list, 0) - return mod_info.module_state.oper_state, mod_info.module_state.error_type + return oper_state, error_type class SFP(NvidiaSFPCommon): From 55fb6d0a5ae93d72107bab9bcbb5aa2216f958eb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:32:26 +0800 Subject: [PATCH 02/32] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#16228) #### Why I did it src/sonic-gnmi ``` * ac94807 - (HEAD -> master, origin/master, origin/HEAD) Support get all with json (#145) (19 hours ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index fdb94da0ab27..ac94807358fc 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit fdb94da0ab27c674eb0b17ecd5409b767fac7282 +Subproject commit ac94807358fcb3cc2bd61d31dd7fb54425ac998c From fbe75ee85b0e5b9fbaf22c434864ebddbc4f5f7b Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:32:45 +0800 Subject: [PATCH 03/32] [submodule] Update submodule dhcpmon to the latest HEAD automatically (#16227) #### Why I did it src/dhcpmon ``` * a3c5381 - (HEAD -> master, origin/master, origin/HEAD) Merge pull request #11 from jcaiMR/dev/jcai_fix_err_log (12 hours ago) [StormLiangMS] * ab78a31 - Merge branch 'master' into dev/jcai_fix_err_log (4 days ago) [jcaiMR] * 5314b72 - remove unnessary log message in case too many log output (5 days ago) [jcaiMR] * 01f4fa7 - fix build issue (5 days ago) [jcaiMR] * c2fbb34 - fix format issue (5 days ago) [jcaiMR] * 79b6720 - fix a notification message format issue (6 days ago) [jcaiMR] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/dhcpmon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcpmon b/src/dhcpmon index c5ef7e765db7..a3c5381307ec 160000 --- a/src/dhcpmon +++ b/src/dhcpmon @@ -1 +1 @@ -Subproject commit c5ef7e765db782f6e7bb66bbd28732b9968c40e6 +Subproject commit a3c5381307ec4f7fbcc2ac8626caf3b32d997127 From 0652991eb807f7cad62a5510df99ca3ec2ff5c66 Mon Sep 17 00:00:00 2001 From: Vivek Date: Tue, 22 Aug 2023 08:36:38 -0700 Subject: [PATCH 04/32] Run db_migrator for non first-time reboots (#16116) - Why I did it The recent change #15685 (comment) removed the db migration for non first reboots. This is problematic for many deployments which doesn't rely on ZTP and push a custom config_db.json Port to older branches after #15685 is ported back - How I did it Re-introduce the logic to run the db_migrator on non-first boots - How to verify it Verified reboot and warm-reboot cases Signed-off-by: Vivek Reddy Karri --- files/build_templates/docker_image_ctl.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 924f0283bad6..546eb24cb629 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -259,9 +259,18 @@ function postStartAction() # This flag will be set to "1" after DB migration/initialization is completed as part of config-setup $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "0" else + $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "0" + # this is not a first time boot to a new image. Datbase container starts w/ old pre-existing config + if [[ -x /usr/local/bin/db_migrator.py ]]; then + # Migrate the DB to the latest schema version if needed + if [ -z "$DEV" ]; then + /usr/local/bin/db_migrator.py -o migrate + fi + fi # set CONFIG_DB_INITIALIZED to indicate end of config load and migration $SONIC_DB_CLI CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" fi + # Add redis UDS to the redis group and give read/write access to the group REDIS_SOCK="/var/run/redis${DEV}/redis.sock" else From 7445106bb96ab9825b4d1d948827dea83e19a7b4 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Wed, 23 Aug 2023 02:26:04 +0800 Subject: [PATCH 05/32] [YANG SONIC-ACL] Fix Yang definition of IN_PORTS and OUT_PORTS (#16220) How I did it Update Yang definition of IN_PORTS and OUT_PORTS to string. Since we cannot split the string with comma (,) and validate each substring is a valid SONiC port name. The only restriction for them is must be a string. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. Build a SONiC image based on 202205 branch and installed on physical DUT. Re try the steps in [Yang] Incorrect definition of IN_PORTS and OUT_PORTS in sonic-acl.yang #16190 and can see below success response: --- .../tests/yang_model_tests/tests/acl.json | 6 + .../yang_model_tests/tests_config/acl.json | 108 ++++++++++++++++++ .../yang-templates/sonic-acl.yang.j2 | 12 +- 3 files changed, 120 insertions(+), 6 deletions(-) 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 f66afc09d1c9..4d9ef12ec442 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 @@ -14,6 +14,12 @@ "eStrKey" : "Mandatory", "eStr": ["ACL_RULE", "PRIORITY"] }, + "ACL_RULE_WITH_VALID_IN_PORTS": { + "desc": "Configure ACL_RULE with valid IN_PORTS." + }, + "ACL_RULE_WITH_VALID_OUT_PORTS": { + "desc": "Configure ACL_RULE with valid OUT_PORTS." + }, "ACL_TABLE_EMPTY_PORTS": { "desc": "Configure ACL_TABLE with empty ports." }, 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 4733c9c3cc73..3173456da09f 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 @@ -482,6 +482,114 @@ } } }, + "ACL_RULE_WITH_VALID_IN_PORTS": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "IN_PORTS": "Ethernet0,Ethernet1", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 9999, + "RULE_NAME": "Rule_20", + "SRC_IPV6": "2001::1/64" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "policy_desc": "Filter IPv4", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "INGRESS", + "type": "L3" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "description": "Ethernet1", + "lanes": "4,5,6,7", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, + "ACL_RULE_WITH_VALID_OUT_PORTS": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_RULE": { + "ACL_RULE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "OUT_PORTS": "Ethernet0,Ethernet1", + "PACKET_ACTION": "FORWARD", + "PRIORITY": 9999, + "RULE_NAME": "Rule_20", + "SRC_IPV6": "2001::1/64" + } + ] + }, + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V4", + "policy_desc": "Filter IPv4", + "ports": [ + "Ethernet0", + "Ethernet1" + ], + "stage": "EGRESS", + "type": "L3" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + }, + { + "admin_status": "up", + "alias": "eth1", + "description": "Ethernet1", + "lanes": "4,5,6,7", + "mtu": 9000, + "name": "Ethernet1", + "speed": 25000 + } + ] + } + } + }, "ACL_TABLE_DEFAULT_VALUE_STAGE": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_TABLE": { 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 c2a8a48dcd12..72faf4313c11 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -128,14 +128,14 @@ module sonic-acl { } } - leaf-list IN_PORTS { - /* Values in leaf list are UNIQUE */ - type uint16; + leaf IN_PORTS { + /* Values is a list of SONiC port name (/port:sonic-port/port:PORT/port:PORT_LIST/port:name) joined by comma */ + type string; } - leaf-list OUT_PORTS { - /* Values in leaf list are UNIQUE */ - type uint16; + leaf OUT_PORTS { + /* Values is a list of SONiC port name (/port:sonic-port/port:PORT/port:PORT_LIST/port:name) joined by comma */ + type string; } choice src_port { From d42066cf8d3fbb21b6281c30465484f3e50231c3 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 23 Aug 2023 02:07:14 +0200 Subject: [PATCH 06/32] [Arista] Remove one pcie device accross platforms (#16173) These devices will not reliabily report the proper devid and vendorid when reading it is read directly from the pci config space. It can be read but shouldn't be compared against some fixed value like the one stored in pcie.yaml. Since this makes pcied unhappy, the simplest path forward is to just remove this device from monitoring. --- device/arista/x86_64-arista_7050dx4_32s/pcie.yaml | 5 ----- device/arista/x86_64-arista_7050px4_32s/pcie.yaml | 5 ----- device/arista/x86_64-arista_7050sx3_48c8/pcie.yaml | 5 ----- device/arista/x86_64-arista_7050sx3_48yc8/pcie.yaml | 5 ----- device/arista/x86_64-arista_7060dx4_32/pcie.yaml | 5 ----- device/arista/x86_64-arista_7060dx5_32/pcie.yaml | 1 + device/arista/x86_64-arista_7060dx5_64s/pcie.yaml | 1 + device/arista/x86_64-arista_7060px4_32/pcie.yaml | 5 ----- device/arista/x86_64-arista_7060px5_64s/pcie.yaml | 1 + device/arista/x86_64-arista_7170_32cd/pcie.yaml | 5 ----- device/arista/x86_64-arista_7170_64c/pcie.yaml | 5 ----- device/arista/x86_64-arista_720dt_48s/pcie.yaml | 5 ----- device/arista/x86_64-arista_7260cx3_64/pcie.yaml | 5 ----- device/arista/x86_64-arista_7280cr3_32p4/pcie.yaml | 5 ----- device/arista/x86_64-arista_7800_sup/pcie.yaml | 1 + device/arista/x86_64-arista_7800r3_48cq2_lc/pcie.yaml | 5 ----- device/arista/x86_64-arista_7800r3_48cqm2_lc/pcie.yaml | 5 ----- device/arista/x86_64-arista_7800r3a_36d2_lc/pcie.yaml | 5 ----- device/arista/x86_64-arista_common/pcie.yaml | 1 + 19 files changed, 5 insertions(+), 70 deletions(-) create mode 120000 device/arista/x86_64-arista_7060dx5_32/pcie.yaml create mode 120000 device/arista/x86_64-arista_7060dx5_64s/pcie.yaml create mode 120000 device/arista/x86_64-arista_7060px5_64s/pcie.yaml create mode 120000 device/arista/x86_64-arista_7800_sup/pcie.yaml create mode 100644 device/arista/x86_64-arista_common/pcie.yaml diff --git a/device/arista/x86_64-arista_7050dx4_32s/pcie.yaml b/device/arista/x86_64-arista_7050dx4_32s/pcie.yaml index 0085590fe348..30947acfbe09 100644 --- a/device/arista/x86_64-arista_7050dx4_32s/pcie.yaml +++ b/device/arista/x86_64-arista_7050dx4_32s/pcie.yaml @@ -152,11 +152,6 @@ id: '1466' name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arastra Inc. Device 0001' - bus: '01' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_7050px4_32s/pcie.yaml b/device/arista/x86_64-arista_7050px4_32s/pcie.yaml index 0085590fe348..30947acfbe09 100644 --- a/device/arista/x86_64-arista_7050px4_32s/pcie.yaml +++ b/device/arista/x86_64-arista_7050px4_32s/pcie.yaml @@ -152,11 +152,6 @@ id: '1466' name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arastra Inc. Device 0001' - bus: '01' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_7050sx3_48c8/pcie.yaml b/device/arista/x86_64-arista_7050sx3_48c8/pcie.yaml index a0e58628f4b7..17e961550415 100644 --- a/device/arista/x86_64-arista_7050sx3_48c8/pcie.yaml +++ b/device/arista/x86_64-arista_7050sx3_48c8/pcie.yaml @@ -64,11 +64,6 @@ id: '1578' name: 'Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor' -- bus: '00' - dev: 09 - fn: '0' - id: '0001' - name: 'Host bridge: Arastra Inc. Device 0001' - bus: '00' dev: 09 fn: '2' diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/pcie.yaml b/device/arista/x86_64-arista_7050sx3_48yc8/pcie.yaml index 96e42dd936ef..0b9ece287ab9 100644 --- a/device/arista/x86_64-arista_7050sx3_48yc8/pcie.yaml +++ b/device/arista/x86_64-arista_7050sx3_48yc8/pcie.yaml @@ -64,11 +64,6 @@ id: '1578' name: 'Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor' -- bus: '00' - dev: 09 - fn: '0' - id: '0001' - name: 'Host bridge: Arastra Inc. Device 0001' - bus: '00' dev: 09 fn: '2' diff --git a/device/arista/x86_64-arista_7060dx4_32/pcie.yaml b/device/arista/x86_64-arista_7060dx4_32/pcie.yaml index 9417788f1dbd..9e1c27f88183 100644 --- a/device/arista/x86_64-arista_7060dx4_32/pcie.yaml +++ b/device/arista/x86_64-arista_7060dx4_32/pcie.yaml @@ -186,11 +186,6 @@ 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: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' - bus: ff dev: 0c fn: '0' diff --git a/device/arista/x86_64-arista_7060dx5_32/pcie.yaml b/device/arista/x86_64-arista_7060dx5_32/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060dx5_32/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060dx5_64s/pcie.yaml b/device/arista/x86_64-arista_7060dx5_64s/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060dx5_64s/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060px4_32/pcie.yaml b/device/arista/x86_64-arista_7060px4_32/pcie.yaml index 9417788f1dbd..9e1c27f88183 100644 --- a/device/arista/x86_64-arista_7060px4_32/pcie.yaml +++ b/device/arista/x86_64-arista_7060px4_32/pcie.yaml @@ -186,11 +186,6 @@ 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: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' - bus: ff dev: 0c fn: '0' diff --git a/device/arista/x86_64-arista_7060px5_64s/pcie.yaml b/device/arista/x86_64-arista_7060px5_64s/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7060px5_64s/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7170_32cd/pcie.yaml b/device/arista/x86_64-arista_7170_32cd/pcie.yaml index eafae4eb1472..0f8df9154cdb 100644 --- a/device/arista/x86_64-arista_7170_32cd/pcie.yaml +++ b/device/arista/x86_64-arista_7170_32cd/pcie.yaml @@ -186,11 +186,6 @@ 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: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' - bus: ff dev: 0c fn: '0' diff --git a/device/arista/x86_64-arista_7170_64c/pcie.yaml b/device/arista/x86_64-arista_7170_64c/pcie.yaml index f26914761125..49faf89dc565 100644 --- a/device/arista/x86_64-arista_7170_64c/pcie.yaml +++ b/device/arista/x86_64-arista_7170_64c/pcie.yaml @@ -174,11 +174,6 @@ 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: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' - bus: ff dev: 0c fn: '0' diff --git a/device/arista/x86_64-arista_720dt_48s/pcie.yaml b/device/arista/x86_64-arista_720dt_48s/pcie.yaml index bda6ac688c7a..b2ecad04bc2f 100644 --- a/device/arista/x86_64-arista_720dt_48s/pcie.yaml +++ b/device/arista/x86_64-arista_720dt_48s/pcie.yaml @@ -90,11 +90,6 @@ id: 15ee name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arista Networks, Inc. Device 0001' - bus: '01' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_7260cx3_64/pcie.yaml b/device/arista/x86_64-arista_7260cx3_64/pcie.yaml index a2540013703e..24955eee42f4 100644 --- a/device/arista/x86_64-arista_7260cx3_64/pcie.yaml +++ b/device/arista/x86_64-arista_7260cx3_64/pcie.yaml @@ -179,11 +179,6 @@ 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: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' - bus: ff dev: 0c fn: '0' diff --git a/device/arista/x86_64-arista_7280cr3_32p4/pcie.yaml b/device/arista/x86_64-arista_7280cr3_32p4/pcie.yaml index b327bf557796..7608e5e9c782 100644 --- a/device/arista/x86_64-arista_7280cr3_32p4/pcie.yaml +++ b/device/arista/x86_64-arista_7280cr3_32p4/pcie.yaml @@ -64,11 +64,6 @@ id: '1578' name: 'Encryption controller: Advanced Micro Devices, Inc. [AMD] Carrizo Platform Security Processor' -- bus: '00' - dev: 09 - fn: '0' - id: '0001' - name: 'Host bridge: Arista Networks, Inc. Device 0001' - bus: '00' dev: 09 fn: '2' diff --git a/device/arista/x86_64-arista_7800_sup/pcie.yaml b/device/arista/x86_64-arista_7800_sup/pcie.yaml new file mode 120000 index 000000000000..df18a601d82f --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/pcie.yaml @@ -0,0 +1 @@ +../x86_64-arista_common/pcie.yaml \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/pcie.yaml b/device/arista/x86_64-arista_7800r3_48cq2_lc/pcie.yaml index 8d7fb1849979..1669ab31dad3 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/pcie.yaml +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/pcie.yaml @@ -152,11 +152,6 @@ id: '1466' name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arista Networks, Inc. Device 0001' - bus: '04' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_7800r3_48cqm2_lc/pcie.yaml b/device/arista/x86_64-arista_7800r3_48cqm2_lc/pcie.yaml index 8d7fb1849979..1669ab31dad3 100644 --- a/device/arista/x86_64-arista_7800r3_48cqm2_lc/pcie.yaml +++ b/device/arista/x86_64-arista_7800r3_48cqm2_lc/pcie.yaml @@ -152,11 +152,6 @@ id: '1466' name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arista Networks, Inc. Device 0001' - bus: '04' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/pcie.yaml b/device/arista/x86_64-arista_7800r3a_36d2_lc/pcie.yaml index 4b4481f3154d..882f87987b70 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/pcie.yaml +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/pcie.yaml @@ -152,11 +152,6 @@ id: '1466' name: 'Host bridge: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6' -- bus: '00' - dev: '18' - fn: '7' - id: '0001' - name: 'Host bridge: Arista Networks, Inc. Device 0001' - bus: '04' dev: '00' fn: '0' diff --git a/device/arista/x86_64-arista_common/pcie.yaml b/device/arista/x86_64-arista_common/pcie.yaml new file mode 100644 index 000000000000..fe51488c7066 --- /dev/null +++ b/device/arista/x86_64-arista_common/pcie.yaml @@ -0,0 +1 @@ +[] From 95f317a5e2b415a02e9416b4fa29dcebfa3570dc Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Wed, 23 Aug 2023 14:30:58 +0800 Subject: [PATCH 07/32] [Mellanox] Fix issue: watchdogutil command does not work (#16091) - Why I did it watchdogutil uses platform API watchdog instance to control/query watchdog status. In Nvidia watchdog status, it caches "armed" status in a object member "WatchdogImplBase.armed". This is not working for CLI infrastructure because each CLI will create a new watchdog instance, the status cached in previous instance will totally lose. Consider following commands: admin@sonic:~$ sudo watchdogutil arm -s 100 =====> watchdog instance1, armed=True Watchdog armed for 100 seconds admin@sonic:~$ sudo watchdogutil status ======> watchdog instance2, armed=False Status: Unarmed admin@sonic:~$ sudo watchdogutil disarm =======> watchdog instance3, armed=False Failed to disarm Watchdog - How I did it Use sysfs to query watchdog status - How to verify it Manual test Unit test --- .../sonic_platform/watchdog.py | 48 +++++++++---------- .../mlnx-platform-api/tests/test_watchdog.py | 36 +++++++++----- 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index 2a032d3131f2..630163c12e18 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -27,6 +27,7 @@ import time from sonic_platform_base.watchdog_base import WatchdogBase +from . import utils """ ioctl constants """ IO_WRITE = 0x40000000 @@ -80,16 +81,15 @@ def __init__(self, wd_device_path): super(WatchdogImplBase, self).__init__() self.watchdog_path = wd_device_path - self.watchdog = self.open_handle() - - # Opening a watchdog descriptor starts - # watchdog timer; - # by default it should be stopped - self._disablecard() - self.armed = False - + self._watchdog = None self.timeout = self._gettimeout() + @property + def watchdog(self): + if self._watchdog is None: + self._watchdog = self.open_handle() + return self._watchdog + def open_handle(self): return os.open(self.watchdog_path, os.O_WRONLY) @@ -134,10 +134,7 @@ def _gettimeout(self): @return watchdog timeout """ - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) - - return int(req[0]) + return utils.read_int_from_file('/run/hw-management/watchdog/main/timeout') def _gettimeleft(self): """ @@ -145,10 +142,7 @@ def _gettimeleft(self): @return time left in seconds """ - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) - - return int(req[0]) + return utils.read_int_from_file('/run/hw-management/watchdog/main/timeleft') def arm(self, seconds): """ @@ -162,11 +156,10 @@ def arm(self, seconds): try: if self.timeout != seconds: self.timeout = self._settimeout(seconds) - if self.armed: + if self.is_armed(): self._keepalive() else: self._enablecard() - self.armed = True ret = self.timeout except IOError: pass @@ -179,10 +172,9 @@ def disarm(self): """ disarmed = False - if self.armed: + if self.is_armed(): try: self._disablecard() - self.armed = False disarmed = True except IOError: pass @@ -194,7 +186,7 @@ def is_armed(self): Implements is_armed WatchdogBase API """ - return self.armed + return utils.read_str_from_file('/run/hw-management/watchdog/main/state') == 'active' def get_remaining_time(self): """ @@ -203,7 +195,7 @@ def get_remaining_time(self): timeleft = WD_COMMON_ERROR - if self.armed: + if self.is_armed(): try: timeleft = self._gettimeleft() except IOError: @@ -216,13 +208,15 @@ def __del__(self): Close watchdog """ - os.close(self.watchdog) + if self._watchdog is not None: + os.close(self._watchdog) class WatchdogType1(WatchdogImplBase): """ Watchdog type 1 """ + TIMESTAMP_FILE = '/tmp/nvidia/watchdog_timestamp' def arm(self, seconds): """ @@ -233,7 +227,8 @@ def arm(self, seconds): ret = WatchdogImplBase.arm(self, seconds) # Save the watchdog arm timestamp # requiered for get_remaining_time() - self.arm_timestamp = time.time() + os.makedirs('/tmp/nvidia', exist_ok=True) + utils.write_file(self.TIMESTAMP_FILE, str(time.time())) return ret @@ -246,8 +241,9 @@ def get_remaining_time(self): timeleft = WD_COMMON_ERROR - if self.armed: - timeleft = int(self.timeout - (time.time() - self.arm_timestamp)) + if self.is_armed(): + arm_timestamp = utils.read_float_from_file(self.TIMESTAMP_FILE) + timeleft = int(self.timeout - (time.time() - arm_timestamp)) return timeleft diff --git a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py index d3dff9db8735..68d29d38a654 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_watchdog.py @@ -84,46 +84,58 @@ def test_is_wd_type2(self, mock_exists, test_para): mock_exists.return_value = test_para assert is_wd_type2('') is test_para + @mock.patch('sonic_platform.utils.read_str_from_file') + def test_is_armed(self, mock_read): + watchdog = WatchdogType2('watchdog2') + mock_read.return_value = 'inactive' + assert not watchdog.is_armed() + mock_read.return_value = 'active' + assert watchdog.is_armed() + @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) - def test_arm_disarm_watchdog2(self): + @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + def test_arm_disarm_watchdog2(self, mock_is_armed): watchdog = WatchdogType2('watchdog2') assert watchdog.arm(-1) == -1 - assert not watchdog.is_armed() + mock_is_armed.return_value = False watchdog.arm(10) - assert watchdog.is_armed() + mock_is_armed.return_value = True watchdog.arm(5) - assert watchdog.is_armed() watchdog.disarm() - assert not watchdog.is_armed() @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) - def test_arm_disarm_watchdog1(self): + @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + def test_arm_disarm_watchdog1(self, mock_is_armed): watchdog = WatchdogType1('watchdog1') assert watchdog.arm(-1) == -1 - assert not watchdog.is_armed() + mock_is_armed.return_value = False watchdog.arm(10) - assert watchdog.is_armed() + mock_is_armed.return_value = True watchdog.arm(5) - assert watchdog.is_armed() watchdog.disarm() - assert not watchdog.is_armed() @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.WatchdogImplBase._gettimeleft', mock.MagicMock(return_value=10)) - def test_get_remaining_time_watchdog2(self): + @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + def test_get_remaining_time_watchdog2(self, mock_is_armed): watchdog = WatchdogType2('watchdog2') + mock_is_armed.return_value = False assert watchdog.get_remaining_time() == -1 watchdog.arm(10) + mock_is_armed.return_value = True assert watchdog.get_remaining_time() == 10 @mock.patch('sonic_platform.watchdog.WatchdogImplBase.open_handle', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.fcntl.ioctl', mock.MagicMock()) @mock.patch('sonic_platform.watchdog.WatchdogImplBase._gettimeleft', mock.MagicMock(return_value=10)) - def test_get_remaining_time_watchdog1(self): + @mock.patch('sonic_platform.watchdog.WatchdogImplBase.is_armed') + def test_get_remaining_time_watchdog1(self, mock_is_armed): watchdog = WatchdogType1('watchdog2') + mock_is_armed.return_value = False assert watchdog.get_remaining_time() == -1 watchdog.arm(10) + mock_is_armed.return_value = True assert watchdog.get_remaining_time() > 0 From 0eb7907e8741db289c70a722d11ca378c6d139f6 Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Wed, 23 Aug 2023 23:31:22 +0530 Subject: [PATCH 08/32] Dell S6100 Platform API 2.0 fixes (#16208) Why I did it Dell S6100 Platform components needs to be updated. How I did it Modified platform.json to fix the issue. How to verify it Run sonic-mgmt component test and check whether it passes. --- device/dell/x86_64-dell_s6100_c2538-r0/platform.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/platform.json b/device/dell/x86_64-dell_s6100_c2538-r0/platform.json index 819f104aa53a..ba9fb90ad6ab 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/platform.json +++ b/device/dell/x86_64-dell_s6100_c2538-r0/platform.json @@ -469,7 +469,13 @@ }, { "name": "QSFP+ or later" - } + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "SFP/SFP+/SFP28" + } ] }, "interfaces": {} From 821be3f6fcb632bfa6fe7828c77e79fac16f9658 Mon Sep 17 00:00:00 2001 From: Aravind Mani <53524901+aravindmani-1@users.noreply.github.com> Date: Wed, 23 Aug 2023 23:35:03 +0530 Subject: [PATCH 09/32] DellEMC: System health config changes (#15771) Why I did it System health config is missing in few Dell platforms. How I did it Added system health monitoring config and its related API's How to verify it show system-health summary/detail commands. --- .../system_health_monitoring_config.json | 11 +++ .../system_health_monitoring_config.json | 11 +++ .../system_health_monitoring_config.json | 11 +++ .../s5248f/sonic_platform/chassis.py | 68 +++++++++++++------ .../s5248f/sonic_platform/psu.py | 55 ++++++++++++++- .../s5296f/sonic_platform/chassis.py | 29 ++------ 6 files changed, 140 insertions(+), 45 deletions(-) create mode 100644 device/dell/x86_64-dellemc_s5248f_c3538-r0/system_health_monitoring_config.json create mode 100644 device/dell/x86_64-dellemc_s5296f_c3538-r0/system_health_monitoring_config.json create mode 100644 device/dell/x86_64-dellemc_z9264f_c3538-r0/system_health_monitoring_config.json diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/system_health_monitoring_config.json b/device/dell/x86_64-dellemc_s5248f_c3538-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..315deec90b0a --- /dev/null +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": ["fan.speed"], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault" : "amber", + "normal" : "green", + "booting": "blinking_green" + } +} diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/system_health_monitoring_config.json b/device/dell/x86_64-dellemc_s5296f_c3538-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..315deec90b0a --- /dev/null +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": ["fan.speed"], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault" : "amber", + "normal" : "green", + "booting": "blinking_green" + } +} diff --git a/device/dell/x86_64-dellemc_z9264f_c3538-r0/system_health_monitoring_config.json b/device/dell/x86_64-dellemc_z9264f_c3538-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..315deec90b0a --- /dev/null +++ b/device/dell/x86_64-dellemc_z9264f_c3538-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": ["fan.speed"], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault" : "amber", + "normal" : "green", + "booting": "blinking_green" + } +} diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py index fc0768368e45..3e6a2e32c9ea 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py @@ -33,33 +33,31 @@ SYSTEM_BEACON_LED_SET = 0x8 SYSTEM_BEACON_LED_CLEAR = 0xFFFFFFF7 -media_part_num_list = set([ \ -"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC", -"C5RNH","5250G","N8TDR","7D64H","7D64H","RN84N","RN84N","HMTNW","6K3Y6","6K3Y6","TY5FM","50M0R","PGYJT","WP2PP","85Y13","1HCGH","FP9R1","FYD0M","C6Y7M","C6Y7M","V250M","V250M", -"5CWK6","5CWK6","53HVN","53HVN","358VV","358VV","MV799","MV799","YJF03","P9GND","T1KCN","1DXKP","MT7R2","K0T7R","W5G04","7TCDN","7TCDN","7TCDN","7TCDN","7TCDN","V3XJK","0MV31", -"5FVP7","N6KM9","C41MF","77KC3","XW7J0","V4NJV","2XJHY","H93DH","H93DH","F8CG0","F8CG0","F8CG0","119N6","WFMF5","794RX","288F6","1M31V","1M31V","5NP8R","5NP8R","4TC09","4TC09", -"FC6KV","FC6KV","J90VN","J90VN","05RH0","05RH0","YDN52","0C2YV","YDN52","0C2YV","9JT65","D7M6H","6GW14","FYVFW","0VF5H","P4YPY","P4YPY","TCPM2","TCPM2","JNPF8","JNPF8","27GG5", -"27GG5","P8T4W","P8T4W","JR54Y","M6N0J","XJYD0","K44H9","035KG","P7C7N","76V43","3CC35","FN4FC","26FN3","YFNDD","YFNDD","7R9N9","035KG","P7C7N","76V43","3CC35","PLRXPLSCS43811", -"FN4FC","26FN3","YFNDD","YFNDD","7R9N9","G86YJ","V407F","V407F","9KH6T","G86YJ","V407F","9KH6T","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY", -"9X8JP","GMFC5","GMFC5","GMFC5","D7P80","3MFXG","3MFXG","0GWXJ","THPF3","THPF3","THPF3","THPF3","THPF3","PJ62G","3XCX1","JJYKG","RRRTK","16K56","86JM2","K5R6C","7MG2C","WTPPN","9HTT2", -"NKM4F","VXGGG","JC9W6","6MR8M","RP3GV","M5PPJ","XKY55","TKCXT","05J8P","5WGKD","XFDRT","NW8DM","YPKH3","5WGKD","XFDRT","NW8DM","YPKH3","71XXK","MVCX6","0XYP6","HPPVW","3GHRT","71XXK", -"MVCX6","0XYP6","HPPVW","3GHRT","2X5T6","135V2","KD5MV","2X5T6","KD5MV","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","3YWG7","5CMT2","RCVP5","X5DH4", -"4WJ41","4WJ41","14NV5","14NV5","14NV5","4WGYD","YKMH7","X7CCC","X7CCC","0X9CT","0CY8V","P7D7R","W4GPP","W4GPP","W4GPP","HHHCHC","07RN7","07RN7","0YR96","0YR96","JCYM9","FTLX8571D3BCL", -"DDW0X","VPFDJ","229KM","9FC7D","DDW0X","VPFDJ","6FMR5","J7K20","N3K9W","6FMR5","8R4VM","7VN5T","D9YM8","8R4VM","VYXPW","87TPX","WY6FK","VYXPW","87TPX","WY6FK","WG8C4","N8K82","2DV6Y", -"77C3C","RC0HM","77C3C","RC0HM","JHXTN","3P3PG","92YVM","4VX5M","4VX5M","6RRGD","W4JWV","22V6R","XR11M","9GMDY","JMCWK","TP2F0","6MGDY","78RHK", "C0TP5","0WDNV","FCLF8522P2BTL"\ -]) - class Chassis(ChassisBase): """ DELLEMC Platform-specific Chassis class """ REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason" + pci_res = "/sys/bus/pci/devices/0000:04:00.0/resource0" oir_fd = -1 epoll = -1 - _global_port_pres_dict = {} + SYSLED_COLOR_TO_REG = { + "blinking_green": 0x0, + "green" : 0x10, + "amber" : 0x20, + "blinking_amber": 0x30 + } + + REG_TO_SYSLED_COLOR = { + 0x0 : "blinking_green", + 0x10 : "green", + 0x20 : "amber", + 0x30 : "blinking_amber" + } + _port_to_i2c_mapping = { 1: 2, 2: 3, @@ -346,8 +344,39 @@ def get_reboot_cause(self): else: return (self.REBOOT_CAUSE_NON_HARDWARE, None) - def get_qualified_media_list(self): - return media_part_num_list + def initizalize_system_led(self): + self.sys_ledcolor = "green" + + def get_status_led(self): + """ + Gets the current system LED color + + Returns: + A string that represents the supported color + """ + val = hwaccess.pci_get_value(self.pci_res, SYSTEM_LED_REG) + if val != -1: + val = val & 0x30 + return self.REG_TO_SYSLED_COLOR.get(val) + return self.sys_ledcolor + + 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.SYSLED_COLOR_TO_REG.keys()): + return False + + val = hwaccess.pci_get_value(self.pci_res, SYSTEM_LED_REG) + val = (val & 0xFFCF) | self.SYSLED_COLOR_TO_REG[color] + + hwaccess.pci_set_value(self.pci_res, val, SYSTEM_LED_REG) + self.sys_ledcolor = color + return True def set_locator_led(self, color): """ @@ -385,4 +414,3 @@ def get_locator_led(self): return self.LOCATOR_LED_OFF else: return self.LOCATOR_LED_ON - diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py index 192a93b2d3a9..a4fa13c03d60 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py @@ -24,11 +24,11 @@ class Psu(PsuBase): SENSOR_MAPPING = { 1: { "State": 0x31, "Current": 0x39, "Power": 0x37, "Voltage": 0x38, "InCurrent": 0x36, "InPower": 0x34, - "InVoltage": 0x35 }, + "InVoltage": 0x35, "Temperature": 0xc }, 2: { "State": 0x32, "Current": 0x3F, "Power": 0x3D, "Voltage": 0x3E, "InCurrent": 0x3C, "InPower": 0x3A, - "InVoltage": 0x3B } } + "InVoltage": 0x3B, "Temperature": 0xd } } # ( PSU-ID: FRU-ID } FRU_MAPPING = { 1: 1, 2: 2 } @@ -43,6 +43,7 @@ def __init__(self, psu_index): self.power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Power"]) self.input_voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InVoltage"]) self.input_current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InCurrent"]) + self.temp_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Temperature"]) self.input_power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InPower"]) self.fru = IpmiFru(self.FRU_MAPPING[self.index]) @@ -120,6 +121,30 @@ def get_voltage(self): return "{:.1f}".format(voltage) + def get_voltage_low_threshold(self): + """ + Returns PSU low threshold in Volts + """ + + is_valid, low_threshold = self.voltage_sensor.get_threshold("LowerCritical") + if not is_valid: + low_threshold = 11.6 + low_threshold = "{:.2f}".format(low_threshold) + + return float(low_threshold) + + def get_voltage_high_threshold(self): + """ + Returns PSU high threshold in Volts + """ + + is_valid, high_threshold = self.voltage_sensor.get_threshold("UpperCritical") + if not is_valid: + high_threshold = 12.8 + high_threshold = "{:.2f}".format(high_threshold) + + return float(high_threshold) + def get_current(self): """ Retrieves present electric current supplied by PSU @@ -134,6 +159,32 @@ def get_current(self): return "{:.1f}".format(current) + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to + nearest thousandth of one degree Celsius, e.g. 30.125 + """ + is_valid, temperature = self.temp_sensor.get_reading() + if not is_valid: + temperature = 0 + + return float(temperature) + + def get_temperature_high_threshold(self): + """ + Returns the high temperature threshold for PSU in Celsius + """ + + is_valid, high_threshold = self.temp_sensor.get_threshold("UpperCritical") + if not is_valid: + high_threshold = 105 + high_threshold = "{:.2f}".format(high_threshold) + + return float(high_threshold) + def get_power(self): """ Retrieves current energy supplied by PSU diff --git a/platform/broadcom/sonic-platform-modules-dell/s5296f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s5296f/sonic_platform/chassis.py index d3828765496e..79381d3f231c 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5296f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5296f/sonic_platform/chassis.py @@ -33,22 +33,6 @@ SYSTEM_BEACON_LED_SET = 0x8 SYSTEM_BEACON_LED_CLEAR = 0xFFFFFFF7 -media_part_num_list = set([ \ -"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC", -"C5RNH","5250G","N8TDR","7D64H","7D64H","RN84N","RN84N","HMTNW","6K3Y6","6K3Y6","TY5FM","50M0R","PGYJT","WP2PP","85Y13","1HCGH","FP9R1","FYD0M","C6Y7M","C6Y7M","V250M","V250M", -"5CWK6","5CWK6","53HVN","53HVN","358VV","358VV","MV799","MV799","YJF03","P9GND","T1KCN","1DXKP","MT7R2","K0T7R","W5G04","7TCDN","7TCDN","7TCDN","7TCDN","7TCDN","V3XJK","0MV31", -"5FVP7","N6KM9","C41MF","77KC3","XW7J0","V4NJV","2XJHY","H93DH","H93DH","F8CG0","F8CG0","F8CG0","119N6","WFMF5","794RX","288F6","1M31V","1M31V","5NP8R","5NP8R","4TC09","4TC09", -"FC6KV","FC6KV","J90VN","J90VN","05RH0","05RH0","YDN52","0C2YV","YDN52","0C2YV","9JT65","D7M6H","6GW14","FYVFW","0VF5H","P4YPY","P4YPY","TCPM2","TCPM2","JNPF8","JNPF8","27GG5", -"27GG5","P8T4W","P8T4W","JR54Y","M6N0J","XJYD0","K44H9","035KG","P7C7N","76V43","3CC35","FN4FC","26FN3","YFNDD","YFNDD","7R9N9","035KG","P7C7N","76V43","3CC35","PLRXPLSCS43811", -"FN4FC","26FN3","YFNDD","YFNDD","7R9N9","G86YJ","V407F","V407F","9KH6T","G86YJ","V407F","9KH6T","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY", -"9X8JP","GMFC5","GMFC5","GMFC5","D7P80","3MFXG","3MFXG","0GWXJ","THPF3","THPF3","THPF3","THPF3","THPF3","PJ62G","3XCX1","JJYKG","RRRTK","16K56","86JM2","K5R6C","7MG2C","WTPPN","9HTT2", -"NKM4F","VXGGG","JC9W6","6MR8M","RP3GV","M5PPJ","XKY55","TKCXT","05J8P","5WGKD","XFDRT","NW8DM","YPKH3","5WGKD","XFDRT","NW8DM","YPKH3","71XXK","MVCX6","0XYP6","HPPVW","3GHRT","71XXK", -"MVCX6","0XYP6","HPPVW","3GHRT","2X5T6","135V2","KD5MV","2X5T6","KD5MV","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","3YWG7","5CMT2","RCVP5","X5DH4", -"4WJ41","4WJ41","14NV5","14NV5","14NV5","4WGYD","YKMH7","X7CCC","X7CCC","0X9CT","0CY8V","P7D7R","W4GPP","W4GPP","W4GPP","HHHCHC","07RN7","07RN7","0YR96","0YR96","JCYM9","FTLX8571D3BCL", -"DDW0X","VPFDJ","229KM","9FC7D","DDW0X","VPFDJ","6FMR5","J7K20","N3K9W","6FMR5","8R4VM","7VN5T","D9YM8","8R4VM","VYXPW","87TPX","WY6FK","VYXPW","87TPX","WY6FK","WG8C4","N8K82","2DV6Y", -"77C3C","RC0HM","77C3C","RC0HM","JHXTN","3P3PG","92YVM","4VX5M","4VX5M","6RRGD","W4JWV","22V6R","XR11M","9GMDY","JMCWK","TP2F0","6MGDY","78RHK", "C0TP5","0WDNV","FCLF8522P2BTL"\ -]) - class Chassis(ChassisBase): """ DELLEMC Platform-specific Chassis class @@ -59,7 +43,6 @@ class Chassis(ChassisBase): PCI_RES = "/sys/bus/pci/devices/0000:04:00.0/resource0" oir_fd = -1 - sysled_offset = 0x0024 SYSLED_COLOR_TO_REG = { "blinking_green": 0x0, "green" : 0x10, @@ -272,6 +255,9 @@ def get_status(self): """ return True + def initizalize_system_led(self): + self.sys_ledcolor = "green" + def set_status_led(self, color): """ Sets the state of the system LED @@ -284,10 +270,10 @@ def set_status_led(self, color): if color not in list(self.SYSLED_COLOR_TO_REG.keys()): return False - val = pci_get_value(self.PCI_RES, self.sysled_offset) + val = pci_get_value(self.PCI_RES, SYSTEM_LED_REG) val = (val & 0xFFCF) | self.SYSLED_COLOR_TO_REG[color] - pci_set_value(self.PCI_RES, val, self.sysled_offset) + pci_set_value(self.PCI_RES, val, SYSTEM_LED_REG) self.sys_ledcolor = color return True @@ -298,7 +284,7 @@ def get_status_led(self): A string, one of the valid LED color strings which could be vendor specified. """ - val = pci_get_value(self.PCI_RES, self.sysled_offset) + val = pci_get_value(self.PCI_RES, SYSTEM_LED_REG) if val != -1: val = val & 0x30 return self.REG_TO_SYSLED_COLOR.get(val) @@ -400,9 +386,6 @@ def get_reboot_cause(self): else: return (self.REBOOT_CAUSE_NON_HARDWARE, None) - def get_qualified_media_list(self): - return media_part_num_list - def set_locator_led(self, color): """ Sets the state of the Chassis Locator LED From c1c1054952f4c8ecfcbe946aa7e125b0a2619477 Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 23 Aug 2023 20:05:42 +0200 Subject: [PATCH 10/32] [Arista] Update platform library submodules (#16112) Ignore intermittent IO errors during get_change_event in the Platform API Fix tunings for some ports on CatalinaDD Fix kernel module build for 6.1 kernel in preparation of bookworm upgrade --- platform/barefoot/sonic-platform-modules-arista | 2 +- platform/broadcom/sonic-platform-modules-arista | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index cca827843c05..6f62ce11e234 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit cca827843c0528347b996aedd5790558c5d6a656 +Subproject commit 6f62ce11e2347d419fe843ea60e53767508a3a9b diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index cca827843c05..6f62ce11e234 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit cca827843c0528347b996aedd5790558c5d6a656 +Subproject commit 6f62ce11e2347d419fe843ea60e53767508a3a9b From 67863b8d57f8186a09cc44336e7edb44e03c4bb1 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Thu, 24 Aug 2023 04:57:37 +0800 Subject: [PATCH 11/32] Add yang model for PFC watchdog debug information (#16206) ### Why I did it When PFC WD is triggered there is no diagnosis information which makes it difficult to understand why PFC WD was triggered. So, we add a field `additional_information` to accommodate the diagnosis information. ### How to verify it unit test --- .../tests/sonic-events-swss.json | 11 ++++++ .../tests_config/sonic-events-swss.json | 36 +++++++++++++++++++ .../yang-models/sonic-events-swss.yang | 7 ++++ 3 files changed, 54 insertions(+) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json index 7762ec17db27..6592fd10136f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/sonic-events-swss.json @@ -37,6 +37,17 @@ "SONIC_EVENTS_SWSS_PFC_STORM_VALID": { "desc": "VALID IF_STATE EVENT." }, + "SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO": { + "desc": "VALID IF_STATE EVENT." + }, + "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": { + "desc": "PFC_STORM_EVENT_INCORRECT_ADDITIONAL_INFO failure.", + "eStrKey": "Pattern" + }, + "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_2": { + "desc": "PFC_STORM_EVENT_INCORRECT_ADDITIONAL_INFO failure.", + "eStrKey": "Pattern" + }, "SONIC_EVENTS_SWSS_CHK_CRM_THRESHOLD_INCORRECT_PERCENT": { "desc": "CHK_CRM_THRESHOLD_EVENT_INCORRECT_PERCENT failure.", "eStrKey": "Range" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json index 90ca2b7df124..6b50ccd55acf 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/sonic-events-swss.json @@ -101,6 +101,42 @@ } } }, + "SONIC_EVENTS_SWSS_PFC_STORM_VALID_WITH_ADDITIONAL_INFO": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:pfc-storm": { + "ifname": "Ethernet0", + "queue_index": 0, + "queue_id": 0, + "port_id": 0, + "additional_info": "info1:1|info2:2", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } + }, + "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_1": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:pfc-storm": { + "ifname": "Ethernet0", + "queue_index": 0, + "queue_id": 0, + "port_id": 0, + "additional_info": "info1:1|info2", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } + }, + "SONIC_EVENTS_SWSS_PFC_STORM_WITH_INVALID_ADDITIONAL_INFO_2": { + "sonic-events-swss:sonic-events-swss": { + "sonic-events-swss:pfc-storm": { + "ifname": "Ethernet0", + "queue_index": 0, + "queue_id": 0, + "port_id": 0, + "additional_info": "info1:1|", + "timestamp": "1985-04-12T23:20:50.52Z" + } + } + }, "SONIC_EVENTS_SWSS_CHK_CRM_THRESHOLD_INCORRECT_PERCENT": { "sonic-events-swss:sonic-events-swss": { "sonic-events-swss:chk_crm_threshold": { diff --git a/src/sonic-yang-models/yang-models/sonic-events-swss.yang b/src/sonic-yang-models/yang-models/sonic-events-swss.yang index af5bfd905672..f7b3ca3ea5e6 100644 --- a/src/sonic-yang-models/yang-models/sonic-events-swss.yang +++ b/src/sonic-yang-models/yang-models/sonic-events-swss.yang @@ -78,6 +78,13 @@ module sonic-events-swss { type uint64; } + leaf additional_info { + type string { + pattern '[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+(\|{1}[-a-zA-Z0-9_]+:[-a-zA-Z0-9_]+)*'; + } + description "Additional information to investigate PFC storm"; + } + uses evtcmn:sonic-events-cmn; } From 618bddc07d7cedb768921bd20370921e15bac331 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 25 Aug 2023 14:59:01 +0800 Subject: [PATCH 12/32] [submodule] Update submodule sonic-mgmt-common to the latest HEAD automatically (#16284) --- src/sonic-mgmt-common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-mgmt-common b/src/sonic-mgmt-common index 68234700ead1..172b94fb2f8e 160000 --- a/src/sonic-mgmt-common +++ b/src/sonic-mgmt-common @@ -1 +1 @@ -Subproject commit 68234700ead18362f1511a49f4eefd3bfa1f1f8d +Subproject commit 172b94fb2f8ecd80c25961116f660d2b7cc70c38 From e9abf9e5eeb8515ce67ac9b98098ede7a080d43a Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 25 Aug 2023 16:32:30 +0800 Subject: [PATCH 13/32] [submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#16283) #### Why I did it src/sonic-linux-kernel ``` * a2aa335 - (HEAD -> master, origin/master, origin/HEAD) PATCH] net: allow user to set metric on default route learned via Router Advertisement (#326) (12 hours ago) [abdosi] ``` #### How I did it #### How to verify it #### Description for the changelog --- 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 e72818fcb6c2..a2aa335d1629 160000 --- a/src/sonic-linux-kernel +++ b/src/sonic-linux-kernel @@ -1 +1 @@ -Subproject commit e72818fcb6c2b02864e66d842d67e13d8b67df4a +Subproject commit a2aa335d16297badeaed01d2ce552338273bba24 From 36b21157d6fe7f84819c82f3da8ddd38c4890a3c Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 25 Aug 2023 16:32:36 +0800 Subject: [PATCH 14/32] [submodule] Update submodule sonic-gnmi to the latest HEAD automatically (#16282) #### Why I did it src/sonic-gnmi ``` * 7a1b7cd - (HEAD -> master, origin/master, origin/HEAD) Improve full path logic (#146) (37 minutes ago) [ganglv] ``` #### How I did it #### How to verify it #### Description for the changelog --- src/sonic-gnmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-gnmi b/src/sonic-gnmi index ac94807358fc..7a1b7cd99105 160000 --- a/src/sonic-gnmi +++ b/src/sonic-gnmi @@ -1 +1 @@ -Subproject commit ac94807358fcb3cc2bd61d31dd7fb54425ac998c +Subproject commit 7a1b7cd99105cf1e183e8de03cbeb80a942a60af From c8465c0d9a05fc5294511182afa58f35a4a06285 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Sat, 26 Aug 2023 18:45:45 +0800 Subject: [PATCH 15/32] [ci/build]: Upgrade SONiC package versions (#16294) --- .../versions-deb-bullseye-arm64 | 2 - .../build-sonic-slave-bullseye/versions-py3 | 2 +- .../versions-py3-all-arm64 | 6 --- files/build/versions/default/versions-git | 10 ++-- files/build/versions/default/versions-mirror | 20 ++++---- files/build/versions/default/versions-web | 4 +- .../docker-sonic-mgmt-framework/versions-py3 | 2 +- .../dockers/docker-sonic-vs/versions-py3 | 2 +- .../sonic-slave-buster/versions-deb-buster | 50 +++++++++---------- files/build/versions/host-image/versions-py3 | 2 +- 10 files changed, 46 insertions(+), 54 deletions(-) delete mode 100644 files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 index 90f712515be3..3bad5a5352bd 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye-arm64 @@ -1,3 +1 @@ -libnl-3-200==3.5.0-1 -libnl-route-3-200==3.5.0-1 linux-headers-5.10.0-18-2-arm64==5.10.140-1 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 index 2a19509593ea..b578d6f6bf9e 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3 @@ -32,6 +32,6 @@ tabulate==0.8.2 thrift==0.14.1 toposort==1.6 wcwidth==0.2.6 -websocket-client==1.6.1 +websocket-client==1.6.2 www-authenticate==0.9.2 xmltodict==0.12.0 diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 deleted file mode 100644 index 715879b74e33..000000000000 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-py3-all-arm64 +++ /dev/null @@ -1,6 +0,0 @@ -bcrypt==3.2.2 -bitarray==1.5.3 -click==7.0 -requests==2.31.0 -urllib3==2.0.4 -zipp==1.2.0 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index f6bf987f93bb..2d8ab7ee9a94 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -1,11 +1,11 @@ -https://chromium.googlesource.com/chromium/tools/depot_tools.git==b11693a5cab86ffe6be648fc39818daac33027d8 +https://chromium.googlesource.com/chromium/tools/depot_tools.git==b8164180d2c339940c99db74344c865e67ca064d https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f https://github.com/CESNET/libyang.git==8b0b910a2dcb7360cb5b0aaefbd1338271d50946 https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9502b12a75b6 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 -https://github.com/flashrom/flashrom.git==c17be0b3fa498d773f852f444967267953bd71a3 -https://github.com/FreeRADIUS/freeradius-server.git==76816565aee52996c6873a06ff503d3dee2891d8 +https://github.com/flashrom/flashrom.git==d534100c0503bc9ff47d95456ceabbe644929b5d +https://github.com/FreeRADIUS/freeradius-server.git==6bcdb8a7200cab4d185a9e73a823944983c15a8f https://github.com/FreeRADIUS/pam_radius.git==7d75a319e43d5e234b93f89cd461a11861d07b95 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 @@ -14,9 +14,9 @@ https://github.com/Marvell-switching/mrvl-prestera.git==63118c2a6b627e543f5556ba https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 https://github.com/p4lang/ptf.git==d2e2d8ad005a451ad11f9d21af50079a0552921a https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 -https://github.com/sflow/host-sflow==183dc2f51e5654727f1e0dd475c2672d839ac640 +https://github.com/sflow/host-sflow==b9a0015e65f4e0274b9a4904f141867cf2f8ef97 https://github.com/sflow/sflowtool==219ab50bcfd9d9e714ff169eec31b2625933acb5 -https://github.com/thom311/libnl==b544a3c69c8a8adf330fb243069d705bde60109c +https://github.com/thom311/libnl==0f60ab3917dae704b6bc889b45a25e932f4cbc3a https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d https://salsa.debian.org/kernel-team/ethtool/==d0578651310379629399dde060577d4b9b0bcab1 https://salsa.debian.org/kernel-team/initramfs-tools.git==cf964bfb4362019fd7fba1e839e403ff950dca8e diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 9e51bf833aa9..464608e668f2 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230820T000751Z -debian-security==20230820T000216Z +debian==20230825T000145Z +debian-security==20230826T000224Z download.docker.com_linux_debian_dists_bullseye==2023-07-31T14:38:46Z download.docker.com_linux_debian_dists_buster==2023-07-31T14:38:46Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230820T000216Z_dists_bullseye-security==2023-08-18T21:55:32Z -packages.trafficmanager.net_snapshot_debian-security_20230820T000216Z_dists_buster_updates==2023-08-18T21:55:32Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_bullseye-backports==2023-08-19T20:42:06Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_bullseye-updates==2023-08-19T20:42:06Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_buster-backports==2023-08-19T20:42:06Z -packages.trafficmanager.net_snapshot_debian_20230820T000751Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230826T000224Z_dists_bullseye-security==2023-08-25T20:03:52Z +packages.trafficmanager.net_snapshot_debian-security_20230826T000224Z_dists_buster_updates==2023-08-25T20:03:53Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye-backports==2023-08-24T20:24:17Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye-updates==2023-08-24T20:24:17Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster-backports==2023-08-24T20:24:17Z +packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web index ceaeed81e891..c6c347bffbfa 100644 --- a/files/build/versions/default/versions-web +++ b/files/build/versions/default/versions-web @@ -36,8 +36,8 @@ https://download.docker.com/linux/debian/gpg==1afae06b34a13c1b3d9cb61a26285a15 https://github.com/aristanetworks/sonic-firmware/raw/446f30ccd8626f904d89d5798da7294948e090a6/phy/phy-credo_1.0_amd64.deb==6c3d6c32477615cbe049b9161ce15bd5 https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnplatform_20221130_sai_1.11.0_deb11.deb==4a77e5f35b75ad7ce062f631581b40e2 https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnsdk_20221130_sai_1.11.0_deb11.deb==c2b0dfb4122dcdbd4af58826e2010640 -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==d9f6a4c3197625b1835b523697eb953e -https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==6105edb638de24bce2c368b8f8f698a4 +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64==0334fd679ec178f14882b73ebc10d7d8 +https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-arm64==e07f07d9f758cdcf57ba5d2ff9f3d491 https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsai-dev_1.11.0-1_amd64.deb==6a9e27b3830d96e980651de15b291933 https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/sai/libsai_1.11.0-1_amd64.deb==8bd907c4baeacf6467c0794bee0d723c https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/third_party/advantech/_Susi4.so==5e1b8daef522c9da00af400abe25810b diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 index 3d355a3b5cf0..9f5e1c7b1eea 100644 --- a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -18,7 +18,7 @@ openapi-schema-validator==0.4.4 openapi-spec-validator==0.5.7 pathable==0.4.3 pkgutil_resolve_name==1.3.10 -protobuf==4.24.1 +protobuf==4.24.2 pyrsistent==0.19.3 python-dateutil==2.6.0 requests==2.31.0 diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 index ed9fc75545d5..6fdecd32b4cd 100644 --- a/files/build/versions/dockers/docker-sonic-vs/versions-py3 +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -41,6 +41,6 @@ toposort==1.6 typing_extensions==4.5.0 urllib3==2.0.4 wcwidth==0.2.6 -websocket-client==1.6.1 +websocket-client==1.6.2 www-authenticate==0.9.2 zipp==3.15.0 diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster index 5a04709cbf48..5391914a1c08 100644 --- a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -984,24 +984,24 @@ libpython3.7-minimal==3.7.3-2+deb10u5 libpython3.7-stdlib==3.7.3-2+deb10u5 libqdox-java==1.12.1-3 libqdox2-java==2.0~M10-1 -libqt4-dbus==4:4.8.7+dfsg-18+deb10u1 -libqt4-declarative==4:4.8.7+dfsg-18+deb10u1 -libqt4-designer==4:4.8.7+dfsg-18+deb10u1 -libqt4-dev==4:4.8.7+dfsg-18+deb10u1 -libqt4-dev-bin==4:4.8.7+dfsg-18+deb10u1 -libqt4-help==4:4.8.7+dfsg-18+deb10u1 -libqt4-network==4:4.8.7+dfsg-18+deb10u1 -libqt4-opengl==4:4.8.7+dfsg-18+deb10u1 -libqt4-opengl-dev==4:4.8.7+dfsg-18+deb10u1 -libqt4-qt3support==4:4.8.7+dfsg-18+deb10u1 -libqt4-script==4:4.8.7+dfsg-18+deb10u1 -libqt4-scripttools==4:4.8.7+dfsg-18+deb10u1 -libqt4-sql==4:4.8.7+dfsg-18+deb10u1 -libqt4-sql-mysql==4:4.8.7+dfsg-18+deb10u1 -libqt4-svg==4:4.8.7+dfsg-18+deb10u1 -libqt4-test==4:4.8.7+dfsg-18+deb10u1 -libqt4-xml==4:4.8.7+dfsg-18+deb10u1 -libqt4-xmlpatterns==4:4.8.7+dfsg-18+deb10u1 +libqt4-dbus==4:4.8.7+dfsg-18+deb10u2 +libqt4-declarative==4:4.8.7+dfsg-18+deb10u2 +libqt4-designer==4:4.8.7+dfsg-18+deb10u2 +libqt4-dev==4:4.8.7+dfsg-18+deb10u2 +libqt4-dev-bin==4:4.8.7+dfsg-18+deb10u2 +libqt4-help==4:4.8.7+dfsg-18+deb10u2 +libqt4-network==4:4.8.7+dfsg-18+deb10u2 +libqt4-opengl==4:4.8.7+dfsg-18+deb10u2 +libqt4-opengl-dev==4:4.8.7+dfsg-18+deb10u2 +libqt4-qt3support==4:4.8.7+dfsg-18+deb10u2 +libqt4-script==4:4.8.7+dfsg-18+deb10u2 +libqt4-scripttools==4:4.8.7+dfsg-18+deb10u2 +libqt4-sql==4:4.8.7+dfsg-18+deb10u2 +libqt4-sql-mysql==4:4.8.7+dfsg-18+deb10u2 +libqt4-svg==4:4.8.7+dfsg-18+deb10u2 +libqt4-test==4:4.8.7+dfsg-18+deb10u2 +libqt4-xml==4:4.8.7+dfsg-18+deb10u2 +libqt4-xmlpatterns==4:4.8.7+dfsg-18+deb10u2 libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 libqt5core5a==5.11.3+dfsg1-1+deb10u5 libqt5dbus5==5.11.3+dfsg1-1+deb10u5 @@ -1016,9 +1016,9 @@ libqt5svg5==5.11.3-2 libqt5test5==5.11.3+dfsg1-1+deb10u5 libqt5widgets5==5.11.3+dfsg1-1+deb10u5 libqt5xml5==5.11.3+dfsg1-1+deb10u5 -libqtcore4==4:4.8.7+dfsg-18+deb10u1 -libqtdbus4==4:4.8.7+dfsg-18+deb10u1 -libqtgui4==4:4.8.7+dfsg-18+deb10u1 +libqtcore4==4:4.8.7+dfsg-18+deb10u2 +libqtdbus4==4:4.8.7+dfsg-18+deb10u2 +libqtgui4==4:4.8.7+dfsg-18+deb10u2 libquadmath0==8.3.0-6 libraw1394-11==2.1.2-1+b1 librdmacm1==22.1-1 @@ -1648,7 +1648,7 @@ python3.7==3.7.3-2+deb10u5 python3.7-dbg==3.7.3-2+deb10u5 python3.7-dev==3.7.3-2+deb10u5 python3.7-minimal==3.7.3-2+deb10u5 -qdbus==4:4.8.7+dfsg-18+deb10u1 +qdbus==4:4.8.7+dfsg-18+deb10u2 qemu-kvm==1:3.1+dfsg-8+deb10u10 qemu-system-common==1:3.1+dfsg-8+deb10u10 qemu-system-data==1:3.1+dfsg-8+deb10u10 @@ -1656,8 +1656,8 @@ qemu-system-gui==1:3.1+dfsg-8+deb10u10 qemu-system-x86==1:3.1+dfsg-8+deb10u10 qemu-utils==1:3.1+dfsg-8+deb10u10 qt-at-spi==0.4.0-9 -qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u1 -qt4-qmake==4:4.8.7+dfsg-18+deb10u1 +qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u2 +qt4-qmake==4:4.8.7+dfsg-18+deb10u2 qt5-default==5.11.3+dfsg1-1+deb10u5 qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 qt5-qmake==5.11.3+dfsg1-1+deb10u5 @@ -1665,7 +1665,7 @@ qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 qtbase5-dev==5.11.3+dfsg1-1+deb10u5 qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 qtchooser==66-2 -qtcore4-l10n==4:4.8.7+dfsg-18+deb10u1 +qtcore4-l10n==4:4.8.7+dfsg-18+deb10u2 qttranslations5-l10n==5.11.3-2 quilt==0.65-3 rake==12.3.1-3+deb10u1 diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 index 0ed244ee5a6a..938d86efc6cb 100644 --- a/files/build/versions/host-image/versions-py3 +++ b/files/build/versions/host-image/versions-py3 @@ -72,7 +72,7 @@ toposort==1.6 urllib3==2.0.4 watchdog==0.10.3 wcwidth==0.2.6 -websocket-client==1.6.1 +websocket-client==1.6.2 wheel==0.35.1 www-authenticate==0.9.2 xmltodict==0.12.0 From 55849d0c6bf96914ce5d03b4318d9bd2129e45b8 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:31:51 +0800 Subject: [PATCH 16/32] [ci/build]: Upgrade SONiC package versions (#16300) --- .../versions-deb-bullseye | 1 + files/build/versions/default/versions-git | 2 +- files/build/versions/default/versions-mirror | 20 +++++++++---------- .../versions-deb-bullseye | 6 +++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye index d481a7826b22..c59424d3a1ec 100644 --- a/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/build/build-sonic-slave-bullseye/versions-deb-bullseye @@ -44,6 +44,7 @@ linux-headers-5.10.0-18-2-common==5.10.140-1 lldpd==1.0.4-1 lm-sensors==1:3.6.0-7 mft==4.25.0-62 +mlnx-sai==1.mlnx.SAIBuild2305.25.0.3 net-tools==1.60+git20181103.0eebece-1 protobuf-compiler==3.21.12-3 python-thrift==0.11.0-4 diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git index 2d8ab7ee9a94..2a028d9c29bb 100644 --- a/files/build/versions/default/versions-git +++ b/files/build/versions/default/versions-git @@ -5,7 +5,7 @@ https://github.com/daveolson53/audisp-tacplus.git==559c9f22edd4f2dea0ecedffb3ad9 https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 https://github.com/flashrom/flashrom.git==d534100c0503bc9ff47d95456ceabbe644929b5d -https://github.com/FreeRADIUS/freeradius-server.git==6bcdb8a7200cab4d185a9e73a823944983c15a8f +https://github.com/FreeRADIUS/freeradius-server.git==77b95a3f229355c722348fdbd9e623c51a24c65d https://github.com/FreeRADIUS/pam_radius.git==7d75a319e43d5e234b93f89cd461a11861d07b95 https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 https://github.com/jpirko/libteam.git==7cb5de8b01be132bd4150eff460bfd83296414b6 diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror index 464608e668f2..45f52cea8e02 100644 --- a/files/build/versions/default/versions-mirror +++ b/files/build/versions/default/versions-mirror @@ -1,15 +1,15 @@ deb.nodesource.com_node%5f14.x_dists_bullseye==2023-02-17T00:35:28Z deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z -debian==20230825T000145Z -debian-security==20230826T000224Z +debian==20230827T000225Z +debian-security==20230828T000133Z download.docker.com_linux_debian_dists_bullseye==2023-07-31T14:38:46Z download.docker.com_linux_debian_dists_buster==2023-07-31T14:38:46Z packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z -packages.trafficmanager.net_snapshot_debian-security_20230826T000224Z_dists_bullseye-security==2023-08-25T20:03:52Z -packages.trafficmanager.net_snapshot_debian-security_20230826T000224Z_dists_buster_updates==2023-08-25T20:03:53Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye==2023-06-10T08:52:21Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye-backports==2023-08-24T20:24:17Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_bullseye-updates==2023-08-24T20:24:17Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster==2023-06-10T08:53:33Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster-backports==2023-08-24T20:24:17Z -packages.trafficmanager.net_snapshot_debian_20230825T000145Z_dists_buster-updates==2023-06-10T08:55:10Z +packages.trafficmanager.net_snapshot_debian-security_20230828T000133Z_dists_bullseye-security==2023-08-27T14:25:23Z +packages.trafficmanager.net_snapshot_debian-security_20230828T000133Z_dists_buster_updates==2023-08-27T14:25:23Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_bullseye==2023-06-10T08:52:21Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_bullseye-backports==2023-08-26T20:19:59Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_bullseye-updates==2023-08-26T20:19:59Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_buster==2023-06-10T08:53:33Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_buster-backports==2023-08-26T20:19:59Z +packages.trafficmanager.net_snapshot_debian_20230827T000225Z_dists_buster-updates==2023-06-10T08:55:10Z diff --git a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye index 1fe19064ddeb..4ec615519ef6 100644 --- a/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye +++ b/files/build/versions/dockers/sonic-slave-bullseye/versions-deb-bullseye @@ -39,7 +39,7 @@ byacc==20140715-1+b1 bzip2==1.0.8-4 bzip2-doc==1.0.8-4 ca-certificates==20210119 -ca-certificates-java==20190909 +ca-certificates-java==20190909+deb11u1 cdbs==0.4.163 check==0.15.2-2 chrpath==0.16-2+b1 @@ -1072,8 +1072,8 @@ librhash0==1.4.1-2 librole-tiny-perl==2.002004-1 librrd-dev==1.7.2-3+b7 librrd8==1.7.2-3+b7 -librsvg2-2==2.50.3+dfsg-1 -librsvg2-common==2.50.3+dfsg-1 +librsvg2-2==2.50.3+dfsg-1+deb11u1 +librsvg2-common==2.50.3+dfsg-1+deb11u1 librtmp1==2.4+20151223.gitfa8646d.1-2+b2 librubberband2==1.9.0-1 libruby2.7==2.7.4-1+deb11u1 From 65b0011866fd6c0b3047a4f91631ce0195a6faca Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Mon, 28 Aug 2023 14:50:53 +0300 Subject: [PATCH 17/32] [Mellanox] [PPI] Enable global port late create for SN5600 (#15866) - Why I did it Enabled port late create on SN5600 Spectrum-4 switch boots up with no ports Work item tracking N/A - How I did it Updated SAI xml config file - How to verify it Run sonic-mgmt tests of fastboot Signed-off-by: Nazarii Hnydyn --- .../mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai_5600.xml | 3 +++ .../x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai_5600.xml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai_5600.xml b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai_5600.xml index 83074f6a9cc2..bbfe12c0e8bb 100644 --- a/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai_5600.xml +++ b/device/mellanox/x86_64-nvidia_sn5600-r0/ACS-SN5600/sai_5600.xml @@ -27,6 +27,9 @@ 65 + + 1 + diff --git a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai_5600.xml b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai_5600.xml index 7fe318fc0808..e4548ffe2506 100644 --- a/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai_5600.xml +++ b/device/mellanox/x86_64-nvidia_sn5600_simx-r0/ACS-SN5600/sai_5600.xml @@ -27,6 +27,9 @@ 65 + + 1 + From be8843b1663cc35dd44228c22e5a4f809bc66ced Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 28 Aug 2023 20:03:39 +0800 Subject: [PATCH 18/32] Fix issue: unprintable character is rendered when handling comments in j2 (#16287) Use "{#-" and "-#}" to mark comments in jinja template Signed-off-by: Stephen Sun --- platform/mellanox/mlnx-fw-upgrade.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 188aa0bfa58f..9a73d78eb82d 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -1,4 +1,4 @@ -{# +{#- Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); @@ -10,7 +10,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -#} +-#} #!/bin/bash declare -r SCRIPT_NAME="$(basename "$0")" From 0446d7654f10637250dfd930704b8d3d2314944d Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Mon, 28 Aug 2023 20:05:11 +0800 Subject: [PATCH 19/32] Add yang model for scheduler in PORT_QOS_MAP (#16244) Signed-off-by: Stephen Sun --- .../tests/files/sample_config_db.json | 26 +++++++--- .../tests/yang_model_tests/tests/qosmaps.json | 5 ++ .../tests_config/qosmaps.json | 50 ++++++++++++++++++- .../yang-models/sonic-port-qos-map.yang | 11 ++++ 4 files changed, 83 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 1e01dcbdba66..43fcba9526ae 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1915,6 +1915,15 @@ "pbs": "2048", "pir": "2560000", "type": "STRICT" + }, + "port_scheduler": { + "cbs": "256", + "cir": "1250000", + "meter_type": "bytes", + "pbs": "1024", + "pir": "25000000", + "type": "DWRR", + "weight": "10" } }, @@ -2079,14 +2088,15 @@ }, "PORT_QOS_MAP": { "Ethernet0": { - "dot1p_to_tc_map" : "Dot1p_to_tc_map1", - "dscp_to_tc_map": "Dscp_to_tc_map1", - "tc_to_queue_map": "tc_to_q_map1", - "tc_to_pg_map": "tc_to_pg_map1", - "pfc_to_queue_map": "pfc_prio_to_q_map1", - "pfc_to_pg_map" : "pfc_prio_to_pg_map1", - "pfc_enable" : "3,4", - "pfcwd_sw_enable" : "3,4" + "dot1p_to_tc_map" : "Dot1p_to_tc_map1", + "dscp_to_tc_map": "Dscp_to_tc_map1", + "tc_to_queue_map": "tc_to_q_map1", + "tc_to_pg_map": "tc_to_pg_map1", + "pfc_to_queue_map": "pfc_prio_to_q_map1", + "pfc_to_pg_map" : "pfc_prio_to_pg_map1", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4", + "scheduler" : "port_scheduler" }, "Ethernet4": { "dot1p_to_tc_map" : "Dot1p_to_tc_map2", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json index db068f714fad..c89e8e89ce25 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json @@ -96,6 +96,11 @@ "eStrKey": "LeafRef" }, + "PORT_QOS_MAP_APPLY_NON_EXISTS_SCHEDULER": { + "desc": "Configure non exists scheduler on port.", + "eStrKey": "LeafRef" + }, + "PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": { "desc": "Configure port qos map entry on non exists port.", "eStr": "Invalid value" diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json index 3082bb10e9cc..355187b497dc 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json @@ -657,6 +657,24 @@ ] } }, + + "sonic-scheduler:sonic-scheduler":{ + "sonic-scheduler:SCHEDULER": { + "SCHEDULER_LIST": [ + { + "name":"port_scheduler", + "cbs": "256", + "cir": "1250000", + "meter_type": "bytes", + "pbs": "1024", + "pir": "25000000", + "type": "DWRR", + "weight": "10" + } + ] + } + }, + "sonic-port-qos-map:sonic-port-qos-map": { "sonic-port-qos-map:PORT_QOS_MAP": { "PORT_QOS_MAP_LIST": [ @@ -670,7 +688,8 @@ "dscp_to_tc_map": "map1", "dot1p_to_tc_map": "map1", "pfc_enable": "2,3,4,6", - "pfcwd_sw_enable" : "2,3,4,6" + "pfcwd_sw_enable" : "2,3,4,6", + "scheduler" : "port_scheduler" } ] } @@ -751,6 +770,35 @@ } }, + "PORT_QOS_MAP_APPLY_NON_EXISTS_SCHEDULER": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet0", + "tpid": "0x8100", + "speed": "25000" + } + ] + } + }, + "sonic-port-qos-map:sonic-port-qos-map": { + "sonic-port-qos-map:PORT_QOS_MAP": { + "PORT_QOS_MAP_LIST": [ + { + "ifname": "Ethernet0", + "scheduler": "scheduler1" + } + ] + } + } + }, + "PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": { "sonic-port:sonic-port": { "sonic-port:PORT": { diff --git a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang index 346b08bd1b23..b8a448c6526b 100644 --- a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang @@ -34,6 +34,10 @@ module sonic-port-qos-map { prefix dot1ptm; } + import sonic-scheduler { + prefix sch; + } + organization "SONiC"; @@ -117,6 +121,13 @@ module sonic-port-qos-map { path "/dot1ptm:sonic-dot1p-tc-map/dot1ptm:DOT1P_TO_TC_MAP/dot1ptm:DOT1P_TO_TC_MAP_LIST/dot1ptm:name"; } } + + leaf scheduler { + type leafref { + path "/sch:sonic-scheduler/sch:SCHEDULER/sch:SCHEDULER_LIST/sch:name"; //Reference to SCHEDULER table + } + description "Scheduler for port."; + } } } } From 2c9c96c0d8e09379fa1a39393e2a98c24de9abfb Mon Sep 17 00:00:00 2001 From: Rajkumar-Marvell <54936542+rajkumar38@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:06:46 +0530 Subject: [PATCH 20/32] [SFLOW] Fixed SFLOW DROPMON patch to align with 2.0.45 version (#15948) - Why I did it Fixed build failure when flag ENABLE_SFLOW_DROPMON=y set - How I did it Fixed sflow dropmon patch to align with hsflowd version 2.0.45 Signed-off-by: rajkumar38 --- ...abled-drop-monitor-support-for-SONiC.patch | 35 ++++--------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/sflow/hsflowd/patch/dropmon/0001-sflow-enabled-drop-monitor-support-for-SONiC.patch b/src/sflow/hsflowd/patch/dropmon/0001-sflow-enabled-drop-monitor-support-for-SONiC.patch index 7a3561fd7d4c..b5919e8185b1 100644 --- a/src/sflow/hsflowd/patch/dropmon/0001-sflow-enabled-drop-monitor-support-for-SONiC.patch +++ b/src/sflow/hsflowd/patch/dropmon/0001-sflow-enabled-drop-monitor-support-for-SONiC.patch @@ -3,47 +3,27 @@ From: Vadym Hlushko Date: Tue, 25 Jan 2022 12:59:40 +0000 Subject: [PATCH] [sflow] enabled drop monitor support for SONiC -Signed-off-by: Vadym Hlushko ---- - src/Linux/Makefile | 2 +- - src/Linux/hsflowd.c | 8 ++++++++ - src/Linux/scripts/hsflowd.conf.sonic | 2 ++ - 3 files changed, 11 insertions(+), 1 deletion(-) - -diff --git a/src/Linux/Makefile b/src/Linux/Makefile -index 8128cf2..cf538e7 100644 ---- a/src/Linux/Makefile -+++ b/src/Linux/Makefile -@@ -34,7 +34,7 @@ FEATURES_DENT= DENT PSAMPLE SYSTEMD DROPMON - FEATURES_EOS= EAPI - FEATURES_OS10= OS10 DBUS SYSTEMD - FEATURES_OPX= OPX DBUS SYSTEMD --FEATURES_SONIC= SONIC PSAMPLE DOCKER -+FEATURES_SONIC= SONIC PSAMPLE DOCKER DROPMON - FEATURES_XEN= XEN OVS - FEATURES_HOST= NFLOG PCAP TCP DOCKER KVM OVS DBUS SYSTEMD - diff --git a/src/Linux/hsflowd.c b/src/Linux/hsflowd.c -index 5d94e79..25031d1 100644 +index a29da54..4b6acc1 100644 --- a/src/Linux/hsflowd.c +++ b/src/Linux/hsflowd.c -@@ -1877,6 +1877,14 @@ extern "C" { +@@ -1922,6 +1922,14 @@ extern "C" { sp->psample.ingress = YES; - sp->psample.egress = NO; - sp->psample.group = 1; + sp->psample.egress = YES; + sp->psample.group = 1; // Ingress PSAMPLE group number. Expects egress on (group+1). + // drop-monitor support + myLog(LOG_INFO, "drop-monitor support for SONiC"); + sp->dropmon.dropmon = YES; -+ sp->dropmon.group = 1; + sp->dropmon.start = NO; + sp->dropmon.limit = 1000; + sp->dropmon.sw = NO; + sp->dropmon.hw = YES; ++ #endif /* HSP_LOAD_SONIC */ #ifdef HSP_LOAD_XEN diff --git a/src/Linux/scripts/hsflowd.conf.sonic b/src/Linux/scripts/hsflowd.conf.sonic -index e675730..fb52a54 100644 +index e675730..0604c5d 100644 --- a/src/Linux/scripts/hsflowd.conf.sonic +++ b/src/Linux/scripts/hsflowd.conf.sonic @@ -4,6 +4,8 @@ @@ -55,6 +35,3 @@ index e675730..fb52a54 100644 # ====== detect new interfaces ====== refreshAdaptors=60 # ====== Agent IP selection ====== --- -2.17.1 - From 83dca59efc8de5d2788cf745da377673a0f81c31 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Mon, 28 Aug 2023 23:40:01 +0800 Subject: [PATCH 21/32] [YANG SONIC-ACL] Fix Yang definition of ACL_TABLE_TYPE (#16247) How I did it Update Yang definition of ACL_TABLE_TYPE. Update existing testcase. Add new testcase to cover lowercase key scenario. How to verify it Verified by building sonic_yang_models-1.0-py3-none-any.whl. While building the target package, unit tests were run and passed. --- .../tests/files/sample_config_db.json | 6 +- .../tests/yang_model_tests/test_yang_model.py | 1 + .../tests/yang_model_tests/tests/acl.json | 8 ++- .../yang_model_tests/tests_config/acl.json | 63 ++++++++++++++++--- .../yang-templates/sonic-acl.yang.j2 | 6 +- 5 files changed, 69 insertions(+), 15 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 43fcba9526ae..acff24dc7229 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2327,18 +2327,18 @@ }, "ACL_TABLE_TYPE": { "CUSTOM_L3": { - "matches": [ + "MATCHES": [ "IN_PORTS", "OUT_PORTS", "SRC_IP", "BTH_OPCODE", "AETH_SYNDROME" ], - "actions": [ + "ACTIONS": [ "PACKET_ACTION", "MIRROR_INGRESS_ACTION" ], - "bind_points": [ + "BIND_POINTS": [ "PORT", "LAG" ] diff --git a/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py b/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py index 355c9086a6fb..d776f479cd37 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py +++ b/src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py @@ -48,6 +48,7 @@ def initTest(self): 'Range': ['does not satisfy', 'range'], 'MinElements': ['Too few'], 'MaxElements': ['Too many'], + 'UnknownElement': ['Unknown element'], 'None': [] } 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 4d9ef12ec442..779a96d02bce 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 @@ -98,14 +98,18 @@ "eStrKey": "MinElements" }, "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": { - "desc": "ACL_TABLE LOAD TABLE TYPE SUCCESSFULLY WITH NO ACTIONS.", + "desc": "ACL_TABLE LOAD TABLE TYPE WITH NO ACTIONS.", "eStrKey" : "Verify", "verify": { "xpath": "/sonic-acl:sonic-acl/ACL_TABLE_TYPE/ACL_TABLE_TYPE_LIST[ACL_TABLE_TYPE_NAME='CUSTOM_L3']/ACL_TABLE_TYPE_NAME", - "key": "sonic-acl:actions", + "key": "sonic-acl:ACTIONS", "value": [""] } }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_LOWERCASE_KEY": { + "desc": "ACL_TABLE LOAD TABLE TYPE WITH KEY ACTIONS/BIND_POINTS/MATCHES WRITTEN IN LOWERCASE.", + "eStrKey": "UnknownElement" + }, "ACL_TABLE_L2_ACL_FIELDS": { "desc": "Configure L2 ACL with proper rule fields" }, 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 3173456da09f..49dad6497fea 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 @@ -723,14 +723,14 @@ "ACL_TABLE_TYPE_LIST": [ { "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", - "matches": [ + "MATCHES": [ "SRC_IP", "IN_PORTS" ], - "actions": [ + "ACTIONS": [ "PACKET_ACTION" ], - "bind_points": [ + "BIND_POINTS": [ "PORT" ] } @@ -772,10 +772,10 @@ "ACL_TABLE_TYPE_LIST": [ { "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", - "actions": [ + "ACTIONS": [ "PACKET_ACTION" ], - "bind_points": [ + "BIND_POINTS": [ "PORT" ] } @@ -817,11 +817,11 @@ "ACL_TABLE_TYPE_LIST": [ { "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", - "matches": [ + "MATCHES": [ "SRC_IP", "IN_PORTS" ], - "actions": [ + "ACTIONS": [ "PACKET_ACTION" ] } @@ -845,6 +845,52 @@ } }, "ACL_TABLE_CUSTOM_TABLE_TYPE_NO_ACTIONS": { + "sonic-acl:sonic-acl": { + "sonic-acl:ACL_TABLE": { + "ACL_TABLE_LIST": [ + { + "ACL_TABLE_NAME": "NO-NSW-PACL-V6", + "policy_desc": "Filter IPv6", + "ports": [ + "Ethernet0" + ], + "stage": "EGRESS", + "type": "CUSTOM_L3" + } + ] + }, + "sonic-acl:ACL_TABLE_TYPE": { + "ACL_TABLE_TYPE_LIST": [ + { + "ACL_TABLE_TYPE_NAME": "CUSTOM_L3", + "MATCHES": [ + "SRC_IP", + "IN_PORTS" + ], + "BIND_POINTS": [ + "PORT" + ] + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet0", + "lanes": "0,1,2,3", + "mtu": 9000, + "name": "Ethernet0", + "speed": 25000 + } + ] + } + } + }, + "ACL_TABLE_CUSTOM_TABLE_TYPE_LOWERCASE_KEY": { "sonic-acl:sonic-acl": { "sonic-acl:ACL_TABLE": { "ACL_TABLE_LIST": [ @@ -867,6 +913,9 @@ "SRC_IP", "IN_PORTS" ], + "actions": [ + "PACKET_ACTION" + ], "bind_points": [ "PORT" ] 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 72faf4313c11..264421c7cdfa 100644 --- a/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 +++ b/src/sonic-yang-models/yang-templates/sonic-acl.yang.j2 @@ -295,17 +295,17 @@ module sonic-acl { type string; } - leaf-list matches { + leaf-list MATCHES { type string; min-elements 1; } - leaf-list actions { + leaf-list ACTIONS { type string; default ""; } - leaf-list bind_points { + leaf-list BIND_POINTS { type enumeration { enum PORT; enum LAG; From 1d1489b2c78b5a5ba745180d5d6a854d7ac5dc07 Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Mon, 28 Aug 2023 23:40:55 +0800 Subject: [PATCH 22/32] [minigraph-parser] Update the definition of acl table type BMCDATA and BMCDATAV6 (#16249) Why I did it According to ACL-Table-Type-HLD, the value type of MATCHES, ACTIONS and BIND_POINTS should be list instead of string. Opening this PR to update the definition of BMCDATA and BMCDATAV6. How I did it Update the definition of BMCDATA and BMCDATAV6 in minigraph-parser. How to verify it Verified by UT and build SONiC image. --- src/sonic-config-engine/minigraph.py | 12 ++++++------ src/sonic-config-engine/tests/test_minigraph_case.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 276e9e2d177c..b29c277ee2e6 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -55,14 +55,14 @@ # Defination of custom acl table types acl_table_type_defination = { 'BMCDATA': { - "ACTIONS": "PACKET_ACTION,COUNTER", - "BIND_POINTS": "PORT", - "MATCHES": "SRC_IP,DST_IP,ETHER_TYPE,IP_TYPE,IP_PROTOCOL,IN_PORTS,L4_SRC_PORT,L4_DST_PORT,L4_SRC_PORT_RANGE,L4_DST_PORT_RANGE", + "ACTIONS": ["PACKET_ACTION", "COUNTER"], + "BIND_POINTS": ["PORT"], + "MATCHES": ["SRC_IP", "DST_IP", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"] }, 'BMCDATAV6': { - "ACTIONS": "PACKET_ACTION,COUNTER", - "BIND_POINTS": "PORT", - "MATCHES": "SRC_IPV6,DST_IPV6,ETHER_TYPE,IP_TYPE,IP_PROTOCOL,IN_PORTS,L4_SRC_PORT,L4_DST_PORT,L4_SRC_PORT_RANGE,L4_DST_PORT_RANGE", + "ACTIONS": ["PACKET_ACTION", "COUNTER"], + "BIND_POINTS": ["PORT"], + "MATCHES": ["SRC_IPV6", "DST_IPV6", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"] } } diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index d33d2c14e825..e1242a3fa9e5 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -497,14 +497,14 @@ def test_minigraph_acl_attach_to_ports(self): def test_minigraph_acl_type_bmcdata(self): expected_acl_type_bmcdata = { - "ACTIONS": "PACKET_ACTION,COUNTER", - "BIND_POINTS": "PORT", - "MATCHES": "SRC_IP,DST_IP,ETHER_TYPE,IP_TYPE,IP_PROTOCOL,IN_PORTS,L4_SRC_PORT,L4_DST_PORT,L4_SRC_PORT_RANGE,L4_DST_PORT_RANGE", + "ACTIONS": ["PACKET_ACTION", "COUNTER"], + "BIND_POINTS": ["PORT"], + "MATCHES": ["SRC_IP", "DST_IP", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"], } expected_acl_type_bmcdatav6 = { - "ACTIONS": "PACKET_ACTION,COUNTER", - "BIND_POINTS": "PORT", - "MATCHES": "SRC_IPV6,DST_IPV6,ETHER_TYPE,IP_TYPE,IP_PROTOCOL,IN_PORTS,L4_SRC_PORT,L4_DST_PORT,L4_SRC_PORT_RANGE,L4_DST_PORT_RANGE", + "ACTIONS": ["PACKET_ACTION", "COUNTER"], + "BIND_POINTS": ["PORT"], + "MATCHES": ["SRC_IPV6", "DST_IPV6", "ETHER_TYPE", "IP_TYPE", "IP_PROTOCOL", "IN_PORTS", "L4_SRC_PORT", "L4_DST_PORT", "L4_SRC_PORT_RANGE", "L4_DST_PORT_RANGE"], } expected_acl_table_bmc_acl_northbound = { 'policy_desc': 'BMC_ACL_NORTHBOUND', From 4da72b9eca80fdefe48aac45c912915653fbdc8a Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Mon, 28 Aug 2023 11:42:27 -0400 Subject: [PATCH 23/32] [yang] Add Bmc to Device Neighbor Metadata element type list (#16188) Bmc is a valid neighbor type in minigraph, however it was missing from the YANG model definition. Usually, the Bmc type device can be neighbor of BmcMgmtToRRouter. This PR is to introduce this type. --- .../tests/device_neighbor_metadata.json | 7 +++++ .../device_neighbor_metadata.json | 26 +++++++++++++++++++ .../sonic-device_neighbor_metadata.yang | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_neighbor_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_neighbor_metadata.json index 2943a53d1b91..404856159a44 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_neighbor_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_neighbor_metadata.json @@ -9,6 +9,13 @@ "DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN": { "desc": "DEVICE_NEIGHBOR_METADATA correct value for Type field" }, + "DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN_BMC": { + "desc": "DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN pattern failure with IncorrectTypeBmc.", + "eStrKey" : "Pattern" + }, + "DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN_BMC": { + "desc": "DEVICE_NEIGHBOR_METADATA correct value for type field for Bmc" + }, "DEVICE_NEIGHBOR_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "desc": "DEVICE_NEIGHBOR_METADATA value as not-provisioned for Type field" } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_neighbor_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_neighbor_metadata.json index ecc0c35d2208..82faf0815f56 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_neighbor_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_neighbor_metadata.json @@ -25,6 +25,32 @@ } } }, + "DEVICE_NEIGHBOR_METADATA_TYPE_INCORRECT_PATTERN_BMC": { + "sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": { + "sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": { + "DEVICE_NEIGHBOR_METADATA_LIST": [ + { + "name": "Ethernet116", + "hwsku": "DUMMY_BMC_SKU", + "type": "IncorrectTypeBmc" + } + ] + } + } + }, + "DEVICE_NEIGHBOR_METADATA_TYPE_CORRECT_PATTERN_BMC": { + "sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": { + "sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": { + "DEVICE_NEIGHBOR_METADATA_LIST": [ + { + "name": "Ethernet116", + "hwsku": "DUMMY_BMC_SKU", + "type": "Bmc" + } + ] + } + } + }, "DEVICE_NEIGHBOR_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "sonic-device_neighbor_metadata:sonic-device_neighbor_metadata": { "sonic-device_neighbor_metadata:DEVICE_NEIGHBOR_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_neighbor_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_neighbor_metadata.yang index eb7e75d63a81..51c69a480fe8 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_neighbor_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_neighbor_metadata.yang @@ -83,7 +83,7 @@ module sonic-device_neighbor_metadata { leaf type { description "Network element type"; type string { - pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|Asic|Supervior|MgmtToRRouter|MgmtLeafRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|Server|MiniPower|SmartCable|Ixia|not-provisioned"; + pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|Asic|Supervior|MgmtToRRouter|MgmtLeafRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|Server|Bmc|MiniPower|SmartCable|Ixia|not-provisioned"; } } From 44d52dbb8bee83c8d107d94154e49560d2313ecb Mon Sep 17 00:00:00 2001 From: Yaqiang Zhu Date: Mon, 28 Aug 2023 11:43:28 -0400 Subject: [PATCH 24/32] [yang][dhcp_server] Add dhcp_server_ipv4 yang model (#15955) Add yang model for IPv4 DHCP Server. Add four new tables: DHCP_SERVER_IPV4, DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS, DHCP_SERVER_IPV4_RANGE, DHCP_SERVER_IPV4_PORT --- src/sonic-yang-models/doc/Configuration.md | 45 + src/sonic-yang-models/setup.py | 1 + .../tests/files/sample_config_db.json | 39 + .../tests/dhcp_server_ipv4.json | 96 ++ .../tests_config/dhcp_server_ipv4.json | 941 ++++++++++++++++++ .../yang-models/sonic-dhcp-server-ipv4.yang | 235 +++++ 6 files changed, 1357 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json create mode 100644 src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 9e1f709300dd..b42b3672c7b7 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -29,6 +29,7 @@ Table of Contents * [Device Metadata](#device-metadata) * [Device neighbor metada](#device-neighbor-metada) * [DHCP_RELAY](#dhcp_relay) + * [DHCP Server IPV4](#dhcp_server_ipv4) * [DSCP_TO_TC_MAP](#dscp_to_tc_map) * [FG_NHG](#fg_nhg) * [FG_NHG_MEMBER](#fg_nhg_member) @@ -986,6 +987,50 @@ instance is supported in SONiC. ``` +### DHCP_SERVER_IPV4 +IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS**, **DHCP_SERVER_IPV4_RANGE**, **DHCP_SERVER_IPV4_PORT** tables. +``` +{ + "DHCP_SERVER_IPV4": { + "Vlan100": { + "gateway": "100.1.1.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "option60": { + "id": 60, + "type": "text", + "value": "dummy_value" + } + }, + "DHCP_SERVER_IPV4_RANGE": { + "range1": { + "ip_start": "100.1.1.3", + "ip_end": "100.1.1.5" + } + }, + "DHCP_SERVER_IPV4_PORT": { + "Vlan100|PortChannel0003": { + "ips": [ + "100.1.1.10" + ] + }, + "Vlan100|PortChannel2": { + "ranges": [ + "range1" + ] + } + } +} +``` + ### DSCP_TO_TC_MAP ``` { diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index e20c10da05db..aacdd74204d7 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -178,6 +178,7 @@ def run(self): './yang-models/sonic-dscp-fc-map.yang', './yang-models/sonic-exp-fc-map.yang', './yang-models/sonic-dscp-tc-map.yang', + './yang-models/sonic-dhcp-server-ipv4.yang', './yang-models/sonic-dot1p-tc-map.yang', './yang-models/sonic-storm-control.yang', './yang-models/sonic-tc-priority-group-map.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 acff24dc7229..6af5120d6661 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1880,6 +1880,45 @@ "interface_id": "true" } }, + "DHCP_SERVER_IPV4": { + "Vlan100": { + "gateway": "100.1.1.1", + "lease_time": "3600", + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "option60": { + "id": "60", + "type": "text", + "value": "dummy_value" + } + }, + "DHCP_SERVER_IPV4_RANGE": { + "range1": { + "range": [ + "100.1.1.3", + "100.1.1.5" + ] + } + }, + "DHCP_SERVER_IPV4_PORT": { + "Vlan100|Ethernet0": { + "ips": [ + "100.1.1.10" + ] + }, + "Vlan100|Ethernet1": { + "ranges": [ + "range1" + ] + } + }, "SCHEDULER": { "TEST@0": { "cbs": "256", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json new file mode 100644 index 000000000000..42fa61056893 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json @@ -0,0 +1,96 @@ +{ + "DHCP_SERVER_IPV4_VALID_FORMAT": { + "desc": "Add dhcp_server_ipv4 in correct format." + }, + "DHCP_SERVER_IPV4_WITH_NON_EXIST_VLAN": { + "desc": "Configure vlan-id in DHCP_SERVER_IPV4 table which does not exist in VLAN table.", + "eStrKey": "LeafRef" + }, + "DHCP_SERVER_IPV4_INCORRECT_GATEWAY": { + "desc": "Add gateway which is not in correct ip-prefix format.", + "eStrKey": "Pattern" + }, + "DHCP_SERVER_IPV4_INCORRECT_NETMASK": { + "desc": "Add netmask which is not in correct ip-prefix format.", + "eStrKey": "Pattern" + }, + "DHCP_SERVER_IPV4_STATE_WRONG_VALUE": { + "desc": "Configure wrong value for state.", + "eStrKey": "InvalidValue" + }, + "DHCP_SERVER_IPV4_MODE_WRONG_VALUE": { + "desc": "Configure wrong value for mode.", + "eStrKey": "InvalidValue" + }, + "DHCP_SREVER_IPV4_NON_EXIST_OPTION": { + "desc": "Configure option in DHCP_SERVER_IPV4 table which does not exist in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS table.", + "eStrKey": "LeafRef" + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": { + "desc": "Configure wrong value for type.", + "eStrKey": "InvalidValue", + "eStr": ["type"] + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { + "desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { + "desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": { + "desc": "Add uint8 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": { + "desc": "Add uint16 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": { + "desc": "Add uint32 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." + }, + "DHCP_SERVER_IPV4_RANGE_INVALID_END": { + "desc": "Configure wrong end ip of range.", + "eStrKey": "Pattern" + }, + "DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": { + "desc": "Configure both ip and ranges in DHCP_SERVER_IPV4_RANGE_RANGES", + "eStr": ["Statement of 'ips' and 'ranges' cannot both exist"] + }, + "DHCP_SERVER_IPV4_GATEWAY_ABSENT": { + "desc": "Missing gateway in DHCP_SERVER_IPV4", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_LEASE_TIME_ABSENT": { + "desc": "Missing lease_time in DHCP_SERVER_IPV4", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_MODE_ABSENT": { + "desc": "Missing mode in DHCP_SERVER_IPV4", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_NETMASK_ABSENT": { + "desc": "Missing netmask in DHCP_SERVER_IPV4", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_STATE_ABSENT": { + "desc": "Missing state in DHCP_SERVER_IPV4", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_ID_ABSENT": { + "desc": "Missing id in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_VALUE_ABSENT": { + "desc": "Missing value in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", + "eStrKey" : "Mandatory" + }, + "DHCP_SERVER_IPV4_RANGE_RANGE_ABSENT": { + "desc": "Missing ranges in DHCP_SERVER_IPV4_RANGE", + "eStrKey": "Must" + }, + "DHCP_SERVER_IPV4_RANGE_SINGLE_IP": { + "desc": "Single ip in DHCP_SERVER_IPV4_RANGE" + }, + "DHCP_SERVER_IPV4_RANGE_THREE_IP": { + "desc": "Three ips in DHCP_SERVER_IPV4_RANGE", + "eStrKey": "Must" + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json new file mode 100644 index 000000000000..de68a5829c7d --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json @@ -0,0 +1,941 @@ +{ + "DHCP_SERVER_IPV4_VALID_FORMAT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1", + "admin_status": "up" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_WITH_NON_EXIST_VLAN": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan2000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "state": "enabled" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_INCORRECT_GATEWAY": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.300", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [], + "state": "enabled" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_INCORRECT_NETMASK": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.300", + "customized_options": [], + "state": "enabled" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_STATE_WRONG_VALUE": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "state": "dis-abled" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_MODE_WRONG_VALUE": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "pool", + "netmask": "255.255.255.0", + "state": "enabled" + } + ] + } + } + }, + "DHCP_SREVER_IPV4_NON_EXIST_OPTION": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option61" + ], + "state": "enabled" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "ipv4-address", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "uint8", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "uint16", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "uint32", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "texts", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_RANGE_INVALID_END": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.300" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ], + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_GATEWAY_ABSENT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_LEASE_TIME_ABSENT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_MODE_ABSENT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_NETMASK_ABSENT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "customized_options": [ + "option60" + ], + "state": "enabled" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_STATE_ABSENT": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [ + { + "name": "Vlan1000", + "vlanid": 1000 + } + ] + } + }, + "sonic-portchannel:sonic-portchannel": { + "sonic-portchannel:PORTCHANNEL": { + "PORTCHANNEL_LIST": [ + { + "name": "PortChannel1" + } + ] + } + }, + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "etp1", + "description": "Ethernet0", + "mtu": 9000, + "lanes": "1", + "name": "Ethernet0", + "speed": 25000 + } + ] + } + }, + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { + "DHCP_SERVER_IPV4_LIST": [ + { + "name": "Vlan1000", + "gateway": "192.168.0.1", + "lease_time": 3600, + "mode": "PORT", + "netmask": "255.255.255.0", + "customized_options": [ + "option60" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text", + "value": "dummy_value" + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3" + ] + } + ] + }, + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { + "DHCP_SERVER_IPV4_PORT_LIST": [ + { + "vlan": "Vlan1000", + "port": "Ethernet0", + "ranges": [ + "range1" + ] + }, + { + "vlan": "Vlan1000", + "port": "PortChannel1", + "ips": [ + "192.168.0.4" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_ID_ABSENT": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "type": "text", + "value": "dummy_value" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_VALUE_ABSENT": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { + "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ + { + "name": "option60", + "id": 60, + "type": "text" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_RANGE_RANGE_ABSENT": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1" + } + ] + } + } + }, + "DHCP_SERVER_IPV4_RANGE_SINGLE_IP": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2" + ] + } + ] + } + } + }, + "DHCP_SERVER_IPV4_RANGE_THREE_IP": { + "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { + "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { + "DHCP_SERVER_IPV4_RANGE_LIST": [ + { + "name": "range1", + "range": [ + "192.168.0.2", + "192.168.0.3", + "192.168.0.4" + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang new file mode 100644 index 000000000000..4d6738bf3674 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang @@ -0,0 +1,235 @@ +module sonic-dhcp-server-ipv4 { + + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-dhcp-server-ipv4"; + + prefix dhcp-server-ipv4; + + import ietf-inet-types { + prefix inet; + } + + import sonic-types { + prefix stypes; + } + + import sonic-vlan { + prefix vlan; + } + + import sonic-port { + prefix port; + } + + import sonic-portchannel { + prefix lag; + } + + description "DHCP_SERVER_IPV4 YANG module for SONiC OS"; + + revision 2023-07-19 { + description "Initial version"; + } + + container sonic-dhcp-server-ipv4 { + container DHCP_SERVER_IPV4 { + + description "DHCP_SERVER_IPV4 part of config_db.json"; + + list DHCP_SERVER_IPV4_LIST { + + description "DHCP_SERVER_IPV4 list part of config_db.json"; + + key "name"; + + leaf name { + description "Interface name for DHCP server"; + type leafref { + path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; + } + } + + leaf gateway { + description "Gateway IP for DHCP server"; + mandatory true; + type inet:ipv4-address; + } + + leaf lease_time { + description "Lease time of DHCP IP in second"; + mandatory true; + type uint32 { + range "1..4294967295"; + } + } + + leaf mode { + description "Mode of assigning IP"; + mandatory true; + type enumeration { + enum PORT; + } + } + + leaf netmask { + description "Subnet mask value for DHCP server"; + mandatory true; + type inet:ipv4-address-no-zone; + } + + leaf-list customized_options { + description "Customized options list"; + type leafref { + path "/dhcp-server-ipv4:sonic-dhcp-server-ipv4/dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS/dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST/dhcp-server-ipv4:name"; + } + } + + leaf state { + description "State of DHCP server"; + mandatory true; + type stypes:admin_mode; + } + } + /* end of DHCP_SERVER_IPV4_LIST */ + } + /* end of DHCP_SERVER_IPV4 container */ + + container DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS { + + description "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS part of config_db.json"; + + list DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST { + + description "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS list part of config_db.json"; + + key "name"; + + leaf name { + description "Name of customized option"; + type string { + length 1..255 { + error-message "Invalid length for the customized options name"; + } + } + } + + leaf id { + description "Customized PortChannel0003option ID"; + mandatory true; + type uint8 { + range "1..254"; + } + } + + leaf type { + description "Type of customized option, for standard DHCP option, this field is invalid"; + type enumeration { + enum text; + enum ipv4-address; + enum uint8; + enum uint16; + enum uint32; + } + } + + leaf value { + description "Value of customized option"; + mandatory true; + type union { + type string { + length 0..255; + } + type inet:ipv4-address; + type uint8; + type uint16; + type uint32; + } + } + } + /* end of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST */ + } + /* end of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS container */ + + container DHCP_SERVER_IPV4_RANGE { + + description "DHCP_SERVER_IPV4_RANGE part of config_db.json"; + + list DHCP_SERVER_IPV4_RANGE_LIST { + + description "DHCP_SERVER_IPV4_RANGE list part of config_db.json"; + + key "name"; + + leaf name { + description "Name of IP range"; + type string { + length 1..255 { + error-message "Invalid length for the IP range name"; + } + } + } + + leaf-list range { + description "Range of IPs"; + type inet:ipv4-address; + } + + must "((count(range) <= 2) and (count(range) >= 1))"; + } + /* end of DHCP_SERVER_IPV4_RANGE_LIST */ + } + /* end of DHCP_SERVER_IPV4_RANGE */ + + container DHCP_SERVER_IPV4_PORT { + + description "DHCP_SERVER_IPV4_PORT part of config_db.json"; + + list DHCP_SERVER_IPV4_PORT_LIST { + + description "DHCP_SERVER_IPV4_PORT list part of config_db.json"; + + key "vlan port"; + + leaf vlan { + description "Name of vlan"; + type leafref { + path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; + } + } + + leaf port { + description "Interface under vlan"; + type union { + type leafref { + path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; + } + type leafref { + path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name"; + } + } + } + + leaf-list ips { + description "Assigned IPs"; + must "(not(boolean(../ranges)))"{ + error-message "Statement of 'ips' and 'ranges' cannot both exist"; + } + type inet:ipv4-address; + } + + leaf-list ranges { + description "IP ranges"; + must "(not(boolean(../ips)))"{ + error-message "Statement of 'ips' and 'ranges' cannot both exist"; + } + type leafref { + path "/dhcp-server-ipv4:sonic-dhcp-server-ipv4/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE_LIST/dhcp-server-ipv4:name"; + } + } + } + /* end of DHCP_SERVER_IPV4_PORT_LIST */ + } + /* end of DHCP_SERVER_IPV4_PORT container */ + } +} From d0a40afcad4e111765650228f586fe2169761255 Mon Sep 17 00:00:00 2001 From: Yakiv Huryk <62013282+Yakiv-Huryk@users.noreply.github.com> Date: Mon, 28 Aug 2023 23:25:06 +0300 Subject: [PATCH 25/32] [build] add SKIP_BUILD_HOOK support for curl (#15923) #### Why I did it To support SKIP_BUILD_HOOK for curl command so the targets downloaded by curl (SONIC_ONLINE_DEBS, SONIC_ONLINE_FILES) can utilize it. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Add a logic to invoke a real command instead of a `download_packages()` (the same way it's done for wget) #### How to verify it Add an online target (with URL attribute). Add the "SKIP_VERSION=y" to this target. Check that download_packages is not invoked. --- src/sonic-build-hooks/hooks/curl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sonic-build-hooks/hooks/curl b/src/sonic-build-hooks/hooks/curl index 58bfe0395e55..5e8dd91b887c 100755 --- a/src/sonic-build-hooks/hooks/curl +++ b/src/sonic-build-hooks/hooks/curl @@ -3,4 +3,9 @@ . /usr/local/share/buildinfo/scripts/buildinfo_base.sh [ -z $REAL_COMMAND ] && REAL_COMMAND=/usr/bin/curl +if [ "$SKIP_BUILD_HOOK" == y ]; then + $REAL_COMMAND "$@" + exit $? +fi + REAL_COMMAND=$REAL_COMMAND download_packages "$@" From 80ce957d20f094cd75d649a3864c3d17a522fe2b Mon Sep 17 00:00:00 2001 From: guangyao6 <107662061+guangyao6@users.noreply.github.com> Date: Tue, 29 Aug 2023 09:12:19 +0800 Subject: [PATCH 26/32] Add no-export to sentinel community-list (#16285) Why I did it Add no-export to bgp sentinel community-list. So that bgp updates from bgp sentinel service must match sentinel community and no-export, otherwise, the bgp update will be dropped. Work item tracking Microsoft ADO (24946274): How I did it Add no-export to bgp sentinel community-list. How to verify it Run UT, case would pass. Build the image and start the device. Add bgp sentinel and check that no-export community exist in bgp sentinel community list. --- .../frr/bgpd/templates/sentinels/policies.conf.j2 | 2 +- .../tests/data/sentinels/policies.conf/result_all.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/sentinels/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/sentinels/policies.conf.j2 index 46a72344f341..3c8ac55ccac1 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/sentinels/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/sentinels/policies.conf.j2 @@ -2,7 +2,7 @@ ! template: bgpd/templates/sentinels/policies.conf.j2 ! {% if constants.bgp.sentinel_community is defined %} -bgp community-list standard sentinel_community permit {{ constants.bgp.sentinel_community }} +bgp community-list standard sentinel_community permit {{ constants.bgp.sentinel_community }} no-export ! route-map FROM_BGP_SENTINEL permit 100 match community sentinel_community diff --git a/src/sonic-bgpcfgd/tests/data/sentinels/policies.conf/result_all.conf b/src/sonic-bgpcfgd/tests/data/sentinels/policies.conf/result_all.conf index b64e3ceb0dcc..282636cd9c91 100644 --- a/src/sonic-bgpcfgd/tests/data/sentinels/policies.conf/result_all.conf +++ b/src/sonic-bgpcfgd/tests/data/sentinels/policies.conf/result_all.conf @@ -1,7 +1,7 @@ ! ! template: bgpd/templates/sentinels/policies.conf.j2 ! -bgp community-list standard sentinel_community permit 12345:12346 +bgp community-list standard sentinel_community permit 12345:12346 no-export ! route-map FROM_BGP_SENTINEL permit 100 match community sentinel_community From 459ba257a41b4d8a16acddf06060c238a8e19490 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Tue, 29 Aug 2023 19:14:45 +0800 Subject: [PATCH 27/32] [ci] Add job to cleanup nfs in armhf and arm64 agents. (#16270) Why I did it Clean old cached file in nfs disk for armhf/arm64 Work item tracking Microsoft ADO (number only): 24930879 --- .azure-pipelines/dpkg-cache-cleanup.yml | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/dpkg-cache-cleanup.yml b/.azure-pipelines/dpkg-cache-cleanup.yml index 2789d1818819..50bb3a63635b 100644 --- a/.azure-pipelines/dpkg-cache-cleanup.yml +++ b/.azure-pipelines/dpkg-cache-cleanup.yml @@ -15,13 +15,34 @@ trigger: none pr: none jobs: -- job: Build +- job: Amd pool: sonicbld timeoutInMinutes: 5 steps: - checkout: none - script: | - set -xe + df -h sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete + df -h displayName: clean dpkg cache - +- job: Armhf + pool: sonicbld-armhf + timeoutInMinutes: 5 + steps: + - checkout: none + - script: | + df -h + sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete + df -h + displayName: clean dpkg cache +- job: Arm64 + pool: sonicbld-arm64 + timeoutInMinutes: 5 + steps: + - checkout: none + - script: | + df -h + sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete + df -h + displayName: clean dpkg cache + From 42cf1536249e41b1849191e58982b41eb06f0de8 Mon Sep 17 00:00:00 2001 From: Nonodark Huang Date: Wed, 30 Aug 2023 00:45:28 +0800 Subject: [PATCH 28/32] [ufispace][pddf] Add the pddf package dependency to the ufispace platform modules mk file. (#16302) Signed-off-by: nonodark --- platform/broadcom/platform-modules-ufispace.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/platform-modules-ufispace.mk b/platform/broadcom/platform-modules-ufispace.mk index 3fc5f6e72fec..2c202cbbaa0c 100644 --- a/platform/broadcom/platform-modules-ufispace.mk +++ b/platform/broadcom/platform-modules-ufispace.mk @@ -14,7 +14,7 @@ export UFISPACE_S6301_56ST_PLATFORM_MODULE_VERSION UFISPACE_S9300_32D_PLATFORM_MODULE = sonic-platform-ufispace-s9300-32d_$(UFISPACE_S9300_32D_PLATFORM_MODULE_VERSION)_amd64.deb $(UFISPACE_S9300_32D_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-ufispace -$(UFISPACE_S9300_32D_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(UFISPACE_S9300_32D_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(PDDF_PLATFORM_MODULE_SYM) $(UFISPACE_S9300_32D_PLATFORM_MODULE)_PLATFORM = x86_64-ufispace_s9300_32d-r0 SONIC_DPKG_DEBS += $(UFISPACE_S9300_32D_PLATFORM_MODULE) From f39adda55ed74dc6a8ac00e0cd992daf748b6f1b Mon Sep 17 00:00:00 2001 From: jingwenxie Date: Wed, 30 Aug 2023 04:26:59 +0800 Subject: [PATCH 29/32] Revert "[yang][dhcp_server] Add dhcp_server_ipv4 yang model (#15955)" (#16322) This reverts commit 44d52dbb8bee83c8d107d94154e49560d2313ecb. --- src/sonic-yang-models/doc/Configuration.md | 45 - src/sonic-yang-models/setup.py | 1 - .../tests/files/sample_config_db.json | 39 - .../tests/dhcp_server_ipv4.json | 96 -- .../tests_config/dhcp_server_ipv4.json | 941 ------------------ .../yang-models/sonic-dhcp-server-ipv4.yang | 235 ----- 6 files changed, 1357 deletions(-) delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json delete mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json delete mode 100644 src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index b42b3672c7b7..9e1f709300dd 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -29,7 +29,6 @@ Table of Contents * [Device Metadata](#device-metadata) * [Device neighbor metada](#device-neighbor-metada) * [DHCP_RELAY](#dhcp_relay) - * [DHCP Server IPV4](#dhcp_server_ipv4) * [DSCP_TO_TC_MAP](#dscp_to_tc_map) * [FG_NHG](#fg_nhg) * [FG_NHG_MEMBER](#fg_nhg_member) @@ -987,50 +986,6 @@ instance is supported in SONiC. ``` -### DHCP_SERVER_IPV4 -IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS**, **DHCP_SERVER_IPV4_RANGE**, **DHCP_SERVER_IPV4_PORT** tables. -``` -{ - "DHCP_SERVER_IPV4": { - "Vlan100": { - "gateway": "100.1.1.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "option60": { - "id": 60, - "type": "text", - "value": "dummy_value" - } - }, - "DHCP_SERVER_IPV4_RANGE": { - "range1": { - "ip_start": "100.1.1.3", - "ip_end": "100.1.1.5" - } - }, - "DHCP_SERVER_IPV4_PORT": { - "Vlan100|PortChannel0003": { - "ips": [ - "100.1.1.10" - ] - }, - "Vlan100|PortChannel2": { - "ranges": [ - "range1" - ] - } - } -} -``` - ### DSCP_TO_TC_MAP ``` { diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index aacdd74204d7..e20c10da05db 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -178,7 +178,6 @@ def run(self): './yang-models/sonic-dscp-fc-map.yang', './yang-models/sonic-exp-fc-map.yang', './yang-models/sonic-dscp-tc-map.yang', - './yang-models/sonic-dhcp-server-ipv4.yang', './yang-models/sonic-dot1p-tc-map.yang', './yang-models/sonic-storm-control.yang', './yang-models/sonic-tc-priority-group-map.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 6af5120d6661..acff24dc7229 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1880,45 +1880,6 @@ "interface_id": "true" } }, - "DHCP_SERVER_IPV4": { - "Vlan100": { - "gateway": "100.1.1.1", - "lease_time": "3600", - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "option60": { - "id": "60", - "type": "text", - "value": "dummy_value" - } - }, - "DHCP_SERVER_IPV4_RANGE": { - "range1": { - "range": [ - "100.1.1.3", - "100.1.1.5" - ] - } - }, - "DHCP_SERVER_IPV4_PORT": { - "Vlan100|Ethernet0": { - "ips": [ - "100.1.1.10" - ] - }, - "Vlan100|Ethernet1": { - "ranges": [ - "range1" - ] - } - }, "SCHEDULER": { "TEST@0": { "cbs": "256", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json deleted file mode 100644 index 42fa61056893..000000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "DHCP_SERVER_IPV4_VALID_FORMAT": { - "desc": "Add dhcp_server_ipv4 in correct format." - }, - "DHCP_SERVER_IPV4_WITH_NON_EXIST_VLAN": { - "desc": "Configure vlan-id in DHCP_SERVER_IPV4 table which does not exist in VLAN table.", - "eStrKey": "LeafRef" - }, - "DHCP_SERVER_IPV4_INCORRECT_GATEWAY": { - "desc": "Add gateway which is not in correct ip-prefix format.", - "eStrKey": "Pattern" - }, - "DHCP_SERVER_IPV4_INCORRECT_NETMASK": { - "desc": "Add netmask which is not in correct ip-prefix format.", - "eStrKey": "Pattern" - }, - "DHCP_SERVER_IPV4_STATE_WRONG_VALUE": { - "desc": "Configure wrong value for state.", - "eStrKey": "InvalidValue" - }, - "DHCP_SERVER_IPV4_MODE_WRONG_VALUE": { - "desc": "Configure wrong value for mode.", - "eStrKey": "InvalidValue" - }, - "DHCP_SREVER_IPV4_NON_EXIST_OPTION": { - "desc": "Configure option in DHCP_SERVER_IPV4 table which does not exist in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS table.", - "eStrKey": "LeafRef" - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": { - "desc": "Configure wrong value for type.", - "eStrKey": "InvalidValue", - "eStr": ["type"] - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { - "desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { - "desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": { - "desc": "Add uint8 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": { - "desc": "Add uint16 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": { - "desc": "Add uint32 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." - }, - "DHCP_SERVER_IPV4_RANGE_INVALID_END": { - "desc": "Configure wrong end ip of range.", - "eStrKey": "Pattern" - }, - "DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": { - "desc": "Configure both ip and ranges in DHCP_SERVER_IPV4_RANGE_RANGES", - "eStr": ["Statement of 'ips' and 'ranges' cannot both exist"] - }, - "DHCP_SERVER_IPV4_GATEWAY_ABSENT": { - "desc": "Missing gateway in DHCP_SERVER_IPV4", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_LEASE_TIME_ABSENT": { - "desc": "Missing lease_time in DHCP_SERVER_IPV4", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_MODE_ABSENT": { - "desc": "Missing mode in DHCP_SERVER_IPV4", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_NETMASK_ABSENT": { - "desc": "Missing netmask in DHCP_SERVER_IPV4", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_STATE_ABSENT": { - "desc": "Missing state in DHCP_SERVER_IPV4", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_ID_ABSENT": { - "desc": "Missing id in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_VALUE_ABSENT": { - "desc": "Missing value in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", - "eStrKey" : "Mandatory" - }, - "DHCP_SERVER_IPV4_RANGE_RANGE_ABSENT": { - "desc": "Missing ranges in DHCP_SERVER_IPV4_RANGE", - "eStrKey": "Must" - }, - "DHCP_SERVER_IPV4_RANGE_SINGLE_IP": { - "desc": "Single ip in DHCP_SERVER_IPV4_RANGE" - }, - "DHCP_SERVER_IPV4_RANGE_THREE_IP": { - "desc": "Three ips in DHCP_SERVER_IPV4_RANGE", - "eStrKey": "Must" - } -} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json deleted file mode 100644 index de68a5829c7d..000000000000 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/dhcp_server_ipv4.json +++ /dev/null @@ -1,941 +0,0 @@ -{ - "DHCP_SERVER_IPV4_VALID_FORMAT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1", - "admin_status": "up" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_WITH_NON_EXIST_VLAN": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan2000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "state": "enabled" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_INCORRECT_GATEWAY": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.300", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [], - "state": "enabled" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_INCORRECT_NETMASK": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.300", - "customized_options": [], - "state": "enabled" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_STATE_WRONG_VALUE": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "state": "dis-abled" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_MODE_WRONG_VALUE": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "pool", - "netmask": "255.255.255.0", - "state": "enabled" - } - ] - } - } - }, - "DHCP_SREVER_IPV4_NON_EXIST_OPTION": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option61" - ], - "state": "enabled" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "ipv4-address", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "uint8", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "uint16", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "uint32", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "texts", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_RANGE_INVALID_END": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.300" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ], - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_GATEWAY_ABSENT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_LEASE_TIME_ABSENT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_MODE_ABSENT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_NETMASK_ABSENT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "customized_options": [ - "option60" - ], - "state": "enabled" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_STATE_ABSENT": { - "sonic-vlan:sonic-vlan": { - "sonic-vlan:VLAN": { - "VLAN_LIST": [ - { - "name": "Vlan1000", - "vlanid": 1000 - } - ] - } - }, - "sonic-portchannel:sonic-portchannel": { - "sonic-portchannel:PORTCHANNEL": { - "PORTCHANNEL_LIST": [ - { - "name": "PortChannel1" - } - ] - } - }, - "sonic-port:sonic-port": { - "sonic-port:PORT": { - "PORT_LIST": [ - { - "admin_status": "up", - "alias": "etp1", - "description": "Ethernet0", - "mtu": 9000, - "lanes": "1", - "name": "Ethernet0", - "speed": 25000 - } - ] - } - }, - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4": { - "DHCP_SERVER_IPV4_LIST": [ - { - "name": "Vlan1000", - "gateway": "192.168.0.1", - "lease_time": 3600, - "mode": "PORT", - "netmask": "255.255.255.0", - "customized_options": [ - "option60" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text", - "value": "dummy_value" - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3" - ] - } - ] - }, - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_PORT": { - "DHCP_SERVER_IPV4_PORT_LIST": [ - { - "vlan": "Vlan1000", - "port": "Ethernet0", - "ranges": [ - "range1" - ] - }, - { - "vlan": "Vlan1000", - "port": "PortChannel1", - "ips": [ - "192.168.0.4" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_ID_ABSENT": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "type": "text", - "value": "dummy_value" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_VALUE_ABSENT": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS": { - "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST": [ - { - "name": "option60", - "id": 60, - "type": "text" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_RANGE_RANGE_ABSENT": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1" - } - ] - } - } - }, - "DHCP_SERVER_IPV4_RANGE_SINGLE_IP": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2" - ] - } - ] - } - } - }, - "DHCP_SERVER_IPV4_RANGE_THREE_IP": { - "sonic-dhcp-server-ipv4:sonic-dhcp-server-ipv4": { - "sonic-dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE": { - "DHCP_SERVER_IPV4_RANGE_LIST": [ - { - "name": "range1", - "range": [ - "192.168.0.2", - "192.168.0.3", - "192.168.0.4" - ] - } - ] - } - } - } -} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang b/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang deleted file mode 100644 index 4d6738bf3674..000000000000 --- a/src/sonic-yang-models/yang-models/sonic-dhcp-server-ipv4.yang +++ /dev/null @@ -1,235 +0,0 @@ -module sonic-dhcp-server-ipv4 { - - yang-version 1.1; - - namespace "http://github.com/sonic-net/sonic-dhcp-server-ipv4"; - - prefix dhcp-server-ipv4; - - import ietf-inet-types { - prefix inet; - } - - import sonic-types { - prefix stypes; - } - - import sonic-vlan { - prefix vlan; - } - - import sonic-port { - prefix port; - } - - import sonic-portchannel { - prefix lag; - } - - description "DHCP_SERVER_IPV4 YANG module for SONiC OS"; - - revision 2023-07-19 { - description "Initial version"; - } - - container sonic-dhcp-server-ipv4 { - container DHCP_SERVER_IPV4 { - - description "DHCP_SERVER_IPV4 part of config_db.json"; - - list DHCP_SERVER_IPV4_LIST { - - description "DHCP_SERVER_IPV4 list part of config_db.json"; - - key "name"; - - leaf name { - description "Interface name for DHCP server"; - type leafref { - path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; - } - } - - leaf gateway { - description "Gateway IP for DHCP server"; - mandatory true; - type inet:ipv4-address; - } - - leaf lease_time { - description "Lease time of DHCP IP in second"; - mandatory true; - type uint32 { - range "1..4294967295"; - } - } - - leaf mode { - description "Mode of assigning IP"; - mandatory true; - type enumeration { - enum PORT; - } - } - - leaf netmask { - description "Subnet mask value for DHCP server"; - mandatory true; - type inet:ipv4-address-no-zone; - } - - leaf-list customized_options { - description "Customized options list"; - type leafref { - path "/dhcp-server-ipv4:sonic-dhcp-server-ipv4/dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS/dhcp-server-ipv4:DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST/dhcp-server-ipv4:name"; - } - } - - leaf state { - description "State of DHCP server"; - mandatory true; - type stypes:admin_mode; - } - } - /* end of DHCP_SERVER_IPV4_LIST */ - } - /* end of DHCP_SERVER_IPV4 container */ - - container DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS { - - description "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS part of config_db.json"; - - list DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST { - - description "DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS list part of config_db.json"; - - key "name"; - - leaf name { - description "Name of customized option"; - type string { - length 1..255 { - error-message "Invalid length for the customized options name"; - } - } - } - - leaf id { - description "Customized PortChannel0003option ID"; - mandatory true; - type uint8 { - range "1..254"; - } - } - - leaf type { - description "Type of customized option, for standard DHCP option, this field is invalid"; - type enumeration { - enum text; - enum ipv4-address; - enum uint8; - enum uint16; - enum uint32; - } - } - - leaf value { - description "Value of customized option"; - mandatory true; - type union { - type string { - length 0..255; - } - type inet:ipv4-address; - type uint8; - type uint16; - type uint32; - } - } - } - /* end of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_LIST */ - } - /* end of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS container */ - - container DHCP_SERVER_IPV4_RANGE { - - description "DHCP_SERVER_IPV4_RANGE part of config_db.json"; - - list DHCP_SERVER_IPV4_RANGE_LIST { - - description "DHCP_SERVER_IPV4_RANGE list part of config_db.json"; - - key "name"; - - leaf name { - description "Name of IP range"; - type string { - length 1..255 { - error-message "Invalid length for the IP range name"; - } - } - } - - leaf-list range { - description "Range of IPs"; - type inet:ipv4-address; - } - - must "((count(range) <= 2) and (count(range) >= 1))"; - } - /* end of DHCP_SERVER_IPV4_RANGE_LIST */ - } - /* end of DHCP_SERVER_IPV4_RANGE */ - - container DHCP_SERVER_IPV4_PORT { - - description "DHCP_SERVER_IPV4_PORT part of config_db.json"; - - list DHCP_SERVER_IPV4_PORT_LIST { - - description "DHCP_SERVER_IPV4_PORT list part of config_db.json"; - - key "vlan port"; - - leaf vlan { - description "Name of vlan"; - type leafref { - path "/vlan:sonic-vlan/vlan:VLAN/vlan:VLAN_LIST/vlan:name"; - } - } - - leaf port { - description "Interface under vlan"; - type union { - type leafref { - path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name"; - } - type leafref { - path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name"; - } - } - } - - leaf-list ips { - description "Assigned IPs"; - must "(not(boolean(../ranges)))"{ - error-message "Statement of 'ips' and 'ranges' cannot both exist"; - } - type inet:ipv4-address; - } - - leaf-list ranges { - description "IP ranges"; - must "(not(boolean(../ips)))"{ - error-message "Statement of 'ips' and 'ranges' cannot both exist"; - } - type leafref { - path "/dhcp-server-ipv4:sonic-dhcp-server-ipv4/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE/dhcp-server-ipv4:DHCP_SERVER_IPV4_RANGE_LIST/dhcp-server-ipv4:name"; - } - } - } - /* end of DHCP_SERVER_IPV4_PORT_LIST */ - } - /* end of DHCP_SERVER_IPV4_PORT container */ - } -} From b6edc374ba57f32974561aa94a45a030d0675605 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:41:01 -0700 Subject: [PATCH 30/32] [build]: Added flag in sonic_version.yml to see if image is secured or non-secured (#16191) What I did: Added flag in sonic_version.yml to see if compiled image is secured or non-secured. This is done using build/compile time environmental variable SECURE_UPGRADE_MODE as define in HLD: https://github.com/sonic-net/SONiC/blob/master/doc/secure_boot/hld_secure_boot.md This flag does not provide the runtime status of whether the image has booted securely or not. It's possible that compile time signed image (secured image) can boot on non secure platform. Why I did: Flag can be used for manual check or by the test case. ADO: 24319390 How I verify: Manual Verification --- build_version: 'master-16191.346262-cdc5e72a3' debian_version: '11.7' kernel_version: '5.10.0-18-2-amd64' asic_type: broadcom asic_subtype: 'broadcom' commit_id: 'cdc5e72a3' branch: 'master-16191' release: 'none' build_date: Fri Aug 25 03:15:45 UTC 2023 build_number: 346262 built_by: AzDevOps@vmss-soni001UR5 libswsscommon: 1.0.0 sonic_utilities: 1.2 sonic_os_version: 11 secure_boot_image: 'no' Signed-off-by: Abhishek Dosi --- files/build_templates/sonic_version.yml.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/build_templates/sonic_version.yml.j2 b/files/build_templates/sonic_version.yml.j2 index 8b829feeed00..510b3d3c6044 100644 --- a/files/build_templates/sonic_version.yml.j2 +++ b/files/build_templates/sonic_version.yml.j2 @@ -30,3 +30,8 @@ built_by: {{ built_by }} asan: 'yes' {% endif -%} sonic_os_version: {{ sonic_os_version }} +{% if SECURE_UPGRADE_MODE == "dev" or SECURE_UPGRADE_MODE == "prod" -%} +secure_boot_image: 'yes' +{% else -%} +secure_boot_image: 'no' +{% endif -%} From 9a15221e46b0921162a53cf0e68084d14d379da2 Mon Sep 17 00:00:00 2001 From: vmittal-msft <46945843+vmittal-msft@users.noreply.github.com> Date: Tue, 29 Aug 2023 18:33:16 -0700 Subject: [PATCH 31/32] Update CPU transmitted packets to queue 7 for chassis (#16254) * Update CPU transmitted packets to TC = 7 for SONIC chassis * Added new SOC property to permitted list --- .../Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../0/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../1/j2p-a7800r3a-36d-36x400G.config.bcm | 1 + .../0/jr2cp-nokia-18x100g-4x25g-config.bcm | 1 + .../1/jr2cp-nokia-18x100g-4x25g-config.bcm | 1 + .../Nokia-IXR7250E-36x400G/0/jr2cp-nokia-18x400g-config.bcm | 1 + .../Nokia-IXR7250E-36x400G/1/jr2cp-nokia-18x400g-config.bcm | 1 + src/sonic-device-data/tests/permitted_list | 1 + 12 files changed, 12 insertions(+) diff --git a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm index cad55409b548..3d6885e6831e 100644 --- a/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm +++ b/device/arista/x86_64-arista_7800r3_48cq2_lc/Arista-7800R3-48CQ2-C48/jr2-a7280cr3-32d4-40x100G.config.bcm @@ -860,3 +860,4 @@ dma_desc_aggregator_timeout_usec.BCM8869X=1000 dma_desc_aggregator_enable_specific_MDB_LPM.BCM8869X=1 dma_desc_aggregator_enable_specific_MDB_FEC.BCM8869X=1 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/j2p-a7800r3a-36d-36x400G.config.bcm index 35b372615cf6..960ede5626c1 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/0/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1014,3 +1014,4 @@ appl_param_nof_ports_per_modid=64 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/j2p-a7800r3a-36d-36x400G.config.bcm index 06804706e753..7784b4876909 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C36/1/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1014,3 +1014,4 @@ appl_param_nof_ports_per_modid=64 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=2 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/j2p-a7800r3a-36d-36x400G.config.bcm index aa4efbbcfea8..9530ae83ce04 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/0/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1031,3 +1031,4 @@ serdes_tx_taps_36=nrz:-8:89:-29:0:0:0 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/j2p-a7800r3a-36d-36x400G.config.bcm index a62b21a9b5a0..3c5039fcd4a0 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-C72/1/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1031,3 +1031,4 @@ serdes_tx_taps_36=nrz:-7:85:-25:0:0:0 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/j2p-a7800r3a-36d-36x400G.config.bcm index 525c85185b3c..6a52876baa4d 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/0/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1051,3 +1051,4 @@ appl_param_nof_ports_per_modid=64 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/j2p-a7800r3a-36d-36x400G.config.bcm b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/j2p-a7800r3a-36d-36x400G.config.bcm index 3a51490ef385..d1065f0ff8a6 100644 --- a/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/j2p-a7800r3a-36d-36x400G.config.bcm +++ b/device/arista/x86_64-arista_7800r3a_36d2_lc/Arista-7800R3A-36D2-D36/1/j2p-a7800r3a-36d-36x400G.config.bcm @@ -1051,3 +1051,4 @@ appl_param_nof_ports_per_modid=64 xflow_macsec_secure_chan_to_num_secure_assoc_encrypt=2 xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 sai_pfc_dlr_init_capability=0 +sai_default_cpu_tx_tc=7 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm index c0d364d0b672..9f3064f279f0 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/0/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -2093,3 +2093,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 +sai_default_cpu_tx_tc=7 diff --git a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm index 74d5f9e742fa..27ff4d423394 100644 --- a/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm +++ b/device/nokia/x86_64-nokia_ixr7250e_36x400g-r0/Nokia-IXR7250E-36x100G/1/jr2cp-nokia-18x100g-4x25g-config.bcm @@ -2094,3 +2094,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 +sai_default_cpu_tx_tc=7 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 0fed59012e56..eee3aad3f15b 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 @@ -2095,3 +2095,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 +sai_default_cpu_tx_tc=7 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 5875117ee422..9634b0451185 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 @@ -2097,3 +2097,4 @@ xflow_macsec_secure_chan_to_num_secure_assoc_decrypt=4 cmic_dma_abort_in_cold_boot=0 sai_pfc_dlr_init_capability=0 trunk_group_max_members=16 +sai_default_cpu_tx_tc=7 diff --git a/src/sonic-device-data/tests/permitted_list b/src/sonic-device-data/tests/permitted_list index cb99b99fd3d9..017ae8f8295a 100644 --- a/src/sonic-device-data/tests/permitted_list +++ b/src/sonic-device-data/tests/permitted_list @@ -339,3 +339,4 @@ svi_my_station_optimization sai_nbr_bcast_ifp_optimized sai_pfc_defaults_disable sai_optimized_mmu +sai_default_cpu_tx_tc From 5e586a5a37987fe390b9ea2b15602190e0358f1e Mon Sep 17 00:00:00 2001 From: Zhijian Li Date: Thu, 31 Aug 2023 01:46:21 +0800 Subject: [PATCH 32/32] Fix openconfig_acl.py (#16303) How I did it Fix the regex for L4 port range in openconfig_acl.py. How to verify it Build image and install on Arista-720DT DUT, then try the repro steps in #16189 and confirmed the ACL rule be setup correctly: --- src/sonic-config-engine/openconfig_acl.py | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/sonic-config-engine/openconfig_acl.py b/src/sonic-config-engine/openconfig_acl.py index 7bb9c287e71d..79ef2ad87ace 100644 --- a/src/sonic-config-engine/openconfig_acl.py +++ b/src/sonic-config-engine/openconfig_acl.py @@ -2353,9 +2353,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) load = kwargs.pop("load", None) if args: @@ -2405,12 +2405,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__source_port = t @@ -2418,7 +2418,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_destination_port(self): @@ -2442,12 +2442,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__destination_port = t @@ -2455,7 +2455,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_tcp_flags(self): @@ -2522,9 +2522,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) load = kwargs.pop("load", None) if args: @@ -2574,12 +2574,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__source_port = t @@ -2587,7 +2587,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_destination_port(self): @@ -2611,12 +2611,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__destination_port = t @@ -2624,7 +2624,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})\\.\\.(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[0-5][0-9]{4}|[0-9]{1,4})$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_tcp_flags(self):