From 40ef03e70beb32784b04e24eca6546291b616597 Mon Sep 17 00:00:00 2001 From: Liping Xu <108326363+lipxu@users.noreply.github.com> Date: Sat, 10 Jun 2023 14:19:44 +0800 Subject: [PATCH 01/12] allow docker_inram to kernel cmd list (#15374) Why I did it After docker_inram is enabled, the docker folder's default max size is 1.5G. It's not big enough for some tests which need to install additional docker images or install extra packages. Work item tracking Microsoft ADO 24199761: How I did it add docker_inram into cmdline_allowlist How to verify it sudo sh -c 'echo "docker_inram_size=3000M" >> kernel-cmdline-append' sudo reboot and check the docker folder size --- files/Aboot/boot0.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index b89acde326..b00ff199e1 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -86,7 +86,7 @@ installer_image_path="$image_path/$installer_image" boot_config="$target_path/boot-config" -cmdline_allowlist="crashkernel hwaddr_ma1 sonic_fips" +cmdline_allowlist="crashkernel hwaddr_ma1 sonic_fips docker_inram" # for backward compatibility with the sonic_upgrade= behavior install="${install:-${sonic_upgrade:-}}" From a1ee45d7d6b48f179c26726e23bcd632eaeeb39f Mon Sep 17 00:00:00 2001 From: James An <94036556+jamesan47@users.noreply.github.com> Date: Thu, 15 Jun 2023 10:27:03 -0700 Subject: [PATCH 02/12] Update cisco-8000.ini (#15465) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why I did it Release Notes for Cisco 8101-32FH-O: • Fixed a FEC lane related error message • Implemented 'show platform npu mac-state -i ' CLI for NPU MAC information and save-state dump. • Fixed a Mac Port SerDes credit mismatch error message • Configurable drop counter support for SAI_DEBUG_COUNTER_ATTR_TYPE (MIGSMSFT-197) • Removed eth1-midplane creation rule that is not needed for this platform. • Fix to move control packets from queue 0 to queue 7 How I did it Update platform version to 202205.2.2.5 --- platform/checkout/cisco-8000.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini index 8089ddd801..19ddab9241 100644 --- a/platform/checkout/cisco-8000.ini +++ b/platform/checkout/cisco-8000.ini @@ -1,3 +1,3 @@ [module] repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git -ref=202205.2.2.4 +ref=202205.2.2.5 From 77d42df16037ce62b19c693e2ce6c8b030772bba Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:27:40 +0800 Subject: [PATCH 03/12] [submodule] Update submodule sonic-utilities to the latest HEAD automatically (#15455) src/sonic-utilities * 24d0d1cb - (HEAD -> 202205, origin/202205) Update portstat (#2877) (26 hours ago) [wenyiz2021] --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 0b878087fb..24d0d1cbd1 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 0b878087fb6f3cc770ea97f1c9370cd1a7bbbbee +Subproject commit 24d0d1cbd1a000ecf240464eb52c27296ace16ba From 7ce21a6db5871cae38578250949c69897c15b5eb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 03:41:30 +0800 Subject: [PATCH 04/12] [healthd] Use unix_socket_path instead of loopback ip (#14843) (#15480) --- .../health_checker/hardware_checker.py | 2 +- .../health_checker/service_checker.py | 2 +- src/system-health/health_checker/sysmonitor.py | 16 ++++++++-------- src/system-health/scripts/healthd | 2 +- src/system-health/tests/mock_connector.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/system-health/health_checker/hardware_checker.py b/src/system-health/health_checker/hardware_checker.py index 575564de87..2bc9b5d9d1 100644 --- a/src/system-health/health_checker/hardware_checker.py +++ b/src/system-health/health_checker/hardware_checker.py @@ -15,7 +15,7 @@ class HardwareChecker(HealthChecker): def __init__(self): HealthChecker.__init__(self) - self._db = SonicV2Connector(host="127.0.0.1") + self._db = SonicV2Connector(use_unix_socket_path=True) self._db.connect(self._db.STATE_DB) def get_category(self): diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index 8de86e245b..0c6bba50b2 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -265,7 +265,7 @@ def check_services(self, config): config (config.Config): Health checker configuration. """ if not self.config_db: - self.config_db = swsscommon.ConfigDBConnector() + self.config_db = swsscommon.ConfigDBConnector(use_unix_socket_path=True) self.config_db.connect() feature_table = self.config_db.get_table("FEATURE") expected_running_containers, self.container_feature_dict = self.get_expected_running_containers(feature_table) diff --git a/src/system-health/health_checker/sysmonitor.py b/src/system-health/health_checker/sysmonitor.py index 1357693c10..8979327eaf 100755 --- a/src/system-health/health_checker/sysmonitor.py +++ b/src/system-health/health_checker/sysmonitor.py @@ -31,7 +31,7 @@ def __init__(self,myQ): self.task_queue = myQ def subscribe_statedb(self): - state_db = swsscommon.DBConnector("STATE_DB", REDIS_TIMEOUT_MS, True) + state_db = swsscommon.DBConnector("STATE_DB", REDIS_TIMEOUT_MS, False) sel = swsscommon.Select() cst = swsscommon.SubscriberStateTable(state_db, "FEATURE") sel.addSelectable(cst) @@ -122,7 +122,7 @@ def __init__(self): def post_system_status(self, state): try: if not self.state_db: - self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') + self.state_db = swsscommon.SonicV2Connector(use_unix_socket_path=True) self.state_db.connect(self.state_db.STATE_DB) self.state_db.set(self.state_db.STATE_DB, "SYSTEM_READY|SYSTEM_STATE", "Status", state) @@ -135,7 +135,7 @@ def post_system_status(self, state): def get_all_service_list(self): if not self.config_db: - self.config_db = swsscommon.ConfigDBConnector() + self.config_db = swsscommon.ConfigDBConnector(use_unix_socket_path=True) self.config_db.connect() dir_list = [] @@ -197,10 +197,10 @@ def get_service_from_feature_table(self, dir_list): #else, just return Up def get_app_ready_status(self, service): if not self.state_db: - self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') + self.state_db = swsscommon.SonicV2Connector(use_unix_socket_path=True) self.state_db.connect(self.state_db.STATE_DB) if not self.config_db: - self.config_db = swsscommon.ConfigDBConnector() + self.config_db = swsscommon.ConfigDBConnector(use_unix_socket_path=True) self.config_db.connect() fail_reason = "" @@ -248,7 +248,7 @@ def run_systemctl_show(self, service): #Sets the service status to state db def post_unit_status(self, srv_name, srv_status, app_status, fail_reason, update_time): if not self.state_db: - self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') + self.state_db = swsscommon.SonicV2Connector(use_unix_socket_path=True) self.state_db.connect(self.state_db.STATE_DB) key = 'ALL_SERVICE_STATUS|{}'.format(srv_name) @@ -378,7 +378,7 @@ def update_system_status(self): def check_unit_status(self, event): #global dnsrvs_name if not self.state_db: - self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') + self.state_db = swsscommon.SonicV2Connector(use_unix_socket_path=True) self.state_db.connect(self.state_db.STATE_DB) astate = "DOWN" @@ -419,7 +419,7 @@ def check_unit_status(self, event): def system_service(self): if not self.state_db: - self.state_db = swsscommon.SonicV2Connector(host='127.0.0.1') + self.state_db = swsscommon.SonicV2Connector(use_unix_socket_path=True) self.state_db.connect(self.state_db.STATE_DB) mpmgr = multiprocessing.Manager() diff --git a/src/system-health/scripts/healthd b/src/system-health/scripts/healthd index cb404de29e..28bffeb712 100644 --- a/src/system-health/scripts/healthd +++ b/src/system-health/scripts/healthd @@ -31,7 +31,7 @@ class HealthDaemon(DaemonBase): Constructor of HealthDaemon. """ DaemonBase.__init__(self, SYSLOG_IDENTIFIER) - self._db = SonicV2Connector(host="127.0.0.1") + self._db = SonicV2Connector(use_unix_socket_path=True) self._db.connect(self._db.STATE_DB) self.stop_event = threading.Event() diff --git a/src/system-health/tests/mock_connector.py b/src/system-health/tests/mock_connector.py index d602c8eaf1..76ed01d2b9 100644 --- a/src/system-health/tests/mock_connector.py +++ b/src/system-health/tests/mock_connector.py @@ -2,7 +2,7 @@ class MockConnector(object): STATE_DB = None data = {} - def __init__(self, host): + def __init__(self, use_unix_socket_path): pass def connect(self, db_id): From 913f466cbb1c294c0d2e1f584da1107f4d161c76 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 03:48:52 +0800 Subject: [PATCH 05/12] [ci] Add OVERRIDE_BUILD_OPTIONS in image build template. (#15309) (#15481) --- .azure-pipelines/azure-pipelines-image-template.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 1311ab0608..0b480638cd 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -28,11 +28,13 @@ jobs: - template: .azure-pipelines/cleanup.yml@buildimage - ${{ parameters.preSteps }} - script: | - BUILD_OPTIONS="$(BUILD_OPTIONS)" + [ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS) + BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS" if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)" - BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS" + BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS" fi + echo $BUILD_OPTIONS echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" displayName: "Set cache options" - checkout: self From c4fcd31fa6ad886e86912963e05f147fa38c6bfb Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 03:52:17 +0800 Subject: [PATCH 06/12] enable ethernet backplane port support in port config for packet mode T2 devices (#14533) (#15479) --- files/build_templates/buffers_config.j2 | 7 +++++++ files/build_templates/qos_config.j2 | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index d6063312e0..b442f4d8bd 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -112,6 +112,7 @@ def {%- endmacro %} {%- set PORT_ALL = [] %} +{%- set PORT_BP = [] %} {%- set SYSTEM_PORT_ALL = [] %} {%- if voq_chassis %} @@ -136,6 +137,9 @@ def {%- if PORT_ALL.append(port) %}{%- endif %} {%- endif %} {%- endfor %} + {%- if defs.generate_bp_port_list is defined %} + {%- if defs.generate_bp_port_list(PORT,PORT_BP) %} {% endif %} + {%- endif %} {%- endif %} {%- set PORT_ACTIVE = [] %} @@ -146,6 +150,9 @@ def {%- for port in DEVICE_NEIGHBOR.keys() %} {%- if PORT_ACTIVE.append(port) %}{%- endif %} {%- endfor %} + {%- for port in PORT_BP %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} {%- for port in PORT_ALL %} {%- if port not in DEVICE_NEIGHBOR.keys() %} {%- if PORT_INACTIVE.append(port) %}{%- endif %} diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index 4695b51459..f9900714d8 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -1,9 +1,14 @@ {%- set PORT_ALL = [] %} +{%- set PORT_BP = [] %} {%- for port in PORT %} {%- if not port.startswith('Ethernet-Rec') and not port.startswith('Ethernet-IB') %} {%- if PORT_ALL.append(port) %}{% endif %} {%- endif %} {%- endfor %} +{%- if generate_bp_port_list is defined %} + {%- if generate_bp_port_list(PORT,PORT_BP) %} {% endif %} +{%- endif %} + {%- if PORT_ALL | sort_by_port_index %}{% endif %} {%- set port_names_list_all = [] %} @@ -20,6 +25,9 @@ {%- for port in DEVICE_NEIGHBOR.keys() %} {%- if PORT_ACTIVE.append(port) %}{%- endif %} {%- endfor %} + {%- for port in PORT_BP %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} {%- endif %} {%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} From 821c883ef4175e3385227787c6940e8abb489267 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 03:58:05 +0800 Subject: [PATCH 07/12] [yang] Change asn to start from 0 for bgp monitor (#15350) (#15482) --- src/sonic-yang-models/tests/files/sample_config_db.json | 2 +- src/sonic-yang-models/yang-models/sonic-bgp-common.yang | 2 +- .../yang-models/sonic-bgp-internal-neighbor.yang | 3 +++ src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang | 8 +++++++- .../yang-models/sonic-bgp-voq-chassis-neighbor.yang | 3 +++ 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 1c14152fd8..f35d197019 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1351,7 +1351,7 @@ "BGP_MONITORS": { "5.6.7.8": { "admin_status": "up", - "asn": "65000", + "asn": "0", "holdtime": "180", "keepalive": "60", "local_addr": "10.0.0.11", diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-common.yang b/src/sonic-yang-models/yang-models/sonic-bgp-common.yang index 1c360faa9c..e56b1cffcb 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-common.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-common.yang @@ -534,7 +534,7 @@ module sonic-bgp-common { grouping sonic-bgp-cmn-neigh { leaf asn { type uint32 { - range "1..4294967295"; + range "0..4294967295"; } description "Peer AS number"; } diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-internal-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-internal-neighbor.yang index 69a089f7ca..eea5e6bba0 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-internal-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-internal-neighbor.yang @@ -43,6 +43,9 @@ module sonic-bgp-internal-neighbor { must "(current() = /dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:bgp_asn)" { error-message "Internal iBGP neighbors should have same ASN as defined in device metadata"; } + must ". >= 1" { + error-message "ASN must be greater than 0"; + } } refine local_addr { mandatory true; diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang index 12432ffc35..14bfa404f2 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang @@ -61,7 +61,13 @@ module sonic-bgp-neighbor { description "BGP Neighbor address"; } - uses bgpcmn:sonic-bgp-cmn-neigh; + uses bgpcmn:sonic-bgp-cmn-neigh { + refine asn { + must ". >= 1" { + error-message "ASN must be greater than 0"; + } + } + } } list BGP_NEIGHBOR_LIST { diff --git a/src/sonic-yang-models/yang-models/sonic-bgp-voq-chassis-neighbor.yang b/src/sonic-yang-models/yang-models/sonic-bgp-voq-chassis-neighbor.yang index 662f77c3c8..9348b24a95 100644 --- a/src/sonic-yang-models/yang-models/sonic-bgp-voq-chassis-neighbor.yang +++ b/src/sonic-yang-models/yang-models/sonic-bgp-voq-chassis-neighbor.yang @@ -45,6 +45,9 @@ module sonic-bgp-voq-chassis-neighbor { must "(current() = /dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:bgp_asn)" { error-message "Voq chassis BGP neighbors should have same ASN as defined in device metadata"; } + must ". >= 1" { + error-message "ASN must be greater than 0"; + } } refine local_addr { mandatory true; From 3c8350c7c888a3713414bf524828e5b45ec01a74 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Fri, 16 Jun 2023 05:33:32 +0800 Subject: [PATCH 08/12] [submodule] Update submodule sonic-swss to the latest HEAD automatically (#15470) src/sonic-swss * 6a193e0 - (HEAD -> 202205, origin/202205) [Dual-ToR][ACL] bind LAG to ACL table in order to guarantee rule coverage if lag menber will be added to LAG after binding (#2749) (5 hours ago) [Andriy Yurkiv] --- src/sonic-swss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-swss b/src/sonic-swss index 2aec5479d0..6a193e089f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit 2aec5479d093080d14c97de99a49e0fee1e08a10 +Subproject commit 6a193e089f68ebb84651fd64b1511ea4032d9d59 From 417196f80fd39a38fad27e58419e88c9e71bd4d4 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Thu, 15 Jun 2023 14:35:36 -0700 Subject: [PATCH 09/12] [202205][YANG] add model for `MUX_CABLE` and `PEER_SWITCH` (#15485) * [YANG] Add MUX_CABLE yang model (#11797) Why I did it Address issue #10970 sign-off: Jing Zhang zhangjing@microsoft.com How I did it Add sonic-mux-cable.yang and unit tests. How to verify it Compile Compile target/python-wheels/sonic_yang_mgmt-1.0-py3-none-any.whl and target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl. Pass sonic-config-engine unit test. Which release branch to backport (provide reason below if selected) 201811 201911 202006 202012 202106 202111 202205 Description for the changelog Link to config_db schema for YANG module changes https://github.com/sonic-net/sonic-buildimage/blob/f8fe41a0238b8a7b9e32ae42262f41b63050c55f/src/sonic-yang-models/doc/Configuration.md#mux_cable * [YANG] add peer switch model (#11828) Why I did it Address issue #10966 sign-off: Jing Zhang zhangjing@microsoft.com How I did it Add sonic-peer-switch.yang and unit tests. How to verify it Compile Compile target/python-wheels/sonic_yang_mgmt-1.0-py3-none-any.whl and target/python-wheels/sonic_yang_models-1.0-py3-none-any.whl. Which release branch to backport (provide reason below if selected) 201811 201911 202006 202012 202106 202111 202205 Description for the changelog Link to config_db schema for YANG module changes https://github.com/sonic-net/sonic-buildimage/blob/b721ff87b976a6a38bdd65443ea3bc686014e783/src/sonic-yang-models/doc/Configuration.md#peer-switch --- src/sonic-yang-models/doc/Configuration.md | 20 ++++ src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 21 +++++ .../yang_model_tests/tests/mux_cable.json | 16 ++++ .../yang_model_tests/tests/peer-switch.json | 13 +++ .../tests_config/mux_cable.json | 93 +++++++++++++++++++ .../tests_config/peer-switch.json | 39 ++++++++ .../yang-models/sonic-mux-cable.yang | 92 ++++++++++++++++++ .../yang-models/sonic-peer-switch.yang | 49 ++++++++++ 9 files changed, 345 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/mux_cable.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/peer-switch.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/peer-switch.json create mode 100644 src/sonic-yang-models/yang-models/sonic-mux-cable.yang create mode 100644 src/sonic-yang-models/yang-models/sonic-peer-switch.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 25deed912a..98d10a5b5d 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -37,8 +37,10 @@ Table of Contents * [Management port](#management-port) * [Management VRF](#management-vrf) * [MAP_PFC_PRIORITY_TO_QUEUE](#map_pfc_priority_to_queue) + * [MUX_CABLE](#muxcable) * [NTP Global Configuration](#ntp-global-configuration) * [NTP and SYSLOG servers](#ntp-and-syslog-servers) + * [Peer Switch](#peer-switch) * [Policer](#policer) * [Port](#port) * [Port Channel](#port-channel) @@ -1129,6 +1131,24 @@ instead of data network. } } ``` +### MUX_CABLE + +The **MUX_CABLE** table is used for dualtor interface configuration. The `cable_type` and `soc_ipv4` objects are optional. + +``` +{ + "MUX_CABLE": { + "Ethernet4": { + "cable_type": "active-active", + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::30/128", + "soc_ipv4": "192.168.0.3/32", + "state": "auto" + } + } +} +``` + ### NTP Global Configuration These configuration options are used to modify the way that diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 4b5646525d..b44bbb8c92 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -117,6 +117,7 @@ def run(self): './yang-models/sonic-mgmt_port.yang', './yang-models/sonic-mgmt_vrf.yang', './yang-models/sonic-mirror-session.yang', + './yang-models/sonic-mux-cable.yang', './yang-models/sonic-ntp.yang', './yang-models/sonic-nat.yang', './yang-models/sonic-nvgre-tunnel.yang', @@ -155,6 +156,7 @@ def run(self): './yang-models/sonic-storm-control.yang', './yang-models/sonic-tc-priority-group-map.yang', './yang-models/sonic-tc-queue-map.yang', + './yang-models/sonic-peer-switch.yang', './yang-models/sonic-pfc-priority-queue-map.yang', './yang-models/sonic-pfc-priority-priority-group-map.yang', './yang-models/sonic-port-qos-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 f35d197019..8b274866de 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1806,6 +1806,27 @@ } }, + "PEER_SWITCH": { + "vlab-05": { + "address_ipv4": "10.1.0.33" + } + }, + + "MUX_CABLE": { + "Ethernet4": { + "cable_type": "active-active", + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::30/128", + "soc_ipv4": "192.168.0.3/32", + "state": "auto" + }, + "Ethernet0": { + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::30/128", + "state": "auto" + } + }, + "POLICER": { "everflow_static_policer": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/mux_cable.json b/src/sonic-yang-models/tests/yang_model_tests/tests/mux_cable.json new file mode 100644 index 0000000000..0d02097fdf --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/mux_cable.json @@ -0,0 +1,16 @@ +{ + "MUX_CABLE_ACTIVE_STANDBY_INTERFACE": { + "desc": "Load MUX_CABLE for active-standby interface." + }, + "MUX_CABLE_ACTIVE_ACTIVE_INTERFACE": { + "desc":"Load MUX_CABLE for active-active interface." + }, + "MUX_CABLE_INVALID_STATE": { + "desc": "Load MUX_CABLE with invalid state.", + "eStrKey": "InvalidValue" + }, + "MUX_CABLE_INVALID_IP": { + "desc": "Load MUX_CABLE with invalid server ip address.", + "eStrKey": "Pattern" + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/peer-switch.json b/src/sonic-yang-models/tests/yang_model_tests/tests/peer-switch.json new file mode 100644 index 0000000000..b8ee10dbdf --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/peer-switch.json @@ -0,0 +1,13 @@ +{ + "PEER_SWITCH_LOAD_NORMAL": { + "desc": "Load PEER_SWITCH for dualtor device." + }, + "PEER_SWITCH_MISSING_DEVICE__NAME": { + "desc": "Load PEER_SWITCH missing PEER Device name.", + "eStrKey": "Mandatory" + }, + "PEER_SWITCH_INVALID_IP_ADDRESS": { + "desc": "Load PEER_SWITCH with invalid IPv4 Address.", + "eStrKey": "Pattern" + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json new file mode 100644 index 0000000000..815171306b --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/mux_cable.json @@ -0,0 +1,93 @@ +{ + "MUX_CABLE_ACTIVE_STANDBY_INTERFACE": { + "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-mux-cable:sonic-mux-cable": { + "sonic-mux-cable:MUX_CABLE": { + "MUX_CABLE_LIST": [ + { + "ifname": "Ethernet0", + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::30/128", + "state": "auto" + } + ] + + } + } + }, + + "MUX_CABLE_ACTIVE_ACTIVE_INTERFACE": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet4", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } + ] + } + }, + "sonic-mux-cable:sonic-mux-cable": { + "sonic-mux-cable:MUX_CABLE": { + "MUX_CABLE_LIST": [ + { + "ifname": "Ethernet4", + "cable_type": "active-active", + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::30/128", + "soc_ipv4": "192.168.0.3/32", + "state": "auto" + } + ] + + } + } + }, + + "MUX_CABLE_INVALID_STATE": { + "sonic-mux-cable:sonic-mux-cable": { + "sonic-mux-cable:MUX_CABLE": { + "MUX_CABLE_LIST": [ + { + "state": "Standby" + } + ] + + } + } + }, + + "MUX_CABLE_INVALID_IP": { + "sonic-mux-cable:sonic-mux-cable": { + "sonic-mux-cable:MUX_CABLE": { + "MUX_CABLE_LIST": [ + { + "server_ipv4": "999.999.999.999/32" + } + ] + + } + } + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/peer-switch.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/peer-switch.json new file mode 100644 index 0000000000..e3857fc392 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/peer-switch.json @@ -0,0 +1,39 @@ +{ + "PEER_SWITCH_LOAD_NORMAL": { + "sonic-peer-switch:sonic-peer-switch": { + "sonic-peer-switch:PEER_SWITCH": { + "PEER_SWITCH_LIST": [ + { + "peer_switch": "vlab-05", + "address_ipv4": "10.1.0.33" + } + ] + } + } + }, + + "PEER_SWITCH_MISSING_DEVICE__NAME": { + "sonic-peer-switch:sonic-peer-switch": { + "sonic-peer-switch:PEER_SWITCH": { + "PEER_SWITCH_LIST": [ + { + "address_ipv4": "10.1.0.33" + } + ] + } + } + }, + + "PEER_SWITCH_INVALID_IP_ADDRESS": { + "sonic-peer-switch:sonic-peer-switch": { + "sonic-peer-switch:PEER_SWITCH": { + "PEER_SWITCH_LIST": [ + { + "peer_switch": "vlab-05", + "address_ipv4": "10.1.0.33/32" + } + ] + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-mux-cable.yang b/src/sonic-yang-models/yang-models/sonic-mux-cable.yang new file mode 100644 index 0000000000..a66a588c91 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-mux-cable.yang @@ -0,0 +1,92 @@ +module sonic-mux-cable { + namespace "http://github.com/Azure/sonic-mux-cable"; + prefix mux_cable; + yang-version 1.1; + + import ietf-inet-types { + prefix inet; + } + + import sonic-port { + prefix prt; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONiC DualToR MUX CABLE confifuration data"; + + revision 2022-08-19 { + description + "Initial revision"; + } + + container sonic-mux-cable { + + container MUX_CABLE { + + list MUX_CABLE_LIST { + + key "ifname"; + + leaf ifname { + type leafref { + path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name"; + } + description + "Reference of port on which MUX cable to be configured."; + } + + leaf cable_type { + type enumeration { + enum active-active; + enum active-standby; + } + default active-standby; + description "SONiC DualToR interface cable type."; + } + + leaf server_ipv4 { + type inet:ipv4-prefix; + + description "Server IPv4 Address."; + } + + leaf server_ipv6 { + type inet:ipv6-prefix; + + description "Server IPv6 Address."; + } + + leaf soc_ipv4 { + type inet:ipv4-prefix; + + description "SoC IPv4 address. Optional and for active-active ports only. "; + } + + leaf soc_ipv6 { + type inet:ipv6-prefix; + + description "SoC IPv6 address. Optional and for active-active ports only. "; + } + + leaf state { + type enumeration { + enum auto; + enum manual; + enum detach; + enum active; + enum standby; + } + + default auto; + description "MUX mode determining if auto failover is enabled. "; + } + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-peer-switch.yang b/src/sonic-yang-models/yang-models/sonic-peer-switch.yang new file mode 100644 index 0000000000..79a94c95c2 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-peer-switch.yang @@ -0,0 +1,49 @@ +module sonic-peer-switch { + yang-version 1.1; + namespace "http://github.com/Azure/sonic-peer-switch"; + prefix peer_switch; + + import ietf-inet-types { + prefix inet; + } + + import sonic-types { + prefix stypes; + } + + organization + "SONiC"; + + contact + "SONiC"; + + description + "SONiC DualToR peer switch data"; + + revision 2022-08-23 { + description + "Initial revision"; + } + + container sonic-peer-switch { + container PEER_SWITCH { + list PEER_SWITCH_LIST { + max-elements 1; + + key "peer_switch"; + + leaf peer_switch { + type stypes:hostname; + + description "SONiC DualToR peer host name."; + } + + leaf address_ipv4 { + type inet:ipv4-address; + + description "SONiC DualToR peer's IPv4 address."; + } + } + } + } +} From 340a6f68a8be4aee1a69a8162c4176900d009644 Mon Sep 17 00:00:00 2001 From: Ikki Zhu <79439153+qnos@users.noreply.github.com> Date: Tue, 28 Mar 2023 01:14:37 +0800 Subject: [PATCH 10/12] [celestica/e1031]: enable emc2305 fan controller timeout feature (#14401) Why I did it There is rare condition, emc2305 hold SMBus and cause SMBus completion wait timed out. How I did it Enable EMC2305 SMBus timeout feature, 30ms period of inactivity will reset the interface. How to verify it Use 'i2cget -y -f 23 0x4d 0x20 b' to read EMC2305 configuration register and check DIS_TO bit not set. Signed-off-by: Eric Zhu --- .../haliburton/modules/emc2305.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c index f08033e080..c32f5dffbc 100644 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c @@ -407,6 +407,35 @@ emc2305_set_pwm(struct i2c_client *client, int fan_idx, long pwm) mutex_unlock(&data->update_lock); return status; } + +static int +emc2305_enable_timeout(struct i2c_client *client, bool enable) +{ + struct emc2305_data *data = i2c_get_clientdata(client); + int status = 0; + u8 conf_val = 0; + + mutex_lock(&data->update_lock); + + status = read_u8_from_i2c(client, REG_CONFIGURATION, &conf_val); + if (status < 0) { + mutex_unlock(&data->update_lock); + return status; + } + + // Section 6.2: CONFIG REGISTER DIS_TO bit(bit 6) + if (enable) { + conf_val &= ~(1 << 6); + } else { + conf_val |= (1 << 6); + } + + status = i2c_smbus_write_byte_data(client, REG_CONFIGURATION, conf_val); + + mutex_unlock(&data->update_lock); + return status; +} + /* * sysfs callback functions * @@ -744,6 +773,9 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id) i2c_set_clientdata(client, data); mutex_init(&data->update_lock); + // Enable SMBus timeout feature + emc2305_enable_timeout(client, true); + status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID); switch (status) { case 0x34: /* EMC2305 */ From 89b7f46486dec15b64b21fbe50cabe618baf7bbf Mon Sep 17 00:00:00 2001 From: pavannaregundi <92989231+pavannaregundi@users.noreply.github.com> Date: Wed, 14 Jun 2023 23:24:30 +0530 Subject: [PATCH 11/12] [Marvell] Update armhf driver version (#15138) Changes in MRVL_PRESTERA_DRIVER_1.4: - Memory leak fixed by releasing pci device after retrieval. - Fixes for 5.10 kernel porting. Change-Id: I1d7ee4ec02ec17a29ddb8473725ab68ca399748b Signed-off-by: Pavan Naregundi --- platform/marvell-armhf/prestera.mk | 2 +- .../prestera/debian/mrvlprestera.install.template | 4 ++-- platform/marvell-armhf/prestera/debian/rules | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/marvell-armhf/prestera.mk b/platform/marvell-armhf/prestera.mk index 113b8f41a3..0d48b9ed8a 100644 --- a/platform/marvell-armhf/prestera.mk +++ b/platform/marvell-armhf/prestera.mk @@ -4,7 +4,7 @@ export MRVL_PRESTERA_VER = 1.0 export MRVL_PRESTERA = mrvlprestera_$(MRVL_PRESTERA_VER)_$(PLATFORM_ARCH) export MRVL_PRESTERA_DEB = $(MRVL_PRESTERA).deb export MRVL_PRESTERA_SRC_URL = https://github.com/Marvell-switching/mrvl-prestera.git -export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.2 +export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.4 $(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera $(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) diff --git a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template index d0e96ab1e7..3c805336cc 100644 --- a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template +++ b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template @@ -1,3 +1,3 @@ -mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvDmaDrv.ko /lib/modules/KVERSION/kernel/extra -mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers/mvDmaDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra mrvl-prestera/platform/armhf/* / diff --git a/platform/marvell-armhf/prestera/debian/rules b/platform/marvell-armhf/prestera/debian/rules index d3895c2f76..99bb283874 100755 --- a/platform/marvell-armhf/prestera/debian/rules +++ b/platform/marvell-armhf/prestera/debian/rules @@ -6,7 +6,7 @@ PACKAGE_PRE_NAME := mrvlprestera KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIR := mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers +MODULE_DIR := mrvl-prestera/drivers/armhf/cpssEnabler/linuxNoKernelModule/drivers %: dh $@ --with systemd,python2,python3 --buildsystem=pybuild @@ -19,9 +19,9 @@ clean: build: # get sources rm -rf mrvl-prestera || true - git clone -b ${MRVL_PRESTERA_SRC_TAG} ${MRVL_PRESTERA_SRC_URL} + git clone ${MRVL_PRESTERA_SRC_URL} + cd mrvl-prestera && git checkout ${MRVL_PRESTERA_SRC_TAG} && cd .. sed "s/KVERSION/${KVERSION}/g" /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template > /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install - sed -i "s/4,11,0)/4,11,0) \&\& LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0)/g" /sonic/platform/marvell-armhf/prestera/mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/dmaDriver.c make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/ From 3396cca1a3c5f38231e34361c6b89c4bf821623c Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 14 Jun 2023 13:19:28 -0700 Subject: [PATCH 12/12] [Arista] fix platform.json for a few devices (#15308) Why I did it sonic-mgmt is failing tests due to invalid test data in platform.json Fwutil is upset the chassis name in the platform_component.json of the 7060CX-32S How I did it Fixed the aforementioned issues --- .../x86_64-arista_7050_qx32/platform.json | 42 ++++++++------- .../x86_64-arista_7050_qx32s/platform.json | 51 ++++++++++--------- .../platform_components.json | 2 +- 3 files changed, 51 insertions(+), 44 deletions(-) diff --git a/device/arista/x86_64-arista_7050_qx32/platform.json b/device/arista/x86_64-arista_7050_qx32/platform.json index 115de84194..8772ce8b23 100644 --- a/device/arista/x86_64-arista_7050_qx32/platform.json +++ b/device/arista/x86_64-arista_7050_qx32/platform.json @@ -53,37 +53,43 @@ "psus": [ { "name": "psu1", - "fans": [] + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] }, { "name": "psu2", - "fans": [] + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] } ], "thermals": [ { - "name": "Cpu temp sensor" - }, - { - "name": "Board sensor" - }, - { - "name": "Front-panel temp sensor" - }, - { - "name": "Rear temp sensor" - }, - { - "name": "Power supply 1 inlet temp sensor" + "name": "Cpu temp sensor", + "controllable": false }, { - "name": "Power supply 1 internal sensor" + "name": "Board sensor", + "controllable": false }, { - "name": "Power supply 2 inlet temp sensor" + "name": "Front-panel temp sensor", + "controllable": false }, { - "name": "Power supply 2 internal sensor" + "name": "Rear temp sensor", + "controllable": false } ], "sfps": [ diff --git a/device/arista/x86_64-arista_7050_qx32s/platform.json b/device/arista/x86_64-arista_7050_qx32s/platform.json index 0dd9b558d0..56ee4a0dff 100644 --- a/device/arista/x86_64-arista_7050_qx32s/platform.json +++ b/device/arista/x86_64-arista_7050_qx32s/platform.json @@ -40,46 +40,47 @@ "psus": [ { "name": "psu1", - "fans": [] + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] }, { "name": "psu2", - "fans": [] + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] } ], "thermals": [ { - "name": "Cpu temp sensor" - }, - { - "name": "Cpu board temp sensor" - }, - { - "name": "Back-panel temp sensor" - }, - { - "name": "Board Sensor" - }, - { - "name": "Front-panel temp sensor" - }, - { - "name": "Power supply 1 hotspot sensor" - }, - { - "name": "Power supply 1 inlet temp sensor" + "name": "Cpu temp sensor", + "controllable": false }, { - "name": "Power supply 1 exhaust temp sensor" + "name": "Cpu board temp sensor", + "controllable": false }, { - "name": "Power supply 2 hotspot sensor" + "name": "Back-panel temp sensor", + "controllable": false }, { - "name": "Power supply 2 inlet temp sensor" + "name": "Board Sensor", + "controllable": false }, { - "name": "Power supply 2 exhaust temp sensor" + "name": "Front-panel temp sensor", + "controllable": false } ], "sfps": [ diff --git a/device/arista/x86_64-arista_7060_cx32s/platform_components.json b/device/arista/x86_64-arista_7060_cx32s/platform_components.json index d7647e359b..b89e8017ca 100644 --- a/device/arista/x86_64-arista_7060_cx32s/platform_components.json +++ b/device/arista/x86_64-arista_7060_cx32s/platform_components.json @@ -1,6 +1,6 @@ { "chassis": { - "DCS-7050CX3-32S": { + "DCS-7060CX-32S": { "component": { "Aboot()": {}, "Scd(addr=0000:02:00.0)": {},